Repo contains a compiler that can be used to compile basic JavaScript code, such as for loops, if constructs, etc.
lex.l
is the file used as a lexer. The lexer generates tokens from the given input and removes comments.- To run the file, run the following commands
$ lex lex.l
$ gcc lex.yy.c
- Parsing is done by a YACC file,
yacc.y
. It takes the tokens sent by the lexer and generates a parse tree as well as a symbol table, while performing a syntax check. - To run the file, run the follwing commands
$ yacc yacc.y
$ gcc y.tab.c