Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Re: Creating common interface
Re: Creating common interface [message #844028] Fri, 13 April 2012 16:01
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Andrew,

no, there is no other way to do that in your grammar. You should
consider to import the ePackage and maintain it manually.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 12.04.12 20:57, schrieb Andrew Gacek:
> I have an expression language that has both field and array access:
>
>
> Index returns Expr:
> Atom ({FieldIndex.base=current} '.' field=ID |
> {ArrayIndex.base=current} '[' index=INT ']')*
> ;
>
>
> This generates interfaces FieldIndex and ArrayIndex, both extending
> Expr, which have their own versions of set/getBase(). I am trying to
> find a way to get Xtext to generate an intermediate interface Index
> which extends Expr and contains set/getBase() and such that FieldIndex
> and ArrayIndex both extend Index. So far the best solution I've found is
> the following two fake productions:
>
>
> Fake1 returns Expr: {Index} base=Expr;
> Fake2 returns Index: {FieldIndex} | {ArrayIndex};
>
>
> Is there a better way to do this?
>
> Thanks,
> Andrew
Previous Topic:reference
Next Topic:Re: Creating common interface
Goto Forum:
  


Current Time: Thu Apr 25 10:15:08 GMT 2024

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

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

Back to the top