Skip to content
Snippets Groups Projects
Commit 6b6f5d5d authored by Kia's avatar Kia
Browse files

improve prettyprinting tree

parent cec05c1d
No related branches found
No related tags found
No related merge requests found
...@@ -265,7 +265,7 @@ class TreeNode: ...@@ -265,7 +265,7 @@ class TreeNode:
return str(self.language_element) + str(self.subnodes) return str(self.language_element) + str(self.subnodes)
def walk_the_tree(tree, level = 0): def walk_the_tree(tree, level = 1):
if tree == None: if tree == None:
return return
...@@ -298,7 +298,7 @@ if __name__ == '__main__': ...@@ -298,7 +298,7 @@ if __name__ == '__main__':
init_data = [OPENPAREN, 0xE101, ADDOP, OPENPAREN, OPENPAREN, 0XE102,CLOSEPAREN, CLOSEPAREN, ADDOP, 0XE103, CLOSEPAREN, MULTOP, 0XE104, ENDOFPARSE] init_data = [OPENPAREN, 0xE101, ADDOP, OPENPAREN, OPENPAREN, 0XE102,CLOSEPAREN, CLOSEPAREN, ADDOP, 0XE103, CLOSEPAREN, MULTOP, 0XE104, ENDOFPARSE]
with m.Switch(nine.input_memory_addr): with m.Switch(nine.input_memory_addr):
for addr,data in enumerate(init_data): for addr,data in enumerate(init_data):
with m.Case(addr): with m.Case(addr):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment