Esempio n. 1
0
 private void If_statement() {
   System.out.print("if");
   mustbe(TK.IF);
   guarded_command();
   while (is(TK.ELSEIF)) {
     System.out.print("else if");
     scan();
     guarded_command();
   }
   if (tok.kind == TK.ELSE) {
     System.out.print("else");
     scan();
     addBlock();
     System.out.println("{");
     block();
     System.out.println("}");
     removeBlock();
   }
   mustbe(TK.ENDIF);
 }
Esempio n. 2
0
 private void Do_statement() {
   System.out.print("while");
   mustbe(TK.DO);
   guarded_command();
   mustbe(TK.ENDDO);
 }