Package org.allspice.bytecode

Examples of org.allspice.bytecode.CaseLabel


      if (s instanceof CaseStatement) {
        Mark mark = new Mark() ;
        CaseStatement cs = (CaseStatement)s ;
        final Expr e = cs.e;
        if (e == null) {
          labels.add(new CaseLabel(null,mark)) ;
          deffound = true ;
        }
        else {
          ConstObj constobj = newContext.getConst(e) ;
          if (constobj == null) {
            throw new NonConstCase() ;
          }
          Integer label = getIntValue(constobj) ;
          labels.add(new CaseLabel(label,mark)) ;         
        }
        marks.put(cs,mark) ;
      }
    }
    if (!deffound) {
      labels.add(new CaseLabel(null,theEnd)) ;
    }
    l.add(new LookupSwitch(labels)) ;
    for(Statement s: statements) {
      if (s instanceof CaseStatement) {
        CaseStatement cs = (CaseStatement)s ;
View Full Code Here


    Mark two = new Mark() ;
    Mark three = new Mark() ;
    Mark others = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new LookupSwitch(new FIFO<CaseLabel>(new CaseLabel(3,three),new CaseLabel(1,one),new CaseLabel(2,two),new CaseLabel(null,others))),
        new Nop(one),new Const(1.0),new Return(TypeCode.DOUBLE),
        new Nop(two),new Const(2.0),new Return(TypeCode.DOUBLE),
        new Nop(three),new Const(3.0),new Return(TypeCode.DOUBLE),
        new Nop(others),new Const(0.0),new Return(TypeCode.DOUBLE)
        ) ;
View Full Code Here

TOP

Related Classes of org.allspice.bytecode.CaseLabel

Copyright © 2018 www.massapicom. 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.