Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » terminal rule - error (Decision can match input..)
terminal rule - error (Decision can match input..) [message #1756494] Fri, 17 March 2017 19:46 Go to next message
Aran A is currently offline Aran AFriend
Messages: 30
Registered: January 2011
Member
Hi,

I need some help with terminal rules. I have written this one in my grammar.
terminal URLPATTERN:
	(('0'..'9'|'_'|'-'|'.'|'='|'/'|'*'|'@'|':'|';'|'&'|'#')*('A'..'Z'|'a'..'z')+)+
;


And I get this error: Decision can match input such as "{'A'..'Z', 'a'..'z'}" using multiple alternatives: 1, 2 As a result, alternative(s) 2 were disabled for that input.

In the documentation I've read about "the order of terminal rules" or about terminal rule fragments, but perhaps I miss something. That is my only terminal rule in the grammar (so, I shouldn't worry about the rule order, should I?), and if I describe a fragment (e.g. with ('A'..'Z'|'a'..'z'), the error is the same.

I'd appreciate any clue. Thanks in advance,

Aran
Re: terminal rule - error (Decision can match input..) [message #1756495 is a reply to message #1756494] Fri, 17 March 2017 19:50 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10431
Registered: July 2009
Senior Member
the problem is the double +,

since the first part is optional why not

terminal URLPATTERN:
	(('0'..'9'|'_'|'-'|'.'|'='|'/'|'*'|'@'|':'|';'|'&'|'#')*('A'..'Z'|'a'..'z'))+
;
Previous Topic:Xtend Graph Transformation
Next Topic:using reserved keyword in grammar
Goto Forum:
  


Current Time: Wed Apr 26 21:45:34 GMT 2017

Powered by FUDForum. Page generated in 0.02580 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software