psym_if_expr_stmt.c revision 1.3
11.3Srillig/* $NetBSD: psym_if_expr_stmt.c,v 1.3 2022/04/23 09:01:03 rillig Exp $ */
21.1Srillig
31.1Srillig/*
41.1Srillig * Tests for the parser symbol psym_if_expr_stmt, which represents the state
51.1Srillig * after reading the keyword 'if', the controlling expression and the
61.3Srillig * statement for the 'then' branch.
71.3Srillig *
81.3Srillig * At this point, the 'if' statement is not necessarily complete, it can be
91.3Srillig * completed with the keyword 'else' followed by a statement.
101.3Srillig *
111.3Srillig * Any token other than 'else' completes the 'if' statement.
121.1Srillig */
131.1Srillig
141.1Srillig#indent input
151.3Srilligvoid
161.3Srilligfunction(void)
171.3Srillig{
181.3Srillig	if (cond)
191.3Srillig		stmt();
201.3Srillig	if (cond)
211.3Srillig		stmt();
221.3Srillig	else			/* belongs to the second 'if' */
231.3Srillig		stmt();
241.3Srillig}
251.1Srillig#indent end
261.1Srillig
271.1Srillig#indent run-equals-input
28