org.eigenbase.sql.validate
Class SqlScopedShuttle

java.lang.Object
  extended by org.eigenbase.sql.util.SqlBasicVisitor<SqlNode>
      extended by org.eigenbase.sql.util.SqlShuttle
          extended by org.eigenbase.sql.validate.SqlScopedShuttle
All Implemented Interfaces:
SqlVisitor<SqlNode>
Direct Known Subclasses:
SqlValidatorImpl.Expander, SqlValidatorImpl.OrderExpressionExpander, SqlValidatorUtil.DeepCopier

public abstract class SqlScopedShuttle
extends SqlShuttle

Refinement to SqlShuttle which maintains a stack of scopes.

Derived class should override visitScoped(SqlCall) rather than visit(SqlCall).

Since:
Jun 10, 2006
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/SqlScopedShuttle.java#6 $
Author:
jhyde

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eigenbase.sql.util.SqlShuttle
SqlShuttle.CallCopyingArgHandler
 
Nested classes/interfaces inherited from class org.eigenbase.sql.util.SqlBasicVisitor
SqlBasicVisitor.ArgHandler<R>, SqlBasicVisitor.ArgHandlerImpl<R>
 
Field Summary
private  Stack<SqlValidatorScope> scopes
           
 
Constructor Summary
protected SqlScopedShuttle(SqlValidatorScope initialScope)
           
 
Method Summary
protected  SqlValidatorScope getScope()
          Returns the current scope.
 SqlNode visit(SqlCall call)
          Visits a call to a SqlOperator.
protected  SqlNode visitScoped(SqlCall call)
          Visits an operator call.
 
Methods inherited from class org.eigenbase.sql.util.SqlShuttle
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

scopes

private final Stack<SqlValidatorScope> scopes
Constructor Detail

SqlScopedShuttle

protected SqlScopedShuttle(SqlValidatorScope initialScope)
Method Detail

visit

public final SqlNode visit(SqlCall call)
Description copied from interface: SqlVisitor
Visits a call to a SqlOperator.

Specified by:
visit in interface SqlVisitor<SqlNode>
Overrides:
visit in class SqlShuttle
Parameters:
call - Call
See Also:
SqlCall.accept(SqlVisitor)

visitScoped

protected SqlNode visitScoped(SqlCall call)
Visits an operator call. If the call has entered a new scope, the base class will have already modified the scope.


getScope

protected SqlValidatorScope getScope()
Returns the current scope.