Skip to main content



      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 13:23 Go to next message
Eclipse UserFriend
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 03:23 Go to previous messageGo to next message
Eclipse UserFriend
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 08:33 Go to previous messageGo to next message
Eclipse UserFriend
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 08:36] by Moderator

Re: How is XText terminals match its previous terminal? [message #1697395 is a reply to message #1697362] Wed, 03 June 2015 11:11 Go to previous messageGo to next message
Eclipse UserFriend
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?
Re: How is XText terminals match its previous terminal? [message #1697403 is a reply to message #1697395] Wed, 03 June 2015 12:35 Go to previous messageGo to next message
Eclipse UserFriend
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 13:11 Go to previous message
Eclipse UserFriend
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
Previous Topic:Cannot launch runtime eclipse anymore
Next Topic:Bad version number in .class file
Goto Forum:
  


Current Time: Wed Jul 09 09:34:59 EDT 2025

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

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

Back to the top