private void ReadSignAsID() { SymbolQueue.Enqueue(character); while (true) { if ('a' <= (char)Reader.Peek() && 'z' >= (char)Reader.Peek() || 'A' <= (char)Reader.Peek() && 'Z' >= (char)Reader.Peek()) { SymbolQueue.Enqueue((char)Reader.Peek()); } else if ('0' <= (char)Reader.Peek() && '9' >= (char)Reader.Peek()) { SymbolQueue.Enqueue((char)Reader.Peek()); } else { LexicalLabel label = GetLexicalLabel(new string(SymbolQueue.ToArray())); if (LexicalLabel.PL0_ID == label) { VocabularyUnitNext = new IdentifierVocabularyUnit(label, new string(SymbolQueue.ToArray()), Line); } else { VocabularyUnitNext = new GeneralVocabularyUnit(label, Line); } SymbolQueue.Clear(); return; } character = (char)Reader.Read(); } }
public UnsignedNumberVocabularyUnit(LexicalLabel lexicalLabel, uint number, long line) : base(lexicalLabel, line) { Number = number; }
public IdentifierVocabularyUnit(LexicalLabel lexicalLabel, string id, long line) : base(lexicalLabel, line) { Identifier = id; }
public GeneralVocabularyUnit(LexicalLabel lexicalLabel, long line) { LexicalLabel = lexicalLabel; Line = line; }