Examples of Compiler


Examples of com.googlecode.prolog_cafe.compiler.Compiler

  /** Creates a copy of rules.pl and compiles it into Java sources. */
  private void compileProlog(ObjectId prolog, File tempDir)
      throws IOException, CompileException {
    File tempRules = copyToTempFile(prolog, tempDir);
    try {
      Compiler comp = new Compiler();
      comp.prologToJavaSource(tempRules.getPath(), tempDir.getPath());
    } finally {
      tempRules.delete();
    }
  }
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.runtime.tools.Compiler

    public void testJavaCompiler() throws Exception {
        runInNewJVM();
    }
   
    private void testJavaCompiler_() throws IOException {
        Compiler javaCompiler = CeylonToolProvider.getCompiler(Backend.Java);
        testCompiler(javaCompiler, "modules.usesProvided", "1");
    }
View Full Code Here

Examples of com.sun.facelets.compiler.Compiler

                this.servletRequest, this.servletResponse,
                this.factoryLifecycle
                        .getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE));
       
       
        Compiler c = new SAXCompiler();
        //c.setTrimmingWhitespace(true);
        FaceletFactory factory = new DefaultFaceletFactory(c, this);
        FaceletFactory.setInstance(factory);
       
        faces.setViewRoot(faces.getApplication().getViewHandler().createView(faces, "/test"));
View Full Code Here

Examples of com.sun.faces.facelets.compiler.Compiler

    }


    protected Compiler createCompiler(Map<String, Object> appMap, WebConfiguration webConfig) {

        Compiler c = new SAXCompiler();

        // load decorators
        String decParam = webConfig
              .getOptionValue(FaceletsDecorators);
        if (decParam != null) {
            decParam = decParam.trim();
            String[] decs = Util.split(appMap, decParam, ";");
            TagDecorator decObj;
            for (String decorator : decs) {
                try {
                    decObj = (TagDecorator) ReflectionUtil.forName(decorator)
                          .newInstance();
                    c.addTagDecorator(decObj);

                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   "Successfully Loaded Decorator: {0}",
                                   decorator);
                    }
                } catch (Exception e) {
                    if (LOGGER.isLoggable(Level.SEVERE)) {
                        LOGGER.log(Level.SEVERE,
                                   "Error Loading Decorator: " + decorator,
                                   e);
                    }
                }
            }
        }

        // skip params?
        c.setTrimmingComments(
              webConfig.isOptionEnabled(
                    BooleanWebContextInitParameter.FaceletsSkipComments));

        c.addTagLibrary(new CoreLibrary());
        c.addTagLibrary(new CoreLibrary("http://xmlns.jcp.org/jsf/core"));
        c.addTagLibrary(new HtmlLibrary());
        c.addTagLibrary(new HtmlLibrary("http://xmlns.jcp.org/jsf/html"));
        c.addTagLibrary(new UILibrary());
        c.addTagLibrary(new UILibrary("http://xmlns.jcp.org/jsf/facelets"));
        c.addTagLibrary(new JstlCoreLibrary());
        c.addTagLibrary(new JstlCoreLibrary("http://java.sun.com/jstl/core"));
        c.addTagLibrary(new JstlCoreLibrary("http://xmlns.jcp.org/jsp/jstl/core"));
        c.addTagLibrary(new PassThroughAttributeLibrary());
        c.addTagLibrary(new PassThroughElementLibrary());
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://java.sun.com/jsp/jstl/functions"));
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://xmlns.jcp.org/jsp/jstl/functions"));
        if (isDevModeEnabled()) {
            c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://java.sun.com/mojarra/private/functions"));
            c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://xmlns.jcp.org/mojarra/private/functions"));
        }
        c.addTagLibrary(new CompositeLibrary());
        c.addTagLibrary(new CompositeLibrary("http://xmlns.jcp.org/jsf/composite"));

        return c;

    }
View Full Code Here

