コード例 #1
0
        protected override bool ReadNext()
        {
            if (EndOfLine) //End of line or script
            {
                if (!foundGo)
                {
                    builder.Append(Current);
                    Splitter.Append(builder.ToString());
                    Splitter.SetParser(new SeparatorLineReader(Splitter));
                    return(false);
                }
                Reset();
                return(true);
            }

            if (WhiteSpace)
            {
                builder.Append(Current);
                return(false);
            }

            if (!CharEquals('g') && !CharEquals('o'))
            {
                FoundNonEmptyCharacter(Current);
                return(false);
            }

            if (CharEquals('o'))
            {
                if (CharEquals('g', LastChar) && !foundGo)
                {
                    foundGo = true;
                }
                else
                {
                    FoundNonEmptyCharacter(Current);
                }
            }

            if (CharEquals('g', Current))
            {
                if (gFound || (!char.IsWhiteSpace(LastChar) && LastChar != char.MinValue))
                {
                    FoundNonEmptyCharacter(Current);
                    return(false);
                }

                gFound = true;
            }

            if (!HasNext && foundGo)
            {
                Reset();
                return(true);
            }

            builder.Append(Current);
            return(false);
        }
コード例 #2
0
        protected override bool ReadNext()
        {
            if (EndOfLine) //end of line
            {
                Splitter.Append(Current);
                Splitter.SetParser(new SeparatorLineReader(Splitter));
                return(false);
            }

            Splitter.Append(Current);
            return(false);
        }
コード例 #3
0
 void FoundNonEmptyCharacter(char c)
 {
     builder.Append(c);
     Splitter.Append(builder.ToString());
     Splitter.SetParser(new SqlScriptReader(Splitter));
 }