annotate python/c3/astnodes.py @ 149:74241ca312cc

Fixes on parser and semantics
author Windel Bouwman
date Fri, 01 Mar 2013 11:43:52 +0100
parents e5263f74b287
children 4ae0e02599de
rev   line source
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
1 """
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
2 AST nodes for the c3 language.
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
3 """
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
4
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
5 class Node:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
6 location = None
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
7 def getChildren(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
8 children = []
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
9 members = dir(self)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
10 for member in members:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
11 member = getattr(self, member)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
12 if isinstance(member, Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
13 children.append(member)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
14 elif type(member) is list:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
15 for mi in member:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
16 if isinstance(mi, Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
17 children.append(mi)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
18 return children
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
19
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
20
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
21 class Id(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
22 def __init__(self, tok, pub):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
23 self.name = tok.val
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
24 self.is_public = pub
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
25 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
26 return 'ID {0}'.format(self.name)
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 # Selectors:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
29 class Designator(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
30 def __init__(self, obj, selectors, typ):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
31 self.obj = obj
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
32 self.selectors = selectors
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
33 self.typ = typ
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
34 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
35 return 'DESIGNATOR {0}, selectors {1}, type {2}'.format(self.obj, self.selectors, self.typ)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
36
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
37 """
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
38 Type classes
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
39 """
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
40 def isType(a, b):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
41 """ Compare types a and b and check if they are equal """
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
42 if type(a) is type(b):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
43 if type(a) is BaseType:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
44 return (a.name == b.name) and (a.size == b.size)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
45 elif type(a) is ProcedureType:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
46 if len(a.parameters) != len(b.parameters):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
47 print('Number of parameters does not match')
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
48 return False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
49 for aparam, bparam in zip(a.parameters, b.parameters):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
50 if not isType(aparam.typ, bparam.typ):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
51 print('Parameter {0} does not match parameter {1}'.format(aparam, bparam))
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
52 return False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
53 if a.result is None:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
54 # TODO: how to handle a None return type??
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
55 pass
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
56 if not isType(a.result, b.result):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
57 print('Procedure return value mismatch {0} != {1}'.format(a.result, b.result))
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
58 return False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
59 return True
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
60 else:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
61 print(a)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
62 print(b)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
63 Error('Not implemented {0}'.format(a))
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
64 else:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
65 return False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
66
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
67 class Type(Node):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
68 def isType(self, b):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
69 return isType(self, b)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
70
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
71 class BaseType(Type):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
72 def __init__(self, name):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
73 self.name = name
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
74 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
75 return '[TYPE {0}]'.format(self.name)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
76
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
77 class FunctionType(Type):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
78 def __init__(self, parameters, returntype):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
79 self.parameters = parameters
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
80 self.returntype = returntype
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
81 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
82 return '[PROCTYPE {0} RET {1}]'.format(self.parameters, self.returntype)
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 DefinedType(Type):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
85 def __init__(self, name, typ):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
86 self.name = name
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
87 self.typ = typ
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
88 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
89 return 'Named type {0} of type {1}'.format(self.name, self.typ)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
90
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
91 # Variables, parameters, local variables, constants:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
92 class Symbol(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
93 pass
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
94
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
95 class Constant(Symbol):
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
96 def __init__(self, value, name=None):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
97 self.name = name
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
98 self.value = value
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
99 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
100 return 'CONSTANT {0} = {1}'.format(self.name, self.value)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
101
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
102 class Variable(Symbol):
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
103 def __init__(self, name, typ):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
104 self.name = name
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
105 self.typ = typ
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
106 self.isLocal = False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
107 self.isReadOnly = False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
108 self.isParameter = False
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
109 def __repr__(self):
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
110 return 'VAR {0} : {1}'.format(self.name, self.typ)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
111
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
112 class Parameter(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
113 """ A parameter has a passing method, name and typ """
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
114 def __init__(self, name, typ):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
115 self.name = name
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
116 self.typ = typ
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
117 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
118 return 'PARAM {0} {1}'.format(self.name, self.typ)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
119
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
120 # Operations:
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
121 class Unop(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
122 def __init__(self, a, op):
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.op = op
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
125 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
126 return 'UNOP {0}'.format(self.op)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
127
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
128 class Binop(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
129 def __init__(self, a, op, b):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
130 self.a = a
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
131 self.b = b
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
132 self.op = op # Operation: '+', '-', '*', '/', 'mod'
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
133 def __repr__(self):
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
134 return 'BINOP {0}'.format(self.op)
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
135
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
136 # Modules
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
137 class Package(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
138 def __init__(self, name):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
139 self.name = name
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
140 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
141 return 'PACKAGE {0}'.format(self.name)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
142
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
143 # Procedure types
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
144 class Procedure(Symbol):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
145 """ Actual implementation of a function """
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
146 def __init__(self, name, typ=None, block=None):
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
147 self.name = name
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
148 self.body = block
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
149 self.typ = typ
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 'PROCEDURE {0} {1}'.format(self.name, self.typ)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
152
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
153 # Statements
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
154 class CompoundStatement(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
155 def __init__(self, statements):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
156 self.statements = statements
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
157 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
158 return 'COMPOUND STATEMENT'
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
159
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
160 class ReturnStatement(Node):
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
161 def __init__(self, expr):
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
162 self.expr = expr
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
163 def __repr__(self):
149
74241ca312cc Fixes on parser and semantics
Windel Bouwman
parents: 148
diff changeset
164 return 'RETURN STATEMENT'
148
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
165
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
166 class Assignment(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
167 def __init__(self, lval, rval):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
168 self.lval = lval
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
169 self.rval = rval
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
170 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
171 return 'ASSIGNMENT'
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
172
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
173 class ProcedureCall(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
174 def __init__(self, proc, args):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
175 self.proc = proc
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
176 self.args = args
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
177 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
178 return 'CALL {0} '.format(self.proc)
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
179
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
180 class IfStatement(Node):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
181 def __init__(self, condition, truestatement, falsestatement=None):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
182 self.condition = condition
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
183 self.truestatement = truestatement
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
184 self.falsestatement = falsestatement
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):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
189 def __init__(self, condition, statements):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
190 self.condition = condition
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
191 self.dostatements = statements
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
192 def __repr__(self):
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
193 return 'WHILE-statement'
e5263f74b287 Added c3 language frontend initial parser
Windel Bouwman
parents:
diff changeset
194