Exemplo n.º 1
0
        //----------------------------------------------------------------------

        static bool GrabType(ref Types.XStringSeg word, out String result)
        {
            if (word != null)
            {
                //int quote = 0;
                //int escape = 0;
                XString    type = new XString();
                XStringSeg first_word;
                type.Append(first_word = word.Clone());
                first_word.Originate();
                word = word.Next;
                if (word && word[0] == '(')
                {
                    while (word && word[0] != ')')
                    {
                        type.Append(word.Clone());
                        word = word.Next;
                    }
                    type.Append(word.Clone());
                    word = word.Next;
                }
                result = type.ToString();
                return(true);
            }
            else
            {
                result = null;
            }
            return(false);
        }
Exemplo n.º 2
0
        //----------------------------------------------------------------------

        static bool GrabExtra(ref Types.XStringSeg word, out String result)
        {
            if (word != null)
            {
                XString type = new XString();
                {
                    while (word && ((word[0] != ',') && (word[0] != ')')))
                    {
                        if (word[0] == ')')
                        {
                            break;
                        }
                        type.Append(word.Clone());
                        word = word.Next;
                    }
                }
                if (type)
                {
                    type.Originate();
                    result = type.ToString();
                }
                else
                {
                    result = null;
                }
            }
            else
            {
                result = null;
            }
            return(true);
        }
Exemplo n.º 3
0
        //----------------------------------------------------------------------

        static bool GrabName(ref Types.XStringSeg word, out String result, out bool bQuoted)
        {
            String name = null;

            //PTEXT start = word;
            //printf( "word is %s", GetText( *word ) );
            if (TextLike(word, "`"))
            {
                XString phrase = new XString();
                //Types.XStringSeg phrase = null;
                bQuoted = true;
                word    = word.Next;
                while (word != null && word.ToString()[0] != '`')
                {
                    phrase.Append(word.Clone());
                    word = word.Next;
                }
                // skip one more - end after the last `
                word = word.Next;
                name = phrase.ToString();
            }
            else
            {
                // don't know...
                String next;
                bQuoted = false;
                next    = word.Next;
                if (next != null && next[0] == '.')
                {
                    // database and table name...
                    word = word.Next;
                    word = word.Next;
                    name = (String)word;
                    word = word.Next;
                }
                else
                {
                    if (word.Text == "(")
                    {
                        result  = null;
                        bQuoted = false;
                        return(true);
                    }
                    name = (String)word;
                    word = word.Next;
                }
            }
            result = name;
            return((result != null) ? true : false);
        }