[Xtext] ZUnassigned Rule Call not Allowed [message #57411] |
Mon, 13 July 2009 05:10  |
Eclipse User |
|
|
|
Hi
A part of my grammar is as follows:
Line :
'Line'
SectionOpen
(lineParamValuePair+=ParamValuePair)+
SectionClose
;
SectionOpen :
'{'
;
SectionClose :
'}'
;
Here, SectionClose is marked as an error, saying that:
"Multiple markers at this line
- Cannot change type twice within a rule
- An unassigned rule call is not allowed, when the 'current' was already
created."
What is wrong here?
Regards, Helko
|
|
|
Re: [Xtext] ZUnassigned Rule Call not Allowed [message #57539 is a reply to message #57411] |
Mon, 13 July 2009 09:32   |
Eclipse User |
|
|
|
In parser rules it is not allowed to call other parser rules without
assigning the outcome to something. There's only one exception, which we
refer to as unassigned rules calls.
They have a special semantic (see documentation
http://www.eclipse.org/Xtext/documentation/0_7_0/xtext.html and search
for 'unassigned').
I think the analysis is not correct here, since it is only a datatype
rule you are referring to, which shouldn't be a problem. Could you
please file a bugzilla?
But for now, you'll have to either embed the curly brace directly into
the rule (that is what we usually do) or the rules have to become
terminal rules (i.e. you add the 'terminal' keyword).
Regards,
Sven
Helko Glathe schrieb:
> Hi
>
> A part of my grammar is as follows:
>
> Line :
> 'Line'
> SectionOpen
> (lineParamValuePair+=ParamValuePair)+
> SectionClose
> ;
>
> SectionOpen :
> '{'
> ;
>
> SectionClose :
> '}'
> ;
>
> Here, SectionClose is marked as an error, saying that:
>
> "Multiple markers at this line
> - Cannot change type twice within a rule
> - An unassigned rule call is not allowed, when the 'current' was already
> created."
>
> What is wrong here?
>
> Regards, Helko
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05008 seconds