Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Adding attributes to a references element
Adding attributes to a references element [message #1830740] Sun, 02 August 2020 12:51
Avi Shaked is currently offline Avi ShakedFriend
Messages: 122
Registered: October 2019
Senior Member

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)*;
'property' name=ID;

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).

Any suggestions?

thanks in advance,

Previous Topic:XText to VSCode integration
Next Topic:DSL Debugger exits the dsl code and enters java code
Goto Forum:

Current Time: Sun May 09 00:42:45 GMT 2021

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

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

Back to the top