Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generating Objects (Generating objects with additional properties)
Generating Objects [message #953886] Mon, 22 October 2012 12:08 Go to previous message
Dana Klein is currently offline Dana Klein
Messages: 54
Registered: October 2012
Member
Hi,

I want to know how (if possible) to generate more properties on objects in xtext.

I have xtext file similar to the xtext describe in here:
(www.ebpml.org/blog2/index.php/2010/11/05/mde-xtext-and-json)

JSONDataSource: root = Object ;
Object: '{' firstObject=TerminalObject (',' objects+=TerminalObject)* '}';
Array: '['firstItem=ObjectValue (',' items+=ObjectValue)* ']';
EmptyObject: isEmpty?= '{}' ;
EmptyArray: isEmpty?= '[]' ;
ObjectValue: value=STRING | Object | Array | EmptyObject | EmptyArray ;
TerminalObject: element=STRING ':' (content = ObjectValue) ;

So after generating the code I have all the objects generated in java and now in order to get into a TerminalObject content ("b" -> such as "a":"b") i need to iterate the object until i get there, so what i'm asking exactly can I generate more properties than the basic one?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Proposal for Jvm subtypes
Next Topic:Adding API to access ImportManager or to add imports to ITreeAppendable
Goto Forum:
  


Current Time: Sat May 18 13:19:41 EDT 2013

Powered by FUDForum. Page generated in 0.01707 seconds