Exemple #1
0
 private void termb1() throws IOException {
   if (sta.lastToken() == TOKEN_AND) {
     builder.buildOperator(OP_AND);
     sta.nextTokenType();
     factb();
     builder.endOperator();
     termb1();
   }
 }
Exemple #2
0
 private void termb() 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:
       factb();
       termb1();
       break;
     default:
       throw new InvalidExpressionError(
           "Expected not (!), (, [ +, -, a number or an identifier. Got '"
               + sta.lastToken()
               + "' instead.");
   }
 }