diff 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
line wrap: on
line diff
--- a/python/c3/semantics.py	Mon Mar 18 22:15:57 2013 +0100
+++ b/python/c3/semantics.py	Fri Mar 22 15:12:38 2013 +0100
@@ -55,11 +55,15 @@
       n = astnodes.Literal(num)
       n.loc = loc
       return n
-   def actOnVariableUse(self, d):
+   def actOnVariableUse(self, d, loc):
       vu = astnodes.VariableUse(d)
+      vu.loc = loc
       return vu
    def actOnAssignment(self, lval, rval, loc):
       a = astnodes.Assignment(lval, rval)
       a.loc = loc
       return a
-
+   def actOnIfStatement(self, cond, yes, no, loc):
+      i = astnodes.IfStatement(cond, yes, no)
+      i.loc = loc
+      return i