|
|||||||||
| Home >> All >> com >> puppycrawl >> tools >> checkstyle >> checks >> usage >> [ transmogrify overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.puppycrawl.tools.checkstyle.checks.usage.transmogrify
Class SymbolTable

java.lang.Objectcom.puppycrawl.tools.checkstyle.checks.usage.transmogrify.SymbolTable
- public class SymbolTable
- extends java.lang.Object
this class contains all of the definitions, references, and scopes created by the system. Other stuff this class does:
- holds the "base" scope containing primitive definitions
- holds the java.lang package
- holds the definition of java.lang.Object, which is the base class of all class hierarchies
- kicks off the resolve step
- does some of the work of constructing object definitions
| Field Summary | |
private BaseScope |
baseScope
|
private java.io.File |
currentFile
|
private int |
currentLine
|
private ScopeIndex |
index
|
private java.util.Hashtable |
packages
|
private SymTabAST |
root
|
private java.util.Stack |
scopes
|
| Constructor Summary | |
SymbolTable(SymTabAST root)
constructor takes SymTabAST |
|
| Method Summary | |
void |
defineBlock(BlockDef blockDef)
defines a block within the symbol table |
void |
defineClass(ClassDef def)
defines a class in the symbol table. |
void |
defineLabel(LabelDef labelDef)
defines a label within the symbol table |
void |
defineMethod(MethodDef method)
defines a method in the symbol table |
void |
definePackage(PackageDef pkg,
Scope parent)
adds PackageDef to its parent scope and stores the
PackageDef in packages |
void |
defineVariable(VariableDef v)
defines a variable in the symbol table |
BaseScope |
getBaseScope()
returns the "base" scope |
java.io.File |
getCurrentFile()
gets the file that the symbol table is currently processing |
Scope |
getCurrentScope()
returns the current scope. |
PackageDef |
getPackage(java.lang.String name)
gets package by its name |
java.util.Hashtable |
getPackages()
gets all packages stored in this symbol table |
ScopeIndex |
getScopeIndex()
gets the symbol table's scope index |
SymTabAST |
getTree()
gets the root node |
void |
indexScope(Scope scope)
places a scope in the symbol table's index |
Scope |
popScope()
pops a scope from the stack. |
void |
pushScope(Scope scope)
pushes a new scope onto the stack |
void |
setCurrentFile(java.io.File file)
sets the current file that the symbol table is processing |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
packages
private java.util.Hashtable packages
scopes
private java.util.Stack scopes
index
private ScopeIndex index
currentFile
private java.io.File currentFile
currentLine
private int currentLine
baseScope
private BaseScope baseScope
root
private SymTabAST root
| Constructor Detail |
SymbolTable
public SymbolTable(SymTabAST root)
- constructor takes
SymTabAST
| Method Detail |
getTree
public SymTabAST getTree()
- gets the root node
getBaseScope
public BaseScope getBaseScope()
- returns the "base" scope
getCurrentScope
public Scope getCurrentScope()
- returns the current scope. Scopes are nested in a stack (FIFO queue)
and pushed/popped based on the structure of the AST
pushScope
public void pushScope(Scope scope)
- pushes a new scope onto the stack
popScope
public Scope popScope()
- pops a scope from the stack.
getPackages
public java.util.Hashtable getPackages()
- gets all packages stored in this symbol table
getPackage
public PackageDef getPackage(java.lang.String name)
- gets package by its name
definePackage
public void definePackage(PackageDef pkg, Scope parent)
- adds
PackageDefto its parent scope and stores thePackageDefinpackages
defineClass
public void defineClass(ClassDef def)
- defines a class in the symbol table.
defineMethod
public void defineMethod(MethodDef method)
- defines a method in the symbol table
defineVariable
public void defineVariable(VariableDef v)
- defines a variable in the symbol table
defineBlock
public void defineBlock(BlockDef blockDef)
- defines a block within the symbol table
defineLabel
public void defineLabel(LabelDef labelDef)
- defines a label within the symbol table
indexScope
public void indexScope(Scope scope)
- places a scope in the symbol table's index
getScopeIndex
public ScopeIndex getScopeIndex()
- gets the symbol table's scope index
setCurrentFile
public void setCurrentFile(java.io.File file)
- sets the current file that the symbol table is processing
getCurrentFile
public java.io.File getCurrentFile()
- gets the file that the symbol table is currently processing
|
|||||||||
| Home >> All >> com >> puppycrawl >> tools >> checkstyle >> checks >> usage >> [ transmogrify overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.SymbolTable