Package ch.snowdon.minijava.sline.model.stm

Examples of ch.snowdon.minijava.sline.model.stm.CompoundStm.maxArgs()


            new LastExpList(new OpExp(new IdExp("a"),
                OpExp.Op.MINUS, new NumExp(1))))), new OpExp(
            new NumExp(10), OpExp.Op.TIMES, new IdExp("a")))),
        new PrintStm(new LastExpList(new IdExp("b")))));

    assertEquals(2, prog.maxArgs());

    prog = new CompoundStm(new AssignStm("a", new OpExp(new NumExp(5),
        OpExp.Op.PLUS, new NumExp(3))), new CompoundStm(new AssignStm(
        "b", new NumExp(2)), new PrintStm(new LastExpList(
        new IdExp("b")))));
View Full Code Here


    prog = new CompoundStm(new AssignStm("a", new OpExp(new NumExp(5),
        OpExp.Op.PLUS, new NumExp(3))), new CompoundStm(new AssignStm(
        "b", new NumExp(2)), new PrintStm(new LastExpList(
        new IdExp("b")))));

    assertEquals(1, prog.maxArgs());
  }

  @Test
  public void maxArgsNested() throws Exception {
View Full Code Here

    Stm prog = new CompoundStm(new AssignStm("a", new OpExp(new NumExp(5),
        OpExp.Op.PLUS, new NumExp(3))), new CompoundStm(new AssignStm(
        "b", new IdExp("c")), new AssignStm(
            "b", new IdExp("c"))));

    assertEquals(-1, prog.maxArgs());
  }

  @Test
  public void integerInc() throws Exception {
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.