use of suite.node.parser.FactorizeResult.FPair in project suite by stupidsing.
the class RecursiveParser method node.
private Node node(FNode fn) {
if (fn instanceof FTree) {
FTree ft = (FTree) fn;
String name = ft.name;
List<FPair> pairs = ft.pairs;
FNode fn0 = pairs.get(0).node;
FNode fn1 = pairs.get(1).node;
FNode fn2 = pairs.get(2).node;
if (name.equals("("))
return node(fn1);
else if (name.equals("["))
return Tree.of(TermOp.TUPLE_, Atom.of("[]"), node(fn1));
else if (name.equals("`"))
return Tree.of(TermOp.TUPLE_, Atom.of("`"), node(fn1));
else
return Tree.of(TermOp.valueOf(name), node(fn0), node(fn2));
} else
return terminalParser.parseTerminal(((FTerminal) fn).chars.toString());
}