Navigation
Types
data Production
     = \priority(Symbol def, list[Production] choices)
  | \associativity(Symbol def, Associativity \assoc, set[Production] alternatives)
  | \others(Symbol def)
  | \reference(Symbol def, str cons)
     ;
Usage import ParseTree;

Here we extend productions with basic combinators allowing to construct ordered and un-ordered compositions, and associativity groups.

The intended semantics are that
  • 'choice' means unordered choice (defined in |Type|)
  • 'priority' means ordered choice, where alternatives are tried from left to right,
  • 'assoc' means all alternatives are acceptable, but nested on the declared side
  • 'others' means '...', which is substituted for a choice among the other definitions
  • 'reference' means a reference to another production rule which should be substituted there, for extending priority chains and such.
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.