Mercurial > lcfOS
diff python/c3/semantics.py @ 163:8104fc8b5e90
Added visitor to c3
author | Windel Bouwman |
---|---|
date | Mon, 18 Mar 2013 20:13:57 +0100 |
parents | b73bc14a3aa3 |
children | e023d3ce1d63 |
line wrap: on
line diff
--- a/python/c3/semantics.py Sun Mar 10 11:36:55 2013 +0100 +++ b/python/c3/semantics.py Mon Mar 18 20:13:57 2013 +0100 @@ -19,6 +19,10 @@ s = astnodes.Variable(name, t) s.loc = loc self.addSymbol(s) + def actOnConstDef(self, name, loc, t, val): + s = astnodes.Constant(name, t, val) + s.loc = loc + self.addSymbol(s) def actOnFuncDef1(self, name, loc): self.curFunc = astnodes.Function(name) self.curFunc.loc = loc @@ -48,7 +52,7 @@ bo.loc = loc return bo def actOnNumber(self, num, loc): - n = astnodes.Constant(num) + n = astnodes.Literal(num) n.loc = loc return n def actOnVariableUse(self, d):