|
antlraux package v0.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlraux.context.Context
The main class for managing contextual information.
This class is implemented around the Scope
class. One
could say it's just a thin wrapper around it.
Context is thought to be subclassed. In most cases they'll add a bunch of methods adapted to each language's particuarities. This way, they may add:
Scope
directly.
See its comments for further information.
Scope
Constructor Summary | |
Context(int rootScopeTag,
java.lang.String rootScopeName)
It creates a default scope if no other is specified |
|
Context(Scope rootScope)
Uses a given scope as root scope |
Method Summary | |
Scope |
closeScope(int tag)
Closes the current scope |
Scope |
getCurrentScope()
Returns the scope |
Scope |
getRootScope()
Gets the root scope |
void |
insert(Declaration d)
Inserts a declaration in the current scope. |
Scope |
openScope(int scopeTag,
java.lang.String scopeName)
Opens a new scope |
Scope |
openScope(Scope newScope)
Opens a new scope |
void |
setCurrentScope(Scope s)
Sets current scope |
Scope |
toFather()
Sets the current scope to point to the father |
void |
toRoot()
Sets the current scope to the root scope |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Context(int rootScopeTag, java.lang.String rootScopeName)
public Context(Scope rootScope)
Method Detail |
public void insert(Declaration d) throws ContextException
ContextException
- if a subclass overrides the insertion and throws itpublic Scope openScope(Scope newScope) throws ContextException
ContextException
- if a subclass throws itpublic Scope openScope(int scopeTag, java.lang.String scopeName) throws ContextException
ContextException
- depending on openScope(Scope)
public Scope getCurrentScope()
public void setCurrentScope(Scope s)
public Scope getRootScope()
public void toRoot()
public Scope toFather()
public Scope closeScope(int tag) throws ContextException
ContextException
- if "name" does not match the
current scope's name or if the stack is empty
|
antlraux package v0.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |