/* Production 36 */ public void unary_expr() { /*@bgen(jjtree) unary_expr */ ASTunary_expr jjtn000 = new ASTunary_expr(this, IDLParserTreeConstants.JJTUNARY_EXPR); bool jjtc000 = true; jjtree.openNodeScope(jjtn000);UnaryOps unary_op = UnaryOps.UnaryNone; try { switch ((jj_ntk==-1)?jj_ntk_calc():jj_ntk) { case 40: case 41: case 45: unary_op = unary_operator(); break; default: jj_la1[43] = jj_gen; ; break; } primary_expr(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.SetUnaryOperation(unary_op); } catch (Exception jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } {if (true) throw ;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); } } }
/** * @see parser.IDLParserVisitor#visit(ASTunary_expr, Object) */ public Object visit(ASTunary_expr node, Object data) { // evaluate the primary-expr Literal result = (Literal)node.jjtGetChild(0).jjtAccept(this, data); switch (node.GetUnaryOperation()) { case UnaryOps.UnaryNegate: result.Negate(); break; case UnaryOps.UnaryMinus: result.InvertSign(); break; default: // for UnaryOps.Plus and UnaryOps.None: nothing to do break; } return result; }