A python script to simulate the working of three addresses in intermediate code generation and to generate the respective machine code
To run the code use either of the following commands and follow the instructions on screen. Try the next command if one fails
python three_address.py
python3 three_address.py
py three_address.py
-
Enter a valid expression for evaluation otherwise the code will generate errors or unexpected results
-
An output file called
intermediate_code_output.txt
will be generated in the same directory as the python file -
This code does not work for negative numbers, irrational numbers, rational numbers and for numbers not in range(0, 10). Come on man, it's just a simulation.
-
Feel free to launch a PR for any changes or additions to the code