Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compiler Tools Pccts > Matching everyt...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 43 of 134
Post > Topic >>

Matching everything "else" as a lex token in Antlr 2.7.3

by k2k2e6@[EMAIL PROTECTED] (Pawan Singh) Apr 12, 2004 at 11:07 PM

Hi,

I have a set of lexical rules which match PatternA, PatternB and
PatternC. Is there a way to specify in Antlr that what ever is left
over or did not match be returned as a token?

I found out that I cannot add a rule like:

OTHER: (.)+
       { FoundToken(getText()); }
       ;

because it starts causing non-determinism with other rules. I could do
it in LEX, but I am pretty sure there must be a way to do it in Antlr.

Thanks
Pawan
 




 1 Posts in Topic:
Matching everything "else" as a lex token in Antlr 2.7.3
k2k2e6@[EMAIL PROTECTED]   2004-04-12 23:07:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 23:52:06 CDT 2008.