Input with multiple alternatives [message #1755945] |
Thu, 09 March 2017 08:16  |
Eclipse User |
|
|
|
Hello guys.
I have the following problem in my grammar:
This rule overlaps the terminal rule ID, native from Xtext.
terminal FREESTRING: (('\\')?('a'..'z'|'A'..'Z'|'0'..'9'|','))*;
As a result, my log shows:
Decision can match input such as "RULE_FREESTRING" using multiple alternatives: 1, 2
And now I need to use the ID rule in another rules, so then, the parser can't recognize the input as a ID, as follows:
Env: 'ENV' name=ID ':' value=NL '.';
I've tried to use syntatic predicates, but it does not work:
Env: ('ENV' => name=ID) ':' value=NL '.';
How can I solve this problem?
Thanks in advance!
[Updated on: Thu, 09 March 2017 12:39] by Moderator
|
|
|
|
|
|
|
Re: Input with multiple alternatives [message #1755993 is a reply to message #1755987] |
Thu, 09 March 2017 15:17   |
Eclipse User |
|
|
|
Hi, thanks for answer.
Yes, it's a very strange grammar, and I'm just implementing it, I did not created this language. All of this freedom in this grammar has complicated my work many times. Answering your question, what separates a primitive String from the next one is some key word (like SHALL), just it, so I have parts in Natural Language inside of this language (Relax Language).
Is a strange concept, but the language is in this way. And this is the way how I could get do it, I don't know if is the better one.
So, in this case, predicates will not work?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Input with multiple alternatives [message #1756007 is a reply to message #1756006] |
Thu, 09 March 2017 17:22  |
Eclipse User |
|
|
|
Thanks, I'll try it.
This grammar defines the Relax Language, wich is a language for requirements specification for Self-Adaptive Systems, so the grammars and all of this, is not my domain area. It is a new language, without tool supporting, the authors just have defined the grammar and semantics. It is an academic work yet.
[Updated on: Thu, 09 March 2017 17:44] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04812 seconds