annotate python/c3/astnodes.py @ 213:003c8a976fff

Merge of semantics and parser again ..
author Windel Bouwman
date Fri, 05 Jul 2013 11:18:48 +0200
parents 62386bcee1ba
children c1ccb1cb4cef
rev   line source
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
1 """
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
2 AST (abstract syntax tree) nodes for the c3 language.
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
3 The tree is build by the parser.
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
4 Then it is checked
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
5 Finally code is generated from it.
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
6 """
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
7
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
8 class Node:
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
9 pass
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
10
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
11 # Modules
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
12 class Package(Node):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
13 def __init__(self, name, loc):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
14 self.name = name
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
15 self.loc = loc
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
16 self.declarations = []
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
17 def __repr__(self):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
18 return 'PACKAGE {}'.format(self.name)
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
19
150
4ae0e02599de Added type check start and analyze phase
Windel Bouwman
parents: 149
diff changeset
20 class Designator(Node):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
21 def __init__(self, tname, loc):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
22 self.tname = tname
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
23 self.loc = loc
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
24 def __repr__(self):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
25 return 'DESIGNATOR {}'.format(self.tname)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
26
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
27 """
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
28 Type classes
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
29
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
30 types must be comparable.
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
31
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
32 There are the following types:
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
33 - base type
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
34 - struct type
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
35 - pointer type
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
36 - typedef type
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
37 - function type
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
38 """
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
39
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
40 class Type(Node):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
41 def isType(self, b):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
42 return isType(self, b)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
43
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
44 class BaseType(Type):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
45 def __init__(self, name):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
46 self.name = name
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
47 def __repr__(self):
212
62386bcee1ba Added parser combinator lib
Windel Bouwman
parents: 186
diff changeset
48 return '{}'.format(self.name)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
49
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
50 class FunctionType(Type):
167
0b5b2ee6b435 Added 2 unit tests
Windel Bouwman
parents: 166
diff changeset
51 def __init__(self, parametertypes, returntype):
0b5b2ee6b435 Added 2 unit tests
Windel Bouwman
parents: 166
diff changeset
52 self.parametertypes = parametertypes
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
53 self.returntype = returntype
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
54 def __repr__(self):
167
0b5b2ee6b435 Added 2 unit tests
Windel Bouwman
parents: 166
diff changeset
55 params = ', '.join([str(v) for v in self.parametertypes])
165
598d3888a11c Added front class and fided AST view
Windel Bouwman
parents: 163
diff changeset
56 return '{1} f({0})'.format(params, self.returntype)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
57
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
58 class PointerType(Type):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
59 def __init__(self, ptype):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
60 self.ptype = ptype
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
61
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
62 class StructureType(Type):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
63 def __init__(self, mems):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
64 self.mems = mems
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
65
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
66 class DefinedType(Type):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
67 def __init__(self, name, typ):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
68 self.name = name
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
69 self.typ = typ
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
70 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
71 return 'Named type {0} of type {1}'.format(self.name, self.typ)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
72
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
73 # Variables, parameters, local variables, constants:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
74 class Symbol(Node):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
75 def __init__(self, name):
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
76 self.name = name
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
77 self.refs = []
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
78 def addRef(self, r):
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
79 self.refs.append(r)
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
80 @property
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
81 def References(self):
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
82 return self.refs
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
83
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
84 class Constant(Symbol):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
85 def __init__(self, name, typ, value):
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
86 super().__init__(name)
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
87 self.typ = typ
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
88 self.value = value
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
89 def __repr__(self):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
90 return 'CONSTANT {0} = {1}'.format(self.name, self.value)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
91
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
92 class Variable(Symbol):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
93 def __init__(self, name, typ):
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
94 super().__init__(name)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
95 self.typ = typ
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
96 self.ival = None
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
97 self.isLocal = False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
98 self.isReadOnly = False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
99 self.isParameter = False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
100 def __repr__(self):
212
62386bcee1ba Added parser combinator lib
Windel Bouwman
parents: 186
diff changeset
101 return '{}'.format(self.name)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
102
150
4ae0e02599de Added type check start and analyze phase
Windel Bouwman
parents: 149
diff changeset
103 # Procedure types
4ae0e02599de Added type check start and analyze phase
Windel Bouwman
parents: 149
diff changeset
104 class Function(Symbol):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
105 """ Actual implementation of a function """
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
106 def __init__(self, name, loc):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
107 super().__init__(name)
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
108 self.loc = loc
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
109
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
110 def __repr__(self):
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
111 return '{}'.format(self.name)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
112
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
113 # Operations / Expressions:
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
114 class Unop(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
115 def __init__(self, a, op):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
116 self.a = a
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
117 self.op = op
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
118 def __repr__(self):
212
62386bcee1ba Added parser combinator lib
Windel Bouwman
parents: 186
diff changeset
119 return 'UNOP {}'.format(self.op)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
120
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
121 class Binop(Node):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
122 def __init__(self, a, op, b, loc):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
123 self.a = a
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
124 self.b = b
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
125 self.op = op # Operation: '+', '-', '*', '/', 'mod'
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
126 self.loc = loc
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
127 def __repr__(self):
212
62386bcee1ba Added parser combinator lib
Windel Bouwman
parents: 186
diff changeset
128 return 'BINOP {}'.format(self.op)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
129
150
4ae0e02599de Added type check start and analyze phase
Windel Bouwman
parents: 149
diff changeset
130 class VariableUse(Node):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
131 def __init__(self, target, loc):
150
4ae0e02599de Added type check start and analyze phase
Windel Bouwman
parents: 149
diff changeset
132 self.target = target
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
133 self.loc = loc
150
4ae0e02599de Added type check start and analyze phase
Windel Bouwman
parents: 149
diff changeset
134 def __repr__(self):
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
135 nm = self.target.name if hasattr(self.target, 'name') else ''
212
62386bcee1ba Added parser combinator lib
Windel Bouwman
parents: 186
diff changeset
136 return 'VAR USE {}'.format(nm)
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
137
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
138 class Literal(Node):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
139 def __init__(self, val, loc):
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
140 self.val = val
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
141 self.loc = loc
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 158
diff changeset
142 def __repr__(self):
212
62386bcee1ba Added parser combinator lib
Windel Bouwman
parents: 186
diff changeset
143 return 'LITERAL {}'.format(self.val)
150
4ae0e02599de Added type check start and analyze phase
Windel Bouwman
parents: 149
diff changeset
144
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
145
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
146 # Statements
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
147 class CompoundStatement(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
148 def __init__(self, statements):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
149 self.statements = statements
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
150 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
151 return 'COMPOUND STATEMENT'
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
152
155
b28a11c01dbe Simplified IR classes
Windel Bouwman
parents: 150
diff changeset
153 class EmptyStatement(Node):
158
9683a4cd848f Added some functions for code generation
Windel Bouwman
parents: 155
diff changeset
154 def __repr__(self):
9683a4cd848f Added some functions for code generation
Windel Bouwman
parents: 155
diff changeset
155 return 'NOP'
155
b28a11c01dbe Simplified IR classes
Windel Bouwman
parents: 150
diff changeset
156
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
157 class ReturnStatement(Node):
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
158 def __init__(self, expr):
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
159 self.expr = expr
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
160 def __repr__(self):
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
161 return 'RETURN STATEMENT'
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
162
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
163 class Assignment(Node):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
164 def __init__(self, lval, rval, loc):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
165 self.lval = lval
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
166 self.rval = rval
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
167 self.loc = loc
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
168 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
169 return 'ASSIGNMENT'
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
170
167
0b5b2ee6b435 Added 2 unit tests
Windel Bouwman
parents: 166
diff changeset
171 class FunctionCall(Node):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
172 def __init__(self, proc, args, loc):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
173 self.proc = proc
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
174 self.args = args
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
175 self.loc = loc
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
176 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
177 return 'CALL {0} '.format(self.proc)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
178
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
179 class IfStatement(Node):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
180 def __init__(self, condition, truestatement, falsestatement, loc):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
181 self.condition = condition
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
182 self.truestatement = truestatement
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
183 self.falsestatement = falsestatement
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
184 self.loc = loc
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
185 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
186 return 'IF-statement'
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
187
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
188 class WhileStatement(Node):
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
189 def __init__(self, condition, statement, loc):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
190 self.condition = condition
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
191 self.statement = statement
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 212
diff changeset
192 self.loc = loc
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
193 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
194 return 'WHILE-statement'
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
195