You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
efc38eef9b
Before this change, knowledge about variable names was spread between the |computeStackDepths| pass and the code emitter code. For example, the fact that the |&...| expression needs one variable to store a position was represented in both places. This changes consolidates that knowledge and introduces a new |computeVarNames| pass. This pass replaces old |computeStackDepths| pass, does all computations realted to variable names and stores the results in the AST. Note that some knowledge about variables (inevitably) remained in emitter code templates. Beside DRYing things up, this change simplifies the emitter significantly. By storing variable names in the AST it also allows introduction of a pass that will identify parameters passed to actions using proper symbol tables. Right now, this is done in a hackish way directly in the emitter, which won't work well with changes planned in GH-69. |
12 years ago | |
---|---|---|
.. | ||
compiler.js | 12 years ago | |
emitter.js | 12 years ago | |
parser.js | 12 years ago | |
parser.pegjs | 13 years ago | |
passes.js | 12 years ago | |
peg.js | 13 years ago | |
utils.js | 12 years ago |