|
|
Re: cannot add XMemberFeatureCall to sealed type XExpression [message #911283 is a reply to message #910940] |
Tue, 11 September 2012 09:42 |
|
On 09/10/2012 06:57 PM, Hallvard Trætteberg wrote:
> On 10.09.12 07.01, Lorenzo Bettini wrote:
>>
>> I was trying to redefine in my grammar the rule for XMemberFeatureCall
>> as follows:
>>
>> FieldAccess returns xbase::XMemberFeatureCall:
>> PrimaryExpression
>> (=>({XAssignment.assignable=current} '.'
>> feature=[types::JvmIdentifiableElement|ValidID]
>> ))*
>> ;
>>
>> but I get this error from Xtext validator:
>>
>> "cannot add XMemberFeatureCall to sealed type XExpression"
>
> To redefine the grammar for XMemberFeatureCall, you'll need to use the
> same rule name, and it should return the same as the original, i.e.
> xbase::XExpression.
>
> Hallvard
But in the seven languages examples (the template example,
http://www.eclipse.org/Xtext/7languagesDoc.html#template ), I read
something like
RichStringIf returns xbase::XIfExpression:
{RichStringIf}
"IF" if=XExpression
then=RichString
(else=RichStringElseIf | "ELSE" else=RichString)?
"ENDIF";
which is similar to what I was implementing...
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Powered by
FUDForum. Page generated in 0.03720 seconds