Compare quadruples, triples and indirect triples.
x= (a + b) * - c / d
Represent this expression in quadruples, triples and indirect triples forms. Generate the machine code for the following instruction:
V=a+(b*c)-d.
The three address code can be using following methods:
In quadruple representation the result of the operation is stored in some temporary variable. In target code generation one can quickly access the value of temporary variable using symbol table. Whereas in triple representation, use of temporary variables is avoided. The pointers to symbol table hold the result of computation.
The quadruple representation is beneficial for optimizing compilers. The level of indirection is applied by introducing temporary variables between value of computation and its use. Whereas in triple representation references to arg1 and arg2 define value of temporary variable which is not suitable method for optimizing “compiler".
Whereas in indirect triple list of all references to computations is made separately. Thus indirect triple and quadruple representations are similar as far as their utility is concerned. But indirect triple saves amount of space as compared to quadruple.
Machine code for V = a+(b*c)-d:
Convert the Regular Expression into e-NFA and then corresponding DFA.
What are the propositions of Putnam’s model?
Short Notes :Lines of Code (LOC)