Esempio n. 1
0
        public SqlSection AddTokenSection(bool isReservedWord, params Token[] tokens)
        {
            var section = new SqlSection(this, new SqlToken(isReservedWord, tokens));

            Sections.Add(section);
            return(section);
        }
Esempio n. 2
0
        private SqlSection AddParenthesisGroup(Token[] tokens, ref int i, SqlSection parent)
        {
            var section = new SqlSection(parent);

            section.Sections.Add(new SqlSection(section, new SqlToken(false, tokens[i])));
            parent.Sections.Add(section);

            for (i++; i < tokens.Length; i++)
            {
                if (tokens[i].Type == TokenType.StartParenthesis)
                {
                    if (IsMatch(tokens, i + 1, "SELECT"))
                    {
                        var query = new SqlQuery(section);
                        AddTokenSection(query, tokens[i]);
                        i++;
                        AddSelect(tokens, ref i, query);
                        section.Sections.Add(query);
                    }
                    else
                    {
                        AddParenthesisGroup(tokens, ref i, section);
                        continue;
                    }
                }
                else if (tokens[i].Type == TokenType.EndParenthesis)
                {
                    AddTokenSection(section, tokens[i]);
                    break;
                }
                else if (tokens[i].Type == TokenType.EndOfQuery)
                {
                    AddTokenSection(parent, tokens[i]);
                    break;
                }
                else if (IsQueryStart(tokens[i]))
                {
                    i--;
                    break;
                }

                AddTokenSection(section, tokens[i]);
            }
            return(section);
        }
Esempio n. 3
0
 private void AddTokenSection(SqlSection parent, Token t)
 {
     parent.AddTokenSection(IsReservedWord(t), t);
 }
Esempio n. 4
0
 public SqlGroupBy(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 5
0
        private SqlSection AddParenthesisGroup(Token[] tokens, ref int i, SqlSection parent)
        {
            var section = new SqlSection(parent);
            section.Sections.Add(new SqlSection(section, new SqlToken(false, tokens[i])));
            parent.Sections.Add(section);

            for (i++; i < tokens.Length; i++)
            {
                if (tokens[i].Type == TokenType.StartParenthesis)
                {
                    if (IsMatch(tokens, i + 1, "SELECT"))
                    {
                        var query = new SqlQuery(section);
                        AddTokenSection(query, tokens[i]);
                        i++;
                        AddSelect(tokens, ref i, query);
                        section.Sections.Add(query);
                    }
                    else
                    {
                        AddParenthesisGroup(tokens, ref i, section);
                        continue;
                    }
                }
                else if (tokens[i].Type == TokenType.EndParenthesis)
                {
                    AddTokenSection(section, tokens[i]);
                    break;
                }
                else if (tokens[i].Type == TokenType.EndOfQuery)
                {
                    AddTokenSection(parent, tokens[i]);
                    break;
                }
                else if (IsQueryStart(tokens[i]))
                {
                    i--;
                    break;
                }

                AddTokenSection(section, tokens[i]);
            }
            return section;
        }
Esempio n. 6
0
 private void AddTokenSection(SqlSection parent, Token t)
 {
     parent.AddTokenSection(IsReservedWord(t), t);
 }
Esempio n. 7
0
 public SqlOrderBy(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 8
0
 public SqlSection AddTokenSection(bool isReservedWord, params Token[] tokens)
 {
     var section =  new SqlSection(this, new SqlToken(isReservedWord, tokens));
     Sections.Add(section);
     return section;
 }
Esempio n. 9
0
 //public List<SqlToken> Tokens { get; private set; }
 public SqlSection(SqlSection parent)
 {
     Parent = parent;
     Sections = new List<SqlSection>();
 }
Esempio n. 10
0
 public SqlWhere(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 11
0
 public SqlFrom(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 12
0
 public SqlSelect(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 13
0
 public SqlQuery(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 14
0
 public SqlSection(SqlSection parent, SqlToken token)
 {
     Parent = parent;
     Token  = token;
 }
Esempio n. 15
0
        //public List<SqlToken> Tokens { get; private set; }

        public SqlSection(SqlSection parent)
        {
            Parent   = parent;
            Sections = new List <SqlSection>();
        }
Esempio n. 16
0
 public SqlHaving(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 17
0
 public SqlQuery(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 18
0
 public SqlOrderBy(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 19
0
 public SqlSection(SqlSection parent, SqlToken token)
 {
     Parent = parent;
     Token = token;
 }
Esempio n. 20
0
 public SqlGroupBy(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 21
0
 public SqlSelect(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 22
0
 public SqlHaving(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 23
0
 public SqlWhere(SqlSection parent)
     : base(parent)
 {
 }
Esempio n. 24
0
 public SqlFrom(SqlSection parent)
     : base(parent)
 {
 }