Scoping a feature call [message #1759025] |
Wed, 05 April 2017 07:55  |
Eclipse User |
|
|
|
Hello Christian,
I would like to introduce a new feature to my DSL, but I have tried tracing scoping for XBase but I don't know where the job is done yet.
In my grammar a Configurable is a collection of Property.
Assignments are defined :
Assignment returns xbase::XExpression:
{Assignment} 'set' address=DotExpression ('@' attribute=[Attribute] ('.' key=ID)?)? op=('='|':=') expression=(XExpression|XBlockExpression|Measure)
;
DotExpression returns Ref:
PropertyRef ({DotExpression.ref=current} op=("."|"?.") tail=[Property])*
;
PropertyRef returns Ref:
{PropertyRef} property=[Property]
;
So ultimately, it resolves to a Property followed by other '.' and other Property
Scoping is done by looking at the surrounding container (Configurable) and getting their properties.
What I would like to do, is replace it with something like :
Assignment returns xbase::XExpression:
{Assignment} 'set' (head=XFeatureCall '.')? address=DotExpression ('@' attribute=[Attribute] ('.' key=ID)?)? op=('='|':=') expression=(XExpression|XBlockExpression|Measure)
;
I don't know if that is possible. The idea is that currently the context is implicitly the "this" for the Configurable being edited.
It gets the list of Property in "this", but it would convenient to get it from an "it" in a => lambda, or any direct call that returns a Configurable.
Examples
set callThatGetsAConfiguable.innerproperty = 294
aConfigurable => [
set aPropertyOfAConfigurable= 'asdfasdf'
set anotherProperty = 430.0
]
Any suggestion ? I don't even know where to start with that.
Thanks !
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04228 seconds