Exemple #1
0
        private bool TryGetLexem(out Lexem lexem)
        {
            StringBuilder sb = new StringBuilder();
            char symbol;
            while (position < source.Length)
            {
                symbol = source[position];
                sb.Append(symbol);
                if (specials.ContainsKey(symbol))
                {
                    position += (sb.Length == 0) ? 1 : 0;
                    lexem = new Lexem(sb.ToString(), position);

                    return true;

                }
                position += 1;
            }
            lexem = null;
            return false;
        }
Exemple #2
0
 private bool TryGetSpecial(out Lexem lexem)
 {
     throw new NotImplementedException();
 }
Exemple #3
0
 public bool GetNextLexem(out Lexem lexem)
 {
     return TryGetSpecial(out lexem) || TryGetLexem(out lexem);
 }