if-then-elsif-els-out.txt ----------------------------------------------------- productions 1 ifstmt ::= If bexpr Then stmtlist elsif_list else_option EndIf 2 elsif_list ::= elsif_list Elsif bexpr Then stmtlist 3 elsif_list ::= epsilon 4 else_option ::= Else stmtlist 5 else_option ::= epsilon terminals eof error If bexpr Then stmtlist EndIf Elsif Else nonterminals ifstmt elsif_list else_option first sets first ( ifstmt ) = If first ( elsif_list ) = epsilon Elsif first ( else_option ) = epsilon Else follow sets follow ( ifstmt ) = eof follow ( elsif_list ) = EndIf Elsif Else follow ( else_option ) = EndIf actions action ( 1 , If ) = shift 2 action ( 2 , bexpr ) = shift 3 action ( 3 , Then ) = shift 4 action ( 4 , stmtlist ) = shift 5 action ( 5 , EndIf ) = reduce 3 action ( 5 , Elsif ) = reduce 3 action ( 5 , Else ) = reduce 3 goto ( 5 , elsif_list ) = 6 action ( 6 , EndIf ) = reduce 5 action ( 6 , Elsif ) = shift 8 action ( 6 , Else ) = shift 9 goto ( 6 , else_option ) = 7 action ( 7 , EndIf ) = shift 10 action ( 8 , bexpr ) = shift 11 action ( 9 , stmtlist ) = shift 12 action ( 10 , eof ) = reduce 1 action ( 11 , Then ) = shift 13 action ( 12 , EndIf ) = reduce 4 action ( 13 , stmtlist ) = shift 14 action ( 14 , EndIf ) = reduce 2 action ( 14 , Elsif ) = reduce 2 action ( 14 , Else ) = reduce 2 states state 1 : ifstmt ::= . If bexpr Then stmtlist elsif_list else_option EndIf state 2 : ifstmt ::= If . bexpr Then stmtlist elsif_list else_option EndIf state 3 : ifstmt ::= If bexpr . Then stmtlist elsif_list else_option EndIf state 4 : ifstmt ::= If bexpr Then . stmtlist elsif_list else_option EndIf state 5 : ifstmt ::= If bexpr Then stmtlist . elsif_list else_option EndIf elsif_list ::= . elsif_list Elsif bexpr Then stmtlist elsif_list ::= . state 6 : elsif_list ::= elsif_list . Elsif bexpr Then stmtlist ifstmt ::= If bexpr Then stmtlist elsif_list . else_option EndIf else_option ::= . Else stmtlist else_option ::= . state 7 : ifstmt ::= If bexpr Then stmtlist elsif_list else_option . EndIf state 8 : elsif_list ::= elsif_list Elsif . bexpr Then stmtlist state 9 : else_option ::= Else . stmtlist state 10 : ifstmt ::= If bexpr Then stmtlist elsif_list else_option EndIf . state 11 : elsif_list ::= elsif_list Elsif bexpr . Then stmtlist state 12 : else_option ::= Else stmtlist . state 13 : elsif_list ::= elsif_list Elsif bexpr Then . stmtlist state 14 : elsif_list ::= elsif_list Elsif bexpr Then stmtlist .