// Utils private Token Expect(TokenKind expected) { if (tokens.Current.Kind != expected) { var message = String.Format("{0}: Expecting {1}, but got {2}", tokens.Current.Span, expected.GetDescription(), tokens.Current); OnParseError(new SyntacticErrorEventArgs(message)); } var token = tokens.Current; tokens.MoveNext(); return(token); }