net.sf.farrago.parser
Class FarragoAbstractParserImpl

java.lang.Object
  extended by org.eigenbase.sql.parser.SqlAbstractParserImpl
      extended by net.sf.farrago.parser.FarragoAbstractParserImpl
Direct Known Subclasses:
FarragoParserImpl, RngParser

public abstract class FarragoAbstractParserImpl
extends SqlAbstractParserImpl

Abstract base for parsers generated from CommonDdlParser.jj. Most of the methods on this class correspond to specific methods generated on subclasses.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/parser/FarragoAbstractParserImpl.java#16 $
Author:
John V. Sichi

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eigenbase.sql.parser.SqlAbstractParserImpl
SqlAbstractParserImpl.ExprContext, SqlAbstractParserImpl.Metadata, SqlAbstractParserImpl.MetadataImpl
 
Field Summary
protected  boolean dropRestrict
          Whether a DROP RESTRICT statement is being processed
protected  FarragoSessionParser farragoParser
          Public parser interface.
 
Fields inherited from class org.eigenbase.sql.parser.SqlAbstractParserImpl
nDynamicParams, opTab
 
Constructor Summary
FarragoAbstractParserImpl()
           
 
Method Summary
abstract  SqlIdentifier ContextVariable()
          Tests whether the current input is a context variable name.
abstract  Object FarragoSqlStmtEof()
           
abstract  SqlParserPos getCurrentPosition()
           
 FarragoRepos getRepos()
           
 boolean isContextVariable(String keyword)
          Returns whether a keyword is the name of a context variable.
 boolean isNonReserved(String keyword)
          Returns whether a keyword is a non-reserved word.
 boolean isReservedFunctionName(String keyword)
          Returns whether a keyword is the name of a reserved function.
 DdlCreateStmt newDdlCreateStmt(CwmModelElement createdElement, DdlReplaceOptions replaceOptions)
          Creates new DDL Statement for CREATE.
 DdlDropStmt newDdlDropLabelStmt(CwmModelElement droppedElement, boolean restrict)
          Creates new DDL Statement for DROP LABEL.
 DdlDropStmt newDdlDropStmt(CwmModelElement droppedElement, boolean restrict)
          Creates new DDL Statement for DROP.
abstract  String NonReservedKeyWord()
          Tests whether the current input is a non-reserved keyword.
abstract  SqlParseException normalizeException(Throwable e)
          Removes or transforms misleading information from a parse exception or error, and converts to SqlParseException.
abstract  SqlIdentifier ReservedFunctionName()
          Tests whether the current input is a reserved function name.
protected  void setDefaultExpression(FemAbstractAttribute attribute, SqlNode defaultClause)
          Converts the SQL representation of a default value into its catalog representation.
abstract  SqlNode SqlExpressionEof()
           
 
Methods inherited from class org.eigenbase.sql.parser.SqlAbstractParserImpl
createCall, getMetadata, getSql92ReservedWords, ReInit, setTabSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

farragoParser

protected FarragoSessionParser farragoParser
Public parser interface.


dropRestrict

protected boolean dropRestrict
Whether a DROP RESTRICT statement is being processed

Constructor Detail

FarragoAbstractParserImpl

public FarragoAbstractParserImpl()
Method Detail

getRepos

public FarragoRepos getRepos()
Returns:
repository accessed by this parser

getCurrentPosition

public abstract SqlParserPos getCurrentPosition()
Returns:
current parser position

SqlExpressionEof

public abstract SqlNode SqlExpressionEof()
                                  throws Exception
Returns:
result of parsing an SQL expression
Throws:
Exception

FarragoSqlStmtEof

public abstract Object FarragoSqlStmtEof()
                                  throws Exception
Returns:
result of parsing a complete statement
Throws:
Exception

NonReservedKeyWord

public abstract String NonReservedKeyWord()
                                   throws Exception
Tests whether the current input is a non-reserved keyword.

Returns:
token if non-reserved
Throws:
Exception - if not a non-reserved keyword

ReservedFunctionName

public abstract SqlIdentifier ReservedFunctionName()
                                            throws Exception
Tests whether the current input is a reserved function name.

Returns:
identifier if a reserved function name
Throws:
Exception - if not a reserved function name

ContextVariable

public abstract SqlIdentifier ContextVariable()
                                       throws Exception
Tests whether the current input is a context variable name.

Returns:
identifier if a context variable name
Throws:
Exception - if not a context variable name

setDefaultExpression

protected void setDefaultExpression(FemAbstractAttribute attribute,
                                    SqlNode defaultClause)
Converts the SQL representation of a default value into its catalog representation.

Parameters:
attribute - attribute for which default value is being defined
defaultClause - SQL representation

normalizeException

public abstract SqlParseException normalizeException(Throwable e)
Description copied from class: SqlAbstractParserImpl
Removes or transforms misleading information from a parse exception or error, and converts to SqlParseException.

Specified by:
normalizeException in class SqlAbstractParserImpl
Parameters:
e - dirty excn
Returns:
clean excn

isNonReserved

public final boolean isNonReserved(String keyword)
Returns whether a keyword is a non-reserved word.

Parameters:
keyword - Keyword
Returns:
Whether the keyword is a non-reserved word.

isReservedFunctionName

public boolean isReservedFunctionName(String keyword)
Returns whether a keyword is the name of a reserved function.

Parameters:
keyword - Keyword
Returns:
Whether the keyword is the name of a reserved function.

isContextVariable

public boolean isContextVariable(String keyword)
Returns whether a keyword is the name of a context variable.

Parameters:
keyword - Keyword
Returns:
Whether the keyword is the name of a context variable.

newDdlDropStmt

public DdlDropStmt newDdlDropStmt(CwmModelElement droppedElement,
                                  boolean restrict)
Creates new DDL Statement for DROP.

Parameters:
droppedElement - catalog element to drop
restrict - whether a DROP RESTRICT statement is being processed
Returns:
DDL Statement for DROP

newDdlCreateStmt

public DdlCreateStmt newDdlCreateStmt(CwmModelElement createdElement,
                                      DdlReplaceOptions replaceOptions)
Creates new DDL Statement for CREATE.

Parameters:
createdElement - catalog element to create
replaceOptions - attributes of CREATE OR REPLACE
Returns:
DDL Statement for CREATE

newDdlDropLabelStmt

public DdlDropStmt newDdlDropLabelStmt(CwmModelElement droppedElement,
                                       boolean restrict)
Creates new DDL Statement for DROP LABEL.

Parameters:
droppedElement - label element to drop
restrict - whether a DROP RESTRICT statement is being processed
Returns:
DDL Statement for DROP LABEL