public static @bind.as("/") class Divide extends BinOp { }
public static @bind.as("+") class Add extends BinOp { }
public static @bind.as("-") class Subtract extends BinOp { }
public static @bind.as("/") class Divide extends BinOp { }
public static @bind.as("+") class Add extends BinOp { }
public static @bind.as("-") class Subtract extends BinOp { }
Parser metaGrammarParser = new CharParser(MetaGrammar.newInstance());
Tree<String> parsedGrammar = metaGrammarParser.parse(new CharInput(new FileInputStream(s[0]))).expand1();
Parser metaGrammarParser = new CharParser(MetaGrammar.newInstance());
Tree<String> parsedGrammar = metaGrammarParser.parse(new CharInput(new FileInputStream(s[0]))).expand1();
Union mathGrammar = Grammar.create(parsedGrammar, "Expr", gbr);
Parser mathParser = new CharParser(mathGrammar);
Union mathGrammar = Grammar.create(parsedGrammar, "Expr", gbr);
Parser mathParser = new CharParser(mathGrammar);
Tree tree = mathParser.parse(new CharInput(new StringReader(s[1]))).expand1();
// below is ugly voodoo which will go away very soon. ignore it.
Tree tree = mathParser.parse(new CharInput(new StringReader(s[1]))).expand1();
// below is ugly voodoo which will go away very soon. ignore it.
Math.Expr e = (Math.Expr)tf.invoke(tree);
// above is ugly voodoo which will go away very soon. ignore it.
Math.Expr e = (Math.Expr)tf.invoke(tree);
// above is ugly voodoo which will go away very soon. ignore it.