Class SyntaxPrinter
java.lang.Object
org.clafer.frontend.SyntaxPrinter
Prints a syntax tree as the compiler's
printTree prints its parse
tree (PrintClafer, generated by BNFC): the same words, parentheses
and line breaks. Two trees print the same text when they are the same tree,
up to the spans, so the text is what the parser is compared on with the
compiler's.
The output is not meant for reading: BNFC puts a line break after each brace and semicolon, and the layout of the source is gone.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringprint(Syntax.Exp exp) static Stringprint(Syntax.Model model)
-
Method Details
-
print
- Parameters:
model- a syntax tree- Returns:
- the text that
printTreeprints for the same tree
-
print
- Parameters:
exp- an expression- Returns:
- the text that
printTreeprints for it
-