Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [Xbase] Change keywords of XSwitchExpression
[Xbase] Change keywords of XSwitchExpression [message #1079935] Mon, 05 August 2013 04:55 Go to next message
Eclipse UserFriend
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 04:56] by Moderator

Re: [Xbase] Change keywords of XSwitchExpression [message #1081398 is a reply to message #1079935] Wed, 07 August 2013 03:22 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 22:54:18 EDT 2025

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

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

Back to the top