Package org.eclipse.imp.pdb.facts

Examples of org.eclipse.imp.pdb.facts.IMap


  public IValue fromJSON(IValue type, IString src, RascalExecutionContext rex) {
    TypeStore store = new TypeStore();
   
    IConstructor type_cons = ((IConstructor) type);
    IMap definitions = rex.getSymbolDefinitions();

    tr.declareAbstractDataTypes(definitions, store);
    Type start = tr.valueToType(type_cons, store);
   
    //TypeStore store = ctx.getCurrentEnvt().getStore();
View Full Code Here


            || subscript.getType().isSubtypeOf(keyType)) {
          IValue oldValue = ((IMap) rec.getValue()).get(subscript
              .getValue());
          __eval.__setValue(__eval.newResult(oldValue, __eval
              .__getValue()));
          IMap map = ((IMap) rec.getValue()).put(
              subscript.getValue(), __eval.__getValue()
                  .getValue());
          result = org.rascalmpl.interpreter.result.ResultFactory
              .makeResult(rec.hasInferredType() ? rec.getType()
                  .lub(map.getType()) : rec.getType(), map,
                  __eval.__getEval());
        } else {
          throw new UnexpectedType(keyType, subscript.getType(),
              this.getSubscript());
        }
View Full Code Here

    switch (value.getName()) {
    case "null":
      out.nullValue();
      break;
    case "object":
      IMap props = (IMap) value.get(0);
      out.beginObject();
      for (IValue k: props) {
        out.name(((IString)k).getValue());
        writePlainJSON((IConstructor) props.get(k));
      }
      out.endObject();
      break;
    case "array":
      IList vals = (IList) value.get(0);
View Full Code Here

       * a type recursively.
       *
       * We also need to construct a TypeStore from the declarations, such that the
       * appropriate definitions for ADT's and aliases can be found.
       */
      IMap definitions = (IMap) typeValue.get("definitions");
      declareAbstractDataTypes(definitions, store);
      return symbolToType((IConstructor) typeValue.get("symbol"), store);
    }

    throw new IllegalArgumentException(typeValue + " is not a reified type");
View Full Code Here

        return vf.constructor(Factory.Symbol_ReifiedType, externalType.getTypeParameters().getFieldType(0).accept(this));
      }

      private IValue visitNonTerminalType(NonTerminalType externalType) {
        IConstructor gr = ctx.getEvaluator().getGrammar(ctx.getCurrentEnvt());
        IMap rules = (IMap) gr.get("rules");
        for (IValue sym : rules) {
          definitions.put((IConstructor) sym, (IConstructor) rules.get(sym));
        }
        return externalType.getSymbol();
      }

      @Override
View Full Code Here

          aw.append(kid);
        }
      }
      args = aw.done();
      int length = args.length();
      IMap comments = cw.done();
     
//      // this could be optimized.
//      i = 0;
//      int length = args.length();
//      while (i < length) {
View Full Code Here

TOP

Related Classes of org.eclipse.imp.pdb.facts.IMap

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.