Package loop.ast.script

Examples of loop.ast.script.Unit.reduceAll()


  @Test
  public final void emitIfStatement() throws Exception {
    Parser parser = new LexprParser(new Tokenizer("sum(cond) ->\n  if cond then 1 else 2\n").tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here


      System.out.println(script);
      System.out.println("\n\n");
    }
    Parser parser = new LexprParser(new Tokenizer(script).tokenize());
    Unit unit = parser.script(null);
    unit.reduceAll();

    // Compile ASM.
    Class<?> generated = new AsmCodeEmitter(unit).write(unit);
    Method asmCallable = javaCallable.lookup(generated);
View Full Code Here

        ? new SexprParser(new Tokenizer(input).tokenize())
        : new LexprParser(new Tokenizer(input).tokenize());
    Unit unit = null;
    try {
      unit = parser.script(file);
      unit.reduceAll();

      this.scope = unit;
    } catch (RuntimeException e) {
      // Ignored.
      System.out.println("Parse errors exist.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.