__ This compiler is case sensitive, all keywords must be written in lowercase __
-
Unary increment and decrement can be done in updation part of for loop only.
-
Function definition can not handle default parameters, currently it is only able to define Identifiers as parameters.
This folder contains the php compiler. We have used lex (for tokenization) and yacc (for syntax analyzer) for creating this compiler for PHP.
we have provided you with :
- php.l (The lex file)
- lex.yy.c (compiled lex file)
- a.out (compiled file for lex.yy.c and y.tab.c)
- php.y (The Yacc file)
- y.tab.c and y.tab.h (Compiled yacc program)
- references.txt (References for this assignment)
When you run ./a.out < source.php, it will take input from the file source.php and print the Intermediate code and symbol table result accordingly.
If you want any change, just do it in the source.php file and you don't have to do anything with the yacc and lex file at all.
- This implements intermediate code generation only for the parts which were given in the assignment sheet.
- For implementing the code generation part and symbol table I have used several resources which were provided during the course.
Note that tokens are in capital letters only