comparison parser.js @ 19:132c7756860e

Use populateSymbols to generate symbol tables during compilation rather than populating them as we go. This change allows us to refer to symbols defined later in the input stream and also gives the symbol table logic a single home that can be used both by the compiler and editor.
author Mike Pavone <pavone@retrodev.com>
date Sun, 25 Mar 2012 16:11:19 -0700
parents 04ae32e91598
children 40a85f135be5
comparison
equal deleted inserted replaced
18:4dd99fde5f63 19:132c7756860e
4 this.left = left; 4 this.left = left;
5 this.op = op; 5 this.op = op;
6 this.right = right; 6 this.right = right;
7 } 7 }
8 8
9 function symbol(name) 9 function symbol(name, symbols)
10 { 10 {
11 this.name = name; 11 this.name = name;
12 this.symbols = symbols;
12 } 13 }
13 symbol.prototype.cleanName = function() { 14 symbol.prototype.cleanName = function() {
14 return this.name[0] == ':' ? this.name.substr(1) : this.name; 15 return this.name[0] == ':' ? this.name.substr(1) : this.name;
15 } 16 }
16 17