Esempio n. 1
0
        //TODO: put into account non-Ascii aplhabets specified by means of Unicode categories!
        public override IList <string> GetFirsts()
        {
            var list = new StringList();

            list.AddRange(Prefixes);
            foreach (char ch in _allFirstCharsSet)
            {
                list.Add(ch.ToString());
            }
            if ((Options & IdOptions.CanStartWithEscape) != 0)
            {
                list.Add(this.EscapeChar.ToString());
            }
            return(list);
        }
Esempio n. 2
0
        public override IList <string> GetFirsts()
        {
            var result = new StringList();

            result.Add(StartSymbol.ToString());
            return(result);
        }
Esempio n. 3
0
        public override IList <string> GetFirsts()
        {
            StringList firsts = new StringList();

            foreach (char t in LineTerminators)
            {
                firsts.Add(t.ToString());
            }
            return(firsts);
        }
        //TODO: put into account non-Ascii aplhabets specified by means of Unicode categories!
        public override IList <string> GetFirsts()
        {
            StringList list = new StringList();

            list.AddRange(Prefixes);
            if (string.IsNullOrEmpty(AllFirstChars))
            {
                return(list);
            }
            char[] chars = AllFirstChars.ToCharArray();
            foreach (char ch in chars)
            {
                list.Add(ch.ToString());
            }
            if ((Options & IdOptions.CanStartWithEscape) != 0)
            {
                list.Add(this.EscapeChar.ToString());
            }
            return(list);
        }
        }//method

        public override IList <string> GetFirsts()
        {
            StringList result = new StringList();

            result.AddRange(Prefixes);
            //we assume that prefix is always optional, so string can start with start-end symbol
            foreach (char ch in _startSymbolsFirsts)
            {
                result.Add(ch.ToString());
            }
            return(result);
        }
Esempio n. 6
0
        public override IList <string> GetFirsts()
        {
            StringList result = new StringList();

            result.AddRange(base.Prefixes);
            //we assume that prefix is always optional, so number can always start with plain digit
            result.AddRange(new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" });
            // Python float numbers can start with a dot
            if (IsSet(NumberOptions.AllowStartEndDot))
            {
                result.Add(DecimalSeparator.ToString());
            }
            if (IsSet(NumberOptions.AllowSign))
            {
                result.AddRange(new string[] { "-", "+" });
            }
            return(result);
        }