1 |
# Exercising Bison Grammar Sets. -*- Autotest -*- |
# Exercising Bison Grammar Sets. -*- Autotest -*- |
2 |
# Copyright 2001, 2002 Free Software Foundation, Inc. |
# Copyright (C) 2001, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
# This program is free software; you can redistribute it and/or modify |
# 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 |
# it under the terms of the GNU General Public License as published by |
16 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
17 |
# 02111-1307, USA. |
# 02111-1307, USA. |
18 |
|
|
19 |
|
|
20 |
# AT_EXTRACT_SETS(INPUT, OUTPUT) |
# AT_EXTRACT_SETS(INPUT, OUTPUT) |
21 |
# ------------------------------ |
# ------------------------------ |
22 |
# Extract the information about the grammar sets from a bison |
# Extract the information about the grammar sets from a bison |
26 |
[AT_DATA([extract.sed], |
[AT_DATA([extract.sed], |
27 |
[[#n |
[[#n |
28 |
/^NULLABLE$/ { |
/^NULLABLE$/ { |
29 |
:nullable |
:null |
30 |
p |
p |
31 |
n |
n |
32 |
/^[ ]*$/! b nullable |
/^[ ]*$/! b null |
33 |
} |
} |
34 |
/^FIRSTS$/ { |
/^FIRSTS$/ { |
35 |
:firsts |
:firsts |
38 |
/^[ ]*$/! b firsts |
/^[ ]*$/! b firsts |
39 |
} |
} |
40 |
/^FDERIVES$/ { |
/^FDERIVES$/ { |
41 |
:fderives |
:fderiv |
42 |
p |
p |
43 |
n |
n |
44 |
/^[ ]*$/! b fderives |
/^[ ]*$/! b fderiv |
45 |
} |
} |
46 |
/^DERIVES$/ { |
/^DERIVES$/ { |
47 |
:derives |
:deriv |
48 |
p |
p |
49 |
n |
n |
50 |
/^[ ]*$/! b derives |
/^[ ]*$/! b deriv |
51 |
} |
} |
52 |
]]) |
]]) |
53 |
AT_CHECK([sed -f extract.sed $1], 0, [stdout]) |
AT_CHECK([sed -f extract.sed $1], 0, [stdout]) |