- Flex
- Bison
- GCC
-
Run the command: make
-
Now for any file use the following command ./tinyc filename -d(y/n) -s(2 digit number)
It generates a.out which can be run to execute the program
-d and -s are optional but order is important Use prefix 0 incase of single digit numbers for option s
Details of options :
d : This option is used to enable/disable debug information If the option is not provided, it is disabled
s : This option is used to generate files as specified in the assignment
-
To run on test files use : make run where number is the test number between 1 to 11
-
Use : make runall to compile all test files at once Note: The a.out will have to be independently generated
-
Cleaning : a) To clean use : make clean b) To clean tests use : make cleantests
In general, all instructions given in the assignment has been tried to be followed. The following bugs are known:
- Initialization of pointers in the global scope is not done
- The conversion to bool may in some situations produce undesired results
- Registers allocation is only done for passing parameters and not in general.
- No optimization of the code generated is done
- The code is mostly written with well named varaibles and functions making it self explanatory and hence comments are not required in such cases
- For passing parameters, 6 are passed through registers and rest through stack as the convention of x86_64 specifies.
- The support for strings is limited to use in prints and non modifying uses.
- For including the library declarations, temporary file is generated with the decalarations included.
- A lot of code is also modified/added in ass6_13CS10060_translator.cxx as was required and moving it to ass6_13CS10060_target_translator.cxx would not have been advisable.