"Decision can match input such as "')'" using multiple alternatives: 1, 2" [message #639748] |
Wed, 17 November 2010 16:28 |
Kai Maschke Messages: 16 Registered: October 2010 |
Junior Member |
|
|
Hi,
I'm trying to define a language which should be used for definig transformation.
So I defined my transformation operations like this:
PrimitiveTransformation:
GetNthChar | GetDelimited | GetSubstring |
Concat | AddType | SubstractType |
MultiplyType | DivideType | Constant;
TransVal:
{PrimitiveTransformation} | {STRING};
GetNthChar returns STRING:
{GetNthChar} 'get_nth_char(' val=TransVal ',' pos=INT ')';
GetDelimited returns STRING:
{GetDelimited} 'get_delimited(' val=TransVal ',' char=STRING ')';
GetSubstring returns STRING:
{GetSubstring} 'get_substring(' val=TransVal ',' lolimit=INT ',' hilimit=INT ')';
Concat returns STRING:
{Concat} 'concat(' val1=TransVal ',' val2=TransVal ')';
AddType returns STRING:
{AddType} 'add_type(' val1=TransVal ',' val2=TransVal ')';
SubstractType returns STRING:
{SubstractType} 'substract_type(' val1=TransVal ',' val2=TransVal ')';
MultiplyType returns STRING:
{MultiplyType} 'multiply_type(' val1=TransVal ',' val2=TransVal ')';
DivideType returns STRING:
{DivideType} 'divide_type(' val1=TransVal ',' val2=TransVal ')';
Constant returns STRING:
constant=STRING;
While generating the code I get the following warnings:
Quote: |
...:1459:1: Decision can match input such as "')'" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ...:1459:1: Decision can match input such as "EOF" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ...:1459:1: Decision can match input such as "','" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(201):...:1459:1: The following alternatives are unreachable: 2
|
I am new to XText. Maybe I didn't figure out yet how to define a grammar well.
Can you see the problem in my grammar?
Here an example how it should look:
concat(
GetSubstring('Attr1',0,3),
'Attr2'
)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02755 seconds