[antlr-interest] Ambiguities or resolving the rules

Bharath R r.bharath at huawei.com
Tue May 12 22:43:06 PDT 2009


Hi All ,, Good morning. 
I m very new to ANTLR , I m facing a below problme like the second rule is
getting matched with the first rule and its not able to be parsed. 
 
This is my grammar 
 
grammar tel;
 
TEL : T E L COLON ; 
COLON : ':';
fragment T : ('t'|'T');
fragment E : ('e'|'E');
fragment L : ('l'|'L');
URI : TEL (parameter)*;
parameter : pname '=' pvalue ;
pname:ALPHA;
pvalue=ALPHA;
 
 
Now when I pass the value as "tel:airtel=provider" then the parser
validation fails, 
 
The exception got in " Mismatch character "=" expected ";"  " , this is like
for the input "tel:airtel=provider" the stream "tel" is taken and validated
for the rule "TEL"
But its expected to alphabets. 
 
 
Pls give ur suggestion on this.
 
Thanx a lot for reading this. 
Bharath R 
 
HUAWEI TECHNOLOGIES CO.,LTD. huawei_logo 


Address: Huawei Industrial Base
Bantian Longgang
Shenzhen 518129, P.R.China
www.huawei.com
----------------------------------------------------------------------------
---------------------------------------------------------
This e-mail and its attachments contain confidential information from
HUAWEI, which 
is intended only for the person or entity whose address is listed above. Any
use of the 
information contained herein in any way (including, but not limited to,
total or partial 
disclosure, reproduction, or dissemination) by persons other than the
intended 
recipient(s) is prohibited. If you receive this e-mail in error, please
notify the sender by 
phone or email immediately and delete it!

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090513/c493f6fd/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outlook_huawei_logo_en.jpg
Type: image/jpeg
Size: 6737 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20090513/c493f6fd/attachment.jpg 


More information about the antlr-interest mailing list