[antlr-interest] Questions about gUnit

Yuri Tijerino yuri at tijerino.net
Thu Aug 21 22:11:42 PDT 2008


Hi,

I have a couple of questions about gUnit.  One is posted at: 
http://www.jguru.com/forums/view.jsp?EID=1368630

the other one is as follows:

How do you run gUnit tests on rules that take arguments such as:

rule [type arg]
    :
       << some code that uses arg >>
    ;

I tried this by including the rule as follows in the 
GrammarName.testsuite file

rule:
"test1" OK

I also tried:

rule [arg]:
"test1" OK

and

rule(arg):
"test1" OK

But java complains that  GrammarNameParser.rule() does not exists as 
follows:

java.lang.NoSuchMethodException: GrammarNameParser.rule()

If I comment out the argument in the grammar file as follows:


rule //[type arg]
    :
       << some code that does not use arg >>
    ;

then the tests seem to go fine.

What is the correct way to run tests on rules with arguments?

Yuri Tijerino


More information about the antlr-interest mailing list