Mercurial > lcfOS
diff python/ppci/c3/astnodes.py @ 393:6ae782a085e0
Added init program
author | Windel Bouwman |
---|---|
date | Sat, 17 May 2014 21:17:40 +0200 |
parents | 2ec730e45ea1 |
children | 988f3fb861e4 |
line wrap: on
line diff
--- a/python/ppci/c3/astnodes.py Fri May 16 13:05:10 2014 +0200 +++ b/python/ppci/c3/astnodes.py Sat May 17 21:17:40 2014 +0200 @@ -207,6 +207,12 @@ self.loc = loc +class Sizeof(Expression): + def __init__(self, typ, loc): + super().__init__(loc) + self.query_typ = typ + + class Deref(Expression): def __init__(self, ptr, loc): super().__init__(loc) @@ -380,6 +386,15 @@ return 'IF-statement' +class Switch(Statement): + def __init__(self, condition, loc): + super().__init__(loc) + self.condition = condition + + def __repr__(self): + return 'Switch on {}'.format(self.condition) + + class While(Statement): def __init__(self, condition, statement, loc): super().__init__(loc)