|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.tools.javac.tree.JCTree.Visitor
com.sun.tools.javac.tree.TreeScanner
com.sun.tools.javac.comp.Lower.FreeVarCollector
class Lower.FreeVarCollector
A navigator class for collecting the free variables accessed from a local class. There is only one case; all other cases simply traverse down the tree.
| Field Summary | |
|---|---|
(package private) Symbol.ClassSymbol |
clazz
The local class. |
(package private) List<Symbol.VarSymbol> |
fvs
The list of owner's variables accessed from within the local class, without any duplicates. |
(package private) Symbol |
owner
The owner of the local class. |
| Constructor Summary | |
|---|---|
Lower.FreeVarCollector(Symbol.ClassSymbol clazz)
|
|
| Method Summary | |
|---|---|
private void |
addFreeVar(Symbol.VarSymbol v)
Add free variable to fvs list unless it is already there. |
private void |
addFreeVars(Symbol.ClassSymbol c)
Add all free variables of class c to fvs list unless they are already there. |
void |
visitApply(JCTree.JCMethodInvocation tree)
If tree refers to a superclass constructor call, add all free variables of the superclass. |
void |
visitIdent(JCTree.JCIdent tree)
If tree refers to a variable in owner of local class, add it to free variables list. |
void |
visitNewClass(JCTree.JCNewClass tree)
If tree refers to a class instance creation expression add all free variables of the freshly created class. |
void |
visitSelect(JCTree.JCFieldAccess tree)
If tree refers to a qualified this or super expression for anything but the current class, add the outer this stack as a free variable. |
private void |
visitSymbol(Symbol _sym)
|
| Methods inherited from class com.sun.tools.javac.tree.TreeScanner |
|---|
scan, scan, visitAnnotation, visitAssert, visitAssign, visitAssignop, visitBinary, visitBlock, visitBracketExpr, visitBreak, visitCase, visitCatch, visitClassDef, visitConditional, visitContinue, visitDoLoop, visitErroneous, visitExec, visitForeachLoop, visitForLoop, visitIf, visitImport, visitIndexed, visitLabelled, visitLetExpr, visitLiteral, visitMethodDef, visitModifiers, visitNewArray, visitParens, visitReturn, visitSkip, visitSwitch, visitSynchronized, visitThrow, visitTopLevel, visitTree, visitTry, visitTypeApply, visitTypeArray, visitTypeBoundKind, visitTypeCast, visitTypeIdent, visitTypeParameter, visitTypeTest, visitUnary, visitVarDef, visitWhileLoop, visitWildcard |
| Methods inherited from class com.sun.tools.javac.tree.JCTree.Visitor |
|---|
visitBracketStat, visitEscapeExpr, visitEscapeStat |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
Symbol owner
Symbol.ClassSymbol clazz
List<Symbol.VarSymbol> fvs
| Constructor Detail |
|---|
Lower.FreeVarCollector(Symbol.ClassSymbol clazz)
| Method Detail |
|---|
private void addFreeVar(Symbol.VarSymbol v)
private void addFreeVars(Symbol.ClassSymbol c)
public void visitIdent(JCTree.JCIdent tree)
visitIdent in class TreeScannerprivate void visitSymbol(Symbol _sym)
public void visitNewClass(JCTree.JCNewClass tree)
visitNewClass in class TreeScannerpublic void visitSelect(JCTree.JCFieldAccess tree)
visitSelect in class TreeScannerpublic void visitApply(JCTree.JCMethodInvocation tree)
visitApply in class TreeScanner
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||