Package org.eclipse.imp.pdb.facts

Examples of org.eclipse.imp.pdb.facts.IListWriter.done()


      IListWriter w = vf.listWriter();
      Object[] lst = (Object[]) result;
      for(int i = 0; i < lst.length; i++){
        w.append(narrow(lst[i]));
      }
      return w.done();
    }
    throw new CompilerError("Cannot convert object back to IValue: " + result);
  }
 
  /**
 
View Full Code Here


    ISourceLocation location = getLocation();
   
    if (location != null) {
      java.util.Map<String,IValue> annos = new HashMap<String,IValue>();
      annos.put("loc", location);
      return makeResult(type, eval.getValueFactory().constructor(Factory.Tree_Appl, annos, production, flatten(w.done())), eval);
    }
    else {
      return makeResult(type, eval.getValueFactory().constructor(Factory.Tree_Appl, production, flatten(w.done())), eval);
    }
  }
View Full Code Here

      java.util.Map<String,IValue> annos = new HashMap<String,IValue>();
      annos.put("loc", location);
      return makeResult(type, eval.getValueFactory().constructor(Factory.Tree_Appl, annos, production, flatten(w.done())), eval);
    }
    else {
      return makeResult(type, eval.getValueFactory().constructor(Factory.Tree_Appl, production, flatten(w.done())), eval);
    }
  }

  private void appendPreviousSeparators(IList args, IListWriter result, int delta, int i, boolean previousWasEmpty) {
    if (!previousWasEmpty) {
View Full Code Here

        result.append(tree);
        previousWasEmpty = false;
      }
    }
   
    return result.done();
  }

  private int getDelta(IConstructor prod) {
    IConstructor rhs = ProductionAdapter.getType(prod);
   
View Full Code Here

      }
      IListWriter w = vf.listWriter(base.isTop() ? tf.valueType() : expected.getElementType());
      for (int i = terms.length - 1; i >= 0; i--) {
        w.insert(terms[i]);
      }
      return w.done();
    } else if (base.isRelation()) {
      ISetWriter w = vf.setWriter(expected.getElementType());
      w.insert(terms);
      return w.done();
View Full Code Here

      }
      return w.done();
    } else if (base.isRelation()) {
      ISetWriter w = vf.setWriter(expected.getElementType());
      w.insert(terms);
      return w.done();

    } else if (base.isSet()) {
      ISetWriter w = vf.setWriter(expected.getElementType());
      w.insert(terms);
      return w.done();
View Full Code Here

      return w.done();

    } else if (base.isSet()) {
      ISetWriter w = vf.setWriter(expected.getElementType());
      w.insert(terms);
      return w.done();
    } else if(base.isMap()){
      //Type tt = expected.getElementType();
      IMapWriter w = vf.mapWriter(expected); //tt.getFieldType(0), tt.getFieldType(1));
      for (int i = terms.length - 1; i >= 0; i--) {
        w.put(((ITuple) terms[i]).get(0), ((ITuple)terms[i]).get(1));
View Full Code Here

      //Type tt = expected.getElementType();
      IMapWriter w = vf.mapWriter(expected); //tt.getFieldType(0), tt.getFieldType(1));
      for (int i = terms.length - 1; i >= 0; i--) {
        w.put(((ITuple) terms[i]).get(0), ((ITuple)terms[i]).get(1));
      }
      return w.done();
    }
    throw new FactParseError("Unexpected type " + expected,
        reader.getPosition());
  }
View Full Code Here

          } else {
            wrel.append(getValueFactory().tuple(args));
          }
        }
      }
      return makeResult(resultType, yieldList ? wset.done() : wrel.done(), ctx);
    }

    ////
   
   
View Full Code Here

      try {
        IListWriter w = getValueFactory().listWriter();
        for (IValue e : getValue()) {
          w.append(((ITuple) e).get(tupleType.getFieldIndex(name)));
        }
        return makeResult(getTypeFactory().listType(tupleType.getFieldType(name)), w.done(), ctx);
      }
      // TODO: why catch this exception here?
      catch (UndeclaredFieldException e) {
        throw new UndeclaredField(name, getType(), ctx.getCurrentAST());
      }
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.