|Adding attributes to a references element [message #1830740]
||Sun, 02 August 2020 12:51
| Avi Shaked
Registered: October 2019
I am making my first steps in using Xtext, so please excuse me if this is too basic.
I am interested in having a languages that creates a database of items and sets their properties. Accordingly I wish to have the following syntax for two separate delcarations:
1. Add item %itemName with property %propertyName1.
2. Add property %propertyName2 to %ItemName
an example for use:
Add item item1 with property p1
Add property p2 to item1
The first statement is simple to create. For example:
'Add' 'item' name=ID (property+=Property)*;
The second statement is something I need your help with: I understand that I can reference predefined items using itemName=[Item], but how do I add a property to the item?
I tried this:
'add' propertyName=Property 'to' itemName=[Item]
But it does not work... (the property is added to an 'unnamed' item and not the referenced one).
thanks in advance,
Powered by FUDForum
. Page generated in 0.01877 seconds