sptr<Node> Parser::ParseBodyBlock() { ParseConstDecl(); ParseTypeDecl(); ParseVarDecl(); return ParseBlock(); }
void Parser::ParseDecl() { while (true) { if (t.GetValue() == "var") ParseVarDecl(); else if(t.GetValue() == "type") ParseTypeDecl(); else if(t.GetValue() == "const") ParseConstDecl(); else if(t.GetValue() == "procedure") ParseProc(); else if(t.GetValue() == "function") ParseFunc(); else break; } }