Lexical Analyzer(Scanner) for Language G by using C/C++
- by udsha
int a = 20;
int b =30;
float c;
c = 20 + a;
if(c)
{
a = c*b + a;
}
else
{
c = a - b + c;
}
use C++ / C to Implement a Lexer.
1. Create Unambiguous grammer for
language G.
2. Create Lexical Analyzer for Language G.
3. It should identified tokens and lexemes for that language.
4. create a parse tree.
5. to use attribute grammer on a parse tree the values of the intrinsic attributes should be available on the symbol table.