Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void ClassDecl() {
- check(ident);
- Block();
- }
- private static void ConstDecl() {
- check(final_);
- if (sym == ident)
- Type();
- check(ident);
- check(assign);
- if (sym == number || sym == charCon)
- check(semicolon);
- }
- private static void VarDecl() {
- if (sym == ident)
- Type();
- check(ident);
- while (sym == comma)
- check(ident);
- check(semicolon);
- }
- private static void MethodDecl() {
- if (sym == ident)
- Type();
- else
- check(void_);
- check(ident);
- check(lpar);
- if (sym == ident)
- FormPars();
- check(rpar);
- while (sym == ident)
- VarDecl();
- Block();
- }
- private static void FormPars() {
- Type();
- check(ident);
- while (sym == comma) {
- scan();
- if (sym == ident) {
- Type();
- check(ident);
- }
- }
- }
- private static void Block() {
- check(lbrace);
- while (sym == ident)
- StatementDecl();
- check(rbrace);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement