public AntlrTreeDumper(ITree tree, string sql, ISqlDumper dmp) { m_tree = tree; m_lines = sql.Split('\n'); m_dmp = dmp; m_tokens = m_dmp.Dialect.GetAntlrTokens(); }
protected AntlrTokens GetAntlrTokens(string[] tokenNames) { var res = new AntlrTokens(); res.EOF = Array.IndexOf(tokenNames, "EOF"); res.F_DEC = Array.IndexOf(tokenNames, "F_DEC"); res.F_INC = Array.IndexOf(tokenNames, "F_INC"); res.F_NL = Array.IndexOf(tokenNames, "F_NL"); res.T_IDENT = Array.IndexOf(tokenNames, "T_IDENT"); res.T_QUOTED_IDENT = Array.IndexOf(tokenNames, "T_QUOTED_IDENT"); res.DOT = Array.IndexOf(tokenNames, "DOT"); res.SELECT = Array.IndexOf(tokenNames, "SELECT"); res.ORDER = Array.IndexOf(tokenNames, "ORDER"); res.BY = Array.IndexOf(tokenNames, "BY"); res.GROUP = Array.IndexOf(tokenNames, "GROUP"); res.HAVING = Array.IndexOf(tokenNames, "HAVING"); res.WHERE = Array.IndexOf(tokenNames, "WHERE"); res.JOIN = Array.IndexOf(tokenNames, "JOIN"); res.ON = Array.IndexOf(tokenNames, "ON"); res.FROM = Array.IndexOf(tokenNames, "FROM"); res.T_STRING = Array.IndexOf(tokenNames, "T_STRING"); res.UPDATE = Array.IndexOf(tokenNames, "UPDATE"); res.DELETE = Array.IndexOf(tokenNames, "DELETE"); res.SET = Array.IndexOf(tokenNames, "SET"); res.INSERT = Array.IndexOf(tokenNames, "INSERT"); res.LPAREN = Array.IndexOf(tokenNames, "LPAREN"); res.RPAREN = Array.IndexOf(tokenNames, "RPAREN"); res.INTO = Array.IndexOf(tokenNames, "INTO"); return(res); }
public SqlEditorAnalyser(ITokenStream input, ISqlDialect dialect) { m_input = input; m_dialect = dialect; m_tokens = dialect.GetAntlrTokens(); }