How to get all types and each rules required fields #1380
Unanswered
Lemour-sudo
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Hey @Lemour-sudo, in the current Note that you can always get the fields of an AST node by using |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have parser rules that expect multiple fields to be included:
Assert: 'assert' '(' value1=STRING possibleValues+=STRING ')';
.For each parser rule I want to get its metadata that will tell me the type and the required fields. In this example, I would expect something like:
I did come across the mandatory property returned as part of a type's metadata with the
getTypeMetaData
method in the generated "ast.ts" file. However, the mandatory property is just a list of one required field:First,
value1
is not included. Second, from the above metadata, it is not clear what typevalue2
is an array of.Is it possible in Langium to get all a parser rule's required fields like in the above example?
Beta Was this translation helpful? Give feedback.
All reactions