psym_if_expr_stmt.c revision 1.4
11.4Srillig/* $NetBSD: psym_if_expr_stmt.c,v 1.4 2022/04/24 09:04:12 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.4Srillig//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.4Srillig//indent end 261.1Srillig 271.4Srillig//indent run-equals-input 28