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 > Why is this lex...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 84 of 135
Post > Topic >>

Why is this lexer not deterministic?

by Stefan Wachter <stefan.wachter@[EMAIL PROTECTED] > Jan 3, 2005 at 04:25 PM

Hi all!

I try to write a small XML lexer using Antlr 2.7.4 (see code below). 
When compiling the Lexer the following message is returned:

minimal.g: warning:lexical nondeterminism between rules X and CDATA upon
minimal.g:     k==1:'<'
minimal.g:     k==2:'A'
minimal.g:     k==3:'B'

I do not understand this message because the CDATA production does 
recognize the sequence '<', 'A', 'B'.

Can anyone help?

Best regards,
Stefan Wachter


PS: Here is the lexer:

class MyLexer extends Lexer;

options {
	k=3;
	charVocabulary = '\3'..'\377';
	caseSensitive=true;
}

X : "<ABC>" ;

CDATA :
   ( CDATA_SECT | ~( '&' | '<' | ' ' | '\t' | '\n' | '\r' ) )+
;

protected CDATA_SECT : "<![CDATA[" CDATA_DATA "]]>" ;

protected CDATA_DATA :
   ( ~']' | ']' ~']' | "]]" ~'>' )*
;


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
News==----
http://www.newsfeeds.com
The #1 Newsgroup Service in the World! >100,000
Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
 




 1 Posts in Topic:
Why is this lexer not deterministic?
Stefan Wachter <stefan  2005-01-03 16:25:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sat Nov 22 8:28:31 CST 2008.