Navigation
Synopsis Yield the string of characters that form the leafs of the given parse tree.
Function str unparse(Tree tree)
Usage import ParseTree;
Description unparse is the inverse function of parse, i.e., for every syntactically correct string TXT of type S, the following holds:
unparse(parse(#S, TXT)) == TXT
Examples
rascal>import demo::lang::Exp::Concrete::NoLayout::Syntax;
ok
rascal>import ParseTree;
ok
First parse an expression, this results in a parse tree. Then unparse this parse tree:
rascal>unparse(parse(#Exp, "2+3"));
str: "2+3"
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.