Package net.janino

Examples of net.janino.Scanner


  // require Janino from http://www.janino.net
  private static class JaninoCompiller implements Compiller {

    public byte[] compile( String name, String source) throws Exception {
      // using janino embeddable compiller
      Parser p = new Parser( new Scanner( name, new StringReader( source)));
      CompilationUnit cu = p.parseCompilationUnit();
      IClassLoader cl = new ClassLoaderIClassLoader( new URLClassLoader( new URL[] {}));
      return cu.compile( cl, 0)[0].toByteArray();
    }
View Full Code Here


        "}\r\n" +
        "";
   
    IClassLoader cl = new ClassLoaderIClassLoader( new URLClassLoader( new URL[] {}));

    Parser p = new Parser( new Scanner( "JPEGImageWriterDump", new StringReader( code)));
    CompilationUnit cu = p.parseCompilationUnit();
    cu.compile( cl, DebuggingInformation.NONE)[0].toByteArray();
   
  }
View Full Code Here

TOP

Related Classes of net.janino.Scanner

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.