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]], [], [],
85 Processing state 0 (reached by $)
94 Entering new_itemsets, state = 0
95 Entering append_states, state = 0
96 Entering get_state, state = 0, symbol = 3 ('e')
97 Entering new_state, state = 0, symbol = 3 ('e')
98 Exiting get_state => 1
99 Processing state 1 (reached by 'e')
108 Entering new_itemsets, state = 1
109 Entering append_states, state = 1
121 ## ---------------- ##
122 ## Broken Closure. ##
123 ## ---------------- ##
125 # TC was once broken during a massive `simplification' of the code.
126 # It resulted in bison dumping core on the following grammar (the
127 # computation of FIRSTS uses TC). It managed to produce a pretty
158 # instead of that below.
160 AT_SETUP([Broken Closure])
174 AT_CHECK([bison --trace input.y 2>&1 |
175 sed -n '/^TC: Output BEGIN/,/^TC: Output END/p'],