|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A context represents a stack of scopes used for looking up types, methods, and variables.
Inner Class Summary | |
static interface |
Context.Mark
A Mark is used to indicate a point in the stack
of scopes. |
Method Summary | |
void |
addMethod(MethodInstance mi)
Add a method to the current scope. |
void |
addType(NamedType t)
Add a type to the current scope. |
void |
addVariable(VarInstance vi)
Add a variable to the current scope. |
void |
assertMark(Context.Mark m)
Assert that the mark at the top of the stack is mark . |
ParsedClassType |
currentClass()
Return the innermost class in scope. |
CodeInstance |
currentCode()
Return the innermost method or constructor in scope. |
FieldInstance |
findField(java.lang.String name)
Looks up a field in the current scope. |
ParsedClassType |
findFieldScope(java.lang.String name)
Finds the class which added a field to the scope. |
LocalInstance |
findLocal(java.lang.String name)
Looks up a local variable in the current scope. |
MethodInstance |
findMethod(java.lang.String name,
java.util.List argumentTypes)
Looks up a method in the current scope. |
ParsedClassType |
findMethodScope(java.lang.String name)
Finds the class which added a method to the scope. |
VarInstance |
findVariable(java.lang.String name)
Looks up a local variable or field in the current scope. |
boolean |
inCode()
Return whether innermost non-block scope is a code scope. |
boolean |
isLocal(java.lang.String name)
Returns whether the symbol is defined within the current method. |
Context.Mark |
mark()
Return the mark at the top of the stack. |
void |
popBlock()
Leave the scope of a block. |
void |
popClass()
Leave the scope of a class. |
void |
popCode()
Leave the scope of a method or constructor. |
void |
popToMark(Context.Mark m)
Pop the stack until the top of the stack is mark . |
void |
pushBlock()
Enter the scope of a block. |
void |
pushClass(ParsedClassType c)
Enter the scope of a class. |
void |
pushCode(CodeInstance f)
Enter the scope of a method or constructor. |
TypeSystem |
typeSystem()
The type system. |
Methods inherited from interface jltools.types.Resolver |
findQualifier, findType |
Method Detail |
public Context.Mark mark()
public void popToMark(Context.Mark m)
mark
.public void assertMark(Context.Mark m)
mark
.public TypeSystem typeSystem()
public void addVariable(VarInstance vi)
public void addMethod(MethodInstance mi)
public void addType(NamedType t)
public MethodInstance findMethod(java.lang.String name, java.util.List argumentTypes) throws SemanticException
public VarInstance findVariable(java.lang.String name) throws SemanticException
public LocalInstance findLocal(java.lang.String name) throws SemanticException
public FieldInstance findField(java.lang.String name) throws SemanticException
public ParsedClassType findFieldScope(java.lang.String name) throws SemanticException
findField(name).container()
.public ParsedClassType findMethodScope(java.lang.String name) throws SemanticException
findMethod(name).container()
.public void pushClass(ParsedClassType c)
public void popClass()
public void pushCode(CodeInstance f)
public void popCode()
public void pushBlock()
public void popBlock()
public boolean inCode()
public boolean isLocal(java.lang.String name)
public ParsedClassType currentClass()
public CodeInstance currentCode()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |