38 import com.sun.tools.javac.code.Symbol.*; |
38 import com.sun.tools.javac.code.Symbol.*; |
39 import com.sun.tools.javac.tree.JCTree.*; |
39 import com.sun.tools.javac.tree.JCTree.*; |
40 import com.sun.tools.javac.code.Type.*; |
40 import com.sun.tools.javac.code.Type.*; |
41 |
41 |
42 import com.sun.tools.javac.jvm.Target; |
42 import com.sun.tools.javac.jvm.Target; |
|
43 import com.sun.tools.javac.parser.EndPosTable; |
43 |
44 |
44 import static com.sun.tools.javac.code.Flags.*; |
45 import static com.sun.tools.javac.code.Flags.*; |
45 import static com.sun.tools.javac.code.Flags.BLOCK; |
46 import static com.sun.tools.javac.code.Flags.BLOCK; |
46 import static com.sun.tools.javac.code.Kinds.*; |
47 import static com.sun.tools.javac.code.Kinds.*; |
47 import static com.sun.tools.javac.code.TypeTags.*; |
48 import static com.sun.tools.javac.code.TypeTags.*; |
125 */ |
126 */ |
126 Env<AttrContext> attrEnv; |
127 Env<AttrContext> attrEnv; |
127 |
128 |
128 /** A hash table mapping syntax trees to their ending source positions. |
129 /** A hash table mapping syntax trees to their ending source positions. |
129 */ |
130 */ |
130 Map<JCTree, Integer> endPositions; |
131 EndPosTable endPosTable; |
131 |
132 |
132 /************************************************************************** |
133 /************************************************************************** |
133 * Global mappings |
134 * Global mappings |
134 *************************************************************************/ |
135 *************************************************************************/ |
135 |
136 |
3673 public List<JCTree> translateTopLevelClass(Env<AttrContext> env, JCTree cdef, TreeMaker make) { |
3673 public List<JCTree> translateTopLevelClass(Env<AttrContext> env, JCTree cdef, TreeMaker make) { |
3674 ListBuffer<JCTree> translated = null; |
3674 ListBuffer<JCTree> translated = null; |
3675 try { |
3675 try { |
3676 attrEnv = env; |
3676 attrEnv = env; |
3677 this.make = make; |
3677 this.make = make; |
3678 endPositions = env.toplevel.endPositions; |
3678 endPosTable = env.toplevel.endPositions; |
3679 currentClass = null; |
3679 currentClass = null; |
3680 currentMethodDef = null; |
3680 currentMethodDef = null; |
3681 outermostClassDef = (cdef.hasTag(CLASSDEF)) ? (JCClassDecl)cdef : null; |
3681 outermostClassDef = (cdef.hasTag(CLASSDEF)) ? (JCClassDecl)cdef : null; |
3682 outermostMemberDef = null; |
3682 outermostMemberDef = null; |
3683 this.translated = new ListBuffer<JCTree>(); |
3683 this.translated = new ListBuffer<JCTree>(); |
3702 translated = this.translated; |
3702 translated = this.translated; |
3703 } finally { |
3703 } finally { |
3704 // note that recursive invocations of this method fail hard |
3704 // note that recursive invocations of this method fail hard |
3705 attrEnv = null; |
3705 attrEnv = null; |
3706 this.make = null; |
3706 this.make = null; |
3707 endPositions = null; |
3707 endPosTable = null; |
3708 currentClass = null; |
3708 currentClass = null; |
3709 currentMethodDef = null; |
3709 currentMethodDef = null; |
3710 outermostClassDef = null; |
3710 outermostClassDef = null; |
3711 outermostMemberDef = null; |
3711 outermostMemberDef = null; |
3712 this.translated = null; |
3712 this.translated = null; |