[antlr-interest] Two nested "top level" rules
Alan D. Cabrera
adc at toolazydogs.com
Sat Apr 17 10:50:46 PDT 2004
Bah! I should have read the FAQ before I posted this.
What I need to do is add the following rule to make it top-level:
b_test : b ;
Then I can getParser("FOO").b_test();
Sorry,
Alan
> -----Original Message-----
> From: Alan D. Cabrera
> Sent: Saturday, April 17, 2004 8:48 AM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] Two nested "top level" rules
>
> I have two rules:
>
> a : BEGIN b END ;
>
> b : FOO;
>
> and a function
>
> private ASN1Parser getParser(String src) {
> ASN1Lexer lexer = new ASN1Lexer(new StringReader(src));
> return new ASN1Parser(lexer);
> }
>
> Now, this works
>
> getParser("FOO END").b();
>
> This does not
>
> getParser("FOO").b();
>
> Here I get "unexpected token: null". What am I doing wrong?
>
>
> Regards,
> Alan
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list