Package org.eclipse.dltk.evaluation.types

Examples of org.eclipse.dltk.evaluation.types.SimpleType


            .getPhpVersion(methodContext.getSourceModule()
                .getScriptProject().getProject());
        if (lambdas[0] != null
            && (lambdas[0].isStatic() || phpVersion
                .isLessThan(PHPVersion.PHP5_4))) {
          this.results.add(new SimpleType(SimpleType.TYPE_NULL));
        } else {
          IEvaluatedType instanceType = methodContext
              .getInstanceType();
          if (instanceType != null) {
            this.results.add(instanceType);
          } else {
            this.results.add(new SimpleType(SimpleType.TYPE_NULL));
          }
        }
        return IGoal.NO_GOALS;
      }
    }
View Full Code Here


  }

  public IGoal[] subGoalDone(IGoal subgoal, Object result, GoalState state) {
    if (state == GoalState.PRUNED || result == null
        || result == UnknownType.INSTANCE) {
      evaluatedType = new SimpleType(SimpleType.TYPE_STRING);
    } else {
      evaluatedType = (IEvaluatedType) result;
    }
    return IGoal.NO_GOALS;
  }
View Full Code Here

    ExpressionTypeGoal typedGoal = (ExpressionTypeGoal) goal;
    UnaryOperation unaryOp = (UnaryOperation) typedGoal.getExpression();
    switch (unaryOp.getOperatorType()) {
    case UnaryOperation.OP_MINUS:
    case UnaryOperation.OP_PLUS:
      result = new SimpleType(SimpleType.TYPE_NUMBER);
      break;
    case UnaryOperation.OP_TILDA:
      return new IGoal[] { new ExpressionTypeGoal(goal.getContext(),
          unaryOp.getExpr()) };
    case UnaryOperation.OP_NOT:
      result = new SimpleType(SimpleType.TYPE_BOOLEAN);
      break;
    }
    return IGoal.NO_GOALS;
  }
View Full Code Here

      } else {
        simpleType = SimpleType.TYPE_STRING;
      }
      break;
    }
    return new SimpleType(simpleType);
  }
View Full Code Here

    case InfixExpression.OP_STRING_AND:
    case InfixExpression.OP_STRING_XOR:
    case InfixExpression.OP_OR:
    case InfixExpression.OP_AND:
    case InfixExpression.OP_XOR:
      result = new SimpleType(SimpleType.TYPE_BOOLEAN);
      break;
    case InfixExpression.OP_CONCAT:
      result = new SimpleType(SimpleType.TYPE_STRING);
      break;
    case InfixExpression.OP_PLUS:
    case InfixExpression.OP_MINUS:
    case InfixExpression.OP_MUL:
    case InfixExpression.OP_DIV:
    case InfixExpression.OP_MOD:
    case InfixExpression.OP_SL:
    case InfixExpression.OP_SR:
      result = new SimpleType(SimpleType.TYPE_NUMBER);
      break;
    default:
      throw new IllegalArgumentException();
    }
    return IGoal.NO_GOALS;
View Full Code Here

        .getExpression();
    int operator = castExpression.getCastType();
    switch (operator) {
    case CastExpression.TYPE_INT:
    case CastExpression.TYPE_REAL:
      result = new SimpleType(SimpleType.TYPE_NUMBER);
      break;
    case CastExpression.TYPE_STRING:
      result = new SimpleType(SimpleType.TYPE_STRING);
      break;
    case CastExpression.TYPE_ARRAY:
      result = new SimpleType(SimpleType.TYPE_ARRAY);
      break;
    case CastExpression.TYPE_OBJECT:
      return new IGoal[] { new ExpressionTypeGoal(typedGoal.getContext(),
          castExpression.getExpr()) };
    case CastExpression.TYPE_BOOL:
      result = new SimpleType(SimpleType.TYPE_BOOLEAN);
      break;
    case CastExpression.TYPE_UNSET:
      result = new SimpleType(SimpleType.TYPE_NULL);
      break;
    default:
      throw new IllegalArgumentException();
    }
    return IGoal.NO_GOALS;
View Full Code Here

    if (expressionClass == VariableReference.class) {
      return new VariableReferenceEvaluator(exprGoal);
    }
    if (expressionClass == BackTickExpression.class
        || expressionClass == Quote.class) {
      return new FixedAnswerEvaluator(exprGoal, new SimpleType(
          SimpleType.TYPE_STRING));
    }
    if (expressionClass == CloneExpression.class) {
      return new CloneEvaluator(exprGoal);
    }
    if (expressionClass == InstanceOfExpression.class) {
      return new FixedAnswerEvaluator(exprGoal, new SimpleType(
          SimpleType.TYPE_BOOLEAN));
    }
    if (expressionClass == ConditionalExpression.class) {
      return new ConditionalExpressionEvaluator(exprGoal);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.evaluation.types.SimpleType

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.