Beispiel #1
0
 protected override void LoadMoreValues()
 {
     if (source.MoveNext())
     {
         LoadedValues.Add(source.Current);
     }
 }
Beispiel #2
0
        protected override void LoadMoreValues()
        {
            foreach (var lexer in lexers)
            {
                if (lexer.Lex(tokenBuilder) is Token token)
                {
                    tokenBuilder.ForgetPreceding();

                    if (token is ISkippable)
                    {
                        LoadMoreValues();
                        return;
                    }
                    else
                    {
                        LoadedValues.Add(token);
                        return;
                    }
                }
                else
                {
                    tokenBuilder.Reset();
                }
            }

            if (tokenBuilder.MoveNext())
            {
                throw new InvalidDataException("Failed to create token at character " + tokenBuilder.Current);
            }
        }