Package org.eclipse.imp.pdb.facts.type

Examples of org.eclipse.imp.pdb.facts.type.TypeStore


    }
  }
 
  public IConstructor convertMapToGrammar(IMap definition) {
    TypeFactory TF = TypeFactory.getInstance();
    TypeStore TS = new TypeStore();
    Type Grammar = TF.abstractDataType(TS, "Grammar");
    Type Symbol = TF.abstractDataType(TS, "Symbol");
    Type Production = TF.abstractDataType(TS, "Production");
    Type grammar = TF.constructor(TS, Grammar, "grammar", TF.setType(Symbol), "starts", TF.mapType(Symbol, Production), "rules");
View Full Code Here


    super(ValueFactoryFactory.getValueFactory().sourceLocation(URIUtil.assumeCorrect("main", name, "")), name);
    this.heap = heap;
    this.importedModules = new HashSet<String>();
    this.concreteSyntaxTypes = new HashMap<String, NonTerminalType>();
    this.productions = new HashSet<IValue>();
    this.typeStore = new TypeStore();
    this.initialized = false;
    this.syntaxDefined = false;
    this.bootstrap = false;
    this.resourceImporters = new HashMap<String, AbstractFunction>();
  }
View Full Code Here

  @Override
  public void reset() {
    super.reset();
    this.importedModules = new HashSet<String>();
    this.concreteSyntaxTypes = new HashMap<String, NonTerminalType>();
    this.typeStore = new TypeStore();
    this.productions = new HashSet<IValue>();
    this.initialized = false;
    this.syntaxDefined = false;
    this.bootstrap = false;
    this.extended = new HashSet<String>();
View Full Code Here

      this.concreteSyntaxTypes.putAll(other.concreteSyntaxTypes);
    }
   
    if (other.typeStore != null) {
      if (this.typeStore == null) {
        this.typeStore = new TypeStore();
      }
      this.typeStore.extendStore(other.typeStore);
    }
   
    if (other.productions != null) {
View Full Code Here

  private Type getType(ModuleEnvironment m, String typeString) {
    Type t = toType.get(typeString);
    if (t != null)
      return t;
    TypeStore ts = m.getStore();
    t = ts.lookupAlias(typeString);
    if (t != null)
      return t;
    t = ts.lookupAbstractDataType(typeString);
    return t;
  }
View Full Code Here

    throw RuntimeExceptionFactory.implodeError("Calling of constructor " + name + " did not return a constructor", null, null);
  }
 
  @Override
  public IValue implode(IValue reifiedType, IConstructor tree, IEvaluatorContext ctx) {
    typeStore = new TypeStore();
    Type type = tr.valueToType((IConstructor) reifiedType, typeStore);
    try {
      IValue result = implode(typeStore, type, tree, false, ctx);
      if (isUntypedNodeType(type) && !type.isTop() && (TreeAdapter.isList(tree) || TreeAdapter.isOpt(tree))) {
        result = values.node("", result);
View Full Code Here

  }

  public IValue readBinaryValueFile(IValue type, ISourceLocation loc, RascalExecutionContext rex){

    //    TypeStore store = ctx.getCurrentEnvt().getStore();
    TypeStore store = new TypeStore();

    // TODO: commented out the following lines and that seems to sove the duplicate declaration of ParseTree.
    //     Why was this import here? Can someone check?

    //    ModuleEnvironment pt = ctx.getHeap().getModule("ParseTree");
View Full Code Here


  public IValue readTextValueFile(IValue type, ISourceLocation loc, RascalExecutionContext rex){
    loc = rex.resolveSourceLocation(loc);

    TypeStore store = new TypeStore();
    Type start = tr.valueToType((IConstructor) type, store);

    InputStream in = null;
    try{
      in = new BufferedInputStream(rex.getResolverRegistry().getInputStream(loc.getURI()));
View Full Code Here

  }

  @Override
  protected <U extends IValue> Result<U> addSourceLocation(
      SourceLocationResult that) {
    Result<IValue> path = that.fieldAccess("path", new TypeStore());
    String parent = ((IString) path.getValue()).getValue();
    String child = getValue().getValue();
    if (parent.endsWith("/")) {
      parent = parent.substring(0, parent.length() - 1);
    }
    if (!child.startsWith("/")) {
      child = "/" + child;
    }
   
    return that.fieldUpdate("path", makeResult(getTypeFactory().stringType(), getValueFactory().string(parent + child), ctx), new TypeStore());
  }
View Full Code Here

 
  RascalExecutionContext(IValueFactory vf, IMap symbol_definitions, boolean debug, boolean profile, IEvaluatorContext ctx, ITestResultListener testResultListener){
   
    this.vf = vf;
    this.symbol_definitions = symbol_definitions;
    this.typeStore = new TypeStore();
    this.debug = debug;
    this.profile = profile;
   
    resolverRegistry = ctx.getResolverRegistry();
    monitor = ctx.getEvaluator().getMonitor();
View Full Code Here

TOP

Related Classes of org.eclipse.imp.pdb.facts.type.TypeStore

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.