openjava.ptree.util
Class ScopeHandler

java.lang.Object
  |
  +--openjava.ptree.util.ParseTreeVisitor
        |
        +--openjava.ptree.util.EvaluationShuttle
              |
              +--openjava.ptree.util.ScopeHandler
Direct Known Subclasses:
ClassCollector, QueryExpander, SubqueryFinder, TypeNameQualifier, VariableBinder

public abstract class ScopeHandler
extends EvaluationShuttle

Refinement of EvaluationShuttle which automatically pushes and pops the current scope.

Since:
%SOFTWARE% 1.0
Version:
1.0
Author:
Michiaki Tatsubori
See Also:
ParseTree, ParseTreeVisitor, EvaluationShuttle

Field Summary
private  Stack env_nest
           
 
Fields inherited from class openjava.ptree.util.EvaluationShuttle
 
Constructor Summary
ScopeHandler(Environment base_env)
           
 
Method Summary
 Statement evaluateDown(Block ptree)
           
 ClassDeclaration evaluateDown(ClassDeclaration ptree)
           
 CompilationUnit evaluateDown(CompilationUnit ptree)
           
 MemberDeclaration evaluateDown(ConstructorDeclaration ptree)
           
 Statement evaluateDown(DoWhileStatement ptree)
           
 Statement evaluateDown(ForStatement ptree)
           
 Statement evaluateDown(IfStatement ptree)
           
 MemberDeclaration evaluateDown(MemberInitializer ptree)
           
 MemberDeclaration evaluateDown(MethodDeclaration ptree)
           
 Expression evaluateDown(QueryExpression ptree)
           
 Statement evaluateDown(SwitchStatement ptree)
           
 Statement evaluateDown(SynchronizedStatement ptree)
           
 Statement evaluateDown(TryStatement ptree)
           
 Statement evaluateDown(WhileStatement ptree)
           
 Statement evaluateUp(Block ptree)
           
 ClassDeclaration evaluateUp(ClassDeclaration ptree)
           
 CompilationUnit evaluateUp(CompilationUnit ptree)
           
 MemberDeclaration evaluateUp(ConstructorDeclaration ptree)
           
 Statement evaluateUp(DoWhileStatement ptree)
           
 Statement evaluateUp(ForStatement ptree)
           
 Statement evaluateUp(IfStatement ptree)
           
 MemberDeclaration evaluateUp(MemberInitializer ptree)
           
 MemberDeclaration evaluateUp(MethodDeclaration ptree)
           
 Expression evaluateUp(QueryExpression ptree)
           
 Statement evaluateUp(SwitchStatement ptree)
           
 Statement evaluateUp(SynchronizedStatement ptree)
           
 Statement evaluateUp(TryStatement ptree)
           
 Statement evaluateUp(WhileStatement ptree)
           
protected  void pop()
           
protected  void push(Environment env)
           
protected  void pushClosedEnvironment()
           
 
Methods inherited from class openjava.ptree.util.EvaluationShuttle
evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, getEnvironment, setEnvironment, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class openjava.ptree.util.ParseTreeVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

env_nest

private Stack env_nest
Constructor Detail

ScopeHandler

public ScopeHandler(Environment base_env)
Method Detail

pushClosedEnvironment

protected final void pushClosedEnvironment()

push

protected final void push(Environment env)

pop

protected final void pop()

evaluateDown

public CompilationUnit evaluateDown(CompilationUnit ptree)
                             throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public ClassDeclaration evaluateDown(ClassDeclaration ptree)
                              throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public MemberDeclaration evaluateDown(MethodDeclaration ptree)
                               throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public MemberDeclaration evaluateDown(ConstructorDeclaration ptree)
                               throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public MemberDeclaration evaluateDown(MemberInitializer ptree)
                               throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public Statement evaluateDown(Block ptree)
                       throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public Statement evaluateDown(SwitchStatement ptree)
                       throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public Statement evaluateDown(IfStatement ptree)
                       throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public Statement evaluateDown(WhileStatement ptree)
                       throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public Statement evaluateDown(DoWhileStatement ptree)
                       throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public Statement evaluateDown(ForStatement ptree)
                       throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public Statement evaluateDown(TryStatement ptree)
                       throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public Statement evaluateDown(SynchronizedStatement ptree)
                       throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateDown

public Expression evaluateDown(QueryExpression ptree)
                        throws ParseTreeException
Overrides:
evaluateDown in class EvaluationShuttle
ParseTreeException

evaluateUp

public CompilationUnit evaluateUp(CompilationUnit ptree)
                           throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public ClassDeclaration evaluateUp(ClassDeclaration ptree)
                            throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public MemberDeclaration evaluateUp(MethodDeclaration ptree)
                             throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public MemberDeclaration evaluateUp(ConstructorDeclaration ptree)
                             throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public MemberDeclaration evaluateUp(MemberInitializer ptree)
                             throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Statement evaluateUp(Block ptree)
                     throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Statement evaluateUp(SwitchStatement ptree)
                     throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Statement evaluateUp(IfStatement ptree)
                     throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Statement evaluateUp(WhileStatement ptree)
                     throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Statement evaluateUp(DoWhileStatement ptree)
                     throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Statement evaluateUp(ForStatement ptree)
                     throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Statement evaluateUp(TryStatement ptree)
                     throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Statement evaluateUp(SynchronizedStatement ptree)
                     throws ParseTreeException
Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(QueryExpression ptree)
Overrides:
evaluateUp in class EvaluationShuttle

SourceForge.net_Logo