[antlr-interest] Matching keywords in the lexer

Zheng, Xiaoran xzheng at doubleclick.net
Wed Aug 9 13:45:38 PDT 2006


 
Hi, I am still working on the problem of nested include files.

I am trying to match "keyword filename;", keyword clashes with the
identifier rule. Is there anyway for me to resolve this in the lexer and
do a "keyword filename;" match?

Thanks.

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Zheng, Xiaoran
Sent: Wednesday, August 09, 2006 4:32 PM
To: Antlr Interest
Subject: RE: [antlr-interest] java.util.NoSuchElementException

 
The exception is thrown from "uponEOF" which I defined in the lexer.

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Terence Parr
Sent: Wednesday, August 09, 2006 4:29 PM
To: Antlr Interest
Subject: Re: [antlr-interest] java.util.NoSuchElementException


On Aug 9, 2006, at 1:22 PM, Zheng, Xiaoran wrote:

> When I have a grammar defined as follows:
>
> A : B*C*
> B : ...
> C : ...
>
> why do I get an NoSuchElementException?

what version?  you missing a semicolon?  A complete grammar please.
Ter


More information about the antlr-interest mailing list