Mercurial > lcfOS
comparison python/c3/semantics.py @ 165:598d3888a11c
Added front class and fided AST view
author | Windel Bouwman |
---|---|
date | Fri, 22 Mar 2013 15:12:38 +0100 |
parents | e023d3ce1d63 |
children | 0b5b2ee6b435 |
comparison
equal
deleted
inserted
replaced
164:e023d3ce1d63 | 165:598d3888a11c |
---|---|
53 return bo | 53 return bo |
54 def actOnNumber(self, num, loc): | 54 def actOnNumber(self, num, loc): |
55 n = astnodes.Literal(num) | 55 n = astnodes.Literal(num) |
56 n.loc = loc | 56 n.loc = loc |
57 return n | 57 return n |
58 def actOnVariableUse(self, d): | 58 def actOnVariableUse(self, d, loc): |
59 vu = astnodes.VariableUse(d) | 59 vu = astnodes.VariableUse(d) |
60 vu.loc = loc | |
60 return vu | 61 return vu |
61 def actOnAssignment(self, lval, rval, loc): | 62 def actOnAssignment(self, lval, rval, loc): |
62 a = astnodes.Assignment(lval, rval) | 63 a = astnodes.Assignment(lval, rval) |
63 a.loc = loc | 64 a.loc = loc |
64 return a | 65 return a |
65 | 66 def actOnIfStatement(self, cond, yes, no, loc): |
67 i = astnodes.IfStatement(cond, yes, no) | |
68 i.loc = loc | |
69 return i |