Documentation generation based on grammar [message #1820910] |
Fri, 31 January 2020 07:52  |
Eclipse User |
|
|
|
Hi,
I'm trying to generate documentation based on my .Xtext grammar. My example Types.xtext file, located in types/src, has the following line:
Range:
min = (NUMER|DECIMAL) ',' max = (NUMBER|DECIMAL)
This generates the Range.java file in types/src-gen. This contains among others the method & generated documentation:
/**
* Returns the value of the '<em><b>Min</b></em>' attribute
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Min</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
... {some parts skipped} ...
*/
String getMin();
The default user-doc text implies that you can add some documentation, however since Range.java is entirely generated based on the xtext file editing it would be pointless. I have tried several ways of adding documentation to the xtext file (using the '//' and '/**' annotation methods) but none of these results in the generated files getting documentation.
Is there an official way to generate user doc based on documentation int he xtext file, and if yes, how?
Thanks for your time
[Updated on: Wed, 05 February 2020 01:43] by Moderator
|
|
|
|
|
|
|
Re: Documentation generation based on grammar [message #1821149 is a reply to message #1821147] |
Thu, 06 February 2020 05:42  |
Eclipse User |
|
|
|
i fear if you cannot answer this question yourself the topic is too advanced for you.
xtext does two things with the grammar
- it derived a parser
- it derived a metamodel (ecore file)
you can also maintain the metamodel manually and import it into the grammar instead of generating it.
|
|
|
Powered by
FUDForum. Page generated in 0.09409 seconds