Examples of IMap


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

    if(scopeIn.equals("")) {
      scopeIn = null;
    }
   
    Integer nlocals = ((IInteger) declaration.get("nlocals")).intValue();
    IMap localNames = ((IMap) declaration.get("localNames"));
    Integer nformals = ((IInteger) declaration.get("nformals")).intValue();
    Integer maxstack = ((IInteger) declaration.get("maxStack")).intValue();
    IList code = (IList) declaration.get("instructions");
    ISourceLocation src = (ISourceLocation) declaration.get("src");
    CodeBlock codeblock = new CodeBlock(vf);
View Full Code Here

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

   */
  public IValue parse(IString moduleName, IValue start, IMap robust, URI location, char[] input, List<Frame> stacktrace) {
    Type reified = start.getType();
    IConstructor startSort = checkPreconditions(start, reified);
   
    IMap syntax = (IMap) ((IConstructor) start).get(1);
    try {
      IConstructor pt = parseObject(moduleName, startSort, robust, location, input, syntax);

      if (TreeAdapter.isAppl(pt)) {
        if (SymbolAdapter.isStart(TreeAdapter.getType(pt))) {
View Full Code Here

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

//        }
//        throw new ImplementationError("class for cached parser " + className + " could not be found");
//      }

      ParserGenerator pg = getParserGenerator();
      IMap definitions = syntax;
     
      Class<IGTD<IConstructor, IConstructor, ISourceLocation>> parser = getObjectParser(name, start);

      if (parser == null || force) {
        String parserName = name; // .replaceAll("::", ".");
View Full Code Here

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

        b[i] = c.getType();
        i++;
      }
    }
    HashMap<String, IValue> map = new HashMap<String, IValue>();
    IMap annoMap = (IMap) t.get(annoKey);
    if (annoMap != null) {
      Iterator<IValue> iterator = annoMap.iterator();
      while (iterator.hasNext()) {
        IValue k = iterator.next();
        String ky = ((IString) k).getValue();
        IValue v = annoMap.get(k);
        map.put(ky, v);
      }
    }
   
    // keyword parameters
View Full Code Here

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

  }
 
  public IValue typeToValue(Type t, RascalExecutionContext rex) {
   
    TypeStore store = new TypeStore();
    IMap definitions = rex.getSymbolDefinitions();
    TypeReifier tr = new TypeReifier(vf);
    tr.declareAbstractDataTypes(definitions, store);
   
    IConstructor symbol = typeToSymbol(t, store);
   
View Full Code Here

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

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

            || 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

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

    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

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

       * 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

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

        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
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.