[antlr-interest] Noob troubles starting with antlr(Python) and antlrworks.

sr srgama at gmail.com
Fri Sep 9 13:04:55 PDT 2011


>
> Hi,
My Goal:
I'm attempting to build a grammar with AntlrWorks and use the python target
for source to source translation.

Following instructions,
wget http://www.antlr.org/download/antlr-3.1.3.tar.gz
unzipping and installed.

antlrWorks generated code needs 3.0.1! So got that installed.

Invoking the parser thus:
*python myGrammer.parser test_file.txt*
gave me an error -
*    from antlr3.main import ParserMain*
*ImportError: No module named main*

So tried the calc example in the python distribution -
To the same effect.

c:\...\antlr-3.0.1\runtime\Python\examples\calc\output>python
CalculatorParser.py
Traceback (most recent call last):
  File "CalculatorParser.py", line 558, in <module>
    main(sys.argv)
  File "CalculatorParser.py", line 547, in main
    from antlr3.main import ParserMain
ImportError: No module named main

c:\...\antlr-3.0.1\runtime\Python\examples\calc\output>python
CalculatorLexer.py
Traceback (most recent call last):
  File "CalculatorLexer.py", line 674, in <module>
    main(sys.argv)
  File "CalculatorLexer.py", line 663, in main
    from antlr3.main import LexerMain
ImportError: No module named main

No antlr3.main to be found in the sources.

Searching the forums did not yield anything useful.

What am I missing?

TIA for all help.
-sr

>


More information about the antlr-interest mailing list