Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Compiling Xassignment to FeatureCall
Compiling Xassignment to FeatureCall [message #1187814] Fri, 15 November 2013 09:43
Matthias Spiller is currently offline Matthias SpillerFriend
Messages: 13
Registered: September 2013
Junior Member
I have an xbase-grammar which I infer to Java-code.
In the inferred code, I use my own data types.
I have changed the TypeComputer and -Provider so that a XStringLiteral is computed to type MyString.
This is working without problems.


The DSL code
var a = "abc"
a = "def"

is inferred to

MyString a = new MyString("abc");
a = new MyString("def");


I would like this to be inferred to:
final MyString a  = new MyString("abc");
a.set(new MyString("def"));

So the variable declarations should create a final variable. But still I would like the be able to change the value by using the set-method.


What would be the best way to achieve this?
Would I need to modify the grammar and make my own rules for assignments?
Or is it possible to influence the scoping so that the assignment is pointed to call the set-method?

Thanks for any hint,
Matthias
Previous Topic:Scoping and inferring inner classes
Next Topic:Extend XBase grammar
Goto Forum:
  


Current Time: Thu Apr 25 10:23:32 GMT 2024

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

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

Back to the top