equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
33 import javax.tools.JavaFileObject; |
33 import javax.tools.JavaFileObject; |
34 import javax.tools.SimpleJavaFileObject; |
34 import javax.tools.SimpleJavaFileObject; |
35 import com.sun.tools.javac.file.JavacFileManager; |
35 import com.sun.tools.javac.file.JavacFileManager; |
36 import com.sun.tools.javac.parser.Parser; |
36 import com.sun.tools.javac.parser.Parser; |
37 import com.sun.tools.javac.parser.ParserFactory; |
37 import com.sun.tools.javac.parser.ParserFactory; |
38 import com.sun.tools.javac.parser.Scanner; |
|
39 import com.sun.tools.javac.tree.JCTree; |
38 import com.sun.tools.javac.tree.JCTree; |
40 import com.sun.tools.javac.tree.TreeScanner; |
39 import com.sun.tools.javac.tree.TreeScanner; |
41 import com.sun.tools.javac.util.Context; |
40 import com.sun.tools.javac.util.Context; |
42 import com.sun.tools.javac.util.Log; |
41 import com.sun.tools.javac.util.Log; |
43 import com.sun.tools.javac.util.JCDiagnostic; |
42 import com.sun.tools.javac.util.JCDiagnostic; |
58 |
57 |
59 Log log = Log.instance(context); |
58 Log log = Log.instance(context); |
60 log.multipleErrors = true; |
59 log.multipleErrors = true; |
61 |
60 |
62 JavacFileManager.preRegister(context); |
61 JavacFileManager.preRegister(context); |
63 Scanner.Factory sfac = Scanner.Factory.instance(context); |
|
64 ParserFactory pfac = ParserFactory.instance(context); |
62 ParserFactory pfac = ParserFactory.instance(context); |
65 |
63 |
66 final String text = |
64 final String text = |
67 "public class Foo {\n" |
65 "public class Foo {\n" |
68 + " public static void main(String[] args) {\n" |
66 + " public static void main(String[] args) {\n" |