------------------------------------------------------------------------------ Yacc constuction types (with error handling) Optional Sequence ( x := 0 or more `y' ) x : /* empty */ { EMPTY_X_LIST(); } | x y { ADD_Y_TO_X_LIST(); yyerrok; } | x error ; Sequence ( x := 1 or more `y' ) EG: a b c d e x : y { EMPTY_X_LIST(); ADD_Y_TO_X_LIST(); } | x y { ADD_Y_TO_X_LIST(); yyerrok; } | error | x error ; Separated List ( x := y { T y } ) EG: 1,2,3,4 x : y { EMPTY_X_LIST(); ADD_Y_TO_X_LIST(); } | x T y { ADD_Y_TO_X_LIST(); yyerrok; } | error | x error | x error y { ADD_Y_TO_X_LIST(); yyerrok; } | x T error ; ------------------------------------------------------------------------------