Beispiel #1
0
 private void cond1() throws IOException {
   if (sta.lastToken() == TOKEN_OR) {
     builder.buildOperator(OP_OR);
     sta.nextTokenType();
     termb();
     builder.endOperator();
     cond1();
   }
 }
Beispiel #2
0
 private void cond() throws IOException {
   switch (sta.lastToken()) {
     case TOKEN_NOT:
     case TOKEN_OPAR:
     case TOKEN_ADD:
     case TOKEN_SUB:
     case TOKEN_ID:
     case TOKEN_NUM:
     case TOKEN_OSB:
       termb();
       cond1();
       break;
     default:
       throw new InvalidExpressionError(
           "Expected not (!), (, [ +, -, a number or an identifier. Got '"
               + sta.lastToken()
               + "' instead.");
   }
 }