Package com.sun.tools.javac.main

Examples of com.sun.tools.javac.main.JavaCompiler$CompileStates


  protected JCTree parseWithLombok(Source source) {
    Context context = new Context();
   
    Options.instance(context).put(OptionName.ENCODING, "UTF-8");
   
    JavaCompiler compiler = new JavaCompiler(context);
    compiler.genEndPos = true;
    compiler.keepComments = true;
   
    JCCompilationUnit cu = compiler.parse(new ContentBasedJavaFileObject(source.getName(), source.getRawInput()));
    JcTreeConverter converter = new JcTreeConverter();
    JcTreeBuilder builder = new JcTreeBuilder();
    converter.visit(cu);
    builder.visit(converter.getResult());
    return builder.get();
View Full Code Here


  protected JCTree parseWithTargetCompiler(Source source) {
    Context context = new Context();
   
    Options.instance(context).put(OptionName.ENCODING, "UTF-8");
   
    JavaCompiler compiler = new JavaCompiler(context);
    compiler.genEndPos = true;
    compiler.keepComments = true;
   
    JCCompilationUnit cu = compiler.parse(new ContentBasedJavaFileObject(source.getName(), source.getRawInput()));
    return cu;
  }
View Full Code Here

    return builder.get();
  }
 
  protected JCTree parseWithTargetCompiler(Source source) throws Exception {
    Context context = new Context();
    JavaCompiler compiler = new JavaCompiler(context);
    compiler.genEndPos = true;
    JCTree result = compiler.parse(new ContentBasedJavaFileObject(source.getName(), source.getRawInput()));
    return compiler.errorCount() > 0 ? null : result;
  }
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.main.JavaCompiler$CompileStates

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.