@@ -122,6 +122,9 @@ class Tree(object):
if isinstance(f, Tree):
f.fix_tracability(self.inputfile)
+ def pretty_print(self, i=0):
+ return "\t" * i + str(self.head) + "\n" + "\n".join([("\t" * (i+1) + st) if isinstance(st, str) else st.pretty_print(i+1) for st in self.get_tail()])
+
class Parser(object):
class Constants(object):
Token = 'token'