Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Variables through the grammar and the UML model
Variables through the grammar and the UML model [message #640171] Fri, 19 November 2010 12:51 Go to next message
Filipe Braida is currently offline Filipe BraidaFriend
Messages: 2
Registered: November 2010
Junior Member
Hi,

I'm using the tool a little time and I'm having some difficulties. I followed the directions on this topic (LINK) and get put to work by reference to UML.

But my objective is to use variables that are in the model or that are declared in code. Below is a summary of the grammar:

import 'http://www.eclipse.org/uml2/3.0.0/UML' as umlMM

MyClassRef:
referencedClass=[umlMM::Class];

IdClass:
MyClassRef |
var={ID};

Assignment:
var=ID EQUALS expression=Expression;

Expression:
Add_Code;

Add_Code:
'ADD_CODE' '(' varClass=IdClass ')';

Only classes derived validates the model, but does not accept the declared variables.
Appreciate the help!
Filipe Braida

[Updated on: Fri, 19 November 2010 12:52]

Report message to a moderator

Re: Variables through the grammar and the UML model [message #640376 is a reply to message #640171] Sun, 21 November 2010 11:27 Go to previous messageGo to next message
Roque Pinel is currently offline Roque PinelFriend
Messages: 14
Registered: October 2010
Location: Rio de Janeiro
Junior Member
Hi Filipe,

I would try to make following changes.

MyClassRef:
referencedClass=[umlMM::Class];

IdClass:
MyClassRef | [Variable];

Assignment:
var=Variable EQUALS expression=Expression;

Variable:
name=ID;

Expression:
Add_Code;

Add_Code:
'ADD_CODE' '(' varClass=IdClass ')';


I still don't know if it will work, but it's a shot.
Re: Variables through the grammar and the UML model [message #640377 is a reply to message #640171] Sun, 21 November 2010 11:28 Go to previous messageGo to next message
Roque Pinel is currently offline Roque PinelFriend
Messages: 14
Registered: October 2010
Location: Rio de Janeiro
Junior Member
Hi Filipe,

I would try to make following changes.

MyClassRef:
referencedClass=[umlMM::Class];

IdClass:
MyClassRef | [Variable];

Assignment:
var=Variable EQUALS expression=Expression;

Variable:
name=ID;

Expression:
Add_Code;

Add_Code:
'ADD_CODE' '(' varClass=IdClass ')';


I still don't know if it will work, but it's a shot.
Re: Variables through the grammar and the UML model [message #640528 is a reply to message #640377] Mon, 22 November 2010 12:42 Go to previous message
Filipe Braida is currently offline Filipe BraidaFriend
Messages: 2
Registered: November 2010
Junior Member
Thanks Roque, but your tip did not work. I tried other ways and so far nothing. =
Previous Topic:DUPLICATE: Language mix-ins?
Next Topic:Cross-reference change RuleCall
Goto Forum:
  


Current Time: Fri Apr 26 14:58:25 GMT 2024

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

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

Back to the top