001package gudusoft.gsqlparser.sqlcmds; 002 003import gudusoft.gsqlparser.EDbVendor; 004import gudusoft.gsqlparser.EFindSqlStateType; 005import gudusoft.gsqlparser.ESqlStatementType; 006import gudusoft.gsqlparser.TCustomSqlStatement; 007import gudusoft.gsqlparser.TSourceToken; 008 009/** 010 * Interface for vendor-specific SQL command resolution. 011 * Provides methods for identifying SQL statement types and resolving commands 012 * used by both the main parser and vendor-specific yacc parsers. 013 * 014 * @since 3.1.0.9 015 */ 016public interface ISqlCmds { 017 018 /** 019 * Identifies the SQL statement type from a token stream. 020 * This method is called repeatedly during parsing to identify statement boundaries 021 * and types in complex SQL scripts. 022 * 023 * @param token Current token being analyzed 024 * @param state Current parsing state (start, in body, or in exception) 025 * @param currentStatement Current statement being built (may be modified) 026 * @return The identified or modified SQL statement 027 */ 028 TCustomSqlStatement issql(TSourceToken token, EFindSqlStateType state, TCustomSqlStatement currentStatement); 029 030 /** 031 * Finds SQL command type for yacc parser integration. 032 * Used by vendor-specific yacc parsers to identify statement types. 033 * 034 * @param token Token to analyze 035 * @return SQL statement type, or sstunknown if not recognized 036 */ 037 ESqlStatementType getStatementTypeForToken(TSourceToken token); 038 039 /** 040 * Gets the vendor this command resolver handles. 041 * @return Database vendor 042 */ 043 EDbVendor getVendor(); 044 045 046 /** 047 * Gets the command list for this vendor (for compatibility and debugging). 048 * @return Command list containing all recognized commands 049 */ 050 TSqlCmdList getSqlCmdList(); 051}