Example #1
0
        protected SqlNode Visit(SqlNode node)
        {
            switch (node.NodeType)
            {
            case SqlNodeType.SqlLiteral:
                return(this.VisitSqlLiteral(node as SqlLiteral));

            case SqlNodeType.SqlSelect:
                return(this.VisitSqlSelect(node as SqlSelect));

            case SqlNodeType.SqlColumn:
                return(this.VisitSqlColumn(node as SqlColumn));

            case SqlNodeType.SqlTable:
                return(this.VisitSqlTable(node as SqlTable));

            case SqlNodeType.SqlColumnConstraint:
                return(this.VisitSqlColumnConstraint(node as SqlColumnConstraint));

            case SqlNodeType.SqlBinaryConstraint:
                return(this.VisitSqlBinaryConstraint(node as SqlBinaryConstraint));

            case SqlNodeType.SqlJoin:
                return(this.VisitSqlJoin(node as SqlJoin));

            case SqlNodeType.SqlArray:
                return(this.VisitSqlArray(node as SqlArray));

            case SqlNodeType.SqlSelectAll:
                return(this.VisitSqlSelectAll(node as SqlSelectAll));

            case SqlNodeType.SqlColumnsComparisonConstraint:
                return(this.VisitSqlColumnsComparisonConstraint(node as SqlColumnsComparisonConstraint));

            case SqlNodeType.SqlExistsConstraint:
                return(this.VisitSqlExistsConstraint(node as SqlExistsConstraint));

            case SqlNodeType.SqlNotConstraint:
                return(this.VisitSqlNotConstraint(node as SqlNotConstraint));

            case SqlNodeType.SqlSubSelect:
                return(this.VisitSqlSubSelect(node as SqlSubSelect));

            case SqlNodeType.SqlOrderBy:
                return(this.VisitSqlOrderBy(node as SqlOrderBy));

            default:
                break;
            }
            throw new NotImplementedException();
        }
Example #2
0
 protected SqlNode Visit(SqlNode node)
 {
     switch (node.NodeType)
     {
         case SqlNodeType.SqlLiteral:
             return this.VisitSqlLiteral(node as SqlLiteral);
         case SqlNodeType.SqlSelect:
             return this.VisitSqlSelect(node as SqlSelect);
         case SqlNodeType.SqlColumn:
             return this.VisitSqlColumn(node as SqlColumn);
         case SqlNodeType.SqlTable:
             return this.VisitSqlTable(node as SqlTable);
         case SqlNodeType.SqlColumnConstraint:
             return this.VisitSqlColumnConstraint(node as SqlColumnConstraint);
         case SqlNodeType.SqlBinaryConstraint:
             return this.VisitSqlBinaryConstraint(node as SqlBinaryConstraint);
         case SqlNodeType.SqlJoin:
             return this.VisitSqlJoin(node as SqlJoin);
         case SqlNodeType.SqlArray:
             return this.VisitSqlArray(node as SqlArray);
         case SqlNodeType.SqlSelectAll:
             return this.VisitSqlSelectAll(node as SqlSelectAll);
         case SqlNodeType.SqlColumnsComparisonConstraint:
             return this.VisitSqlColumnsComparisonConstraint(node as SqlColumnsComparisonConstraint);
         case SqlNodeType.SqlExistsConstraint:
             return this.VisitSqlExistsConstraint(node as SqlExistsConstraint);
         case SqlNodeType.SqlNotConstraint:
             return this.VisitSqlNotConstraint(node as SqlNotConstraint);
         case SqlNodeType.SqlSubSelect:
             return this.VisitSqlSubSelect(node as SqlSubSelect);
         case SqlNodeType.SqlOrderBy:
             return this.VisitSqlOrderBy(node as SqlOrderBy);
         default:
             break;
     }
     throw new NotImplementedException();
 }
Example #3
0
 /// <summary>
 /// 访问 sql 语法树中的每一个结点,并生成相应的 Sql 语句。
 /// </summary>
 /// <param name="tree">The tree.</param>
 public void Generate(SqlNode tree)
 {
     base.Visit(tree);
 }