Package org.eclipse.php.internal.core.typeinference.context

Examples of org.eclipse.php.internal.core.typeinference.context.TypeContext


        ModuleDeclaration moduleDeclaration = SourceParserUtil
            .getModuleDeclaration(type.getSourceModule(), null);
        FileContext fileContext = new FileContext(
            type.getSourceModule(), moduleDeclaration, offset);
        TypeContext typeContext = new TypeContext(fileContext,
            classType);
        PHPTypeInferencer typeInferencer = new PHPTypeInferencer();

        if (!propertyName.startsWith(DOLLAR)) {
          propertyName = DOLLAR + propertyName;
View Full Code Here


  public IGoal[] init() {
    ClassVariableDeclarationGoal typedGoal = (ClassVariableDeclarationGoal) goal;
    IType[] types = typedGoal.getTypes();

    if (types == null) {
      TypeContext context = (TypeContext) typedGoal.getContext();
      types = PHPTypeInferenceUtils.getModelElements(
          context.getInstanceType(), context);
    }
    if (types == null) {
      return null;
    }
View Full Code Here

    super(goal);
  }

  public IGoal[] init() {
    PHPDocClassVariableGoal typedGoal = (PHPDocClassVariableGoal) goal;
    TypeContext context = (TypeContext) typedGoal.getContext();
    String variableName = typedGoal.getVariableName();
    int offset = typedGoal.getOffset();

    IModelAccessCache cache = context.getCache();
    IType[] types = PHPTypeInferenceUtils.getModelElements(
        context.getInstanceType(), context, offset, cache);
    Map<PHPDocBlock, IField> docs = new HashMap<PHPDocBlock, IField>();

    if (types != null) {
      for (IType type : types) {
        try {
View Full Code Here

    // we've evaluated receiver, lets evaluate the method return type now
    // (using PHPDoc first):
    if (state == STATE_GOT_RECEIVER) {
      state = STATE_WAITING_FIELD_PHPDOC;
      TypeContext typeContext = new TypeContext(
          (ISourceModuleContext) goal.getContext(), receiverType);
      if (goal.getContext() instanceof IModelCacheContext) {
        typeContext.setCache(((IModelCacheContext) goal.getContext())
            .getCache());
      }
      return new IGoal[] { new PHPDocClassVariableGoal(typeContext,
          variableName, offset) };
    }

    if (state == STATE_WAITING_FIELD_PHPDOC) {
      if (goalState != GoalState.PRUNED && previousResult != null
          && previousResult != UnknownType.INSTANCE) {
        result = previousResult;
        return null;
      }
      state = STATE_WAITING_FIELD;
      TypeContext typeContext = new TypeContext(
          (ISourceModuleContext) goal.getContext(), receiverType);
      if (goal.getContext() instanceof IModelCacheContext) {
        typeContext.setCache(((IModelCacheContext) goal.getContext())
            .getCache());
      }
      return new IGoal[] { new ClassVariableDeclarationGoal(typeContext,
          variableName) };
    }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.typeinference.context.TypeContext

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.