[antlr-interest] Problem with python runtime example (stdin)

Cesar Otero hfrequency at gmail.com
Fri Jun 20 12:43:09 PDT 2008


Greetings to everyone!

I recently stumbled onto this wiki entry "Book Examples Modified for Python"

http://www.antlr.org/wiki/pages/viewpage.action?pageId=4554829

Generating the grammar files works just fine. But, when I go to
execute the test.py I get the following error message:

####

Traceback (most recent call last):
  File "C:/grammars/test.py", line 8, in <module>
    char_stream = antlr3.ANTLRInputStream(sys.stdin)
  File "C:\Python25\lib\site-packages\antlr_python_runtime-3.0.1-py2.5.egg\antlr3\streams.py",
line 534, in __init__
    data = file.read()
AttributeError: read

####

Any ideas?

Regards,
hf


More information about the antlr-interest mailing list