See all feature accesses in Xtend files using Eclipse? [message #1754074] |
Tue, 14 February 2017 06:56  |
Eclipse User |
|
|
|
Hello everyone,
I am using Xtext to define my grammar and Xtend to generate some files. The generators access features.
To give an example, I try to keep it as easy as possible:
grammar my.language.Lang with org.eclipse.xtext.common.Terminals
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate lang "http://www.language.my/Lang"
Model:
components+=Component*
;
Component:
Main | Component
;
Main:
'Main' name=ID
('element' element=Element)?
'end' 'Main'
;
Element:
'Element' name=ID
('param1' param1=DOUBLE)?
('param2' param2=DOUBLE)?
'end' 'Element'
;
Now my first generator would look like this:
class MyGenerator1 {
def generate(Main main) {
'''
This is the first appearance: «main.element.param1»
'''
}
}
And my second generator like this:
class MyGenerator2 {
def generate(Main main) {
'''
This is the second appearance: «main.element.param1»
'''
}
}
So param1 is accessed in two generator classes. But in real life it is more complex and I would like to determine, in which classes a specific parameter is accessed.
The package my.language.lang was generated my Xtext and contains all defined rules as interfaces. Right-click on the getter of each parameter within the interface, with a leading "Open Call Hierarchy" in Eclipse only leads to the generated eGet() methods but not to the generators, which use the features.
Does anyone know, how to see, in which Xtend generators which features/parameters were accessed?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03337 seconds