diff -aur splint-original/src/cgrammar.y splint/src/cgrammar.y --- splint-original/src/cgrammar.y 2008-07-07 19:23:23.179669600 -0700 +++ splint/src/cgrammar.y 2008-07-07 19:43:52.070294600 -0700 @@ -307,7 +307,7 @@ %type init macroBody iterBody endBody partialIterStmt iterSelectionStmt %type stmt stmtList fcnBody iterStmt iterDefStmt iterDefStmtList debugStmt %type labeledStmt caseStmt defaultStmt -%type compoundStmt compoundStmtAux compoundStmtRest compoundStmtAuxErr +%type compoundStmt compoundStmtAux compoundStmtRest compoundStmtListNext compoundInitListNext compoundStmtAuxErr %type expressionStmt selectionStmt iterationStmt jumpStmt iterDefIterationStmt %type stmtErr stmtListErr compoundStmtErr expressionStmtErr %type iterationStmtErr initializerList typeInitializerList initializer @@ -1868,21 +1868,25 @@ : { context_exitInnerSafe (); } ; +compoundInitListNext + : initializerList + | initializerList compoundStmtListNext { $$ = exprNode_concat($1, $2); } +; + +compoundStmtListNext + : stmtList + | stmtList compoundInitListNext { $$ = exprNode_concat($1, $2); } +; + compoundStmtRest : TRBRACE { $$ = exprNode_createTok ($1); } | QNOTREACHED TRBRACE { $$ = exprNode_notReached (exprNode_createTok ($2)); } - | stmtList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); } - | stmtList QNOTREACHED TRBRACE + | compoundInitListNext TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); } + | compoundInitListNext QNOTREACHED TRBRACE { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); } - | initializerList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); } - | initializerList QNOTREACHED TRBRACE + | compoundStmtListNext TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); } + | compoundStmtListNext QNOTREACHED TRBRACE { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); } - | initializerList stmtList TRBRACE - { $$ = exprNode_updateLocation (exprNode_concat ($1, $2), lltok_getLoc ($3)); } - | initializerList stmtList QNOTREACHED TRBRACE - { $$ = exprNode_notReached (exprNode_updateLocation (exprNode_concat ($1, $2), - lltok_getLoc ($3))); - } ; compoundStmtAux