public class SybaseAseSqlParser extends AbstractSqlParser
This parser handles Sybase ASE-specific SQL syntax including:
Design Notes:
AbstractSqlParser using the template method patternTLexerSybasease for tokenizationTParserSybasease for parsingSqlParser,
AbstractSqlParser,
TLexerSybasease,
TParserSybaseaseAbstractSqlParser.PreparedSqlReader| Modifier and Type | Field and Description |
|---|---|
TLexerSybasease |
flexer
The Sybase ASE lexer used for tokenization
|
defaultDelimiterStr, delimiterChar, frameStack, globalContext, globalFrame, lexer, parserContext, sourcetokenlist, sqlcmds, sqlEnv, sqlstatements, syntaxErrors, vendor| Constructor and Description |
|---|
SybaseAseSqlParser()
Construct Sybase ASE SQL parser.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
extractVendorRawStatements(SqlParseResult.Builder builder)
Call Sybase ASE-specific raw statement extraction logic.
|
protected TCustomLexer |
getLexer(ParserContext context)
Return the Sybase ASE lexer instance.
|
protected TCustomParser |
getParser(ParserContext context,
TSourceTokenList tokens)
Return the Sybase ASE parser instance with updated token list.
|
protected void |
performInterpreter(ParserContext context,
TStatementList statements)
Perform interpretation/evaluation on parsed statements.
|
protected TStatementList |
performParsing(ParserContext context,
TCustomParser parser,
TCustomParser secondaryParser,
TSourceTokenList tokens,
TStatementList rawStatements)
Perform full parsing of statements with syntax checking.
|
protected void |
performSemanticAnalysis(ParserContext context,
TStatementList statements)
Perform semantic analysis on parsed statements.
|
protected void |
setupVendorParsersForExtraction()
Setup Sybase ASE parser for raw statement extraction.
|
protected void |
tokenizeVendorSql()
Call Sybase ASE-specific tokenization logic.
|
List<TCustomSqlStatement> |
validateRecognizedStatements(TStatementList stmts)
Post-parse policy validation ("recognize then reject").
|
afterStatementParsed, attemptErrorRecovery, copyErrorsFromStatement, doAfterTokenize, doExtractRawStatements, extractRawStatements, getanewsourcetoken, getDefaultDelimiterStr, getDelimiterChar, getErrorCount, getrawsqlstatements, getSecondaryParser, getSyntaxErrors, getVendor, handleStatementParsingException, initializeGlobalContext, isDivisionOperatorContext, isDollarFunctionDelimiter, onRawStatementComplete, onRawStatementCompleteVendorSpecific, parse, performTokenization, prepareSqlReader, processTokensBeforeParse, processTokensInTokenTable, setTokenHandle, tokenize, toString, towinlinebreakpublic TLexerSybasease flexer
public SybaseAseSqlParser()
Configures the parser for Sybase ASE with default delimiter (;).
public List<TCustomSqlStatement> validateRecognizedStatements(TStatementList stmts)
Not hooked at raw-extraction time: parsing REPLACES some statement objects (the refined statement is rebuilt from the parse-tree node — e.g. DELETE STATISTICS and READTEXT), and an error attached to the raw object vanishes with it. Post-parse, the statement list is final. This was measured, not assumed: raw-attached errors survived for DUMP TRAN but disappeared for DELETE STATISTICS and READTEXT.
stmts - the fully parsed statement listprotected TCustomLexer getLexer(ParserContext context)
getLexer in class AbstractSqlParsercontext - the parser contextprotected TCustomParser getParser(ParserContext context, TSourceTokenList tokens)
getParser in class AbstractSqlParsercontext - the parser contexttokens - the source token listprotected void tokenizeVendorSql()
Sybase ASE uses MSSQL-like tokenization.
tokenizeVendorSql in class AbstractSqlParserprotected void setupVendorParsersForExtraction()
setupVendorParsersForExtraction in class AbstractSqlParserprotected void extractVendorRawStatements(SqlParseResult.Builder builder)
extractVendorRawStatements in class AbstractSqlParserbuilder - the result builder to populate with raw statementsprotected TStatementList performParsing(ParserContext context, TCustomParser parser, TCustomParser secondaryParser, TSourceTokenList tokens, TStatementList rawStatements)
performParsing in class AbstractSqlParsercontext - the parser contextparser - the main parser instancesecondaryParser - secondary parser (may be null)tokens - the source token listrawStatements - raw statements already extracted (never null)protected void performSemanticAnalysis(ParserContext context, TStatementList statements)
AbstractSqlParserHook Method: Default implementation does nothing. Override to provide vendor-specific semantic analysis.
Typical Implementation:
performSemanticAnalysis in class AbstractSqlParsercontext - the parser contextstatements - the parsed statements (mutable)protected void performInterpreter(ParserContext context, TStatementList statements)
AbstractSqlParserHook Method: Default implementation does nothing. Override to provide AST interpretation/evaluation.
Typical Implementation:
performInterpreter in class AbstractSqlParsercontext - the parser contextstatements - the parsed statements (mutable)