Workflow:
-
Compile the script using Yacc tool.
$ yacc -d parser.y -
Compile the flex script using Flex tool.
$ flex lexer.l -
After compiling the lex file, lex.yy.c file is generated. Also, y.tab.c and y.tab.h files are generated after compiling the yacc script. \
-
Compilation is done with the options –ll, –ly and -w.
$ gcc -o compiler lex.yy.c y.tab.h y.tab.c -ll -ly -
The executable file is generated, which on running parses the C file given as a command line input.
$ ./a.out test1.c