|
|
|
Re: Possible to extend Google'S Go using Xtext? [message #1395790 is a reply to message #1395766] |
Mon, 07 July 2014 12:00 |
Uli Merkel Messages: 250 Registered: June 2013 |
Senior Member |
|
|
Hi Michael,
we just start with a simple grammar which allows you to specify modules and their "arguments"
Model:
mudules+=Module*;
Module: (ModuleA | ModuleB );
Module1: 'module1' name=ID 'arg1='arg1=ID 'arg2='arg2=id
Module2: 'module2' name=ID
All the rest will be done in the generator
where you have multi-line templates, the one with the triple quotes
«FOR Module modul : sm.modules»
«switch modul {
Module1:{genCodeModule1(modul)}
Module2:{genCodeModule2(modul)}
}»
«ENDFOR»
def genCodeModule1(Module1 modul)
'''
entry «modul.name»
params
string «modul.arg1» :IN
string «modul.arg2» : IN
endparams
end ; «modul.name»
'''
Just as a start. Some more you can find in my aricle in "Eclipse Magazin" 2.14.
If you are in Frankfurt, perhaps we can meet to discuss it in more detail.
I will attend the Eclipse Demo Camp on Thursday see:
https://wiki.eclipse.org/Eclipse_DemoCamps_Luna_2014/Frankfurt
[Updated on: Mon, 07 July 2014 16:05] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02594 seconds