[antlr-interest] ANTLR 2.7 Lexer problem

Wigg, J D wiggjd at lsbu.ac.uk
Tue Jun 12 07:16:17 PDT 2007


Thanks to those who replied to my lexer problem about coping with
whitespace in the lexer described in Digest vol 31 issue 22 of 6 June.
As suggested parsing specifically for white space solved this problem.
 
However, I am still getting an ambiguity warning between ( __asm |
_asm | asm ) and ID. I don't want to accept this because it looks as
though something could be wrong (although it does in fact work).
 
I have tried the following options but they don't work (Cut down to
minimum for demonstration).
 
AsmStatements
 :
 (options{generateAmbigWarnings = false;}:
  ("__asm"|"_asm"|"asm") //etc.
 )
 ;

AsmStatements
 options{generateAmbigWarnings = false;}
 :
  ("__asm"|"_asm"|"asm") // etc.
 ;

Antlr accepts these statements but I still get lexical nondeterminsim
between rules AsmStatements and ID.
 
I can't find any similar example in the ANTLR2 documentation and I
would be grateful if someone could let me know what I doing wrong.
 
Thanks.
 
David Wigg
 



--
Copyright in this email and in any attachments belongs to London South Bank University.  This email, and its attachments if any, may be confidential or legally privileged and is intended to be seen only by the person to whom it is addressed.  If you are not the intended recipient, please note the following: (1) You should take immediate action to notify the sender and delete the original email and all copies from your computer systems; (2) You should not read copy or use the contents of the email nor disclose it or its existence to anyone else.

The views expressed herein are those of the author(s) and should not be taken as those of London South Bank University, unless this is specifically stated.

London South Bank University is a company limited by guarantee registered in England and Wales.  The following details apply to London South Bank University: Company number - 00986761; Registered office and trading address - 103 Borough Road London SE1 0AA; VAT number - 778 1116 17; Email address - lsbuinfo at lsbu.ac.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070612/3fc64187/attachment.html 


More information about the antlr-interest mailing list