undns 0.4.0d → 0.4.0f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/update_origins_dat +183 -0
- data/ext/undns/conventions.c +800 -723
- data/ext/undns/conventions.h +30 -38
- data/ext/undns/conventlex.c +45 -58
- data/ext/undns/earth.c +20 -1
- data/ext/undns/extconf.rb +3 -1
- data/ext/undns/hashtable.c +6 -2
- data/ext/undns/originAS.c +6 -4
- data/ext/undns/originAS.h +3 -0
- data/ext/undns/progress.c +3 -3
- data/ext/undns/ruleset.c +9 -3
- data/ext/undns/ruleset.h +3 -1
- data/ext/undns/swig-undns_wrap-rb.c +140 -103
- data/lib/undns.rb +14 -1
- data/lib/undns/LocationTable +2804 -0
- data/lib/undns/keys/Makefile +90 -91
- data/lib/undns/keys/Makefile.am +2 -2
- data/lib/undns/keys/Makefile.in +29 -30
- data/lib/undns/origins.dat +517715 -0
- data/test/test_undns.rb +80 -0
- metadata +20 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a0427aa879826016674018308678c320e467f9c
|
4
|
+
data.tar.gz: e8bcfd6dd560ae8a0b7a34528a6e7d387e9a7598
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0b86b92710a6bd58e686b2398dc4834ca17c38b8df40c990126354b9472c170c764aa42c14b561eae0a750b4c520edb31b6fee2fa98f7e24c89e54b4faabaf9
|
7
|
+
data.tar.gz: df932b28a3a90474baadc01ce6e15cb120173ea823be22ea5fade45dc5c9a4ae6f7e1e18df7cbf2be61a1465c028c0a192d175c64c6c56e10da3f6c867932816
|
@@ -0,0 +1,183 @@
|
|
1
|
+
#! /usr/bin/ruby
|
2
|
+
|
3
|
+
require 'undns'
|
4
|
+
|
5
|
+
# TODO: check that bunzip2 exists
|
6
|
+
|
7
|
+
puts Undns::Path::origins_dat
|
8
|
+
if test(?s,Undns::Path::origins_dat) then
|
9
|
+
age = Time.now - File.stat(Undns::Path::origins_dat).mtime
|
10
|
+
size = File.stat(Undns::Path::origins_dat).size
|
11
|
+
if age > 14000 || size < 30000 then
|
12
|
+
puts "will *update* #{Undns::Path::origins_dat}"
|
13
|
+
else
|
14
|
+
puts "will *not* update #{Undns::Path::origins_dat}, which is only #{(age / 3600).to_i} hours old; aborting."
|
15
|
+
puts "remove #{Undns::Path::origins_dat} if you really want to update."
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
else
|
19
|
+
puts "will *create* #{Undns::Path::origins_dat}"
|
20
|
+
end
|
21
|
+
|
22
|
+
# early open, in case lack permissions
|
23
|
+
o = File.open("%s-new" % Undns::Path::origins_dat, "w")
|
24
|
+
|
25
|
+
URL = 'http://archive.routeviews.org/oix-route-views/%d.%02d/oix-full-snapshot-latest.dat.bz2' % [ Time.now.year, Time.now.month ]
|
26
|
+
|
27
|
+
def canonicalize(network)
|
28
|
+
octets = Array.new(4)
|
29
|
+
octets[0], octets[1], octets[2], octets[3], bits = network.split(/[\/\.]/)
|
30
|
+
if bits then
|
31
|
+
# octets = prefix.split('.')
|
32
|
+
bits_that_should_be_zero = (1 << (32-bits.to_i)) - 1
|
33
|
+
if (octets[3].to_i & bits_that_should_be_zero) != 0 then
|
34
|
+
$stderr.puts "bad prefix #{network}"
|
35
|
+
end
|
36
|
+
return network # not as written by ratul; he ensured that there were no stray bits.
|
37
|
+
else
|
38
|
+
# this part as written by Ratul, though not classful, which surprises me.
|
39
|
+
# octets = prefix.split('.')
|
40
|
+
if octets[3] != '0' then
|
41
|
+
if octets[2] != '0' then
|
42
|
+
if octets[1] != '0' then
|
43
|
+
bits = 8
|
44
|
+
else
|
45
|
+
bits = 16
|
46
|
+
end
|
47
|
+
else
|
48
|
+
bits = 24
|
49
|
+
end
|
50
|
+
else
|
51
|
+
$stderr.puts "unexpected."
|
52
|
+
end
|
53
|
+
return "%s/%d" % [ network, bits ]
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# a difficult line, guess which.
|
58
|
+
#* 213.200.192.0/18 12.0.1.63 0 0 0 7018 3320 3303 44038 i
|
59
|
+
#* 213.200.196.144/29164.128.32.11 0 0 0 3303 ?
|
60
|
+
#* 213.200.197.80/30164.128.32.11 0 0 0 3303 ?
|
61
|
+
#* 213.200.208.16/29164.128.32.11 0 0 0 3303 ?
|
62
|
+
|
63
|
+
# IO.popen('curl %s | bunzip2' % URL).each { |ln|
|
64
|
+
started = false
|
65
|
+
networkPos = nil
|
66
|
+
pathPos = nil
|
67
|
+
lastline = nil
|
68
|
+
origins = Hash.new { |h,k| h[k] = Array.new }
|
69
|
+
i = 0
|
70
|
+
|
71
|
+
Kernel::system("mkdir -p /tmp/undns-update-origins-dat")
|
72
|
+
IntermediatePath = "/tmp/undns-update-origins-dat/oix-full-snapshot-latest.dat.bz2"
|
73
|
+
if(!test(?s, IntermediatePath)) then
|
74
|
+
$stderr.puts "downloading #{URL} to #{IntermediatePath}"
|
75
|
+
unless Kernel::system("curl #{URL} -o #{IntermediatePath}") then
|
76
|
+
$stderr.puts "download failed\n"
|
77
|
+
exit 1
|
78
|
+
end
|
79
|
+
else
|
80
|
+
age = Time.now - File.stat(IntermediatePath).mtime
|
81
|
+
size = File.stat(IntermediatePath).size
|
82
|
+
if age > 3000 || size < 30000000 then # size check in case was incomplete once.
|
83
|
+
$stderr.puts "re-downloading #{URL} to #{IntermediatePath}"
|
84
|
+
unless Kernel::system("curl #{URL} -o #{IntermediatePath}") then
|
85
|
+
$stderr.puts "download failed\n"
|
86
|
+
exit 1
|
87
|
+
end
|
88
|
+
else
|
89
|
+
$stderr.puts "relying on cached #{IntermediatePath} for #{URL}; remove it if bad."
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
$stderr.puts "loading #{IntermediatePath} for table compression"
|
94
|
+
## TODO, run the cat locally with a popen3 so that progress is easier
|
95
|
+
## to track.
|
96
|
+
raise "confused" unless test(?s, IntermediatePath)
|
97
|
+
IO.popen('bunzip2 < %s' % IntermediatePath).each do |ln|
|
98
|
+
unless started
|
99
|
+
if ln =~ /\s*Network\s*Next Hop\s*/ then
|
100
|
+
networkPos = ln.index("Network")
|
101
|
+
pathPos = ln.index("Path")
|
102
|
+
started = true
|
103
|
+
next
|
104
|
+
end
|
105
|
+
else
|
106
|
+
net = ln.slice(networkPos..pathPos)
|
107
|
+
if net =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\/\d{1,2})?)/ then
|
108
|
+
network_string = $1
|
109
|
+
network = canonicalize($1)
|
110
|
+
else
|
111
|
+
puts "not a network '#{net}' in line #{ln}"
|
112
|
+
exit
|
113
|
+
end
|
114
|
+
# off by one relative to old show_origins, but I think correct.
|
115
|
+
this_path_pos = pathPos + (network_string.length > 17 ? 1 : 0)
|
116
|
+
path = ln.slice(this_path_pos..-1).split(/\s+/)
|
117
|
+
origin_as = path[-2].to_i
|
118
|
+
origins[network].push(origin_as) unless origins[network].include?(origin_as)
|
119
|
+
# line = "%s %s" % [ network, origin_as ]
|
120
|
+
# if line != lastline then
|
121
|
+
# puts line
|
122
|
+
# lastline = line
|
123
|
+
# end
|
124
|
+
end
|
125
|
+
# break if i>100000
|
126
|
+
i+=1
|
127
|
+
if i % 100000 == 0 then
|
128
|
+
$stderr.print "\rworking on (%5.1f M) %s..." % [ i.to_f / 1000000.0 , network_string ]
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
origins.delete('0.0.0.0/0')
|
133
|
+
|
134
|
+
def merge(origins, network)
|
135
|
+
octets = Array.new(4)
|
136
|
+
octets[0], octets[1], octets[2], octets[3], bits = network.split(/[\/\.]/)
|
137
|
+
addr = (octets[0].to_i << 24) + (octets[1].to_i << 16) + (octets[2].to_i << 8) + (octets[3].to_i)
|
138
|
+
flip = 1 << (32 - bits.to_i)
|
139
|
+
return if ((addr & flip) != 0) # don't do both sides.
|
140
|
+
other_addr = addr ^ flip
|
141
|
+
other_octets = [ (other_addr & 0xff000000) >> 24, (other_addr & 0xff0000) >> 16, (other_addr & 0xff00) >> 8, (other_addr & 0xff) ]
|
142
|
+
other_net = "%s/%s" % [ other_octets.join('.'), bits ]
|
143
|
+
if origins.has_key?(other_net) then
|
144
|
+
# puts origins[other_net].sort.join(',')
|
145
|
+
# puts origins[network].sort.join(',')
|
146
|
+
if origins[other_net].sort == origins[network].sort then
|
147
|
+
# puts "merging %s %s %x" % [ network, other_net, flip ]
|
148
|
+
origins["%s/%d" % [ octets.join('.'), bits.to_i - 1 ]] = origins[other_net]
|
149
|
+
origins.delete(other_net)
|
150
|
+
origins.delete(network)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
if origins.empty? then
|
156
|
+
$stderr.puts "no origins found. seems pretty bad. aborting."
|
157
|
+
exit 1
|
158
|
+
end
|
159
|
+
|
160
|
+
start = Time.now
|
161
|
+
10.times do
|
162
|
+
$stderr.puts "compressing from #{origins.length} entries #{Time.now - start}"
|
163
|
+
origins.keys.each { |network|
|
164
|
+
merge(origins, network)
|
165
|
+
}
|
166
|
+
end
|
167
|
+
|
168
|
+
$stderr.puts "stopping at #{origins.length}"
|
169
|
+
|
170
|
+
$stderr.puts "writing #{origins.length} entries"
|
171
|
+
origins.keys.sort.each { |network|
|
172
|
+
o.puts "%s %s" % [ network, origins[network].join(',') ]
|
173
|
+
}
|
174
|
+
o.close
|
175
|
+
$stderr.puts "%d bytes" % [ File::stat("%s-new" % Undns::Path::origins_dat).size ]
|
176
|
+
|
177
|
+
if(test(?e, Undns::Path::origins_dat)) then
|
178
|
+
Kernel.system('diff -urb %s %s-new > %s.diff' % [ Undns::Path::origins_dat, Undns::Path::origins_dat, Undns::Path::origins_dat ])
|
179
|
+
Kernel.system('mv %s %s-old' % [ Undns::Path::origins_dat, Undns::Path::origins_dat ])
|
180
|
+
end
|
181
|
+
Kernel.system('mv %s-new %s' % [ Undns::Path::origins_dat, Undns::Path::origins_dat ])
|
182
|
+
|
183
|
+
|
data/ext/undns/conventions.c
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
-
/* A Bison parser, made by GNU Bison 3.
|
1
|
+
/* A Bison parser, made by GNU Bison 2.3. */
|
2
2
|
|
3
|
-
/*
|
3
|
+
/* Skeleton implementation for Bison's Yacc-like parsers in C
|
4
4
|
|
5
|
-
Copyright (C) 1984, 1989
|
5
|
+
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
6
|
+
Free Software Foundation, Inc.
|
6
7
|
|
7
|
-
This program is free software
|
8
|
+
This program is free software; you can redistribute it and/or modify
|
8
9
|
it under the terms of the GNU General Public License as published by
|
9
|
-
the Free Software Foundation
|
10
|
-
|
10
|
+
the Free Software Foundation; either version 2, or (at your option)
|
11
|
+
any later version.
|
11
12
|
|
12
13
|
This program is distributed in the hope that it will be useful,
|
13
14
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
@@ -15,7 +16,9 @@
|
|
15
16
|
GNU General Public License for more details.
|
16
17
|
|
17
18
|
You should have received a copy of the GNU General Public License
|
18
|
-
along with this program
|
19
|
+
along with this program; if not, write to the Free Software
|
20
|
+
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
21
|
+
Boston, MA 02110-1301, USA. */
|
19
22
|
|
20
23
|
/* As a special exception, you may create a larger work that contains
|
21
24
|
part or all of the Bison parser skeleton and distribute that work
|
@@ -44,7 +47,7 @@
|
|
44
47
|
#define YYBISON 1
|
45
48
|
|
46
49
|
/* Bison version. */
|
47
|
-
#define YYBISON_VERSION "3
|
50
|
+
#define YYBISON_VERSION "2.3"
|
48
51
|
|
49
52
|
/* Skeleton name. */
|
50
53
|
#define YYSKELETON_NAME "yacc.c"
|
@@ -52,25 +55,42 @@
|
|
52
55
|
/* Pure parsers. */
|
53
56
|
#define YYPURE 0
|
54
57
|
|
55
|
-
/*
|
56
|
-
#define
|
58
|
+
/* Using locations. */
|
59
|
+
#define YYLSP_NEEDED 0
|
57
60
|
|
58
|
-
/*
|
59
|
-
#define
|
61
|
+
/* Substitute the variable and function names. */
|
62
|
+
#define yyparse conv_yyparse
|
63
|
+
#define yylex conv_yylex
|
64
|
+
#define yyerror conv_yyerror
|
65
|
+
#define yylval conv_yylval
|
66
|
+
#define yychar conv_yychar
|
67
|
+
#define yydebug conv_yydebug
|
68
|
+
#define yynerrs conv_yynerrs
|
69
|
+
|
70
|
+
|
71
|
+
/* Tokens. */
|
72
|
+
#ifndef YYTOKENTYPE
|
73
|
+
# define YYTOKENTYPE
|
74
|
+
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
75
|
+
know about them. */
|
76
|
+
enum yytokentype {
|
77
|
+
TOK_QID = 258,
|
78
|
+
TOK_ID = 259,
|
79
|
+
TOK_NUMBER = 260,
|
80
|
+
TOK_REGEX = 261
|
81
|
+
};
|
82
|
+
#endif
|
83
|
+
/* Tokens. */
|
84
|
+
#define TOK_QID 258
|
85
|
+
#define TOK_ID 259
|
86
|
+
#define TOK_NUMBER 260
|
87
|
+
#define TOK_REGEX 261
|
60
88
|
|
61
89
|
|
62
|
-
/* Substitute the variable and function names. */
|
63
|
-
#define yyparse conv_yyparse
|
64
|
-
#define yylex conv_yylex
|
65
|
-
#define yyerror conv_yyerror
|
66
|
-
#define yydebug conv_yydebug
|
67
|
-
#define yynerrs conv_yynerrs
|
68
90
|
|
69
|
-
#define yylval conv_yylval
|
70
|
-
#define yychar conv_yychar
|
71
91
|
|
72
92
|
/* Copy the first part of user declarations. */
|
73
|
-
#line 1 "conventions.y"
|
93
|
+
#line 1 "conventions.y"
|
74
94
|
|
75
95
|
// #define _GNU_SOURCE
|
76
96
|
#include <config.h>
|
@@ -98,15 +118,10 @@
|
|
98
118
|
|
99
119
|
|
100
120
|
|
101
|
-
|
102
|
-
|
103
|
-
#
|
104
|
-
#
|
105
|
-
# define YY_NULLPTR nullptr
|
106
|
-
# else
|
107
|
-
# define YY_NULLPTR 0
|
108
|
-
# endif
|
109
|
-
# endif
|
121
|
+
/* Enabling traces. */
|
122
|
+
#ifndef YYDEBUG
|
123
|
+
# define YYDEBUG 0
|
124
|
+
#endif
|
110
125
|
|
111
126
|
/* Enabling verbose error messages. */
|
112
127
|
#ifdef YYERROR_VERBOSE
|
@@ -116,42 +131,15 @@
|
|
116
131
|
# define YYERROR_VERBOSE 0
|
117
132
|
#endif
|
118
133
|
|
119
|
-
/*
|
120
|
-
|
121
|
-
#
|
122
|
-
# define YY_CONV_YY_Y_TAB_H_INCLUDED
|
123
|
-
/* Debug traces. */
|
124
|
-
#ifndef YYDEBUG
|
125
|
-
# define YYDEBUG 0
|
134
|
+
/* Enabling the token table. */
|
135
|
+
#ifndef YYTOKEN_TABLE
|
136
|
+
# define YYTOKEN_TABLE 0
|
126
137
|
#endif
|
127
|
-
#if YYDEBUG
|
128
|
-
extern int conv_yydebug;
|
129
|
-
#endif
|
130
|
-
|
131
|
-
/* Token type. */
|
132
|
-
#ifndef YYTOKENTYPE
|
133
|
-
# define YYTOKENTYPE
|
134
|
-
enum yytokentype
|
135
|
-
{
|
136
|
-
TOK_QID = 258,
|
137
|
-
TOK_ID = 259,
|
138
|
-
TOK_NUMBER = 260,
|
139
|
-
TOK_REGEX = 261
|
140
|
-
};
|
141
|
-
#endif
|
142
|
-
/* Tokens. */
|
143
|
-
#define TOK_QID 258
|
144
|
-
#define TOK_ID 259
|
145
|
-
#define TOK_NUMBER 260
|
146
|
-
#define TOK_REGEX 261
|
147
138
|
|
148
|
-
/* Value type. */
|
149
139
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
150
|
-
typedef union YYSTYPE
|
151
|
-
|
140
|
+
typedef union YYSTYPE
|
141
|
+
#line 27 "conventions.y"
|
152
142
|
{
|
153
|
-
#line 27 "conventions.y" /* yacc.c:355 */
|
154
|
-
|
155
143
|
struct asnc *asnc;
|
156
144
|
int in;
|
157
145
|
char *cp;
|
@@ -162,23 +150,22 @@ union YYSTYPE
|
|
162
150
|
conv_queue cq;
|
163
151
|
key_hashtable dict;
|
164
152
|
boolean bool;
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
153
|
+
}
|
154
|
+
/* Line 193 of yacc.c. */
|
155
|
+
#line 156 "conventions.c"
|
156
|
+
YYSTYPE;
|
157
|
+
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
169
158
|
# define YYSTYPE_IS_DECLARED 1
|
159
|
+
# define YYSTYPE_IS_TRIVIAL 1
|
170
160
|
#endif
|
171
161
|
|
172
162
|
|
173
|
-
extern YYSTYPE conv_yylval;
|
174
|
-
|
175
|
-
int conv_yyparse (void);
|
176
|
-
|
177
|
-
#endif /* !YY_CONV_YY_Y_TAB_H_INCLUDED */
|
178
163
|
|
179
164
|
/* Copy the second part of user declarations. */
|
180
165
|
|
181
|
-
|
166
|
+
|
167
|
+
/* Line 216 of yacc.c. */
|
168
|
+
#line 169 "conventions.c"
|
182
169
|
|
183
170
|
#ifdef short
|
184
171
|
# undef short
|
@@ -192,8 +179,11 @@ typedef unsigned char yytype_uint8;
|
|
192
179
|
|
193
180
|
#ifdef YYTYPE_INT8
|
194
181
|
typedef YYTYPE_INT8 yytype_int8;
|
195
|
-
#
|
182
|
+
#elif (defined __STDC__ || defined __C99__FUNC__ \
|
183
|
+
|| defined __cplusplus || defined _MSC_VER)
|
196
184
|
typedef signed char yytype_int8;
|
185
|
+
#else
|
186
|
+
typedef short int yytype_int8;
|
197
187
|
#endif
|
198
188
|
|
199
189
|
#ifdef YYTYPE_UINT16
|
@@ -213,7 +203,8 @@ typedef short int yytype_int16;
|
|
213
203
|
# define YYSIZE_T __SIZE_TYPE__
|
214
204
|
# elif defined size_t
|
215
205
|
# define YYSIZE_T size_t
|
216
|
-
# elif ! defined YYSIZE_T
|
206
|
+
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
|
207
|
+
|| defined __cplusplus || defined _MSC_VER)
|
217
208
|
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
|
218
209
|
# define YYSIZE_T size_t
|
219
210
|
# else
|
@@ -227,68 +218,39 @@ typedef short int yytype_int16;
|
|
227
218
|
# if defined YYENABLE_NLS && YYENABLE_NLS
|
228
219
|
# if ENABLE_NLS
|
229
220
|
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
230
|
-
# define YY_(
|
221
|
+
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
231
222
|
# endif
|
232
223
|
# endif
|
233
224
|
# ifndef YY_
|
234
|
-
# define YY_(
|
235
|
-
# endif
|
236
|
-
#endif
|
237
|
-
|
238
|
-
#ifndef YY_ATTRIBUTE
|
239
|
-
# if (defined __GNUC__ \
|
240
|
-
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
|
241
|
-
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
|
242
|
-
# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
|
243
|
-
# else
|
244
|
-
# define YY_ATTRIBUTE(Spec) /* empty */
|
245
|
-
# endif
|
246
|
-
#endif
|
247
|
-
|
248
|
-
#ifndef YY_ATTRIBUTE_PURE
|
249
|
-
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
|
250
|
-
#endif
|
251
|
-
|
252
|
-
#ifndef YY_ATTRIBUTE_UNUSED
|
253
|
-
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
|
254
|
-
#endif
|
255
|
-
|
256
|
-
#if !defined _Noreturn \
|
257
|
-
&& (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
|
258
|
-
# if defined _MSC_VER && 1200 <= _MSC_VER
|
259
|
-
# define _Noreturn __declspec (noreturn)
|
260
|
-
# else
|
261
|
-
# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
|
225
|
+
# define YY_(msgid) msgid
|
262
226
|
# endif
|
263
227
|
#endif
|
264
228
|
|
265
229
|
/* Suppress unused-variable warnings by "using" E. */
|
266
230
|
#if ! defined lint || defined __GNUC__
|
267
|
-
# define YYUSE(
|
231
|
+
# define YYUSE(e) ((void) (e))
|
268
232
|
#else
|
269
|
-
# define YYUSE(
|
233
|
+
# define YYUSE(e) /* empty */
|
270
234
|
#endif
|
271
235
|
|
272
|
-
|
273
|
-
|
274
|
-
# define
|
275
|
-
_Pragma ("GCC diagnostic push") \
|
276
|
-
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
|
277
|
-
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
278
|
-
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
279
|
-
_Pragma ("GCC diagnostic pop")
|
236
|
+
/* Identity function, used to suppress warnings about constant conditions. */
|
237
|
+
#ifndef lint
|
238
|
+
# define YYID(n) (n)
|
280
239
|
#else
|
281
|
-
#
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
#
|
240
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
241
|
+
|| defined __cplusplus || defined _MSC_VER)
|
242
|
+
static int
|
243
|
+
YYID (int i)
|
244
|
+
#else
|
245
|
+
static int
|
246
|
+
YYID (i)
|
247
|
+
int i;
|
286
248
|
#endif
|
287
|
-
|
288
|
-
|
249
|
+
{
|
250
|
+
return i;
|
251
|
+
}
|
289
252
|
#endif
|
290
253
|
|
291
|
-
|
292
254
|
#if ! defined yyoverflow || YYERROR_VERBOSE
|
293
255
|
|
294
256
|
/* The parser invokes alloca or malloc; define the necessary symbols. */
|
@@ -306,11 +268,11 @@ typedef short int yytype_int16;
|
|
306
268
|
# define alloca _alloca
|
307
269
|
# else
|
308
270
|
# define YYSTACK_ALLOC alloca
|
309
|
-
# if ! defined _ALLOCA_H && ! defined
|
271
|
+
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|
272
|
+
|| defined __cplusplus || defined _MSC_VER)
|
310
273
|
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
311
|
-
|
312
|
-
#
|
313
|
-
# define EXIT_SUCCESS 0
|
274
|
+
# ifndef _STDLIB_H
|
275
|
+
# define _STDLIB_H 1
|
314
276
|
# endif
|
315
277
|
# endif
|
316
278
|
# endif
|
@@ -318,8 +280,8 @@ typedef short int yytype_int16;
|
|
318
280
|
# endif
|
319
281
|
|
320
282
|
# ifdef YYSTACK_ALLOC
|
321
|
-
/* Pacify GCC's
|
322
|
-
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
|
283
|
+
/* Pacify GCC's `empty if-body' warning. */
|
284
|
+
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
|
323
285
|
# ifndef YYSTACK_ALLOC_MAXIMUM
|
324
286
|
/* The OS might guarantee only one guard page at the bottom of the stack,
|
325
287
|
and a page size can be as small as 4096 bytes. So we cannot safely
|
@@ -333,23 +295,25 @@ typedef short int yytype_int16;
|
|
333
295
|
# ifndef YYSTACK_ALLOC_MAXIMUM
|
334
296
|
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
|
335
297
|
# endif
|
336
|
-
# if (defined __cplusplus && ! defined
|
298
|
+
# if (defined __cplusplus && ! defined _STDLIB_H \
|
337
299
|
&& ! ((defined YYMALLOC || defined malloc) \
|
338
|
-
|
300
|
+
&& (defined YYFREE || defined free)))
|
339
301
|
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
340
|
-
# ifndef
|
341
|
-
# define
|
302
|
+
# ifndef _STDLIB_H
|
303
|
+
# define _STDLIB_H 1
|
342
304
|
# endif
|
343
305
|
# endif
|
344
306
|
# ifndef YYMALLOC
|
345
307
|
# define YYMALLOC malloc
|
346
|
-
# if ! defined malloc && ! defined
|
308
|
+
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|
309
|
+
|| defined __cplusplus || defined _MSC_VER)
|
347
310
|
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
|
348
311
|
# endif
|
349
312
|
# endif
|
350
313
|
# ifndef YYFREE
|
351
314
|
# define YYFREE free
|
352
|
-
# if ! defined free && ! defined
|
315
|
+
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|
316
|
+
|| defined __cplusplus || defined _MSC_VER)
|
353
317
|
void free (void *); /* INFRINGES ON USER NAME SPACE */
|
354
318
|
# endif
|
355
319
|
# endif
|
@@ -359,14 +323,14 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
|
|
359
323
|
|
360
324
|
#if (! defined yyoverflow \
|
361
325
|
&& (! defined __cplusplus \
|
362
|
-
|
326
|
+
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
363
327
|
|
364
328
|
/* A type that is properly aligned for any stack member. */
|
365
329
|
union yyalloc
|
366
330
|
{
|
367
|
-
yytype_int16
|
368
|
-
YYSTYPE
|
369
|
-
};
|
331
|
+
yytype_int16 yyss;
|
332
|
+
YYSTYPE yyvs;
|
333
|
+
};
|
370
334
|
|
371
335
|
/* The size of the maximum gap between one aligned stack and the next. */
|
372
336
|
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
|
@@ -377,46 +341,42 @@ union yyalloc
|
|
377
341
|
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
|
378
342
|
+ YYSTACK_GAP_MAXIMUM)
|
379
343
|
|
380
|
-
|
344
|
+
/* Copy COUNT objects from FROM to TO. The source and destination do
|
345
|
+
not overlap. */
|
346
|
+
# ifndef YYCOPY
|
347
|
+
# if defined __GNUC__ && 1 < __GNUC__
|
348
|
+
# define YYCOPY(To, From, Count) \
|
349
|
+
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
|
350
|
+
# else
|
351
|
+
# define YYCOPY(To, From, Count) \
|
352
|
+
do \
|
353
|
+
{ \
|
354
|
+
YYSIZE_T yyi; \
|
355
|
+
for (yyi = 0; yyi < (Count); yyi++) \
|
356
|
+
(To)[yyi] = (From)[yyi]; \
|
357
|
+
} \
|
358
|
+
while (YYID (0))
|
359
|
+
# endif
|
360
|
+
# endif
|
381
361
|
|
382
362
|
/* Relocate STACK from its old location to the new one. The
|
383
363
|
local variables YYSIZE and YYSTACKSIZE give the old and new number of
|
384
364
|
elements in the stack, and YYPTR gives the new location of the
|
385
365
|
stack. Advance YYPTR to a properly aligned location for the next
|
386
366
|
stack. */
|
387
|
-
# define YYSTACK_RELOCATE(
|
388
|
-
do
|
389
|
-
{
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
}
|
396
|
-
while (0)
|
367
|
+
# define YYSTACK_RELOCATE(Stack) \
|
368
|
+
do \
|
369
|
+
{ \
|
370
|
+
YYSIZE_T yynewbytes; \
|
371
|
+
YYCOPY (&yyptr->Stack, Stack, yysize); \
|
372
|
+
Stack = &yyptr->Stack; \
|
373
|
+
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
|
374
|
+
yyptr += yynewbytes / sizeof (*yyptr); \
|
375
|
+
} \
|
376
|
+
while (YYID (0))
|
397
377
|
|
398
378
|
#endif
|
399
379
|
|
400
|
-
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
|
401
|
-
/* Copy COUNT objects from SRC to DST. The source and destination do
|
402
|
-
not overlap. */
|
403
|
-
# ifndef YYCOPY
|
404
|
-
# if defined __GNUC__ && 1 < __GNUC__
|
405
|
-
# define YYCOPY(Dst, Src, Count) \
|
406
|
-
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
|
407
|
-
# else
|
408
|
-
# define YYCOPY(Dst, Src, Count) \
|
409
|
-
do \
|
410
|
-
{ \
|
411
|
-
YYSIZE_T yyi; \
|
412
|
-
for (yyi = 0; yyi < (Count); yyi++) \
|
413
|
-
(Dst)[yyi] = (Src)[yyi]; \
|
414
|
-
} \
|
415
|
-
while (0)
|
416
|
-
# endif
|
417
|
-
# endif
|
418
|
-
#endif /* !YYCOPY_NEEDED */
|
419
|
-
|
420
380
|
/* YYFINAL -- State number of the termination state. */
|
421
381
|
#define YYFINAL 2
|
422
382
|
/* YYLAST -- Last index in YYTABLE. */
|
@@ -428,19 +388,17 @@ union yyalloc
|
|
428
388
|
#define YYNNTS 9
|
429
389
|
/* YYNRULES -- Number of rules. */
|
430
390
|
#define YYNRULES 28
|
431
|
-
/*
|
391
|
+
/* YYNRULES -- Number of states. */
|
432
392
|
#define YYNSTATES 49
|
433
393
|
|
434
|
-
/* YYTRANSLATE
|
435
|
-
by yylex, with out-of-bounds checking. */
|
394
|
+
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
436
395
|
#define YYUNDEFTOK 2
|
437
396
|
#define YYMAXUTOK 261
|
438
397
|
|
439
|
-
#define YYTRANSLATE(YYX)
|
398
|
+
#define YYTRANSLATE(YYX) \
|
440
399
|
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
441
400
|
|
442
|
-
/* YYTRANSLATE[
|
443
|
-
as returned by yylex, without out-of-bounds checking. */
|
401
|
+
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
444
402
|
static const yytype_uint8 yytranslate[] =
|
445
403
|
{
|
446
404
|
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
@@ -473,7 +431,32 @@ static const yytype_uint8 yytranslate[] =
|
|
473
431
|
};
|
474
432
|
|
475
433
|
#if YYDEBUG
|
476
|
-
|
434
|
+
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
|
435
|
+
YYRHS. */
|
436
|
+
static const yytype_uint8 yyprhs[] =
|
437
|
+
{
|
438
|
+
0, 0, 3, 6, 7, 12, 18, 21, 22, 26,
|
439
|
+
31, 37, 44, 47, 52, 56, 59, 66, 74, 78,
|
440
|
+
84, 89, 93, 96, 98, 100, 103, 104, 107
|
441
|
+
};
|
442
|
+
|
443
|
+
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
444
|
+
static const yytype_int8 yyrhs[] =
|
445
|
+
{
|
446
|
+
12, 0, -1, 12, 13, -1, -1, 5, 7, 14,
|
447
|
+
8, -1, 5, 6, 7, 14, 8, -1, 14, 15,
|
448
|
+
-1, -1, 6, 16, 9, -1, 6, 16, 16, 9,
|
449
|
+
-1, 6, 16, 16, 16, 9, -1, 6, 16, 16,
|
450
|
+
16, 16, 9, -1, 6, 9, -1, 6, 16, 16,
|
451
|
+
1, -1, 6, 16, 1, -1, 6, 1, -1, 4,
|
452
|
+
10, 5, 7, 18, 8, -1, 4, 10, 10, 5,
|
453
|
+
7, 18, 8, -1, 4, 10, 3, -1, 4, 10,
|
454
|
+
5, 7, 1, -1, 4, 10, 3, 1, -1, 4,
|
455
|
+
10, 1, -1, 4, 1, -1, 4, -1, 3, -1,
|
456
|
+
18, 19, -1, -1, 4, 17, -1, 5, 17, -1
|
457
|
+
};
|
458
|
+
|
459
|
+
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
477
460
|
static const yytype_uint8 yyrline[] =
|
478
461
|
{
|
479
462
|
0, 54, 54, 62, 68, 79, 119, 122, 126, 128,
|
@@ -482,7 +465,7 @@ static const yytype_uint8 yyrline[] =
|
|
482
465
|
};
|
483
466
|
#endif
|
484
467
|
|
485
|
-
#if YYDEBUG || YYERROR_VERBOSE ||
|
468
|
+
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
486
469
|
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
487
470
|
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
488
471
|
static const char *const yytname[] =
|
@@ -490,13 +473,13 @@ static const char *const yytname[] =
|
|
490
473
|
"$end", "error", "$undefined", "TOK_QID", "TOK_ID", "TOK_NUMBER",
|
491
474
|
"TOK_REGEX", "'{'", "'}'", "';'", "'='", "$accept", "conventions", "asn",
|
492
475
|
"expressionlist", "expression", "keyvalbinding", "quotableident",
|
493
|
-
"bindingtable", "binding",
|
476
|
+
"bindingtable", "binding", 0
|
494
477
|
};
|
495
478
|
#endif
|
496
479
|
|
497
480
|
# ifdef YYPRINT
|
498
|
-
/* YYTOKNUM[NUM] --
|
499
|
-
|
481
|
+
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
|
482
|
+
token YYLEX-NUM. */
|
500
483
|
static const yytype_uint16 yytoknum[] =
|
501
484
|
{
|
502
485
|
0, 256, 257, 258, 259, 260, 261, 123, 125, 59,
|
@@ -504,30 +487,25 @@ static const yytype_uint16 yytoknum[] =
|
|
504
487
|
};
|
505
488
|
# endif
|
506
489
|
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
#define yytable_value_is_error(Yytable_value) \
|
515
|
-
0
|
490
|
+
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
491
|
+
static const yytype_uint8 yyr1[] =
|
492
|
+
{
|
493
|
+
0, 11, 12, 12, 13, 13, 14, 14, 15, 15,
|
494
|
+
15, 15, 15, 15, 15, 15, 16, 16, 16, 16,
|
495
|
+
16, 16, 16, 17, 17, 18, 18, 19, 19
|
496
|
+
};
|
516
497
|
|
517
|
-
|
518
|
-
|
519
|
-
static const yytype_int8 yypact[] =
|
498
|
+
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
499
|
+
static const yytype_uint8 yyr2[] =
|
520
500
|
{
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
-22, 25, 42, -22, -2, -22, 30, -22, -22, 44,
|
525
|
-
44, -22, -22, 32, -22, -22, -22, -22, -22
|
501
|
+
0, 2, 2, 0, 4, 5, 2, 0, 3, 4,
|
502
|
+
5, 6, 2, 4, 3, 2, 6, 7, 3, 5,
|
503
|
+
4, 3, 2, 1, 1, 2, 0, 2, 2
|
526
504
|
};
|
527
505
|
|
528
|
-
|
529
|
-
|
530
|
-
|
506
|
+
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
|
507
|
+
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
|
508
|
+
means the default is an error. */
|
531
509
|
static const yytype_uint8 yydefact[] =
|
532
510
|
{
|
533
511
|
3, 0, 1, 0, 2, 0, 7, 7, 0, 0,
|
@@ -537,21 +515,35 @@ static const yytype_uint8 yydefact[] =
|
|
537
515
|
0, 16, 25, 0, 24, 23, 27, 28, 17
|
538
516
|
};
|
539
517
|
|
540
|
-
|
541
|
-
static const yytype_int8
|
518
|
+
/* YYDEFGOTO[NTERM-NUM]. */
|
519
|
+
static const yytype_int8 yydefgoto[] =
|
542
520
|
{
|
543
|
-
|
521
|
+
-1, 1, 4, 8, 12, 17, 46, 36, 42
|
544
522
|
};
|
545
523
|
|
546
|
-
|
547
|
-
|
524
|
+
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
525
|
+
STATE-NUM. */
|
526
|
+
#define YYPACT_NINF -22
|
527
|
+
static const yytype_int8 yypact[] =
|
548
528
|
{
|
549
|
-
|
529
|
+
-22, 3, -22, 39, -22, 2, -22, -22, 33, 36,
|
530
|
+
12, -22, -22, -22, -22, 0, -22, 13, -22, 1,
|
531
|
+
-22, -22, 14, -22, 23, 21, 26, -22, -22, 16,
|
532
|
+
-22, 25, 42, -22, -2, -22, 30, -22, -22, 44,
|
533
|
+
44, -22, -22, 32, -22, -22, -22, -22, -22
|
550
534
|
};
|
551
535
|
|
552
|
-
|
553
|
-
|
554
|
-
|
536
|
+
/* YYPGOTO[NTERM-NUM]. */
|
537
|
+
static const yytype_int8 yypgoto[] =
|
538
|
+
{
|
539
|
+
-22, -22, -22, 43, -22, -17, -21, 6, -22
|
540
|
+
};
|
541
|
+
|
542
|
+
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
543
|
+
positive, shift that token. If negative, reduce the rule which
|
544
|
+
number is the opposite. If zero, do what YYDEFACT says.
|
545
|
+
If YYTABLE_NINF, syntax error. */
|
546
|
+
#define YYTABLE_NINF -27
|
555
547
|
static const yytype_int8 yytable[] =
|
556
548
|
{
|
557
549
|
22, 18, 23, 2, 24, 29, 25, 38, 3, 7,
|
@@ -572,8 +564,8 @@ static const yytype_uint8 yycheck[] =
|
|
572
564
|
7
|
573
565
|
};
|
574
566
|
|
575
|
-
|
576
|
-
|
567
|
+
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
568
|
+
symbol of state STATE-NUM. */
|
577
569
|
static const yytype_uint8 yystos[] =
|
578
570
|
{
|
579
571
|
0, 12, 0, 5, 13, 6, 7, 7, 14, 14,
|
@@ -583,57 +575,95 @@ static const yytype_uint8 yystos[] =
|
|
583
575
|
5, 8, 19, 18, 3, 4, 17, 17, 8
|
584
576
|
};
|
585
577
|
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
15, 15, 15, 15, 15, 15, 16, 16, 16, 16,
|
591
|
-
16, 16, 16, 17, 17, 18, 18, 19, 19
|
592
|
-
};
|
593
|
-
|
594
|
-
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
|
595
|
-
static const yytype_uint8 yyr2[] =
|
596
|
-
{
|
597
|
-
0, 2, 2, 0, 4, 5, 2, 0, 3, 4,
|
598
|
-
5, 6, 2, 4, 3, 2, 6, 7, 3, 5,
|
599
|
-
4, 3, 2, 1, 1, 2, 0, 2, 2
|
600
|
-
};
|
578
|
+
#define yyerrok (yyerrstatus = 0)
|
579
|
+
#define yyclearin (yychar = YYEMPTY)
|
580
|
+
#define YYEMPTY (-2)
|
581
|
+
#define YYEOF 0
|
601
582
|
|
583
|
+
#define YYACCEPT goto yyacceptlab
|
584
|
+
#define YYABORT goto yyabortlab
|
585
|
+
#define YYERROR goto yyerrorlab
|
602
586
|
|
603
|
-
#define yyerrok (yyerrstatus = 0)
|
604
|
-
#define yyclearin (yychar = YYEMPTY)
|
605
|
-
#define YYEMPTY (-2)
|
606
|
-
#define YYEOF 0
|
607
587
|
|
608
|
-
|
609
|
-
|
610
|
-
|
588
|
+
/* Like YYERROR except do call yyerror. This remains here temporarily
|
589
|
+
to ease the transition to the new meaning of YYERROR, for GCC.
|
590
|
+
Once GCC version 2 has supplanted version 1, this can go. */
|
611
591
|
|
592
|
+
#define YYFAIL goto yyerrlab
|
612
593
|
|
613
594
|
#define YYRECOVERING() (!!yyerrstatus)
|
614
595
|
|
615
|
-
#define YYBACKUP(Token, Value)
|
616
|
-
do
|
617
|
-
if (yychar == YYEMPTY)
|
618
|
-
{
|
619
|
-
yychar = (Token);
|
620
|
-
yylval = (Value);
|
621
|
-
|
622
|
-
|
623
|
-
goto yybackup;
|
624
|
-
}
|
625
|
-
else
|
626
|
-
{
|
596
|
+
#define YYBACKUP(Token, Value) \
|
597
|
+
do \
|
598
|
+
if (yychar == YYEMPTY && yylen == 1) \
|
599
|
+
{ \
|
600
|
+
yychar = (Token); \
|
601
|
+
yylval = (Value); \
|
602
|
+
yytoken = YYTRANSLATE (yychar); \
|
603
|
+
YYPOPSTACK (1); \
|
604
|
+
goto yybackup; \
|
605
|
+
} \
|
606
|
+
else \
|
607
|
+
{ \
|
627
608
|
yyerror (YY_("syntax error: cannot back up")); \
|
628
|
-
YYERROR;
|
629
|
-
}
|
630
|
-
while (0)
|
609
|
+
YYERROR; \
|
610
|
+
} \
|
611
|
+
while (YYID (0))
|
612
|
+
|
613
|
+
|
614
|
+
#define YYTERROR 1
|
615
|
+
#define YYERRCODE 256
|
616
|
+
|
617
|
+
|
618
|
+
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
619
|
+
If N is 0, then set CURRENT to the empty location which ends
|
620
|
+
the previous symbol: RHS[0] (always defined). */
|
621
|
+
|
622
|
+
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
623
|
+
#ifndef YYLLOC_DEFAULT
|
624
|
+
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
625
|
+
do \
|
626
|
+
if (YYID (N)) \
|
627
|
+
{ \
|
628
|
+
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
629
|
+
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
630
|
+
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
631
|
+
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
632
|
+
} \
|
633
|
+
else \
|
634
|
+
{ \
|
635
|
+
(Current).first_line = (Current).last_line = \
|
636
|
+
YYRHSLOC (Rhs, 0).last_line; \
|
637
|
+
(Current).first_column = (Current).last_column = \
|
638
|
+
YYRHSLOC (Rhs, 0).last_column; \
|
639
|
+
} \
|
640
|
+
while (YYID (0))
|
641
|
+
#endif
|
642
|
+
|
643
|
+
|
644
|
+
/* YY_LOCATION_PRINT -- Print the location on the stream.
|
645
|
+
This macro was not mandated originally: define only if we know
|
646
|
+
we won't break user code: when these are the locations we know. */
|
631
647
|
|
632
|
-
|
633
|
-
#
|
634
|
-
#define
|
648
|
+
#ifndef YY_LOCATION_PRINT
|
649
|
+
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
650
|
+
# define YY_LOCATION_PRINT(File, Loc) \
|
651
|
+
fprintf (File, "%d.%d-%d.%d", \
|
652
|
+
(Loc).first_line, (Loc).first_column, \
|
653
|
+
(Loc).last_line, (Loc).last_column)
|
654
|
+
# else
|
655
|
+
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
|
656
|
+
# endif
|
657
|
+
#endif
|
635
658
|
|
636
659
|
|
660
|
+
/* YYLEX -- calling `yylex' with the right arguments. */
|
661
|
+
|
662
|
+
#ifdef YYLEX_PARAM
|
663
|
+
# define YYLEX yylex (YYLEX_PARAM)
|
664
|
+
#else
|
665
|
+
# define YYLEX yylex ()
|
666
|
+
#endif
|
637
667
|
|
638
668
|
/* Enable debugging if requested. */
|
639
669
|
#if YYDEBUG
|
@@ -643,46 +673,54 @@ while (0)
|
|
643
673
|
# define YYFPRINTF fprintf
|
644
674
|
# endif
|
645
675
|
|
646
|
-
# define YYDPRINTF(Args)
|
647
|
-
do {
|
648
|
-
if (yydebug)
|
649
|
-
YYFPRINTF Args;
|
650
|
-
} while (0)
|
651
|
-
|
652
|
-
/* This macro is provided for backward compatibility. */
|
653
|
-
#ifndef YY_LOCATION_PRINT
|
654
|
-
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
|
655
|
-
#endif
|
676
|
+
# define YYDPRINTF(Args) \
|
677
|
+
do { \
|
678
|
+
if (yydebug) \
|
679
|
+
YYFPRINTF Args; \
|
680
|
+
} while (YYID (0))
|
656
681
|
|
682
|
+
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
683
|
+
do { \
|
684
|
+
if (yydebug) \
|
685
|
+
{ \
|
686
|
+
YYFPRINTF (stderr, "%s ", Title); \
|
687
|
+
yy_symbol_print (stderr, \
|
688
|
+
Type, Value); \
|
689
|
+
YYFPRINTF (stderr, "\n"); \
|
690
|
+
} \
|
691
|
+
} while (YYID (0))
|
657
692
|
|
658
|
-
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
659
|
-
do { \
|
660
|
-
if (yydebug) \
|
661
|
-
{ \
|
662
|
-
YYFPRINTF (stderr, "%s ", Title); \
|
663
|
-
yy_symbol_print (stderr, \
|
664
|
-
Type, Value); \
|
665
|
-
YYFPRINTF (stderr, "\n"); \
|
666
|
-
} \
|
667
|
-
} while (0)
|
668
693
|
|
694
|
+
/*--------------------------------.
|
695
|
+
| Print this symbol on YYOUTPUT. |
|
696
|
+
`--------------------------------*/
|
669
697
|
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
698
|
+
/*ARGSUSED*/
|
699
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
700
|
+
|| defined __cplusplus || defined _MSC_VER)
|
674
701
|
static void
|
675
702
|
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
|
703
|
+
#else
|
704
|
+
static void
|
705
|
+
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
|
706
|
+
FILE *yyoutput;
|
707
|
+
int yytype;
|
708
|
+
YYSTYPE const * const yyvaluep;
|
709
|
+
#endif
|
676
710
|
{
|
677
|
-
FILE *yyo = yyoutput;
|
678
|
-
YYUSE (yyo);
|
679
711
|
if (!yyvaluep)
|
680
712
|
return;
|
681
713
|
# ifdef YYPRINT
|
682
714
|
if (yytype < YYNTOKENS)
|
683
715
|
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
716
|
+
# else
|
717
|
+
YYUSE (yyoutput);
|
684
718
|
# endif
|
685
|
-
|
719
|
+
switch (yytype)
|
720
|
+
{
|
721
|
+
default:
|
722
|
+
break;
|
723
|
+
}
|
686
724
|
}
|
687
725
|
|
688
726
|
|
@@ -690,11 +728,22 @@ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvalue
|
|
690
728
|
| Print this symbol on YYOUTPUT. |
|
691
729
|
`--------------------------------*/
|
692
730
|
|
731
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
732
|
+
|| defined __cplusplus || defined _MSC_VER)
|
693
733
|
static void
|
694
734
|
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
|
735
|
+
#else
|
736
|
+
static void
|
737
|
+
yy_symbol_print (yyoutput, yytype, yyvaluep)
|
738
|
+
FILE *yyoutput;
|
739
|
+
int yytype;
|
740
|
+
YYSTYPE const * const yyvaluep;
|
741
|
+
#endif
|
695
742
|
{
|
696
|
-
|
697
|
-
|
743
|
+
if (yytype < YYNTOKENS)
|
744
|
+
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
|
745
|
+
else
|
746
|
+
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
698
747
|
|
699
748
|
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
|
700
749
|
YYFPRINTF (yyoutput, ")");
|
@@ -705,54 +754,66 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
|
|
705
754
|
| TOP (included). |
|
706
755
|
`------------------------------------------------------------------*/
|
707
756
|
|
757
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
758
|
+
|| defined __cplusplus || defined _MSC_VER)
|
708
759
|
static void
|
709
|
-
yy_stack_print (yytype_int16 *
|
760
|
+
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
|
761
|
+
#else
|
762
|
+
static void
|
763
|
+
yy_stack_print (bottom, top)
|
764
|
+
yytype_int16 *bottom;
|
765
|
+
yytype_int16 *top;
|
766
|
+
#endif
|
710
767
|
{
|
711
768
|
YYFPRINTF (stderr, "Stack now");
|
712
|
-
for (;
|
713
|
-
|
714
|
-
int yybot = *yybottom;
|
715
|
-
YYFPRINTF (stderr, " %d", yybot);
|
716
|
-
}
|
769
|
+
for (; bottom <= top; ++bottom)
|
770
|
+
YYFPRINTF (stderr, " %d", *bottom);
|
717
771
|
YYFPRINTF (stderr, "\n");
|
718
772
|
}
|
719
773
|
|
720
|
-
# define YY_STACK_PRINT(Bottom, Top)
|
721
|
-
do {
|
722
|
-
if (yydebug)
|
723
|
-
yy_stack_print ((Bottom), (Top));
|
724
|
-
} while (0)
|
774
|
+
# define YY_STACK_PRINT(Bottom, Top) \
|
775
|
+
do { \
|
776
|
+
if (yydebug) \
|
777
|
+
yy_stack_print ((Bottom), (Top)); \
|
778
|
+
} while (YYID (0))
|
725
779
|
|
726
780
|
|
727
781
|
/*------------------------------------------------.
|
728
782
|
| Report that the YYRULE is going to be reduced. |
|
729
783
|
`------------------------------------------------*/
|
730
784
|
|
785
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
786
|
+
|| defined __cplusplus || defined _MSC_VER)
|
787
|
+
static void
|
788
|
+
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
|
789
|
+
#else
|
731
790
|
static void
|
732
|
-
yy_reduce_print (
|
791
|
+
yy_reduce_print (yyvsp, yyrule)
|
792
|
+
YYSTYPE *yyvsp;
|
793
|
+
int yyrule;
|
794
|
+
#endif
|
733
795
|
{
|
734
|
-
unsigned long int yylno = yyrline[yyrule];
|
735
796
|
int yynrhs = yyr2[yyrule];
|
736
797
|
int yyi;
|
798
|
+
unsigned long int yylno = yyrline[yyrule];
|
737
799
|
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
|
738
|
-
|
800
|
+
yyrule - 1, yylno);
|
739
801
|
/* The symbols being reduced. */
|
740
802
|
for (yyi = 0; yyi < yynrhs; yyi++)
|
741
803
|
{
|
742
|
-
|
743
|
-
yy_symbol_print (stderr,
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
YYFPRINTF (stderr, "\n");
|
804
|
+
fprintf (stderr, " $%d = ", yyi + 1);
|
805
|
+
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
806
|
+
&(yyvsp[(yyi + 1) - (yynrhs)])
|
807
|
+
);
|
808
|
+
fprintf (stderr, "\n");
|
748
809
|
}
|
749
810
|
}
|
750
811
|
|
751
|
-
# define YY_REDUCE_PRINT(Rule)
|
752
|
-
do {
|
753
|
-
if (yydebug)
|
754
|
-
yy_reduce_print (
|
755
|
-
} while (0)
|
812
|
+
# define YY_REDUCE_PRINT(Rule) \
|
813
|
+
do { \
|
814
|
+
if (yydebug) \
|
815
|
+
yy_reduce_print (yyvsp, Rule); \
|
816
|
+
} while (YYID (0))
|
756
817
|
|
757
818
|
/* Nonzero means print parse trace. It is left uninitialized so that
|
758
819
|
multiple parsers can coexist. */
|
@@ -766,7 +827,7 @@ int yydebug;
|
|
766
827
|
|
767
828
|
|
768
829
|
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
769
|
-
#ifndef
|
830
|
+
#ifndef YYINITDEPTH
|
770
831
|
# define YYINITDEPTH 200
|
771
832
|
#endif
|
772
833
|
|
@@ -781,6 +842,7 @@ int yydebug;
|
|
781
842
|
# define YYMAXDEPTH 10000
|
782
843
|
#endif
|
783
844
|
|
845
|
+
|
784
846
|
|
785
847
|
#if YYERROR_VERBOSE
|
786
848
|
|
@@ -789,8 +851,15 @@ int yydebug;
|
|
789
851
|
# define yystrlen strlen
|
790
852
|
# else
|
791
853
|
/* Return the length of YYSTR. */
|
854
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
855
|
+
|| defined __cplusplus || defined _MSC_VER)
|
792
856
|
static YYSIZE_T
|
793
857
|
yystrlen (const char *yystr)
|
858
|
+
#else
|
859
|
+
static YYSIZE_T
|
860
|
+
yystrlen (yystr)
|
861
|
+
const char *yystr;
|
862
|
+
#endif
|
794
863
|
{
|
795
864
|
YYSIZE_T yylen;
|
796
865
|
for (yylen = 0; yystr[yylen]; yylen++)
|
@@ -806,8 +875,16 @@ yystrlen (const char *yystr)
|
|
806
875
|
# else
|
807
876
|
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
|
808
877
|
YYDEST. */
|
878
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
879
|
+
|| defined __cplusplus || defined _MSC_VER)
|
809
880
|
static char *
|
810
881
|
yystpcpy (char *yydest, const char *yysrc)
|
882
|
+
#else
|
883
|
+
static char *
|
884
|
+
yystpcpy (yydest, yysrc)
|
885
|
+
char *yydest;
|
886
|
+
const char *yysrc;
|
887
|
+
#endif
|
811
888
|
{
|
812
889
|
char *yyd = yydest;
|
813
890
|
const char *yys = yysrc;
|
@@ -837,27 +914,27 @@ yytnamerr (char *yyres, const char *yystr)
|
|
837
914
|
char const *yyp = yystr;
|
838
915
|
|
839
916
|
for (;;)
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
917
|
+
switch (*++yyp)
|
918
|
+
{
|
919
|
+
case '\'':
|
920
|
+
case ',':
|
921
|
+
goto do_not_strip_quotes;
|
922
|
+
|
923
|
+
case '\\':
|
924
|
+
if (*++yyp != '\\')
|
925
|
+
goto do_not_strip_quotes;
|
926
|
+
/* Fall through. */
|
927
|
+
default:
|
928
|
+
if (yyres)
|
929
|
+
yyres[yyn] = *yyp;
|
930
|
+
yyn++;
|
931
|
+
break;
|
932
|
+
|
933
|
+
case '"':
|
934
|
+
if (yyres)
|
935
|
+
yyres[yyn] = '\0';
|
936
|
+
return yyn;
|
937
|
+
}
|
861
938
|
do_not_strip_quotes: ;
|
862
939
|
}
|
863
940
|
|
@@ -868,209 +945,211 @@ yytnamerr (char *yyres, const char *yystr)
|
|
868
945
|
}
|
869
946
|
# endif
|
870
947
|
|
871
|
-
/* Copy into
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
881
|
-
yytype_int16 *yyssp, int yytoken)
|
948
|
+
/* Copy into YYRESULT an error message about the unexpected token
|
949
|
+
YYCHAR while in state YYSTATE. Return the number of bytes copied,
|
950
|
+
including the terminating null byte. If YYRESULT is null, do not
|
951
|
+
copy anything; just return the number of bytes that would be
|
952
|
+
copied. As a special case, return 0 if an ordinary "syntax error"
|
953
|
+
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
|
954
|
+
size calculation. */
|
955
|
+
static YYSIZE_T
|
956
|
+
yysyntax_error (char *yyresult, int yystate, int yychar)
|
882
957
|
{
|
883
|
-
|
884
|
-
YYSIZE_T yysize = yysize0;
|
885
|
-
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
886
|
-
/* Internationalized format string. */
|
887
|
-
const char *yyformat = YY_NULLPTR;
|
888
|
-
/* Arguments of yyformat. */
|
889
|
-
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
890
|
-
/* Number of reported tokens (one for the "unexpected", one per
|
891
|
-
"expected"). */
|
892
|
-
int yycount = 0;
|
893
|
-
|
894
|
-
/* There are many possibilities here to consider:
|
895
|
-
- If this state is a consistent state with a default action, then
|
896
|
-
the only way this function was invoked is if the default action
|
897
|
-
is an error action. In that case, don't check for expected
|
898
|
-
tokens because there are none.
|
899
|
-
- The only way there can be no lookahead present (in yychar) is if
|
900
|
-
this state is a consistent state with a default action. Thus,
|
901
|
-
detecting the absence of a lookahead is sufficient to determine
|
902
|
-
that there is no unexpected or expected token to report. In that
|
903
|
-
case, just report a simple "syntax error".
|
904
|
-
- Don't assume there isn't a lookahead just because this state is a
|
905
|
-
consistent state with a default action. There might have been a
|
906
|
-
previous inconsistent state, consistent state with a non-default
|
907
|
-
action, or user semantic action that manipulated yychar.
|
908
|
-
- Of course, the expected token list depends on states to have
|
909
|
-
correct lookahead information, and it depends on the parser not
|
910
|
-
to perform extra reductions after fetching a lookahead from the
|
911
|
-
scanner and before detecting a syntax error. Thus, state merging
|
912
|
-
(from LALR or IELR) and default reductions corrupt the expected
|
913
|
-
token list. However, the list is correct for canonical LR with
|
914
|
-
one exception: it will still contain any token that will not be
|
915
|
-
accepted due to an error action in a later state.
|
916
|
-
*/
|
917
|
-
if (yytoken != YYEMPTY)
|
918
|
-
{
|
919
|
-
int yyn = yypact[*yyssp];
|
920
|
-
yyarg[yycount++] = yytname[yytoken];
|
921
|
-
if (!yypact_value_is_default (yyn))
|
922
|
-
{
|
923
|
-
/* Start YYX at -YYN if negative to avoid negative indexes in
|
924
|
-
YYCHECK. In other words, skip the first -YYN actions for
|
925
|
-
this state because they are default actions. */
|
926
|
-
int yyxbegin = yyn < 0 ? -yyn : 0;
|
927
|
-
/* Stay within bounds of both yycheck and yytname. */
|
928
|
-
int yychecklim = YYLAST - yyn + 1;
|
929
|
-
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
930
|
-
int yyx;
|
931
|
-
|
932
|
-
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
933
|
-
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
|
934
|
-
&& !yytable_value_is_error (yytable[yyx + yyn]))
|
935
|
-
{
|
936
|
-
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
937
|
-
{
|
938
|
-
yycount = 1;
|
939
|
-
yysize = yysize0;
|
940
|
-
break;
|
941
|
-
}
|
942
|
-
yyarg[yycount++] = yytname[yyx];
|
943
|
-
{
|
944
|
-
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
|
945
|
-
if (! (yysize <= yysize1
|
946
|
-
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
947
|
-
return 2;
|
948
|
-
yysize = yysize1;
|
949
|
-
}
|
950
|
-
}
|
951
|
-
}
|
952
|
-
}
|
958
|
+
int yyn = yypact[yystate];
|
953
959
|
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
case N: \
|
958
|
-
yyformat = S; \
|
959
|
-
break
|
960
|
-
YYCASE_(0, YY_("syntax error"));
|
961
|
-
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
962
|
-
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
963
|
-
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
964
|
-
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
965
|
-
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
966
|
-
# undef YYCASE_
|
967
|
-
}
|
968
|
-
|
969
|
-
{
|
970
|
-
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
|
971
|
-
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
972
|
-
return 2;
|
973
|
-
yysize = yysize1;
|
974
|
-
}
|
975
|
-
|
976
|
-
if (*yymsg_alloc < yysize)
|
960
|
+
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
|
961
|
+
return 0;
|
962
|
+
else
|
977
963
|
{
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
964
|
+
int yytype = YYTRANSLATE (yychar);
|
965
|
+
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
|
966
|
+
YYSIZE_T yysize = yysize0;
|
967
|
+
YYSIZE_T yysize1;
|
968
|
+
int yysize_overflow = 0;
|
969
|
+
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
970
|
+
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
971
|
+
int yyx;
|
972
|
+
|
973
|
+
# if 0
|
974
|
+
/* This is so xgettext sees the translatable formats that are
|
975
|
+
constructed on the fly. */
|
976
|
+
YY_("syntax error, unexpected %s");
|
977
|
+
YY_("syntax error, unexpected %s, expecting %s");
|
978
|
+
YY_("syntax error, unexpected %s, expecting %s or %s");
|
979
|
+
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
|
980
|
+
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
|
981
|
+
# endif
|
982
|
+
char *yyfmt;
|
983
|
+
char const *yyf;
|
984
|
+
static char const yyunexpected[] = "syntax error, unexpected %s";
|
985
|
+
static char const yyexpecting[] = ", expecting %s";
|
986
|
+
static char const yyor[] = " or %s";
|
987
|
+
char yyformat[sizeof yyunexpected
|
988
|
+
+ sizeof yyexpecting - 1
|
989
|
+
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
990
|
+
* (sizeof yyor - 1))];
|
991
|
+
char const *yyprefix = yyexpecting;
|
992
|
+
|
993
|
+
/* Start YYX at -YYN if negative to avoid negative indexes in
|
994
|
+
YYCHECK. */
|
995
|
+
int yyxbegin = yyn < 0 ? -yyn : 0;
|
996
|
+
|
997
|
+
/* Stay within bounds of both yycheck and yytname. */
|
998
|
+
int yychecklim = YYLAST - yyn + 1;
|
999
|
+
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
1000
|
+
int yycount = 1;
|
1001
|
+
|
1002
|
+
yyarg[0] = yytname[yytype];
|
1003
|
+
yyfmt = yystpcpy (yyformat, yyunexpected);
|
1004
|
+
|
1005
|
+
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
1006
|
+
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
1007
|
+
{
|
1008
|
+
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
1009
|
+
{
|
1010
|
+
yycount = 1;
|
1011
|
+
yysize = yysize0;
|
1012
|
+
yyformat[sizeof yyunexpected - 1] = '\0';
|
1013
|
+
break;
|
1014
|
+
}
|
1015
|
+
yyarg[yycount++] = yytname[yyx];
|
1016
|
+
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
1017
|
+
yysize_overflow |= (yysize1 < yysize);
|
1018
|
+
yysize = yysize1;
|
1019
|
+
yyfmt = yystpcpy (yyfmt, yyprefix);
|
1020
|
+
yyprefix = yyor;
|
1021
|
+
}
|
1022
|
+
|
1023
|
+
yyf = YY_(yyformat);
|
1024
|
+
yysize1 = yysize + yystrlen (yyf);
|
1025
|
+
yysize_overflow |= (yysize1 < yysize);
|
1026
|
+
yysize = yysize1;
|
1027
|
+
|
1028
|
+
if (yysize_overflow)
|
1029
|
+
return YYSIZE_MAXIMUM;
|
1030
|
+
|
1031
|
+
if (yyresult)
|
1032
|
+
{
|
1033
|
+
/* Avoid sprintf, as that infringes on the user's name space.
|
1034
|
+
Don't have undefined behavior even if the translation
|
1035
|
+
produced a string with the wrong number of "%s"s. */
|
1036
|
+
char *yyp = yyresult;
|
1037
|
+
int yyi = 0;
|
1038
|
+
while ((*yyp = *yyf) != '\0')
|
1039
|
+
{
|
1040
|
+
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
1041
|
+
{
|
1042
|
+
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
1043
|
+
yyf += 2;
|
1044
|
+
}
|
1045
|
+
else
|
1046
|
+
{
|
1047
|
+
yyp++;
|
1048
|
+
yyf++;
|
1049
|
+
}
|
1050
|
+
}
|
1051
|
+
}
|
1052
|
+
return yysize;
|
983
1053
|
}
|
984
|
-
|
985
|
-
/* Avoid sprintf, as that infringes on the user's name space.
|
986
|
-
Don't have undefined behavior even if the translation
|
987
|
-
produced a string with the wrong number of "%s"s. */
|
988
|
-
{
|
989
|
-
char *yyp = *yymsg;
|
990
|
-
int yyi = 0;
|
991
|
-
while ((*yyp = *yyformat) != '\0')
|
992
|
-
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
|
993
|
-
{
|
994
|
-
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
995
|
-
yyformat += 2;
|
996
|
-
}
|
997
|
-
else
|
998
|
-
{
|
999
|
-
yyp++;
|
1000
|
-
yyformat++;
|
1001
|
-
}
|
1002
|
-
}
|
1003
|
-
return 0;
|
1004
1054
|
}
|
1005
1055
|
#endif /* YYERROR_VERBOSE */
|
1056
|
+
|
1006
1057
|
|
1007
1058
|
/*-----------------------------------------------.
|
1008
1059
|
| Release the memory associated to this symbol. |
|
1009
1060
|
`-----------------------------------------------*/
|
1010
1061
|
|
1062
|
+
/*ARGSUSED*/
|
1063
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
1064
|
+
|| defined __cplusplus || defined _MSC_VER)
|
1011
1065
|
static void
|
1012
1066
|
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
|
1067
|
+
#else
|
1068
|
+
static void
|
1069
|
+
yydestruct (yymsg, yytype, yyvaluep)
|
1070
|
+
const char *yymsg;
|
1071
|
+
int yytype;
|
1072
|
+
YYSTYPE *yyvaluep;
|
1073
|
+
#endif
|
1013
1074
|
{
|
1014
1075
|
YYUSE (yyvaluep);
|
1076
|
+
|
1015
1077
|
if (!yymsg)
|
1016
1078
|
yymsg = "Deleting";
|
1017
1079
|
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
1018
1080
|
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1081
|
+
switch (yytype)
|
1082
|
+
{
|
1083
|
+
|
1084
|
+
default:
|
1085
|
+
break;
|
1086
|
+
}
|
1022
1087
|
}
|
1088
|
+
|
1023
1089
|
|
1090
|
+
/* Prevent warnings from -Wmissing-prototypes. */
|
1024
1091
|
|
1092
|
+
#ifdef YYPARSE_PARAM
|
1093
|
+
#if defined __STDC__ || defined __cplusplus
|
1094
|
+
int yyparse (void *YYPARSE_PARAM);
|
1095
|
+
#else
|
1096
|
+
int yyparse ();
|
1097
|
+
#endif
|
1098
|
+
#else /* ! YYPARSE_PARAM */
|
1099
|
+
#if defined __STDC__ || defined __cplusplus
|
1100
|
+
int yyparse (void);
|
1101
|
+
#else
|
1102
|
+
int yyparse ();
|
1103
|
+
#endif
|
1104
|
+
#endif /* ! YYPARSE_PARAM */
|
1025
1105
|
|
1026
1106
|
|
1027
|
-
|
1107
|
+
|
1108
|
+
/* The look-ahead symbol. */
|
1028
1109
|
int yychar;
|
1029
1110
|
|
1030
|
-
/* The semantic value of the
|
1111
|
+
/* The semantic value of the look-ahead symbol. */
|
1031
1112
|
YYSTYPE yylval;
|
1113
|
+
|
1032
1114
|
/* Number of syntax errors so far. */
|
1033
1115
|
int yynerrs;
|
1034
1116
|
|
1035
1117
|
|
1118
|
+
|
1036
1119
|
/*----------.
|
1037
1120
|
| yyparse. |
|
1038
1121
|
`----------*/
|
1039
1122
|
|
1123
|
+
#ifdef YYPARSE_PARAM
|
1124
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
1125
|
+
|| defined __cplusplus || defined _MSC_VER)
|
1126
|
+
int
|
1127
|
+
yyparse (void *YYPARSE_PARAM)
|
1128
|
+
#else
|
1129
|
+
int
|
1130
|
+
yyparse (YYPARSE_PARAM)
|
1131
|
+
void *YYPARSE_PARAM;
|
1132
|
+
#endif
|
1133
|
+
#else /* ! YYPARSE_PARAM */
|
1134
|
+
#if (defined __STDC__ || defined __C99__FUNC__ \
|
1135
|
+
|| defined __cplusplus || defined _MSC_VER)
|
1040
1136
|
int
|
1041
1137
|
yyparse (void)
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
int yyerrstatus;
|
1046
|
-
|
1047
|
-
/* The stacks and their tools:
|
1048
|
-
'yyss': related to states.
|
1049
|
-
'yyvs': related to semantic values.
|
1050
|
-
|
1051
|
-
Refer to the stacks through separate pointers, to allow yyoverflow
|
1052
|
-
to reallocate them elsewhere. */
|
1053
|
-
|
1054
|
-
/* The state stack. */
|
1055
|
-
yytype_int16 yyssa[YYINITDEPTH];
|
1056
|
-
yytype_int16 *yyss;
|
1057
|
-
yytype_int16 *yyssp;
|
1058
|
-
|
1059
|
-
/* The semantic value stack. */
|
1060
|
-
YYSTYPE yyvsa[YYINITDEPTH];
|
1061
|
-
YYSTYPE *yyvs;
|
1062
|
-
YYSTYPE *yyvsp;
|
1063
|
-
|
1064
|
-
YYSIZE_T yystacksize;
|
1138
|
+
#else
|
1139
|
+
int
|
1140
|
+
yyparse ()
|
1065
1141
|
|
1142
|
+
#endif
|
1143
|
+
#endif
|
1144
|
+
{
|
1145
|
+
|
1146
|
+
int yystate;
|
1066
1147
|
int yyn;
|
1067
1148
|
int yyresult;
|
1068
|
-
/*
|
1149
|
+
/* Number of tokens to shift before error messages enabled. */
|
1150
|
+
int yyerrstatus;
|
1151
|
+
/* Look-ahead token as an internal (translated) token number. */
|
1069
1152
|
int yytoken = 0;
|
1070
|
-
/* The variables used to return semantic value and location from the
|
1071
|
-
action routines. */
|
1072
|
-
YYSTYPE yyval;
|
1073
|
-
|
1074
1153
|
#if YYERROR_VERBOSE
|
1075
1154
|
/* Buffer for error messages, and its allocated size. */
|
1076
1155
|
char yymsgbuf[128];
|
@@ -1078,22 +1157,54 @@ yyparse (void)
|
|
1078
1157
|
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
|
1079
1158
|
#endif
|
1080
1159
|
|
1160
|
+
/* Three stacks and their tools:
|
1161
|
+
`yyss': related to states,
|
1162
|
+
`yyvs': related to semantic values,
|
1163
|
+
`yyls': related to locations.
|
1164
|
+
|
1165
|
+
Refer to the stacks thru separate pointers, to allow yyoverflow
|
1166
|
+
to reallocate them elsewhere. */
|
1167
|
+
|
1168
|
+
/* The state stack. */
|
1169
|
+
yytype_int16 yyssa[YYINITDEPTH];
|
1170
|
+
yytype_int16 *yyss = yyssa;
|
1171
|
+
yytype_int16 *yyssp;
|
1172
|
+
|
1173
|
+
/* The semantic value stack. */
|
1174
|
+
YYSTYPE yyvsa[YYINITDEPTH];
|
1175
|
+
YYSTYPE *yyvs = yyvsa;
|
1176
|
+
YYSTYPE *yyvsp;
|
1177
|
+
|
1178
|
+
|
1179
|
+
|
1081
1180
|
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
|
1082
1181
|
|
1182
|
+
YYSIZE_T yystacksize = YYINITDEPTH;
|
1183
|
+
|
1184
|
+
/* The variables used to return semantic value and location from the
|
1185
|
+
action routines. */
|
1186
|
+
YYSTYPE yyval;
|
1187
|
+
|
1188
|
+
|
1083
1189
|
/* The number of symbols on the RHS of the reduced rule.
|
1084
1190
|
Keep to zero when no symbol should be popped. */
|
1085
1191
|
int yylen = 0;
|
1086
1192
|
|
1087
|
-
yyssp = yyss = yyssa;
|
1088
|
-
yyvsp = yyvs = yyvsa;
|
1089
|
-
yystacksize = YYINITDEPTH;
|
1090
|
-
|
1091
1193
|
YYDPRINTF ((stderr, "Starting parse\n"));
|
1092
1194
|
|
1093
1195
|
yystate = 0;
|
1094
1196
|
yyerrstatus = 0;
|
1095
1197
|
yynerrs = 0;
|
1096
|
-
yychar = YYEMPTY;
|
1198
|
+
yychar = YYEMPTY; /* Cause a token to be read. */
|
1199
|
+
|
1200
|
+
/* Initialize stack pointers.
|
1201
|
+
Waste one element of value and location stack
|
1202
|
+
so that they stay on the same level as the state stack.
|
1203
|
+
The wasted elements are never initialized. */
|
1204
|
+
|
1205
|
+
yyssp = yyss;
|
1206
|
+
yyvsp = yyvs;
|
1207
|
+
|
1097
1208
|
goto yysetstate;
|
1098
1209
|
|
1099
1210
|
/*------------------------------------------------------------.
|
@@ -1114,23 +1225,25 @@ yyparse (void)
|
|
1114
1225
|
|
1115
1226
|
#ifdef yyoverflow
|
1116
1227
|
{
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1228
|
+
/* Give user a chance to reallocate the stack. Use copies of
|
1229
|
+
these so that the &'s don't force the real ones into
|
1230
|
+
memory. */
|
1231
|
+
YYSTYPE *yyvs1 = yyvs;
|
1232
|
+
yytype_int16 *yyss1 = yyss;
|
1233
|
+
|
1234
|
+
|
1235
|
+
/* Each stack pointer address is followed by the size of the
|
1236
|
+
data in use in that stack, in bytes. This used to be a
|
1237
|
+
conditional around just the two extra args, but that might
|
1238
|
+
be undefined if yyoverflow is a macro. */
|
1239
|
+
yyoverflow (YY_("memory exhausted"),
|
1240
|
+
&yyss1, yysize * sizeof (*yyssp),
|
1241
|
+
&yyvs1, yysize * sizeof (*yyvsp),
|
1242
|
+
|
1243
|
+
&yystacksize);
|
1244
|
+
|
1245
|
+
yyss = yyss1;
|
1246
|
+
yyvs = yyvs1;
|
1134
1247
|
}
|
1135
1248
|
#else /* no yyoverflow */
|
1136
1249
|
# ifndef YYSTACK_RELOCATE
|
@@ -1138,22 +1251,23 @@ yyparse (void)
|
|
1138
1251
|
# else
|
1139
1252
|
/* Extend the stack our own way. */
|
1140
1253
|
if (YYMAXDEPTH <= yystacksize)
|
1141
|
-
|
1254
|
+
goto yyexhaustedlab;
|
1142
1255
|
yystacksize *= 2;
|
1143
1256
|
if (YYMAXDEPTH < yystacksize)
|
1144
|
-
|
1257
|
+
yystacksize = YYMAXDEPTH;
|
1145
1258
|
|
1146
1259
|
{
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1260
|
+
yytype_int16 *yyss1 = yyss;
|
1261
|
+
union yyalloc *yyptr =
|
1262
|
+
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
1263
|
+
if (! yyptr)
|
1264
|
+
goto yyexhaustedlab;
|
1265
|
+
YYSTACK_RELOCATE (yyss);
|
1266
|
+
YYSTACK_RELOCATE (yyvs);
|
1267
|
+
|
1154
1268
|
# undef YYSTACK_RELOCATE
|
1155
|
-
|
1156
|
-
|
1269
|
+
if (yyss1 != yyssa)
|
1270
|
+
YYSTACK_FREE (yyss1);
|
1157
1271
|
}
|
1158
1272
|
# endif
|
1159
1273
|
#endif /* no yyoverflow */
|
@@ -1161,18 +1275,16 @@ yyparse (void)
|
|
1161
1275
|
yyssp = yyss + yysize - 1;
|
1162
1276
|
yyvsp = yyvs + yysize - 1;
|
1163
1277
|
|
1278
|
+
|
1164
1279
|
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
1165
|
-
|
1280
|
+
(unsigned long int) yystacksize));
|
1166
1281
|
|
1167
1282
|
if (yyss + yystacksize - 1 <= yyssp)
|
1168
|
-
|
1283
|
+
YYABORT;
|
1169
1284
|
}
|
1170
1285
|
|
1171
1286
|
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
1172
1287
|
|
1173
|
-
if (yystate == YYFINAL)
|
1174
|
-
YYACCEPT;
|
1175
|
-
|
1176
1288
|
goto yybackup;
|
1177
1289
|
|
1178
1290
|
/*-----------.
|
@@ -1181,20 +1293,20 @@ yyparse (void)
|
|
1181
1293
|
yybackup:
|
1182
1294
|
|
1183
1295
|
/* Do appropriate processing given the current state. Read a
|
1184
|
-
|
1296
|
+
look-ahead token if we need one and don't already have one. */
|
1185
1297
|
|
1186
|
-
/* First try to decide what to do without reference to
|
1298
|
+
/* First try to decide what to do without reference to look-ahead token. */
|
1187
1299
|
yyn = yypact[yystate];
|
1188
|
-
if (
|
1300
|
+
if (yyn == YYPACT_NINF)
|
1189
1301
|
goto yydefault;
|
1190
1302
|
|
1191
|
-
/* Not known => get a
|
1303
|
+
/* Not known => get a look-ahead token if don't already have one. */
|
1192
1304
|
|
1193
|
-
/* YYCHAR is either YYEMPTY or YYEOF or a valid
|
1305
|
+
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
|
1194
1306
|
if (yychar == YYEMPTY)
|
1195
1307
|
{
|
1196
1308
|
YYDPRINTF ((stderr, "Reading a token: "));
|
1197
|
-
yychar =
|
1309
|
+
yychar = YYLEX;
|
1198
1310
|
}
|
1199
1311
|
|
1200
1312
|
if (yychar <= YYEOF)
|
@@ -1216,27 +1328,29 @@ yybackup:
|
|
1216
1328
|
yyn = yytable[yyn];
|
1217
1329
|
if (yyn <= 0)
|
1218
1330
|
{
|
1219
|
-
if (
|
1220
|
-
|
1331
|
+
if (yyn == 0 || yyn == YYTABLE_NINF)
|
1332
|
+
goto yyerrlab;
|
1221
1333
|
yyn = -yyn;
|
1222
1334
|
goto yyreduce;
|
1223
1335
|
}
|
1224
1336
|
|
1337
|
+
if (yyn == YYFINAL)
|
1338
|
+
YYACCEPT;
|
1339
|
+
|
1225
1340
|
/* Count tokens shifted since error; after three, turn off error
|
1226
1341
|
status. */
|
1227
1342
|
if (yyerrstatus)
|
1228
1343
|
yyerrstatus--;
|
1229
1344
|
|
1230
|
-
/* Shift the
|
1345
|
+
/* Shift the look-ahead token. */
|
1231
1346
|
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
|
1232
1347
|
|
1233
|
-
/* Discard the shifted token. */
|
1234
|
-
yychar
|
1348
|
+
/* Discard the shifted token unless it is eof. */
|
1349
|
+
if (yychar != YYEOF)
|
1350
|
+
yychar = YYEMPTY;
|
1235
1351
|
|
1236
1352
|
yystate = yyn;
|
1237
|
-
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
1238
1353
|
*++yyvsp = yylval;
|
1239
|
-
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
1240
1354
|
|
1241
1355
|
goto yynewstate;
|
1242
1356
|
|
@@ -1259,7 +1373,7 @@ yyreduce:
|
|
1259
1373
|
yylen = yyr2[yyn];
|
1260
1374
|
|
1261
1375
|
/* If YYLEN is nonzero, implement the default value of the action:
|
1262
|
-
|
1376
|
+
`$$ = $1'.
|
1263
1377
|
|
1264
1378
|
Otherwise, the following line sets YYVAL to garbage.
|
1265
1379
|
This behavior is undocumented and Bison
|
@@ -1273,35 +1387,33 @@ yyreduce:
|
|
1273
1387
|
switch (yyn)
|
1274
1388
|
{
|
1275
1389
|
case 2:
|
1276
|
-
#line 54 "conventions.y"
|
1390
|
+
#line 54 "conventions.y"
|
1277
1391
|
{
|
1278
|
-
if( asnc_ht_lookup(Ruleset, (yyvsp[
|
1392
|
+
if( asnc_ht_lookup(Ruleset, (yyvsp[(2) - (2)].asnc)) ) {
|
1279
1393
|
printf("%s:%d warning: we've already got one asn '%d'\n",
|
1280
|
-
currentfilename(), linenum, (yyvsp[
|
1394
|
+
currentfilename(), linenum, (yyvsp[(2) - (2)].asnc)->asn);
|
1281
1395
|
print_stack_trace();
|
1282
1396
|
}
|
1283
|
-
asnc_ht_insert(Ruleset, (yyvsp[
|
1397
|
+
asnc_ht_insert(Ruleset, (yyvsp[(2) - (2)].asnc));
|
1284
1398
|
}
|
1285
|
-
#line 1286 "conventions.c" /* yacc.c:1646 */
|
1286
1399
|
break;
|
1287
1400
|
|
1288
1401
|
case 3:
|
1289
|
-
#line 62 "conventions.y"
|
1402
|
+
#line 62 "conventions.y"
|
1290
1403
|
{
|
1291
1404
|
Ruleset = asnc_ht_new(20,
|
1292
1405
|
(asnc_hash_fn)hash_int,
|
1293
1406
|
(asnc_iseq_fn)isequal_int, NULL);
|
1294
1407
|
}
|
1295
|
-
#line 1296 "conventions.c" /* yacc.c:1646 */
|
1296
1408
|
break;
|
1297
1409
|
|
1298
1410
|
case 4:
|
1299
|
-
#line 68 "conventions.y"
|
1411
|
+
#line 68 "conventions.y"
|
1300
1412
|
{
|
1301
1413
|
(yyval.asnc) = malloc(sizeof(struct asnc));
|
1302
|
-
(yyval.asnc)->asn = (yyvsp[-
|
1414
|
+
(yyval.asnc)->asn = (yyvsp[(1) - (4)].in);
|
1303
1415
|
(yyval.asnc)->prefilter_regex = NULL;
|
1304
|
-
(yyval.asnc)->conventions = (yyvsp[-
|
1416
|
+
(yyval.asnc)->conventions = (yyvsp[(3) - (4)].cq);
|
1305
1417
|
set_file_and_line(&(yyval.asnc)->inst, currentfilename(), linenum);
|
1306
1418
|
conv_q_iterate_nonconst( (yyval.asnc)->conventions, set_asn, (void *)(yyval.asnc)->asn );
|
1307
1419
|
if(want_debug && conv_q_length( (yyval.asnc)->conventions) > 2) {
|
@@ -1309,16 +1421,15 @@ yyreduce:
|
|
1309
1421
|
(yyval.asnc)->asn, conv_q_length( (yyval.asnc)->conventions));
|
1310
1422
|
}
|
1311
1423
|
}
|
1312
|
-
#line 1313 "conventions.c" /* yacc.c:1646 */
|
1313
1424
|
break;
|
1314
1425
|
|
1315
1426
|
case 5:
|
1316
|
-
#line 79 "conventions.y"
|
1427
|
+
#line 79 "conventions.y"
|
1317
1428
|
{
|
1318
1429
|
(yyval.asnc) = malloc(sizeof(struct asnc));
|
1319
1430
|
memset((yyval.asnc), 0, sizeof(struct asnc));
|
1320
|
-
(yyval.asnc)->asn = (yyvsp[-
|
1321
|
-
(yyval.asnc)->prefilter_regex = (yyvsp[-
|
1431
|
+
(yyval.asnc)->asn = (yyvsp[(1) - (5)].in);
|
1432
|
+
(yyval.asnc)->prefilter_regex = (yyvsp[(2) - (5)].cp);
|
1322
1433
|
set_file_and_line(&(yyval.asnc)->inst, currentfilename(), linenum);
|
1323
1434
|
|
1324
1435
|
/* posix egrep interprets intervals (eg. {1,32}) nicely */
|
@@ -1326,277 +1437,245 @@ yyreduce:
|
|
1326
1437
|
re_syntax_options = RE_SYNTAX_POSIX_EGREP;
|
1327
1438
|
{
|
1328
1439
|
const char *errstr =
|
1329
|
-
re_compile_pattern((yyvsp[-
|
1440
|
+
re_compile_pattern((yyvsp[(2) - (5)].cp), strlen((yyvsp[(2) - (5)].cp)), &((yyval.asnc)->prefilter_rpbuf));
|
1330
1441
|
if (errstr != NULL) {
|
1331
1442
|
fprintf(stderr, "error in compiling regular expression '%s': %s\n",
|
1332
|
-
(yyvsp[-
|
1443
|
+
(yyvsp[(2) - (5)].cp), errstr);
|
1333
1444
|
fprintf(stderr, "proceeding without it; error in compiling regular expression '%s': %s\n",
|
1334
|
-
(yyvsp[-
|
1445
|
+
(yyvsp[(2) - (5)].cp), errstr);
|
1335
1446
|
}
|
1336
1447
|
}
|
1337
1448
|
#else
|
1338
1449
|
{
|
1339
|
-
int error = regcomp(&((yyval.asnc)->prefilter_rpbuf), (yyvsp[-
|
1450
|
+
int error = regcomp(&((yyval.asnc)->prefilter_rpbuf), (yyvsp[(2) - (5)].cp), REG_EXTENDED);
|
1340
1451
|
if(error) {
|
1341
1452
|
char *err = malloc(256);
|
1342
1453
|
err[255]='\0';
|
1343
1454
|
regerror(error, &((yyval.asnc)->prefilter_rpbuf), err, 255);
|
1344
1455
|
fprintf(stderr, "error in compiling regular expression '%s': %s\n",
|
1345
|
-
(yyvsp[-
|
1456
|
+
(yyvsp[(2) - (5)].cp), err);
|
1346
1457
|
fprintf(stderr, "proceeding without it; error in compiling regular expression '%s': %s\n",
|
1347
|
-
(yyvsp[-
|
1458
|
+
(yyvsp[(2) - (5)].cp), err);
|
1348
1459
|
free(err); /* why not. */
|
1349
1460
|
}
|
1350
1461
|
}
|
1351
1462
|
#endif
|
1352
1463
|
|
1353
|
-
(yyval.asnc)->conventions = (yyvsp[-
|
1464
|
+
(yyval.asnc)->conventions = (yyvsp[(4) - (5)].cq);
|
1354
1465
|
conv_q_iterate_nonconst( (yyval.asnc)->conventions, set_asn, (void *)(yyval.asnc)->asn );
|
1355
1466
|
}
|
1356
|
-
#line 1357 "conventions.c" /* yacc.c:1646 */
|
1357
1467
|
break;
|
1358
1468
|
|
1359
1469
|
case 6:
|
1360
|
-
#line 119 "conventions.y"
|
1470
|
+
#line 119 "conventions.y"
|
1361
1471
|
{ /* this is an ordered list */
|
1362
|
-
(yyval.cq) = (yyvsp[-
|
1363
|
-
conv_q_append((yyvsp[-
|
1472
|
+
(yyval.cq) = (yyvsp[(1) - (2)].cq);
|
1473
|
+
conv_q_append((yyvsp[(1) - (2)].cq), (yyvsp[(2) - (2)].conv));
|
1364
1474
|
}
|
1365
|
-
#line 1366 "conventions.c" /* yacc.c:1646 */
|
1366
1475
|
break;
|
1367
1476
|
|
1368
1477
|
case 7:
|
1369
|
-
#line 122 "conventions.y"
|
1478
|
+
#line 122 "conventions.y"
|
1370
1479
|
{
|
1371
1480
|
(yyval.cq) = conv_q_new(NULL, NULL);
|
1372
1481
|
}
|
1373
|
-
#line 1374 "conventions.c" /* yacc.c:1646 */
|
1374
1482
|
break;
|
1375
1483
|
|
1376
1484
|
case 8:
|
1377
|
-
#line 126 "conventions.y"
|
1485
|
+
#line 126 "conventions.y"
|
1378
1486
|
{
|
1379
|
-
(yyval.conv) = new_convention((yyvsp[-
|
1487
|
+
(yyval.conv) = new_convention((yyvsp[(1) - (3)].cp), (yyvsp[(2) - (3)].kvb), NULL, NULL, NULL, currentfilename(), linenum);
|
1380
1488
|
}
|
1381
|
-
#line 1382 "conventions.c" /* yacc.c:1646 */
|
1382
1489
|
break;
|
1383
1490
|
|
1384
1491
|
case 9:
|
1385
|
-
#line 128 "conventions.y"
|
1492
|
+
#line 128 "conventions.y"
|
1386
1493
|
{
|
1387
|
-
(yyval.conv) = new_convention((yyvsp[-
|
1494
|
+
(yyval.conv) = new_convention((yyvsp[(1) - (4)].cp), (yyvsp[(2) - (4)].kvb), (yyvsp[(3) - (4)].kvb), NULL, NULL, currentfilename(), linenum);
|
1388
1495
|
}
|
1389
|
-
#line 1390 "conventions.c" /* yacc.c:1646 */
|
1390
1496
|
break;
|
1391
1497
|
|
1392
1498
|
case 10:
|
1393
|
-
#line 130 "conventions.y"
|
1499
|
+
#line 130 "conventions.y"
|
1394
1500
|
{
|
1395
|
-
(yyval.conv) = new_convention((yyvsp[-
|
1501
|
+
(yyval.conv) = new_convention((yyvsp[(1) - (5)].cp), (yyvsp[(2) - (5)].kvb), (yyvsp[(3) - (5)].kvb), (yyvsp[(4) - (5)].kvb), NULL, currentfilename(), linenum);
|
1396
1502
|
}
|
1397
|
-
#line 1398 "conventions.c" /* yacc.c:1646 */
|
1398
1503
|
break;
|
1399
1504
|
|
1400
1505
|
case 11:
|
1401
|
-
#line 132 "conventions.y"
|
1506
|
+
#line 132 "conventions.y"
|
1402
1507
|
{
|
1403
|
-
(yyval.conv) = new_convention((yyvsp[-
|
1508
|
+
(yyval.conv) = new_convention((yyvsp[(1) - (6)].cp), (yyvsp[(2) - (6)].kvb), (yyvsp[(3) - (6)].kvb), (yyvsp[(4) - (6)].kvb), (yyvsp[(5) - (6)].kvb), currentfilename(), linenum);
|
1404
1509
|
}
|
1405
|
-
#line 1406 "conventions.c" /* yacc.c:1646 */
|
1406
1510
|
break;
|
1407
1511
|
|
1408
1512
|
case 12:
|
1409
|
-
#line 134 "conventions.y"
|
1513
|
+
#line 134 "conventions.y"
|
1410
1514
|
{
|
1411
|
-
(yyval.conv) = new_convention((yyvsp[-
|
1515
|
+
(yyval.conv) = new_convention((yyvsp[(1) - (2)].cp), NULL, NULL, NULL, NULL, currentfilename(), linenum);
|
1412
1516
|
}
|
1413
|
-
#line 1414 "conventions.c" /* yacc.c:1646 */
|
1414
1517
|
break;
|
1415
1518
|
|
1416
1519
|
case 13:
|
1417
|
-
#line 136 "conventions.y"
|
1520
|
+
#line 136 "conventions.y"
|
1418
1521
|
{
|
1419
1522
|
printf("%s:%d parse error in rule, expected ';'\n",
|
1420
1523
|
currentfilename(), linenum);
|
1421
1524
|
print_stack_trace();
|
1422
|
-
(yyval.conv) = new_convention((yyvsp[-
|
1525
|
+
(yyval.conv) = new_convention((yyvsp[(1) - (4)].cp), (yyvsp[(2) - (4)].kvb), (yyvsp[(3) - (4)].kvb), NULL, NULL, currentfilename(), linenum);
|
1423
1526
|
}
|
1424
|
-
#line 1425 "conventions.c" /* yacc.c:1646 */
|
1425
1527
|
break;
|
1426
1528
|
|
1427
1529
|
case 14:
|
1428
|
-
#line 141 "conventions.y"
|
1530
|
+
#line 141 "conventions.y"
|
1429
1531
|
{
|
1430
1532
|
printf("%s:%d parse error in rule, expected ';'\n",
|
1431
1533
|
currentfilename(), linenum);
|
1432
1534
|
print_stack_trace();
|
1433
|
-
(yyval.conv) = new_convention((yyvsp[-
|
1535
|
+
(yyval.conv) = new_convention((yyvsp[(1) - (3)].cp), (yyvsp[(2) - (3)].kvb), NULL, NULL, NULL, currentfilename(), linenum);
|
1434
1536
|
}
|
1435
|
-
#line 1436 "conventions.c" /* yacc.c:1646 */
|
1436
1537
|
break;
|
1437
1538
|
|
1438
1539
|
case 15:
|
1439
|
-
#line 146 "conventions.y"
|
1540
|
+
#line 146 "conventions.y"
|
1440
1541
|
{
|
1441
1542
|
printf("%s:%d parse error after regex '%s'\n",
|
1442
|
-
currentfilename(), linenum, (yyvsp[-
|
1543
|
+
currentfilename(), linenum, (yyvsp[(1) - (2)].cp));
|
1443
1544
|
print_stack_trace();
|
1444
|
-
(yyval.conv) = new_convention((yyvsp[-
|
1545
|
+
(yyval.conv) = new_convention((yyvsp[(1) - (2)].cp), NULL, NULL, NULL, NULL, currentfilename(), linenum);
|
1445
1546
|
}
|
1446
|
-
#line 1447 "conventions.c" /* yacc.c:1646 */
|
1447
1547
|
break;
|
1448
1548
|
|
1449
1549
|
case 16:
|
1450
|
-
#line 153 "conventions.y"
|
1550
|
+
#line 153 "conventions.y"
|
1451
1551
|
{
|
1452
|
-
(yyval.kvb) = new_key_decl((yyvsp[-
|
1552
|
+
(yyval.kvb) = new_key_decl((yyvsp[(1) - (6)].cp), (yyvsp[(3) - (6)].in), FALSE, (yyvsp[(5) - (6)].dict));
|
1453
1553
|
set_file_and_line(&(yyval.kvb)->inst, currentfilename(), linenum);
|
1454
1554
|
}
|
1455
|
-
#line 1456 "conventions.c" /* yacc.c:1646 */
|
1456
1555
|
break;
|
1457
1556
|
|
1458
1557
|
case 17:
|
1459
|
-
#line 156 "conventions.y"
|
1558
|
+
#line 156 "conventions.y"
|
1460
1559
|
{
|
1461
|
-
(yyval.kvb) = new_key_decl((yyvsp[-
|
1560
|
+
(yyval.kvb) = new_key_decl((yyvsp[(1) - (7)].cp), (yyvsp[(4) - (7)].in), TRUE, (yyvsp[(6) - (7)].dict));
|
1462
1561
|
if((yyval.kvb) == NULL) {
|
1463
1562
|
printf("%s:%d bad type declaration '%s = %d'\n",
|
1464
|
-
currentfilename(), linenum, (yyvsp[-
|
1563
|
+
currentfilename(), linenum, (yyvsp[(1) - (7)].cp), (yyvsp[(4) - (7)].in));
|
1465
1564
|
} else {
|
1466
1565
|
set_file_and_line(&(yyval.kvb)->inst, currentfilename(), linenum);
|
1467
1566
|
}
|
1468
1567
|
}
|
1469
|
-
#line 1470 "conventions.c" /* yacc.c:1646 */
|
1470
1568
|
break;
|
1471
1569
|
|
1472
1570
|
case 18:
|
1473
|
-
#line 164 "conventions.y"
|
1571
|
+
#line 164 "conventions.y"
|
1474
1572
|
{
|
1475
|
-
(yyval.kvb) = new_key_decl_const((yyvsp[-
|
1573
|
+
(yyval.kvb) = new_key_decl_const((yyvsp[(1) - (3)].cp), (yyvsp[(3) - (3)].cp));
|
1476
1574
|
if((yyval.kvb) == NULL) {
|
1477
1575
|
printf("%s:%d bad type declaration '%s = %s'\n",
|
1478
|
-
currentfilename(), linenum, (yyvsp[-
|
1576
|
+
currentfilename(), linenum, (yyvsp[(1) - (3)].cp), (yyvsp[(3) - (3)].cp));
|
1479
1577
|
} else {
|
1480
1578
|
set_file_and_line(&(yyval.kvb)->inst, currentfilename(), linenum);
|
1481
1579
|
}
|
1482
1580
|
}
|
1483
|
-
#line 1484 "conventions.c" /* yacc.c:1646 */
|
1484
1581
|
break;
|
1485
1582
|
|
1486
1583
|
case 19:
|
1487
|
-
#line 172 "conventions.y"
|
1584
|
+
#line 172 "conventions.y"
|
1488
1585
|
{
|
1489
1586
|
printf("%s:%d parse error after '%s = %d {' (expecting binding table)\n",
|
1490
|
-
currentfilename(), linenum, (yyvsp[-
|
1587
|
+
currentfilename(), linenum, (yyvsp[(1) - (5)].cp), (yyvsp[(3) - (5)].in));
|
1491
1588
|
print_stack_trace();
|
1492
1589
|
}
|
1493
|
-
#line 1494 "conventions.c" /* yacc.c:1646 */
|
1494
1590
|
break;
|
1495
1591
|
|
1496
1592
|
case 20:
|
1497
|
-
#line 176 "conventions.y"
|
1593
|
+
#line 176 "conventions.y"
|
1498
1594
|
{
|
1499
1595
|
printf("%s:%d parse error after '%s = quid' (expecting ';')\n",
|
1500
|
-
currentfilename(), linenum, (yyvsp[-
|
1596
|
+
currentfilename(), linenum, (yyvsp[(1) - (4)].cp));
|
1501
1597
|
print_stack_trace();
|
1502
1598
|
}
|
1503
|
-
#line 1504 "conventions.c" /* yacc.c:1646 */
|
1504
1599
|
break;
|
1505
1600
|
|
1506
1601
|
case 21:
|
1507
|
-
#line 180 "conventions.y"
|
1602
|
+
#line 180 "conventions.y"
|
1508
1603
|
{
|
1509
1604
|
printf("%s:%d parse error after '%s =' (expecting '{' or quid.)\n",
|
1510
|
-
currentfilename(), linenum, (yyvsp[-
|
1605
|
+
currentfilename(), linenum, (yyvsp[(1) - (3)].cp));
|
1511
1606
|
print_stack_trace();
|
1512
1607
|
}
|
1513
|
-
#line 1514 "conventions.c" /* yacc.c:1646 */
|
1514
1608
|
break;
|
1515
1609
|
|
1516
1610
|
case 22:
|
1517
|
-
#line 184 "conventions.y"
|
1611
|
+
#line 184 "conventions.y"
|
1518
1612
|
{
|
1519
1613
|
printf("%s:%d parse error after id '%s'\n",
|
1520
|
-
currentfilename(), linenum, (yyvsp[-
|
1614
|
+
currentfilename(), linenum, (yyvsp[(1) - (2)].cp));
|
1521
1615
|
print_stack_trace();
|
1522
1616
|
}
|
1523
|
-
#line 1524 "conventions.c" /* yacc.c:1646 */
|
1524
1617
|
break;
|
1525
1618
|
|
1526
1619
|
case 25:
|
1527
|
-
#line 192 "conventions.y"
|
1620
|
+
#line 192 "conventions.y"
|
1528
1621
|
{
|
1529
1622
|
struct stringpair *existing;
|
1530
|
-
(yyval.dict) = (yyvsp[-
|
1623
|
+
(yyval.dict) = (yyvsp[(1) - (2)].dict);
|
1531
1624
|
/* make sure it's not already there */
|
1532
|
-
if((existing = key_ht_lookup((yyval.dict), (yyvsp[
|
1625
|
+
if((existing = key_ht_lookup((yyval.dict), (yyvsp[(2) - (2)].binding))) != NULL) {
|
1533
1626
|
if(want_debug) {
|
1534
|
-
if(strcmp(existing->value, (yyvsp[
|
1627
|
+
if(strcmp(existing->value, (yyvsp[(2) - (2)].binding)->value)) {
|
1535
1628
|
printf("%s:%d key %s inconsistently redefined from %s to %s.\n",
|
1536
|
-
currentfilename(), linenum, (yyvsp[
|
1629
|
+
currentfilename(), linenum, (yyvsp[(2) - (2)].binding)->key, existing->value, (yyvsp[(2) - (2)].binding)->value);
|
1537
1630
|
print_stack_trace();
|
1538
1631
|
printf(" this is okay if that's what you want it to do.\n");
|
1539
1632
|
} else if(want_conventions_debug) {
|
1540
1633
|
/* seems unnecessary to spew this often. */
|
1541
1634
|
printf("%s:%d key %s doubly defined to %s.\n",
|
1542
|
-
currentfilename(), linenum, (yyvsp[
|
1635
|
+
currentfilename(), linenum, (yyvsp[(2) - (2)].binding)->key, existing->value);
|
1543
1636
|
print_stack_trace();
|
1544
1637
|
}
|
1545
1638
|
}
|
1546
1639
|
}
|
1547
|
-
key_ht_insert((yyval.dict), (yyvsp[
|
1640
|
+
key_ht_insert((yyval.dict), (yyvsp[(2) - (2)].binding));
|
1548
1641
|
}
|
1549
|
-
#line 1550 "conventions.c" /* yacc.c:1646 */
|
1550
1642
|
break;
|
1551
1643
|
|
1552
1644
|
case 26:
|
1553
|
-
#line 212 "conventions.y"
|
1645
|
+
#line 212 "conventions.y"
|
1554
1646
|
{
|
1555
1647
|
(yyval.dict) = key_ht_new_k(50, pstring_hash, pstring_isequal, NULL);
|
1556
1648
|
}
|
1557
|
-
#line 1558 "conventions.c" /* yacc.c:1646 */
|
1558
1649
|
break;
|
1559
1650
|
|
1560
1651
|
case 27:
|
1561
|
-
#line 216 "conventions.y"
|
1652
|
+
#line 216 "conventions.y"
|
1562
1653
|
{
|
1563
1654
|
(yyval.binding) = (struct stringpair *)malloc(sizeof(struct stringpair));
|
1564
|
-
(yyval.binding)->key = (yyvsp[-
|
1565
|
-
(yyval.binding)->value = (yyvsp[
|
1655
|
+
(yyval.binding)->key = (yyvsp[(1) - (2)].cp);
|
1656
|
+
(yyval.binding)->value = (yyvsp[(2) - (2)].cp);
|
1566
1657
|
set_file_and_line(&(yyval.binding)->inst, currentfilename(), linenum);
|
1567
1658
|
/* if(want_debug) printf("making binding %s->%s\n", $1, $2); */
|
1568
1659
|
}
|
1569
|
-
#line 1570 "conventions.c" /* yacc.c:1646 */
|
1570
1660
|
break;
|
1571
1661
|
|
1572
1662
|
case 28:
|
1573
|
-
#line 222 "conventions.y"
|
1663
|
+
#line 222 "conventions.y"
|
1574
1664
|
{
|
1575
1665
|
(yyval.binding) = (struct stringpair *)malloc(sizeof(struct stringpair));
|
1576
1666
|
(yyval.binding)->key=malloc(15);
|
1577
|
-
snprintf((yyval.binding)->key, 15, "%d", (yyvsp[-
|
1578
|
-
(yyval.binding)->value = (yyvsp[
|
1667
|
+
snprintf((yyval.binding)->key, 15, "%d", (yyvsp[(1) - (2)].in));
|
1668
|
+
(yyval.binding)->value = (yyvsp[(2) - (2)].cp);
|
1579
1669
|
set_file_and_line(&(yyval.binding)->inst, currentfilename(), linenum);
|
1580
1670
|
/* if(want_debug) printf("making binding %s->%s\n", $1, $2); */
|
1581
1671
|
}
|
1582
|
-
#line 1583 "conventions.c" /* yacc.c:1646 */
|
1583
1672
|
break;
|
1584
1673
|
|
1585
1674
|
|
1586
|
-
|
1675
|
+
/* Line 1267 of yacc.c. */
|
1676
|
+
#line 1677 "conventions.c"
|
1587
1677
|
default: break;
|
1588
1678
|
}
|
1589
|
-
/* User semantic actions sometimes alter yychar, and that requires
|
1590
|
-
that yytoken be updated with the new translation. We take the
|
1591
|
-
approach of translating immediately before every use of yytoken.
|
1592
|
-
One alternative is translating here after every semantic action,
|
1593
|
-
but that translation would be missed if the semantic action invokes
|
1594
|
-
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
|
1595
|
-
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
|
1596
|
-
incorrect destructor might then be invoked immediately. In the
|
1597
|
-
case of YYERROR or YYBACKUP, subsequent parser actions might lead
|
1598
|
-
to an incorrect destructor call or verbose syntax error message
|
1599
|
-
before the lookahead is translated. */
|
1600
1679
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
1601
1680
|
|
1602
1681
|
YYPOPSTACK (yylen);
|
@@ -1605,7 +1684,8 @@ yyreduce:
|
|
1605
1684
|
|
1606
1685
|
*++yyvsp = yyval;
|
1607
1686
|
|
1608
|
-
|
1687
|
+
|
1688
|
+
/* Now `shift' the result of the reduction. Determine what state
|
1609
1689
|
that goes to, based on the state we popped back to and the rule
|
1610
1690
|
number reduced by. */
|
1611
1691
|
|
@@ -1620,14 +1700,10 @@ yyreduce:
|
|
1620
1700
|
goto yynewstate;
|
1621
1701
|
|
1622
1702
|
|
1623
|
-
|
1624
|
-
| yyerrlab -- here on detecting error
|
1625
|
-
|
1703
|
+
/*------------------------------------.
|
1704
|
+
| yyerrlab -- here on detecting error |
|
1705
|
+
`------------------------------------*/
|
1626
1706
|
yyerrlab:
|
1627
|
-
/* Make sure we have latest lookahead translation. See comments at
|
1628
|
-
user semantic actions for why this is necessary. */
|
1629
|
-
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
|
1630
|
-
|
1631
1707
|
/* If not already recovering from an error, report this error. */
|
1632
1708
|
if (!yyerrstatus)
|
1633
1709
|
{
|
@@ -1635,36 +1711,37 @@ yyerrlab:
|
|
1635
1711
|
#if ! YYERROR_VERBOSE
|
1636
1712
|
yyerror (YY_("syntax error"));
|
1637
1713
|
#else
|
1638
|
-
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
|
1639
|
-
yyssp, yytoken)
|
1640
1714
|
{
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1715
|
+
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
|
1716
|
+
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
|
1717
|
+
{
|
1718
|
+
YYSIZE_T yyalloc = 2 * yysize;
|
1719
|
+
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
|
1720
|
+
yyalloc = YYSTACK_ALLOC_MAXIMUM;
|
1721
|
+
if (yymsg != yymsgbuf)
|
1722
|
+
YYSTACK_FREE (yymsg);
|
1723
|
+
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
|
1724
|
+
if (yymsg)
|
1725
|
+
yymsg_alloc = yyalloc;
|
1726
|
+
else
|
1727
|
+
{
|
1728
|
+
yymsg = yymsgbuf;
|
1729
|
+
yymsg_alloc = sizeof yymsgbuf;
|
1730
|
+
}
|
1731
|
+
}
|
1732
|
+
|
1733
|
+
if (0 < yysize && yysize <= yymsg_alloc)
|
1734
|
+
{
|
1735
|
+
(void) yysyntax_error (yymsg, yystate, yychar);
|
1736
|
+
yyerror (yymsg);
|
1737
|
+
}
|
1738
|
+
else
|
1739
|
+
{
|
1740
|
+
yyerror (YY_("syntax error"));
|
1741
|
+
if (yysize != 0)
|
1742
|
+
goto yyexhaustedlab;
|
1743
|
+
}
|
1666
1744
|
}
|
1667
|
-
# undef YYSYNTAX_ERROR
|
1668
1745
|
#endif
|
1669
1746
|
}
|
1670
1747
|
|
@@ -1672,24 +1749,24 @@ yyerrlab:
|
|
1672
1749
|
|
1673
1750
|
if (yyerrstatus == 3)
|
1674
1751
|
{
|
1675
|
-
/* If just tried and failed to reuse
|
1676
|
-
|
1752
|
+
/* If just tried and failed to reuse look-ahead token after an
|
1753
|
+
error, discard it. */
|
1677
1754
|
|
1678
1755
|
if (yychar <= YYEOF)
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1756
|
+
{
|
1757
|
+
/* Return failure if at end of input. */
|
1758
|
+
if (yychar == YYEOF)
|
1759
|
+
YYABORT;
|
1760
|
+
}
|
1684
1761
|
else
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1762
|
+
{
|
1763
|
+
yydestruct ("Error: discarding",
|
1764
|
+
yytoken, &yylval);
|
1765
|
+
yychar = YYEMPTY;
|
1766
|
+
}
|
1690
1767
|
}
|
1691
1768
|
|
1692
|
-
/* Else will try to reuse
|
1769
|
+
/* Else will try to reuse look-ahead token after shifting the error
|
1693
1770
|
token. */
|
1694
1771
|
goto yyerrlab1;
|
1695
1772
|
|
@@ -1705,7 +1782,7 @@ yyerrorlab:
|
|
1705
1782
|
if (/*CONSTCOND*/ 0)
|
1706
1783
|
goto yyerrorlab;
|
1707
1784
|
|
1708
|
-
/* Do not reclaim the symbols of the rule
|
1785
|
+
/* Do not reclaim the symbols of the rule which action triggered
|
1709
1786
|
this YYERROR. */
|
1710
1787
|
YYPOPSTACK (yylen);
|
1711
1788
|
yylen = 0;
|
@@ -1718,37 +1795,38 @@ yyerrorlab:
|
|
1718
1795
|
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
1719
1796
|
`-------------------------------------------------------------*/
|
1720
1797
|
yyerrlab1:
|
1721
|
-
yyerrstatus = 3;
|
1798
|
+
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
1722
1799
|
|
1723
1800
|
for (;;)
|
1724
1801
|
{
|
1725
1802
|
yyn = yypact[yystate];
|
1726
|
-
if (
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1803
|
+
if (yyn != YYPACT_NINF)
|
1804
|
+
{
|
1805
|
+
yyn += YYTERROR;
|
1806
|
+
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
|
1807
|
+
{
|
1808
|
+
yyn = yytable[yyn];
|
1809
|
+
if (0 < yyn)
|
1810
|
+
break;
|
1811
|
+
}
|
1812
|
+
}
|
1736
1813
|
|
1737
1814
|
/* Pop the current state because it cannot handle the error token. */
|
1738
1815
|
if (yyssp == yyss)
|
1739
|
-
|
1816
|
+
YYABORT;
|
1740
1817
|
|
1741
1818
|
|
1742
1819
|
yydestruct ("Error: popping",
|
1743
|
-
|
1820
|
+
yystos[yystate], yyvsp);
|
1744
1821
|
YYPOPSTACK (1);
|
1745
1822
|
yystate = *yyssp;
|
1746
1823
|
YY_STACK_PRINT (yyss, yyssp);
|
1747
1824
|
}
|
1748
1825
|
|
1749
|
-
|
1826
|
+
if (yyn == YYFINAL)
|
1827
|
+
YYACCEPT;
|
1828
|
+
|
1750
1829
|
*++yyvsp = yylval;
|
1751
|
-
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
1752
1830
|
|
1753
1831
|
|
1754
1832
|
/* Shift the error token. */
|
@@ -1772,7 +1850,7 @@ yyabortlab:
|
|
1772
1850
|
yyresult = 1;
|
1773
1851
|
goto yyreturn;
|
1774
1852
|
|
1775
|
-
#
|
1853
|
+
#ifndef yyoverflow
|
1776
1854
|
/*-------------------------------------------------.
|
1777
1855
|
| yyexhaustedlab -- memory exhaustion comes here. |
|
1778
1856
|
`-------------------------------------------------*/
|
@@ -1783,22 +1861,17 @@ yyexhaustedlab:
|
|
1783
1861
|
#endif
|
1784
1862
|
|
1785
1863
|
yyreturn:
|
1786
|
-
if (yychar != YYEMPTY)
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
yytoken = YYTRANSLATE (yychar);
|
1791
|
-
yydestruct ("Cleanup: discarding lookahead",
|
1792
|
-
yytoken, &yylval);
|
1793
|
-
}
|
1794
|
-
/* Do not reclaim the symbols of the rule whose action triggered
|
1864
|
+
if (yychar != YYEOF && yychar != YYEMPTY)
|
1865
|
+
yydestruct ("Cleanup: discarding lookahead",
|
1866
|
+
yytoken, &yylval);
|
1867
|
+
/* Do not reclaim the symbols of the rule which action triggered
|
1795
1868
|
this YYABORT or YYACCEPT. */
|
1796
1869
|
YYPOPSTACK (yylen);
|
1797
1870
|
YY_STACK_PRINT (yyss, yyssp);
|
1798
1871
|
while (yyssp != yyss)
|
1799
1872
|
{
|
1800
1873
|
yydestruct ("Cleanup: popping",
|
1801
|
-
|
1874
|
+
yystos[*yyssp], yyvsp);
|
1802
1875
|
YYPOPSTACK (1);
|
1803
1876
|
}
|
1804
1877
|
#ifndef yyoverflow
|
@@ -1809,5 +1882,9 @@ yyreturn:
|
|
1809
1882
|
if (yymsg != yymsgbuf)
|
1810
1883
|
YYSTACK_FREE (yymsg);
|
1811
1884
|
#endif
|
1812
|
-
|
1885
|
+
/* Make sure YYID is used. */
|
1886
|
+
return YYID (yyresult);
|
1813
1887
|
}
|
1888
|
+
|
1889
|
+
|
1890
|
+
|