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());
	}
}

Author: Ming-I Hsieh (Powered by FreeBSD, c2html, gimp, vim, gmake)