Mercurial > lcfOS
comparison python/ppci/c3/astnodes.py @ 336:d1ecc493384e
Added spiffy armtoken class for bit fiddeling. Added cool test that checks for build repeatability
author | Windel Bouwman |
---|---|
date | Wed, 19 Feb 2014 22:32:15 +0100 |
parents | 56e6ff84f646 |
children | 5477e499b039 |
comparison
equal
deleted
inserted
replaced
335:582a1aaa3983 | 336:d1ecc493384e |
---|---|
35 super().__init__(name) | 35 super().__init__(name) |
36 self.loc = loc | 36 self.loc = loc |
37 self.declarations = [] | 37 self.declarations = [] |
38 self.imports = [] | 38 self.imports = [] |
39 | 39 |
40 def add_declaration(self, decl): | |
41 self.declarations.append(decl) | |
42 if isinstance(decl, Function): | |
43 decl.package = self | |
44 | |
40 def __repr__(self): | 45 def __repr__(self): |
41 return 'MODULE {}'.format(self.name) | 46 return 'MODULE {}'.format(self.name) |
42 | 47 |
43 | 48 |
44 class Type(Node): | 49 class Type(Node): |
171 """ Actual implementation of a function """ | 176 """ Actual implementation of a function """ |
172 def __init__(self, name, loc): | 177 def __init__(self, name, loc): |
173 super().__init__(name) | 178 super().__init__(name) |
174 self.loc = loc | 179 self.loc = loc |
175 self.declarations = [] | 180 self.declarations = [] |
181 | |
182 def add_declaration(self, decl): | |
183 self.declarations.append(decl) | |
176 | 184 |
177 def __repr__(self): | 185 def __repr__(self): |
178 return 'Func {}'.format(self.name) | 186 return 'Func {}'.format(self.name) |
179 | 187 |
180 | 188 |