using System; using System.Collections.Generic; namespace sharp.parser { public class TokenQueue : Queue { public TokenQueue() { } public Token Expect(params TokenDefinition[] tdefs) { Token t = Dequeue(); foreach (TokenDefinition tdef in tdefs){ if (t.Definition == tdef) { return t; } } throw new UnexpectedTokenException(t, tdefs); } } }