Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xbase] Change keywords of XSwitchExpression
[Xbase] Change keywords of XSwitchExpression [message #1079935] Mon, 05 August 2013 08:55 Go to next message
Jan Rosczak is currently offline Jan RosczakFriend
Messages: 53
Registered: July 2009
Location: Hamburg, Germany
Member
Hi,

I would like to change the keywords for the XSwitchExpression in Xbase. I would like to transform this:

    switch e {
    case e1 : er1
    ...
    case en : ern
    default : er
    }


to that:

    case of e {
    case e1 : er1
    ...
    case en : ern
    otherwise : er
    }


I managed the "case of" and "otherwise" bits but now the parser complains if I try to write "case" statements, because it expects "case of" and not "case" even so I did not change anything in the XCasePart rule. I guess I have to use syntactic predicates but I could not make it work.

Is this possible somehow?

Thanks
Jan

[Updated on: Mon, 05 August 2013 08:56]

Report message to a moderator

Re: [Xbase] Change keywords of XSwitchExpression [message #1081398 is a reply to message #1079935] Wed, 07 August 2013 07:22 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Am 05.08.13 10:55, schrieb Jan Rosczak:
> Hi,
>
> I would like to change the keywords for the XSwitchExpression in Xbase.
> I would like to transform this:
>
>
> switch e {
> case e1 : er1
> ...
> case en : ern
> default : er
> }
>
>
> to that:
>
>
> case of e {
> case e1 : er1
> ...
> case en : ern
> otherwise : er
> }
>
>
> I managed the "case of" and "otherwise" bits but now the parser
> complains if I try to write "case" statements, because it expects "case
> of" and not "case" even so I did not change anything in the XCasePart
> rule. I guess I have to use syntactic predicates but I could not make it
> work.
>
> Is this possible somehow?
>
> Thanks
> Jan
>

Hi Jan,

make sure that you use 'case' 'of' rather than 'case of', e.g. the space
should not be part of the keyword.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Previous Topic:Xtext 2.4.2 generating generic <T>
Next Topic:No EObjectDescription could be found in Scope Web.sitePermission for
Goto Forum:
  


Current Time: Sat Apr 27 01:35:28 GMT 2024

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

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

Back to the top