ANTLR Grammar: General items starting with same letter as specific item not detected
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Julian_Santiango
Posted On:   Wednesday, December 22, 2010 03:58 AM

Hi! Can please tell me what my mistake is? I am using ANTLR works for debugging but just in interpreter mode. I have following grammar: mydoc : ( doc_line )*; doc_line: begin_end_block | single_cmd | word ; begin_end_block : '\begin' '{' ID '}' ( options { greedy=false; } : doc_line )* '\end{' ID '}' ; single_cmd : '\\'ID ; word : ID; ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* ; When I let try to interprete: egin{asf}end{asf} est oom I get: begin_end_block, single_cmd, word    More>>

Hi!

Can please tell me what my mistake is?
I am using ANTLR works for debugging but just in interpreter mode.



I have following grammar:

			mydoc : ( doc_line )*;
			

doc_line: begin_end_block | single_cmd | word ;

begin_end_block
: '\begin' '{' ID '}'
(
options { greedy=false; } : doc_line
)*
'\end{' ID '}'
;

single_cmd
: '\\'ID
;

word : ID;

ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
;




When I let try to interprete:

egin{asf}end{asf} est oom




I get: begin_end_block, single_cmd, word



However, I also want oom to be a single_cmd .
What do I have to change for that?    <<Less

Re: ANTLR Grammar: General items starting with same letter as specific item not detected

Posted By:   Anonymous  
Posted On:   Monday, March 7, 2011 12:42 PM

www.wholesalesnkey.net
windows 7 key
office 2007 key
office 2010 key
office visio key
windows visio key
windows xp key

office visio key
windows visio key
windows xp key


wholesale windows 7 key
wholesale office 2007 key
wholesale office 2010 key
wholesale office visio key
wholesale windows visio key
wholesale windows xp key
Cheap and easy to use

Do not miss passing through!
Select only expensive non-election!
About | Sitemap | Contact