예제 #1
0
 @Override
 public boolean parse(Scanner s) {
   Parser.require(Parser.WHILEPAT, LOG + "Expecting " + Parser.WHILEPAT.toString(), s);
   Parser.require(Parser.OPENPAREN, LOG + "Expecting (", s);
   condition = new COND(getRoot());
   if (!condition.parse(s)) {
     return false;
   }
   Parser.require(Parser.CLOSEPAREN, LOG + "Expecting )", s);
   Parser.require(Parser.OPENBRACE, LOG + "Expecting {", s);
   block = new BLOCK(getRoot());
   if (!block.parse(s)) {
     return false;
   }
   Parser.require(Parser.CLOSEBRACE, LOG + "Expecting }", s);
   return true;
 }