Examples of comparable()


Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

       
        if (!tmvVar.isAnonymous() && allVars.containsKey(name)) {
          throw new RedeclaredVariable(name, getAST());
        }
       
        if(childType.comparable(staticSubjectElementType)
            || (tmvVar.bindingInstance() && childType.comparable(staticSetSubjectType))) {
          tmvVar.covertToSetType();
          if (!tmvVar.isAnonymous()) {
            patVars.add(name);
            allVars.put(name,  (IVarPattern)child);
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

        if (!tmvVar.isAnonymous() && allVars.containsKey(name)) {
          throw new RedeclaredVariable(name, getAST());
        }
       
        if(childType.comparable(staticSubjectElementType)
            || (tmvVar.bindingInstance() && childType.comparable(staticSetSubjectType))) {
          tmvVar.covertToSetType();
          if (!tmvVar.isAnonymous()) {
            patVars.add(name);
            allVars.put(name,  (IVarPattern)child);
          }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

        Type childType = child.getType(env, null);
        String name = ((TypedVariablePattern)child).getName();
        if(!patVar.isAnonymous() && allVars.containsKey(name)){
          throw new RedeclaredVariable(name, getAST());
        }
        if(childType.comparable(staticSubjectElementType)){
          /*
           * An explicitly declared set or element variable.
           */
          if(!patVar.isAnonymous()){
            patVars.add(name);
 
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

            // so this just causes errors when we use variables in set patterns.
            // env.declareVariable(staticSubjectElementType, name);
          } else {
              if(varRes.getValue() != null){
                  Type varType = varRes.getType();
                  if (varType.comparable(staticSetSubjectType)){
                    /*
                     * A set variable declared in the current scope: add its elements
                     */
                    fixedSetElements = fixedSetElements.union((ISet)varRes.getValue());
                  } else if(varType.comparable(staticSubjectElementType)){
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

                  if (varType.comparable(staticSetSubjectType)){
                    /*
                     * A set variable declared in the current scope: add its elements
                     */
                    fixedSetElements = fixedSetElements.union((ISet)varRes.getValue());
                  } else if(varType.comparable(staticSubjectElementType)){
                    /*
                     * An element variable in the current scope, add its value.
                     */
                    fixedSetElements = fixedSetElements.insert(varRes.getValue());
                  } else {
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

        /*
         * A literal pattern: add it to the set of fixed element
         */
        IValue lit = ((LiteralPattern) child).toIValue(env);
        Type childType = child.getType(env, null);
        if(!childType.comparable(staticSubjectElementType)){
//          throw new UnexpectedType(setSubject.getType(), childType, getAST());
          hasNext = false;
          return;
        }
        fixedSetElements = fixedSetElements.insert(lit);
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

      } else {
        /*
         * All other cases of a nested pattern that is not a variable or a literal.
         */
        Type childType = child.getType(env, null);
        if(!childType.comparable(staticSubjectElementType)){
          hasNext = false;
          return;
          // can't throw type error: throw new UnexpectedType(setSubject.getType(), childType, getAST());
        }
        java.util.List<IVarPattern> childVars = child.getVariables();
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

        listVarOccurrences[i] = 1;
        ++nListVar;

        if(!tmvVar.isAnonymous() && allVars.contains(name)) {
          throw new RedeclaredVariable(name, getAST());
        } else if(tmvType.comparable(listSubject.getType().getElementType())
            || (tmvVar.bindingInstance() && tmvType.comparable(listSubject.getType()))) {
          tmvVar.convertToListType();
          if (!tmvVar.isAnonymous()) {
            allVars.add(name);
          }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

        ++nListVar;

        if(!tmvVar.isAnonymous() && allVars.contains(name)) {
          throw new RedeclaredVariable(name, getAST());
        } else if(tmvType.comparable(listSubject.getType().getElementType())
            || (tmvVar.bindingInstance() && tmvType.comparable(listSubject.getType()))) {
          tmvVar.convertToListType();
          if (!tmvVar.isAnonymous()) {
            allVars.add(name);
          }
          isBindingVar[i] = true;
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.type.Type.comparable()

            isBindingVar[i] = true;
          } else {
            isBindingVar[i] = false;
            Type varType = varRes.getType();
            if (isAnyListType(varType)){ 
              if (!varType.comparable(listSubjectType)) {    
                hasNext = false;
                return;
              }
            } else {
              if(!(varType instanceof NonTerminalType) && !(varType.comparable(staticListSubjectElementType))) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.