langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
changeset 14722 aaa39655aa2e
parent 14547 86d8d242b0c4
child 14725 65836e833f59
equal deleted inserted replaced
14721:071e3587f212 14722:aaa39655aa2e
  3169     }
  3169     }
  3170 
  3170 
  3171     /** Check that given tree is a legal expression statement.
  3171     /** Check that given tree is a legal expression statement.
  3172      */
  3172      */
  3173     protected JCExpression checkExprStat(JCExpression t) {
  3173     protected JCExpression checkExprStat(JCExpression t) {
  3174         switch(t.getTag()) {
  3174         if (!TreeInfo.isExpressionStatement(t)) {
  3175         case PREINC: case PREDEC:
       
  3176         case POSTINC: case POSTDEC:
       
  3177         case ASSIGN:
       
  3178         case BITOR_ASG: case BITXOR_ASG: case BITAND_ASG:
       
  3179         case SL_ASG: case SR_ASG: case USR_ASG:
       
  3180         case PLUS_ASG: case MINUS_ASG:
       
  3181         case MUL_ASG: case DIV_ASG: case MOD_ASG:
       
  3182         case APPLY: case NEWCLASS:
       
  3183         case ERRONEOUS:
       
  3184             return t;
       
  3185         default:
       
  3186             JCExpression ret = F.at(t.pos).Erroneous(List.<JCTree>of(t));
  3175             JCExpression ret = F.at(t.pos).Erroneous(List.<JCTree>of(t));
  3187             error(ret, "not.stmt");
  3176             error(ret, "not.stmt");
  3188             return ret;
  3177             return ret;
       
  3178         } else {
       
  3179             return t;
  3189         }
  3180         }
  3190     }
  3181     }
  3191 
  3182 
  3192     /** Return precedence of operator represented by token,
  3183     /** Return precedence of operator represented by token,
  3193      *  -1 if token is not a binary operator. @see TreeInfo.opPrec
  3184      *  -1 if token is not a binary operator. @see TreeInfo.opPrec