I want to take a program as input and I want to find out:
- No. of identifiers
- No. of unique lines containing identifiers
- No. of identifiers in the set of unique lines
- No. of inputs and outputs
- According to control structures in the program I want to assign a value to control structures
If I calculate this I can do my project. This is the basic for me.
Can any one help me with this by giving guidelines or anything? It's urgent, please! I am trying this but I am not getting anywhere.
For example:
#include<stdio.h>
void main()
{
int a,b,c;
float d;
printf("enter a,b,c value");
scanf("%d %d %d",&a,&b,&c);
d=a+b+c;
getch();
}
Through files I will take the above program as input and I want to count identifiers. For example:
- There are 4 identifiers (
a
,b
,c
, andd
). - No. of input is 1
- No. of output is 1
We can do this manually but I want to do the calculation in a program, how to count the identifiers, inputs, outputs, etc.