|Context based expressions [message #883271]
||Fri, 08 June 2012 07:21
| P.-C. Bue
Registered: November 2011
I have a question on context based expression resolution.
For example, consider an example based on OCL. In OCL, i can write this kind of constraint :
x->select(x | predicate on x)->select(x | predicate on x)
In this predicate, there is 3 different "x" references. The first x refers to, for example, a class, but the two others can refer to attribute of the class.
How can i use XText to provide such context sensitive recognition ? Such as :
1 - external based context, how to add context to xtext editor ?
2 - inner based context, how to make the difference between the two "x" in select operations, i.e. how does xtext knows that the first x only applied to the first select ??
I already tooked a look at the following resources:
- XText "big pdf file" documentation ,
- OCLEssential plugin sources
I don't know if the solution of my problem holds on scoping, naming, validation, or other functionality ... For example, the OCLInEcore editor support context completion (in the operation Book.isAvailable, the member loans of Book is proposed as a possible valid completion, but i can't find in the sources where and understand why XText proposed it.
Powered by FUDForum
. Page generated in 0.03478 seconds