Package org.allspice.bytecode

Examples of org.allspice.bytecode.TypeCode


      ilc.add(createSHL(type)) ;
    }
  }
  private static final class NotConverter implements InstConverter<Not> {
    public void convertInst(Not t, InstructionListContext ilc) {
      TypeCode type = t.type ;
      Number inverse = notZero(type);
      ilc.add(ilc.getInstructionFactory().createConstant(inverse)) ;
      ilc.add(createXOR(type)) ;
    }
View Full Code Here


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

public abstract class ShiftOp<T extends BinopExpr<Expr,Expr>> extends Binop<T> {
  public abstract Inst createOp(TypeCode tc) ;
  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 = StdJavaExpressions.getShiftBinopType(context.getTypeCode(lhs), context.getTypeCode(rhs)) ;
    StdJavaExpressions.createShift(context, lhs, rhs,TypeName.valueOf(type),createOp(type),result);
    StdJavaExpressions.convertResult(context,t, forwardType, result) ;
  }
View Full Code Here

    TypeCode type = StdJavaExpressions.getShiftBinopType(context.getTypeCode(lhs), context.getTypeCode(rhs)) ;
    StdJavaExpressions.createShift(context, lhs, rhs,TypeName.valueOf(type),createOp(type),result);
    StdJavaExpressions.convertResult(context,t, forwardType, result) ;
  }
  public StubResolver getType(T t, EvaluationContext context) throws CompilerException {
    final TypeCode lhstype = context.getTypeCode(t.lhs);
    final TypeCode rhstype = context.getTypeCode(t.rhs);
    return context.makeTypeRef(StdJavaExpressions.getShiftBinopType(lhstype,rhstype)) ;
  }   
View Full Code Here

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

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

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

    }
   
    public StubResolver getType(ConditionalExpr t, EvaluationContext context) throws CompilerException {
      StubResolver td1 = context.getType(t.thenExpr) ;
      StubResolver td2 = context.getType(t.elseExpr) ;
      TypeCode t1 = condTable.get(new TypePair(td1.getTypeCode(),td2.getTypeCode())) ;
      if (t1 != null) {
        return context.makeTypeRef(t1) ;
      }
      return getCommon(context.classPool,td1,td2) ;
    }
View Full Code Here

    public LValue compileLValue(ConditionalExpr t,
        EvaluationContext context, InstList l) throws CompilerException {
      throw new NoLValAvailable() ;
    }
    public boolean isInstanceOf(ConditionalExpr t, TypeName type, EvaluationContext context) throws CompilerException {
      TypeCode td1 = context.getTypeCode(t.thenExpr) ;
      TypeCode td2 = context.getTypeCode(t.elseExpr) ;
      TypeCode t1 = condTable.get(new TypePair(td1,td2)) ;
      if (t1 != null) {
        return context.classPool.isAssignableFrom(type, context.makeTypeRef(t1)) ;
      }

      return context.isInstanceOf(type, t.thenExpr) && context.isInstanceOf(type, t.elseExpr) ;
View Full Code Here

        i++ ;
      }
    }
 
    public StubResolver getType(ArrayOfExpr ae, EvaluationContext context) throws CompilerException {
      TypeCode t = null ;
      for(Expr e: ae.arr) {
        if (t == null) {
          t = context.getTypeCode(e) ;
        }
        else {
          TypeCode u = context.getTypeCode(e) ;
          switch(u) {
          case BOOLEAN:
          case VOID:
          case ARRAY:
            if (t != u) {
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.