Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xbase]How to custom FeatureCallSugarDescription?(Xbase extensions)
[Xbase]How to custom FeatureCallSugarDescription? [message #665119] Wed, 13 April 2011 11:01 Go to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
Hi
Our DSL has some special characters need to be mapped to JVMFeature. How to custom it? Thank you.

[Updated on: Wed, 13 April 2011 11:05]

Report message to a moderator

Re: How to custom FeatureCallSugarDescription? [message #665131 is a reply to message #665119] Wed, 13 April 2011 11:43 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Not sure whether I understand. Are you trying to have cross references
to Java elements whose names contain special characters? If so, the
answer is yes. You have to specify a datatype/terminal rule to match the
names of your Java elements (default is ID that does not match special
chars), e.g.

terminal MyID:
('a'..'z' | 'A'..'Z' | 'ä' | 'Ä')*;

MyFQN:
MyID ('.' MyID)*;

MyClassReferingToJvm:
ref=[JvmMember|MyID];




Am 13.04.11 13:01, schrieb Xingxiao Lu:
> Hi
> Our DSL has some special characters need to be mapped to JVMFeature. How
> to custom it? Thank you.


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


---
Get professional support from the Xtext committers at www.typefox.io
Re: How to custom FeatureCallSugarDescription? [message #665189 is a reply to message #665131] Wed, 13 April 2011 15:15 Go to previous messageGo to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
Thank you, Jan. I would like to develop a DSL based the Xbase. In the Xbase, '+' mapped operator_plus(String a, Object b). How to custom another mapping? For example, 'SET' mapping Foo.set() method.
Re: How to custom FeatureCallSugarDescription? [message #665237 is a reply to message #665189] Wed, 13 April 2011 19:58 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Am 4/13/11 5:15 PM, schrieb Xingxiao Lu:
> Thank you, Jan. I would like to develop a DSL based the Xbase. In the
> Xbase, '+' mapped operator_plus(String a, Object b). How to custom
> another mapping? For example, 'SET' mapping Foo.set() method.
>

There are various possibilities to extend Xbase.
It depends in What context you want to use 'SET'?
Is it a keyword or just a feature call (i.e. an identifier)
Do you want it to be a binary operator?

Please outline the syntax and the context (i.e. arguments/operands and
where/how they appear) by example.

Sven

--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: How to custom FeatureCallSugarDescription? [message #665636 is a reply to message #665237] Fri, 15 April 2011 10:18 Go to previous message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
"Sven Efftinge" <sven.efftinge@itemis.de> :
>> Thank you, Jan. I would like to develop a DSL based the Xbase. In the
>> Xbase, '+' mapped operator_plus(String a, Object b). How to custom
>> another mapping? For example, 'SET' mapping Foo.set() method.
>>
>
> There are various possibilities to extend Xbase.
> It depends in What context you want to use 'SET'?
> Is it a keyword or just a feature call (i.e. an identifier)
> Do you want it to be a binary operator?
>
> Please outline the syntax and the context (i.e. arguments/operands and
> where/how they appear) by example.
>
> Sven
>
> --
> Need professional support for Xtext or other Eclipse Modeling
> technologies?
> Go to: http://xtext.itemis.com
> Twitter : @svenefftinge
> Blog : http://blog.efftinge.de

For example:
SET PERSON1 ONLINE
SET PERSON2 OFFLINE
mapping JVMOperator Foo.set(Person person, Status status).
Previous Topic:Validation with check file (runing problem)
Next Topic:Completion proposal truncated strings
Goto Forum:
  


Current Time: Fri Apr 19 16:43:56 GMT 2024

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

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

Back to the top