1 # Exercising Bison Grammar Sets. -*- Autotest -*-
2 # Copyright 2001 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 AT_BANNER([[Grammar Sets (Firsts etc.).]])
28 # At some point, nullable had been smoking grass, and managed to say:
30 # Entering set_nullable
38 e: 'e' | /* Nothing */;
41 AT_CHECK([[bison --trace input.y]], [], [], [stderr])
43 AT_CHECK([[sed 's/[ ]*$//' stderr]], [],
100 Processing state 0 (reached by $)
110 Entering new_itemsets, state = 0
111 Entering append_states, state = 0
112 Entering get_state, state = 0, symbol = 3 ('e')
113 Entering new_state, state = 0, symbol = 3 ('e')
114 Exiting get_state => 1
115 Entering get_state, state = 0, symbol = 5 (e)
116 Entering new_state, state = 0, symbol = 5 (e)
117 Exiting get_state => 2
118 Processing state 1 (reached by 'e')
127 Entering new_itemsets, state = 1
128 Entering append_states, state = 1
129 Processing state 2 (reached by e)
138 Entering new_itemsets, state = 2
139 Entering append_states, state = 2
140 Entering get_state, state = 2, symbol = 0 ($)
141 Entering new_state, state = 2, symbol = 0 ($)
142 Exiting get_state => 3
143 Processing state 3 (reached by $)
152 Entering new_itemsets, state = 3
153 Entering append_states, state = 3
161 State 0: 1 lookaheads
163 on 1 (error) -> rule -4
164 on 2 ($undefined.) -> rule -4
165 on 3 ('e') -> rule -4
166 State 1: 0 lookaheads
167 State 2: 0 lookaheads
168 State 3: 0 lookaheads
175 ## ---------------- ##
176 ## Broken Closure. ##
177 ## ---------------- ##
179 # TC was once broken during a massive `simplification' of the code.
180 # It resulted in bison dumping core on the following grammar (the
181 # computation of FIRSTS uses TC). It managed to produce a pretty
212 # instead of that below.
214 AT_SETUP([Broken Closure])
228 AT_CHECK([[bison --trace input.y]], [], [], [stderr])
230 AT_CHECK([[sed -n 's/[ ]*$//;/^TC: Output BEGIN/,/^TC: Output END/p' stderr]], [],