Sunday, August 2, 2009

I want to find a source code of lexical analysis/parsing. What should i do?

input file


1:) A = 4


2:) B = 7


3:) C = A + B


4:) D = 123


5:) F = 2FZ + 1


6:) M =








output file


Line 1: Col:1 Type: Id Symbol:A


Line 1: Col:3 Type: Op Symbol:=


Line 1: Col:5 Type: Num Symbol:10


Line 1: Col:6 Type: Eol Symbol:\n


Line 5: Col:5 Type: Err Symbol:2FZ

I want to find a source code of lexical analysis/parsing. What should i do?
Look for a .y or .lex file. They were probably used to generate the parser. Lex and yacc are used to create a .c file that is then compiled.


No comments:

Post a Comment