Examples of com.sun.org.apache.xpath.internal.compiler.Compiler

      errorListener = new com.sun.org.apache.xml.internal.utils.DefaultErrorHandler();
   
    m_patternString = exprString;

    XPathParser parser = new XPathParser(errorListener, locator);
    Compiler compiler = new Compiler(errorListener, locator, m_funcTable);

    if (SELECT == type)
      parser.initXPath(compiler, exprString, prefixResolver);
    else if (MATCH == type)
      parser.initMatchPattern(compiler, exprString, prefixResolver);
    else
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_DEAL_XPATH_TYPE, new Object[]{Integer.toString(type)})); //"Can not deal with XPath type: " + type);

    // System.out.println("----------------");
    Expression expr = compiler.compile(0);

    // System.out.println("expr: "+expr);
    this.setExpression(expr);
   
    if((null != locator) && locator instanceof ExpressionNode)
View Full Code Here

Examples of com.sun.org.apache.xpath.internal.compiler.Compiler

      errorListener = new com.sun.org.apache.xml.internal.utils.DefaultErrorHandler();
   
    m_patternString = exprString;

    XPathParser parser = new XPathParser(errorListener, locator);
    Compiler compiler = new Compiler(errorListener, locator, m_funcTable);

    if (SELECT == type)
      parser.initXPath(compiler, exprString, prefixResolver);
    else if (MATCH == type)
      parser.initMatchPattern(compiler, exprString, prefixResolver);
    else
      throw new RuntimeException(XSLMessages.createXPATHMessage(
            XPATHErrorResources.ER_CANNOT_DEAL_XPATH_TYPE,
            new Object[]{Integer.toString(type)}));
            //"Can not deal with XPath type: " + type);

    // System.out.println("----------------");
    Expression expr = compiler.compile(0);

    // System.out.println("expr: "+expr);
    this.setExpression(expr);
   
    if((null != locator) && locator instanceof ExpressionNode)
View Full Code Here

Examples of erjang.beam.Compiler

        int idx = args[i].lastIndexOf('.');
        File out = ERT.newFile(args[i].substring(0, idx) + ".jar");
        JarClassRepo jcp = new JarClassRepo(out);

        System.out.println("compiling "+in+" -> "+out+" ...");
        new Compiler(jcp).compile(in, beamParser);

        jcp.close();
      }
    }
  }
View Full Code Here

Examples of fjord.compiler.Compiler

      out.flush();
    }
  }

  public static String eval(final Environment env, String input) throws Exception {
    final Compiler compiler = new Compiler(String.format("ScriptFragment$%d", counter++));

    Node node = compiler.parse(input);
    if (node == null)
      return "";

    final StringBuilder output = new StringBuilder();

    node.accept(new DefaultNodeVisitor() {
      @Override public void visit(CompilerDirectiveDecl decl) {
        if (decl.getIdent().equals("help"))
          output.append(help());
        else if (decl.getIdent().equals("quit"))
          env.halt();
        else
          output.append(String.format("Invalid directive '%s'\n", decl));
      }
    });

    node.accept(new DefaultNodeVisitor() {
      @Override public void visitAfter(ValueDefn defn) {
        Value val = compiler.codegen(defn);

        output.append(String.format("val %s = %s\n", defn.pattern(), val.eval()));
      }
    });
View Full Code Here

Examples of jfix.util.Compiler

  }
 
  public String[] getValue() {
    try {
      if (provider == null) {
        provider = (Provider) new Compiler().eval(code);
      }
      return provider.getValue();
    } catch (Throwable e) {
      return new String[] { e.getMessage() };
    }
View Full Code Here

Examples of juzu.impl.compiler.Compiler

        //
        final ReadFileSystem<S> sourcePath = scanner.getFileSystem();

        //
        final RAMFileSystem classOutput = new RAMFileSystem();
        Compiler compiler = Compiler.
            builder().
            sourcePath(sourcePath).
            sourceOutput(classOutput).
            classOutput(classOutput).
            addClassPath(classPath).build();
        compiler.addAnnotationProcessor(new MainProcessor());
        compiler.compile();

        // Copy everything that is not a java source and not already present
        sourcePath.copy(new Filter.Default<S>() {
          @Override
          public boolean acceptFile(S file, String name) throws IOException {
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.