void primary(expr_rec *result) { switch (next_token()) { case LPAREN: /* <primary> -> ( <expression> ) */ match(LPAREN); expression(result); match(RPAREN); break; case ID: /* <primary> -> <ident> */ *result = ident(); break; case INTLITERAL: /* <primary> -> INTLITERAL #process_literal */ match(INTLITERAL); *result = process_literal(); break; default: syntax_error(next_token()); } }