void Parse_LanguageBody(Context& ctx) { if (ctx.Token() == TKKeywordLanguage) { //LanguageBody => KeywordLanguage Identifier LeftCurlyBracketCharacter Declarations RightCurlyBracketCharacter ctx.Match(TKKeywordLanguage); ctx.Match(TKIdentifier); ctx.Action_LanguageName(); ctx.Match(TKLeftCurlyBracketCharacter); Parse_Declarations(ctx); ctx.Match(TKRightCurlyBracketCharacter); } else { assert(false); } }
void Parse_LanguageBody(Context& ctx) { if (ctx.Token() == TKKeywordLanguage) { //LanguageBody => KeywordLanguage Identifier LeftCurlyBracketCharacter Declarations RightCurlyBracketCharacter ctx.Match(TKKeywordLanguage); ctx.Match(TKIdentifier); ctx.Action_LanguageName(); ctx.Match(TKLeftCurlyBracketCharacter); Parse_Declarations(ctx); ctx.Match(TKRightCurlyBracketCharacter); } else { throw ParserException(ctx.GetLine(), ctx.GetCol(), ErrorCodeUnexpectedToken); } }