Beispiel #1
0
        private Token ProcessId(char preanalisis)
        {
            StringBuilder b = new StringBuilder(preanalisis.ToString());
            while (Char.IsLetterOrDigit(reader.Peek()))
            {
                preanalisis = reader.Read();
                b.Append(preanalisis);
            }

            String s = b.ToString();

            if (palabras.ContainsKey(s))
            {
                return palabras[s];
            }
            Palabra w = new Palabra(s, TokenType.ID);
            palabras.Add(s, w);
            return w;
        }
Beispiel #2
0
 private void reservar(Palabra word)
 {
     palabras.Add(word.Lexeme, word);
 }