- NAMED(num_exp_op_token, operator_)
- TYPED(num_exp, operand_)) {
- exp_->op = operator_->type;
- exp_->operand = operand_;
- exp = exp_;
- free(operator_);
+ TOKEN(RPAREN)) {
+ exp = psi_num_exp_init_unary(PSI_T_LPAREN, exp_);
+ exp->token = L;
+}
+
+/*
+ * num_exp: num_exp num_exp_binary_op_token num_exp
+ */
+PARSE_TYPED(num_exp, exp,
+ TYPED(num_exp, lhs_)
+ NAMED(num_exp_binary_op_token, OP)
+ TYPED(num_exp, rhs_)) {
+ exp = psi_num_exp_init_binary(OP->type, lhs_, rhs_);
+ exp->token = OP;
+}
+
+/*
+ * num_exp: num_exp_unary_op_token num_exp
+ */
+PARSE_TYPED(num_exp, exp,
+ NAMED(num_exp_unary_op_token, OP)
+ TYPED(num_exp, exp_)) {
+ exp = psi_num_exp_init_unary(OP->type, exp_);
+ exp->token = OP;