Print possibilities after each read() call.

parent 6c6d35a6
pybison @ 282beeb2
Subproject commit e1dc885322fba639d6447c76e0ecf65896502b97 Subproject commit 282beeb275a9dde703523670a77c4449ce1decf8
#!/usr/bin/python
from src.parser import main
if __name__ == '__main__':
main()
...@@ -144,6 +144,13 @@ class Parser(BisonParser): ...@@ -144,6 +144,13 @@ class Parser(BisonParser):
data = data_after data = data_after
if self.interactive:
if not self.possibilities:
print 'possibilities: None'
else:
print 'possibilities:'
print self.possibilities
return data return data
def hook_handler(self, target, option, names, values, retval): def hook_handler(self, target, option, names, values, retval):
...@@ -155,6 +162,9 @@ class Parser(BisonParser): ...@@ -155,6 +162,9 @@ class Parser(BisonParser):
return retval return retval
def hook_run(self, filename, retval):
return retval
# --------------------------------------------------------------- # ---------------------------------------------------------------
# These methods are the python handlers for the bison targets. # These methods are the python handlers for the bison targets.
# (which get called by the bison code each time the corresponding # (which get called by the bison code each time the corresponding
...@@ -390,8 +400,5 @@ def main(): ...@@ -390,8 +400,5 @@ def main():
if interactive: if interactive:
print print
return node
if __name__ == '__main__': return node
main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment