Class Syntax
java.lang.Object
org.clafer.frontend.Syntax
The syntax tree of a model in the full Clafer language, as written: the
tree of the compiler's
clafer.cf (AbsClafer), with a span
for each node. ClaferParser builds it, and SyntaxPrinter
prints it as the compiler's printTree does.
The sugar stays as written, e.g., a card ? or the implicit
this of a name; the later passes read it from the tree. Where the
parser recovered from an error, the tree has what it read around it.
The records are immutable; their lists are unmodifiable copies.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordinitially eorfinally e.static final recordAn assertion,assert [ e ].static final recordA binary expression.static enumThe binary operators, with their symbols and levels.static interfaceA cardinality:?,+,*, a number or an interval.static final recordA cardinality written as a number,2.static final recordA cardinality written as?,+or*.static final recordA clafer, e.g.,abstract xor A : B -> int ? = 3 { ... }.static final recordA name in an expression.static final recordThe transition of a clafer,--> e.static final recordA use of a clafer,`A ? { ... }.static final recordA constraint,[ e1 e2 ]: the conjunction of its expressions.static final recordThe declaration of a quantifier,x; y : e.static interfaceA declaration at the top level.static interfaceAn element: a clafer, a use of a clafer, a constraint, an objective or an assertion.static final recordThe elements of a clafer, in braces or indented.static final recordAn enumeration,enum E = a | b.static interfaceAn expression.static interfaceA group cardinality: a keyword or an interval.static final recordAn objective,<< minimize e >>.static enumHow an objective is written.static final recordA group cardinality written as a keyword:xor,or,muxoropt.static final recordA name as written, e.g., a clafer's name or a local variable.static final recordif c then t else e.static final recordAn initializer,= eor:= e.static enumHow an initializer is written.static final recordlet x = v in body.static final recordA literal: an integer, a double, a real or a string, as written.static enumThe kinds of literals.static final recordA model: its declarations in the order they were written.static final recordA path of names,a\b.static final recordAn interval,2..3or2..*, of a cardinality or of a group cardinality.static interfaceA node of the tree.static final recordA behavioral pattern, e.g.,never e after s, ora must precede b.static enumThe behavioral patterns.static final recordThe scope of a pattern:before e,after e,between e and e,after e until e.static enumThe quantifiers.static final recordA quantified expression without a declaration,some e.static final recordA quantified expression with a declaration,some disj x : e | body.static final recordA reference,-> eto a set or->> eto a bag.static enumThe scopes of a pattern.static final recordThe super clafer,: e.static final recordA temporal modifier of a clafer.static enumThe temporal modifiers.static final recordA transition arrow:-->,-->>(synchronous), or with a guard,-[ g ]->and-[ g ]->>.static final recordA transition,e1 --> e2.static final recordA prefix expression.static enumThe prefix operators, with their symbols, levels and the levels of their operands. -
Method Summary