Mercurial > lcfOS
comparison python/c3/visitor.py @ 176:5fd02aa38b42
Added while loop code generation
author | Windel Bouwman |
---|---|
date | Sat, 20 Apr 2013 12:00:51 +0200 |
parents | ee0d30533dae |
children | 46d62dadd61b |
comparison
equal
deleted
inserted
replaced
175:a51b3c956386 | 176:5fd02aa38b42 |
---|---|
38 elif type(node) is Constant: | 38 elif type(node) is Constant: |
39 self.visit(node.value) | 39 self.visit(node.value) |
40 elif type(node) in [EmptyStatement, VariableUse, Variable, Literal, FunctionType]: | 40 elif type(node) in [EmptyStatement, VariableUse, Variable, Literal, FunctionType]: |
41 # Those nodes do not have child nodes. | 41 # Those nodes do not have child nodes. |
42 pass | 42 pass |
43 elif type(node) is WhileStatement: | |
44 self.visit(node.condition) | |
45 self.visit(node.dostatement) | |
43 else: | 46 else: |
44 print('UNK visit "{0}"'.format(node)) | 47 print('UNK visit "{0}"'.format(node)) |
45 self.f2(node) | 48 self.f2(node) |
46 | 49 |
47 | 50 |