User Tools

Site Tools


compilers:codgen_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
compilers:codgen_tutorial [2016/12/15 11:04]
deva
compilers:codgen_tutorial [2016/12/15 11:06] (current)
deva
Line 8: Line 8:
 == Step 2: Extend the symbol table == == Step 2: Extend the symbol table ==
  
-  * Create a function in the Parser class that is able to return a fresh label (for example ''​label0'',​ ''​label1'',​ ''​label2''​ ...) each time it is called. (Use a static ​int attribute to store the label index and use the ''​stringstream''​ type build the label.)+  * Create a function in the Parser class that is able to return a fresh label (for example ''​label0'',​ ''​label1'',​ ''​label2''​ ...) each time it is called. (Use an int attribute to store the label index and use the ''​stringstream''​ type build the label.)
   * Add a ''​string label;''​ field to the data type stored in the symbol table.   * Add a ''​string label;''​ field to the data type stored in the symbol table.
   * Change the constructor of that data type to get the label as parameter.   * Change the constructor of that data type to get the label as parameter.
compilers/codgen_tutorial.1481796297.txt.gz · Last modified: 2016/12/15 11:04 by deva