Package org.allspice.bytecode

Examples of org.allspice.bytecode.TypeCode


  }
  public VarStack addLocalVar(FileUnitInfo fuinfo,Collection<? extends VarDecl> varDecls) {
    VarStack vs = this ;
    for(VarDecl varDecl: varDecls) {
      String t = varDecl.type ;
      TypeCode type = TypeCode.getType(t) ;
      TypeName fqtype = fuinfo.getFullQualified(t) ;
      vs = new VarStack(vs.nextVar + type.wordSize,vs.decls.insert(varDecl.name, new Var(vs.nextVar,fqtype))) ;
    }
    return vs ;
  }
View Full Code Here


    }
  }
  private static final class IfLessThanConverter implements
      InstConverter<IfLessThan> {
    public void convertInst(final IfLessThan t, InstructionListContext ilc) {
      TypeCode type = t.type ;
      createIfTest(ilc,type,new IF_ICMPLT(null),new IFLT(null),t.mark) ;
    }
View Full Code Here

    }
  }
  private static final class IfNotEqualsConverter implements
      InstConverter<IfNotEqual> {
    public void convertInst(final IfNotEqual t, InstructionListContext ilc) {
      TypeCode type = t.type ;
      createIFNE(ilc, type,t.mark);
    }
View Full Code Here

      createIFNE(ilc, type,t.mark);
    }
  }
  private static final class IfEqualsConverter implements InstConverter<IfEquals> {
    public void convertInst(final IfEquals t, InstructionListContext ilc) {
      TypeCode type = t.type ;
      createIFEQ(ilc, type,t.mark);
    }
View Full Code Here

      ilc.add(InstructionConstants.ARRAYLENGTH) ;
    }
  }
  private static final class ReturnConverter implements InstConverter<Return> {
    public void convertInst(Return t, InstructionListContext ilc) {
      TypeCode type = t.type ;
      ilc.add(createReturn(type)) ;
    }
View Full Code Here

      ilc.add(ilc.getInstructionFactory().createInvoke(ref, mref.name, ret_type, args, Constants.INVOKEINTERFACE)) ;
    }
  }
  private static final class CompareConverter implements InstConverter<Compare> {
    public void convertInst(Compare t, InstructionListContext ilc) {
      TypeCode type = t.type ;
      createCompare(ilc, type) ;
    }
View Full Code Here

  public abstract Inst createOp(TypeCode tc,Mark isTrue) ;
    public abstract TypeCode getComparisonType(EvaluationContext context,Expr lhs,Expr rhs) throws CompilerException ;
  public void compile(TypeName forwardType, T t, EvaluationContext context, InstList result) throws CompilerException {
    final Expr lhs = t.lhs;
    final Expr rhs = t.rhs;
    TypeCode type = getComparisonType(context,lhs, rhs) ;
    Mark isTrue = new Mark() ;
    StdJavaExpressions.createBinopComparison(context, lhs, rhs,TypeName.valueOf(type),isTrue,createOp(type,isTrue),result);
    StdJavaExpressions.convertResult(context,t, forwardType, result) ;
  }
View Full Code Here

    }
  }
  private static final class UnsignedShiftRightConverter implements
      InstConverter<UnsignedShiftRight> {
    public void convertInst(UnsignedShiftRight t, InstructionListContext ilc) {
      TypeCode type = t.type ;
      ilc.add(createUSHR(type)) ;
    }
View Full Code Here

      ilc.add(createUSHR(type)) ;
    }
  }
  private static final class ShiftRightConverter implements InstConverter<ShiftRight> {
    public void convertInst(ShiftRight t, InstructionListContext ilc) {
      TypeCode type = t.type ;
      ilc.add(createSHR(type)) ;
    }
View Full Code Here

      ilc.add(createSHR(type)) ;
    }
  }
  private static final class ShiftLeftConverter implements InstConverter<ShiftLeft> {
    public void convertInst(ShiftLeft t, InstructionListContext ilc) {
      TypeCode type = t.type ;
      ilc.add(createSHL(type)) ;
    }
View Full Code Here

TOP

Related Classes of org.allspice.bytecode.TypeCode

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.