Package org.rascalmpl.interpreter.staticErrors

Examples of org.rascalmpl.interpreter.staticErrors.NotEnumerable


          IConstructor listSymbol = nt.getSymbol();
          return RascalTypeFactory.getInstance().nonTerminalType(SymbolAdapter.getSymbol(listSymbol));
        }
      }

      throw new NotEnumerable(subjectType.toString(), ctx.getCurrentAST());
    }
    else if (subjectType.isNode() || subjectType.isAbstractData() || subjectType.isTuple()) {
      return TypeFactory.getInstance().valueType();     
    }
   
    throw new NotEnumerable(subjectType.toString(), ctx.getCurrentAST());
  }
View Full Code Here


            return new CFListIterator(TreeAdapter.getArgs(tree), 1);
          }
        }
      }

      throw new NotEnumerable(subjectType.toString(), ctx.getCurrentAST());
      // Node and ADT
    } else if(subjectType.isNode() || subjectType.isAbstractData()){     
      if (shallow){
        if(subjectType.isAbstractData())
          checkMayOccur(patType, subjectType, ctx);
        return new NodeChildIterator((INode) subjectValue);
      }
      return new DescendantReader(subjectValue, false);

    } else if(subjectType.isTuple()){
      if(shallow){
        Type lub = TypeFactory.getInstance().voidType();
        int nElems = subjectType.getArity();
        for(int i = 0; i < nElems; i++)
          lub = lub.lub(subjectType.getFieldType(i));
        if(!lub.comparable(patType))
          throw new UnexpectedType(patType, subjectType, ctx.getCurrentAST())
        return new TupleElementIterator((ITuple)subjectValue);
      }
      return new DescendantReader(subjectValue, false);

    } else if(subjectType.isBool() ||
        subjectType.isInteger() ||
        subjectType.isReal() ||
        subjectType.isString() ||
        subjectType.isSourceLocation() ||
        subjectType.isRational() ||
        subjectType.isDateTime())
    {
      if (shallow) {
        throw new NotEnumerable(subjectType.toString(), ctx.getCurrentAST());
      }
      return new SingleIValueIterator(subjectValue);
    } else {
      throw new UnsupportedOperation("makeIterator", subjectType, ctx.getCurrentAST());
    }
View Full Code Here

TOP

Related Classes of org.rascalmpl.interpreter.staticErrors.NotEnumerable

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.