Examples of IConstructor


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

        );
       
        if (result.getType().isBottom()) {
          return ambCluster;
        }
        IConstructor r = (IConstructor) result.getValue();
        if (TreeAdapter.isAmb(r)) {
          ISet returnedAlts = TreeAdapter.getAlternatives(r);
          if (returnedAlts.size() == 1) {
            return (IConstructor) returnedAlts.iterator().next();
          }
View Full Code Here

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

  public Class<IGTD<IConstructor, IConstructor, ISourceLocation>> getParser(IRascalMonitor monitor, URI loc, String name, IMap definition) {
    monitor.startJob("Generating parser:" + name, 100, 90);
   
    try {
      monitor.event("Importing and normalizing grammar:" + name, 30);
      IConstructor grammar = getGrammar(monitor, name, definition);
      debugOutput(grammar.toString(), System.getProperty("java.io.tmpdir") + "/grammar.trm");
      String normName = name.replaceAll("::", "_");
      monitor.event("Generating java source code for parser: " + name,30);
      IString classString = (IString) evaluator.call(monitor, "generateObjectParser", vf.string(packageName), vf.string(normName), grammar);
      debugOutput(classString.getValue(), System.getProperty("java.io.tmpdir") + "/parser.java");
      monitor.event("Compiling generated java code: " + name, 30);
View Full Code Here

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

   * The class that this parser generates will inherit from that previously generated parser.
   */
  public Class<IGTD<IConstructor, IConstructor, ISourceLocation>> getRascalParser(IRascalMonitor monitor, URI loc, String name, IMap definition, IGTD<IConstructor, IConstructor, ISourceLocation> objectParser) {
    try {
      monitor.event("Importing and normalizing grammar: " + name, 10);
      IConstructor grammar = getGrammar(monitor, name, definition);
      String normName = name.replaceAll("::", "_");
      monitor.event("Generating java source code for Rascal parser:" + name, 10);
      IString classString = (IString) evaluator.call(monitor, "generateMetaParser", vf.string(packageName), vf.string("$Rascal_" + normName), vf.string(packageName + "." + normName), grammar);
      debugOutput(classString.getValue(), System.getProperty("java.io.tmpdir") + "/metaParser.java");
      monitor.event("compiling generated java code: " + name, 10);
View Full Code Here

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

  public IConstructor getGrammar(IRascalMonitor monitor, String main, IMap definition) {
    return (IConstructor) evaluator.call(monitor, "modules2grammar", vf.string(main), definition);
  }
 
  public IConstructor getExpandedGrammar(IRascalMonitor monitor, String main, IMap definition) {
    IConstructor g = getGrammar(monitor, main, definition);
   
    monitor.event("Expanding keywords", 10);
    g = (IConstructor) evaluator.call(monitor, "expandKeywords", g);
    monitor.event("Adding regular productions",10);
    g = (IConstructor) evaluator.call(monitor, "makeRegularStubs", g);
View Full Code Here

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

  public Class<IGTD<IConstructor, IConstructor, ISourceLocation>> getNewParser(IRascalMonitor monitor, URI loc, String name, IMap definition) {
      monitor.startJob("Generating parser:" + name, 100, 130);
   
    try {
      monitor.event("Importing and normalizing grammar:" + name, 30);
      IConstructor grammar = getGrammar(monitor, name, definition);
      debugOutput(grammar.toString(), System.getProperty("java.io.tmpdir") + "/grammar.trm");
      return getNewParser(monitor, loc, name, grammar);
    catch (ClassCastException e) {
      throw new ImplementationError("parser generator:" + e.getMessage(), e);
    } catch (Throw e) {
      throw new ImplementationError("parser generator: " + e.getMessage() + e.getTrace());
View Full Code Here

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

    prevValue = null;
  }

  public void setChildren(IFigureConstructionEnv env, NameResolver resolver){
    if(prevValue == null || recompute.getValue()){
      IConstructor figureCons =
        (IConstructor) env.getCallBackEnv().executeRascalFigureCallBack(callback, noTypes, noArgs);
      if(figureCons == null){
        return;
      }
      if(prevValue == null || !figureCons.isEqual(prevValue)){
        if(innerFig != null){
          innerFig.destroy(env);
        }
        setInnerFig( FigureFactory.make(env, figureCons, prop, childProps));
        prop.stealExternalPropertiesFrom(innerFig.prop);
View Full Code Here

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

  public Class<IGTD<IConstructor, IConstructor, ISourceLocation>> getParser(IRascalMonitor monitor, URI loc, String name, IMap definition) {
    monitor.startJob("Generating parser:" + name, 100, 90);

    try {
      monitor.event("Importing and normalizing grammar:" + name, 30);
      IConstructor grammar = convertMapToGrammar(definition);
      debugOutput(grammar.toString(), System.getProperty("java.io.tmpdir") + "/grammar.trm");
      String normName = name.replaceAll("::", "_");
      monitor.event("Generating java source code for parser: " + name,30);
      IString classString = (IString) evaluator.call(monitor, "generateObjectParser", vf.string(packageName), vf.string(normName), grammar);
      debugOutput(classString.getValue(), System.getProperty("java.io.tmpdir") + "/parser.java");
      monitor.event("Compiling generated java code: " + name, 30);
View Full Code Here

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

   * The class that this parser generates will inherit from that previously generated parser.
   */
  public Class<IGTD<IConstructor, IConstructor, ISourceLocation>> getRascalParser(IRascalMonitor monitor, URI loc, String name, IMap definition, IGTD<IConstructor, IConstructor, ISourceLocation> objectParser) {
    try {
      monitor.event("Importing and normalizing grammar: " + name, 10);
      IConstructor grammar = convertMapToGrammar(definition);
      String normName = name.replaceAll("::", "_");
      monitor.event("Generating java source code for Rascal parser:" + name, 10);
      IString classString = (IString) evaluator.call(monitor, "generateMetaParser", vf.string(packageName), vf.string("$Rascal_" + normName), vf.string(packageName + "." + normName), grammar);
      debugOutput(classString.getValue(), System.getProperty("java.io.tmpdir") + "/metaParser.java");
      monitor.event("compiling generated java code: " + name, 10);
View Full Code Here

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

   
    return (IConstructor) eval.call(monitor, "linkImportedModules", moduleParseTree, mw.done());
  }
 
  public synchronized IConstructor checkModule(IRascalMonitor monitor, IConstructor moduleParseTree) {
    IConstructor res = moduleParseTree;
//    res = resolveImports(monitor, res);
    if (checkerEnabled) res = (IConstructor) eval.call(monitor, "check", res);
    return res;
  }
View Full Code Here

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

    return true;
  }
 
  public void endVisit(AnnotationTypeMemberDeclaration node) {
    ownValue = scopeManager.pop();
    IConstructor type = bindingsResolver.resolveType(node.getType().resolveBinding(), true);
      insert(types, ownValue, type);
  }
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.