// Get an identifier private void GetName() { Value = ""; if (!Cradle.IsAlpha(Cradle.Look)) { Cradle.Expected("Name"); } while (Cradle.IsAlNum(Cradle.Look)) { Value += char.ToUpper(Cradle.Look); Cradle.GetChar(); } Token = KWCode[Lookup(Value) + 1]; }
// Get an identifier private void GetName() { int k; Value = ""; if (!Cradle.IsAlpha(Cradle.Look)) { Cradle.Expected("Name"); } while (Cradle.IsAlNum(Cradle.Look)) { Value += char.ToUpper(Cradle.Look); Cradle.GetChar(); } k = Lookup(Value); if (k == -1) { Token = SymType.Ident; } else { Token = (SymType)k; } }