[antlr-interest] Exception when running compiled ANTLR on all grammars

Brian DeVries contingencyplan at gmail.com
Thu Oct 12 15:02:58 PDT 2006


Both of y'all said the same thing, and both of y'all are right - no
more exceptions.

Thanks!
~Brian DeVries

On 10/12/06, John B. Brodie <jbb at acm.org> wrote:
> Your script:
> >----- antlr ------
> >#!/bin/sh
> >
> >MYCLASSPATH=$CLASSPATH
> >CLASSPATH=${HOME}/classpath/antlr_mine.jar:${HOME}/classpath/stringtemplate-2.3b9.jar:$CLASSPATH
> >java org.antlr.Tool $*
> >CLASSPATH=${MYCLASSSPATH}
>
> does not seem to include the v2 antlr jar (v3 needs v2 at the moment)
> here is the script i use (note i have not compiled a new version, just
> placed the jar files in /usr/local):
>
> #!/bin/bash
>
> # directory containing the unpacked ANTLR v3 distribution:
> V3=/usr/local/antlr-3.0b4/lib/
>
> LIBS=${V3}/antlr-2.7.6.jar:${V3}/antlr-3.0b4.jar:${V3}/stringtemplate-2.3b9.jar
> CP=${LIBS}:${CLASSPATH}
>
> java -cp ${CP} org.antlr.Tool $*
>
>
> hope this helps...
>    -jbb
>

On 10/12/06, Terence Parr <parrt at cs.usfca.edu> wrote:

> Make sure you have 2.7.6 or 2.7.7 ANTLR  In your path as well.  Look
> for old versions that do not have the latest TokenStreamRewriteEngine.
> Ter
> On Oct 12, 2006, at 1:07 AM, Brian DeVries wrote:

> > Hello,
> >
> > I have compiled ANTLR 3.0b4 from source, since Gentoo hasn't added the
> > beta version to portage. I haven't changed any of the source code,
> > except for the version number value in org.antlr.Tool (which I did to
> > make sure of which version I was running).
> >
> > I also have a script in my ~/bin directory to make it easier to run
> > ANTLR (so I don't have to run the whole java command):
> >
> > ----- antlr ------
> > #!/bin/sh
> >
> > MYCLASSPATH=$CLASSPATH
> > CLASSPATH=${HOME}/classpath/antlr_mine.jar:${HOME}/classpath/
> > stringtemplate-2.3b9.jar:$CLASSPATH
> > java org.antlr.Tool $*
> > CLASSPATH=${MYCLASSSPATH}
> >
> >
> > Whenever I try to run ANTLR on a grammar (even ones included in the
> > examples file), I get the following error:
> >
> > % antlr c.g
> > ANTLR Parser Generator   Early Access Version 3.0b4-BWD2 (??,
> > 2006)  1989-2006
> > Exception in thread "main" java.lang.NoSuchMethodError:
> > antlr.TokenStreamRewriteEngine.size()I
> >        at org.antlr.tool.Grammar.defineLexerRuleFoundInParser
> > (Grammar.java:977)
> >        at org.antlr.tool.DefineGrammarItemsWalker.rule
> > (DefineGrammarItemsWalker.java:771)
> >        at org.antlr.tool.DefineGrammarItemsWalker.rules
> > (DefineGrammarItemsWalker.java:478)
> >        at org.antlr.tool.DefineGrammarItemsWalker.grammarSpec
> > (DefineGrammarItemsWalker.java:323)
> >        at org.antlr.tool.DefineGrammarItemsWalker.grammar
> > (DefineGrammarItemsWalker.java:179)
> >        at org.antlr.tool.Grammar.setGrammarContent(Grammar.java:491)
> >        at org.antlr.tool.Grammar.<init>(Grammar.java:409)
> >        at org.antlr.Tool.process(Tool.java:246)
> >        at org.antlr.Tool.main(Tool.java:70)
> >
> > Any ideas on what I'm doing wrong? I'm using Gentoo Linux with the Sun
> > Java5 compiler and environment.
> >
> > Thanks!
> > ~Brian DeVries


More information about the antlr-interest mailing list