static void ParseAll(string s) { CommandParser p = new CommandParser(s); while (p.CurrentToken != CommandParser.Token.EndOfInput) p.GetNextToken(); }
static void CheckString(string s, int idPos, string strVal) { CommandParser p = new CommandParser(s); while (idPos-- > 0) p.GetNextToken(); Debug.Assert(p.CurrentToken == CommandParser.Token.String && p.StringValue == strVal); }
static void CkeckNotIdentifier(string s, int idNotPos) { CommandParser p = new CommandParser(s); while (idNotPos-- > 0) p.GetNextToken(); Debug.Assert(p.CurrentToken != CommandParser.Token.Identifier); }
static void CheckIdentifier(string s, int idPos, string identifier) { CommandParser p = new CommandParser(s); while (idPos-- > 0) p.GetNextToken(); Debug.Assert(p.CurrentToken == CommandParser.Token.Identifier && p.Identifier == identifier); }