コード例 #1
0
ファイル: SelectList.cs プロジェクト: skyquery/graywulf
        public void Replace(SelectList last)
        {
            var n = Stack.First;

            while (n != null)
            {
                if (n.Value is SelectList)
                {
                    n.Value = last;
                }

                n = n.Next;
            }
        }
コード例 #2
0
ファイル: SelectList.cs プロジェクト: skyquery/graywulf
        public void Append(SelectList last)
        {
            SelectList ll, sl;

            ll = sl = this;
            while ((ll = sl.FindDescendant<SelectList>()) != null)
            {
                sl = ll;
            }

            sl.Stack.AddLast(Comma.Create());
            sl.Stack.AddLast(CommentOrWhitespace.Create(Whitespace.Create()));
            sl.Stack.AddLast(last);
        }
コード例 #3
0
ファイル: SelectList.cs プロジェクト: skyquery/graywulf
        public static SelectList Create(ColumnReference cr)
        {
            // Create new expression
            var nsl = new SelectList();

            var nce = new ColumnExpression();
            nce.ColumnReference = new ColumnReference(cr);
            nsl.Stack.AddLast(nce);

            var nex = new Expression();
            nce.Stack.AddLast(nex);

            var nav = new AnyVariable();
            nex.Stack.AddLast(nav);

            nav.Stack.AddLast(ColumnIdentifier.Create(new ColumnReference(cr)));

            return nsl;
        }
コード例 #4
0
ファイル: SelectList.cs プロジェクト: skyquery/graywulf
        private static void Create(ref SelectList root, ref SelectList last, TableReference tableReference)
        {
            foreach (var cr in tableReference.ColumnReferences)
            {
                // Create new expression
                var nsl = SelectList.Create(cr);

                // If root is uninitialized, initialize now
                if (root == null)
                {
                    root = nsl;
                }

                // Append to list if not the first
                if (last != null)
                {
                    last.Append(nsl);
                }

                last = nsl;
            }

            if (root == null)
            {
                throw new InvalidOperationException();
            }
        }