Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How is XText terminals match its previous terminal?
How is XText terminals match its previous terminal? [message #1697251] Tue, 02 June 2015 17:23 Go to next message
Jiaju Shen is currently offline Jiaju ShenFriend
Messages: 5
Registered: June 2015
Junior Member
Hi I am a newbie to Xtext. I am wondering if there is a way in XText syntax that terminals matches its previous terminal.

The situation is that I have several terminals that are derived from a single terminal:
T:
    T1 | T2| T3 | T4  
;


T1, T2, T3 and T4 always start at the beginning of the every line of my DSL. I would like T4 to have the same characteristics and derivation of its nearest previous T literal.

Is there a way I can do it? Does T4 need to be derived from T?
Re: How is XText terminals match its previous terminal? [message #1697318 is a reply to message #1697251] Wed, 03 June 2015 07:23 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Could you please rephrase the question and provide a real example?
I didn't understand the problem statement at all.

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Find help at http://xtext.itemis.com or xtext(@)itemis.com
Blog: zarnekow.blogspot.com
Twitter: @szarnekow
Google+: https://www.google.com/+SebastianZarnekow
Re: How is XText terminals match its previous terminal? [message #1697362 is a reply to message #1697318] Wed, 03 June 2015 12:33 Go to previous messageGo to next message
Jiaju Shen is currently offline Jiaju ShenFriend
Messages: 5
Registered: June 2015
Junior Member
I was trying to figure out if XText (or XTend if possible) supports literals matching nearest previous occurance of literals within the same class. For example in this occasion, if T3 is the closest literal of T before T4, then T4 derives in a same way as T3.

Another example is shown below
//"Text1", "Text2", "Text3" are pre-set strings, followed by a collection of strings E1, E2 and E3.  E1, E2 and E3 are derived from E
//e1, e2 and e3 are strings from E1, E2 and E3, respectively.


"Text1" e1                                           //E1 always comes and only comes after "Text1", e1 is from a collection (enumeration) of E1
"Another Text" e'                                    // Can we set an event handler catching e1, so that e' becomes e1?


//"Another Text" can follow after "Text1" "Text2" and "Text3"


In the example I showed above, E' (where e' derives from) can be E1, E2 and E3 but only one at one point, depending on which occurred from E is closest before the E'.

[Updated on: Wed, 03 June 2015 12:36]

Report message to a moderator

Re: How is XText terminals match its previous terminal? [message #1697395 is a reply to message #1697362] Wed, 03 June 2015 15:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
so e1 is a cross reference to E1 e2 is a cross reference to e2? or not where is e1 defined. why is it e1 and not bla or blubb
and e' is a cross reference to the thing e1 is pointing to?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How is XText terminals match its previous terminal? [message #1697403 is a reply to message #1697395] Wed, 03 June 2015 16:35 Go to previous messageGo to next message
Jiaju Shen is currently offline Jiaju ShenFriend
Messages: 5
Registered: June 2015
Junior Member
Christian Dietrich wrote on Wed, 03 June 2015 15:11
so e1 is a cross reference to E1 e2 is a cross reference to e2? or not where is e1 defined. why is it e1 and not bla or blubb
and e' is a cross reference to the thing e1 is pointing to?

Both e1 and e' are supposed to be strings, derived from E1 and E' respectively.
Re: How is XText terminals match its previous terminal? [message #1697410 is a reply to message #1697403] Wed, 03 June 2015 17:11 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
And wheni have "x" e1 "y" e2 "z" e' then e2 and e' become e1?
It hould be nice to know how the es are defined


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Cannot launch runtime eclipse anymore
Next Topic:Bad version number in .class file
Goto Forum:
  


Current Time: Tue Mar 19 03:21:14 GMT 2024

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

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

Back to the top