Rule parameters - What are they? #3151
-
Hi, while inspecting the Xtext grammar for Xtext itself, I've noticed that rules support parameters.
It seems that these parameters can take as values boolean literals, references to other parameters, or combinations thereof. However, I could find zero documentation online that explains when rule parameters could be useful (i.e. examples or design patterns), and, most importantly, how to use them (i.e. perhaps access them programmatically and do something based on their values? I'm not sure, I am just trying to imagine the main use case). Could anyone enlighten me, please? Cheers :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I fear there is no such thing like docs for this. You might find some examples in the xtext repo and some other repos eg n4js it basically allows to to turn of parts of rules from outside |
Beta Was this translation helpful? Give feedback.
-
You basically for a rule define <a,b,c> In the alternative add a Alternative1 And then call rules with <a=true> or passing from parent |
Beta Was this translation helpful? Give feedback.
I fear there is no such thing like docs for this. You might find some examples in the xtext repo and some other repos eg n4js
it basically allows to to turn of parts of rules from outside
So that you can use the same rule at multiple places and then turn of some alternatives at different places