示例#1
0
文件: Parser.java 项目: iscby/JAVA-HW
 private void guarded_command() {
   System.out.print("(");
   expr();
   System.out.print(" <= 0");
   mustbe(TK.THEN);
   System.out.print(")");
   addBlock();
   System.out.println("{");
   block();
   System.out.println("}");
   removeBlock();
 }
示例#2
0
文件: Parser.java 项目: iscby/JAVA-HW
  private void forl_statement() {
    System.out.print("for (");
    scan();

    System.out.print("int i = 0; i<=" + tok.string + "; i ++)");
    addBlock();
    System.out.print("{");

    scan();
    block();

    mustbe(TK.ENDFORL);

    System.out.println("}");
    removeBlock();
  }
示例#3
0
文件: Parser.java 项目: iscby/JAVA-HW
 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);
 }