Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private static void ClassDecl() {
  2.     check(ident);
  3.     Block();
  4.     }
  5.  
  6.     private static void ConstDecl() {
  7.     check(final_);
  8.  
  9.     if (sym == ident)
  10.         Type();
  11.  
  12.     check(ident);
  13.     check(assign);
  14.  
  15.     if (sym == number || sym == charCon)
  16.         check(semicolon);
  17.     }
  18.  
  19.     private static void VarDecl() {
  20.     if (sym == ident)
  21.         Type();
  22.     check(ident);
  23.     while (sym == comma)
  24.         check(ident);
  25.     check(semicolon);
  26.     }
  27.  
  28.     private static void MethodDecl() {
  29.     if (sym == ident)
  30.         Type();
  31.     else
  32.         check(void_);
  33.     check(ident);
  34.     check(lpar);
  35.     if (sym == ident)
  36.         FormPars();
  37.     check(rpar);
  38.     while (sym == ident)
  39.         VarDecl();
  40.     Block();
  41.     }
  42.  
  43.     private static void FormPars() {
  44.     Type();
  45.     check(ident);
  46.     while (sym == comma) {
  47.         scan();
  48.         if (sym == ident) {
  49.         Type();
  50.         check(ident);
  51.         }
  52.     }
  53.  
  54.     }
  55.  
  56.     private static void Block() {
  57.     check(lbrace);
  58.     while (sym == ident)
  59.         StatementDecl();
  60.     check(rbrace);
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement