1 |
/* A lexical scanner generated by flex */ |
2 |
|
3 |
/* Scanner skeleton version: |
4 |
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ |
5 |
*/ |
6 |
|
7 |
#define FLEX_SCANNER |
8 |
#define YY_FLEX_MAJOR_VERSION 2 |
9 |
#define YY_FLEX_MINOR_VERSION 5 |
10 |
|
11 |
#include <stdio.h> |
12 |
|
13 |
|
14 |
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ |
15 |
#ifdef c_plusplus |
16 |
#ifndef __cplusplus |
17 |
#define __cplusplus |
18 |
#endif |
19 |
#endif |
20 |
|
21 |
|
22 |
#ifdef __cplusplus |
23 |
|
24 |
#include <stdlib.h> |
25 |
#include <unistd.h> |
26 |
|
27 |
/* Use prototypes in function declarations. */ |
28 |
#define YY_USE_PROTOS |
29 |
|
30 |
/* The "const" storage-class-modifier is valid. */ |
31 |
#define YY_USE_CONST |
32 |
|
33 |
#else /* ! __cplusplus */ |
34 |
|
35 |
#if __STDC__ |
36 |
|
37 |
#define YY_USE_PROTOS |
38 |
#define YY_USE_CONST |
39 |
|
40 |
#endif /* __STDC__ */ |
41 |
#endif /* ! __cplusplus */ |
42 |
|
43 |
#ifdef __TURBOC__ |
44 |
#pragma warn -rch |
45 |
#pragma warn -use |
46 |
#include <io.h> |
47 |
#include <stdlib.h> |
48 |
#define YY_USE_CONST |
49 |
#define YY_USE_PROTOS |
50 |
#endif |
51 |
|
52 |
#ifdef YY_USE_CONST |
53 |
#define yyconst const |
54 |
#else |
55 |
#define yyconst |
56 |
#endif |
57 |
|
58 |
|
59 |
#ifdef YY_USE_PROTOS |
60 |
#define YY_PROTO(proto) proto |
61 |
#else |
62 |
#define YY_PROTO(proto) () |
63 |
#endif |
64 |
|
65 |
/* Returned upon end-of-file. */ |
66 |
#define YY_NULL 0 |
67 |
|
68 |
/* Promotes a possibly negative, possibly signed char to an unsigned |
69 |
* integer for use as an array index. If the signed char is negative, |
70 |
* we want to instead treat it as an 8-bit unsigned char, hence the |
71 |
* double cast. |
72 |
*/ |
73 |
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
74 |
|
75 |
/* Enter a start condition. This macro really ought to take a parameter, |
76 |
* but we do it the disgusting crufty way forced on us by the ()-less |
77 |
* definition of BEGIN. |
78 |
*/ |
79 |
#define BEGIN yy_start = 1 + 2 * |
80 |
|
81 |
/* Translate the current start state into a value that can be later handed |
82 |
* to BEGIN to return to the state. The YYSTATE alias is for lex |
83 |
* compatibility. |
84 |
*/ |
85 |
#define YY_START ((yy_start - 1) / 2) |
86 |
#define YYSTATE YY_START |
87 |
|
88 |
/* Action number for EOF rule of a given start state. */ |
89 |
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
90 |
|
91 |
/* Special action meaning "start processing a new file". */ |
92 |
#define YY_NEW_FILE yyrestart( yyin ) |
93 |
|
94 |
#define YY_END_OF_BUFFER_CHAR 0 |
95 |
|
96 |
/* Size of default input buffer. */ |
97 |
#define YY_BUF_SIZE 16384 |
98 |
|
99 |
typedef struct yy_buffer_state *YY_BUFFER_STATE; |
100 |
|
101 |
extern int yyleng; |
102 |
extern FILE *yyin, *yyout; |
103 |
|
104 |
#define EOB_ACT_CONTINUE_SCAN 0 |
105 |
#define EOB_ACT_END_OF_FILE 1 |
106 |
#define EOB_ACT_LAST_MATCH 2 |
107 |
|
108 |
/* The funky do-while in the following #define is used to turn the definition |
109 |
* int a single C statement (which needs a semi-colon terminator). This |
110 |
* avoids problems with code like: |
111 |
* |
112 |
* if ( condition_holds ) |
113 |
* yyless( 5 ); |
114 |
* else |
115 |
* do_something_else(); |
116 |
* |
117 |
* Prior to using the do-while the compiler would get upset at the |
118 |
* "else" because it interpreted the "if" statement as being all |
119 |
* done when it reached the ';' after the yyless() call. |
120 |
*/ |
121 |
|
122 |
/* Return all but the first 'n' matched characters back to the input stream. */ |
123 |
|
124 |
#define yyless(n) \ |
125 |
do \ |
126 |
{ \ |
127 |
/* Undo effects of setting up yytext. */ \ |
128 |
*yy_cp = yy_hold_char; \ |
129 |
YY_RESTORE_YY_MORE_OFFSET \ |
130 |
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ |
131 |
YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
132 |
} \ |
133 |
while ( 0 ) |
134 |
|
135 |
#define unput(c) yyunput( c, yytext_ptr ) |
136 |
|
137 |
/* The following is because we cannot portably get our hands on size_t |
138 |
* (without autoconf's help, which isn't available because we want |
139 |
* flex-generated scanners to compile on their own). |
140 |
*/ |
141 |
typedef unsigned int yy_size_t; |
142 |
|
143 |
|
144 |
struct yy_buffer_state { |
145 |
FILE *yy_input_file; |
146 |
|
147 |
char *yy_ch_buf; /* input buffer */ |
148 |
char *yy_buf_pos; /* current position in input buffer */ |
149 |
|
150 |
/* Size of input buffer in bytes, not including room for EOB |
151 |
* characters. |
152 |
*/ |
153 |
yy_size_t yy_buf_size; |
154 |
|
155 |
/* Number of characters read into yy_ch_buf, not including EOB |
156 |
* characters. |
157 |
*/ |
158 |
int yy_n_chars; |
159 |
|
160 |
/* Whether we "own" the buffer - i.e., we know we created it, |
161 |
* and can realloc() it to grow it, and should free() it to |
162 |
* delete it. |
163 |
*/ |
164 |
int yy_is_our_buffer; |
165 |
|
166 |
/* Whether this is an "interactive" input source; if so, and |
167 |
* if we're using stdio for input, then we want to use getc() |
168 |
* instead of fread(), to make sure we stop fetching input after |
169 |
* each newline. |
170 |
*/ |
171 |
int yy_is_interactive; |
172 |
|
173 |
/* Whether we're considered to be at the beginning of a line. |
174 |
* If so, '^' rules will be active on the next match, otherwise |
175 |
* not. |
176 |
*/ |
177 |
int yy_at_bol; |
178 |
|
179 |
/* Whether to try to fill the input buffer when we reach the |
180 |
* end of it. |
181 |
*/ |
182 |
int yy_fill_buffer; |
183 |
|
184 |
int yy_buffer_status; |
185 |
#define YY_BUFFER_NEW 0 |
186 |
#define YY_BUFFER_NORMAL 1 |
187 |
/* When an EOF's been seen but there's still some text to process |
188 |
* then we mark the buffer as YY_EOF_PENDING, to indicate that we |
189 |
* shouldn't try reading from the input source any more. We might |
190 |
* still have a bunch of tokens to match, though, because of |
191 |
* possible backing-up. |
192 |
* |
193 |
* When we actually see the EOF, we change the status to "new" |
194 |
* (via yyrestart()), so that the user can continue scanning by |
195 |
* just pointing yyin at a new input file. |
196 |
*/ |
197 |
#define YY_BUFFER_EOF_PENDING 2 |
198 |
}; |
199 |
|
200 |
static YY_BUFFER_STATE yy_current_buffer = 0; |
201 |
|
202 |
/* We provide macros for accessing buffer states in case in the |
203 |
* future we want to put the buffer states in a more general |
204 |
* "scanner state". |
205 |
*/ |
206 |
#define YY_CURRENT_BUFFER yy_current_buffer |
207 |
|
208 |
|
209 |
/* yy_hold_char holds the character lost when yytext is formed. */ |
210 |
static char yy_hold_char; |
211 |
|
212 |
static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
213 |
|
214 |
|
215 |
int yyleng; |
216 |
|
217 |
/* Points to current character in buffer. */ |
218 |
static char *yy_c_buf_p = (char *) 0; |
219 |
static int yy_init = 1; /* whether we need to initialize */ |
220 |
static int yy_start = 0; /* start state number */ |
221 |
|
222 |
/* Flag which is used to allow yywrap()'s to do buffer switches |
223 |
* instead of setting up a fresh yyin. A bit of a hack ... |
224 |
*/ |
225 |
static int yy_did_buffer_switch_on_eof; |
226 |
|
227 |
void yyrestart YY_PROTO((FILE * input_file)); |
228 |
|
229 |
void yy_switch_to_buffer YY_PROTO((YY_BUFFER_STATE new_buffer)); |
230 |
void yy_load_buffer_state YY_PROTO((void)); |
231 |
YY_BUFFER_STATE yy_create_buffer YY_PROTO((FILE * file, int size)); |
232 |
void yy_delete_buffer YY_PROTO((YY_BUFFER_STATE b)); |
233 |
void yy_init_buffer YY_PROTO((YY_BUFFER_STATE b, FILE * file)); |
234 |
void yy_flush_buffer YY_PROTO((YY_BUFFER_STATE b)); |
235 |
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
236 |
|
237 |
YY_BUFFER_STATE yy_scan_buffer YY_PROTO((char *base, yy_size_t size)); |
238 |
YY_BUFFER_STATE yy_scan_string YY_PROTO((yyconst char *yy_str)); |
239 |
YY_BUFFER_STATE yy_scan_bytes YY_PROTO((yyconst char *bytes, int len)); |
240 |
|
241 |
static void *yy_flex_alloc YY_PROTO((yy_size_t)); |
242 |
static void *yy_flex_realloc YY_PROTO((void *, yy_size_t)); |
243 |
static void yy_flex_free YY_PROTO((void *)); |
244 |
|
245 |
#define yy_new_buffer yy_create_buffer |
246 |
|
247 |
#define yy_set_interactive(is_interactive) \ |
248 |
{ \ |
249 |
if ( ! yy_current_buffer ) \ |
250 |
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
251 |
yy_current_buffer->yy_is_interactive = is_interactive; \ |
252 |
} |
253 |
|
254 |
#define yy_set_bol(at_bol) \ |
255 |
{ \ |
256 |
if ( ! yy_current_buffer ) \ |
257 |
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
258 |
yy_current_buffer->yy_at_bol = at_bol; \ |
259 |
} |
260 |
|
261 |
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) |
262 |
|
263 |
typedef unsigned char YY_CHAR; |
264 |
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; |
265 |
typedef int yy_state_type; |
266 |
extern char *yytext; |
267 |
#define yytext_ptr yytext |
268 |
|
269 |
static yy_state_type yy_get_previous_state YY_PROTO((void)); |
270 |
static yy_state_type yy_try_NUL_trans |
271 |
YY_PROTO((yy_state_type current_state)); |
272 |
static int yy_get_next_buffer YY_PROTO((void)); |
273 |
static void yy_fatal_error YY_PROTO((yyconst char msg[])); |
274 |
|
275 |
/* Done after the current pattern has been matched and before the |
276 |
* corresponding action - sets up yytext. |
277 |
*/ |
278 |
#define YY_DO_BEFORE_ACTION \ |
279 |
yytext_ptr = yy_bp; \ |
280 |
yyleng = (int) (yy_cp - yy_bp); \ |
281 |
yy_hold_char = *yy_cp; \ |
282 |
*yy_cp = '\0'; \ |
283 |
yy_c_buf_p = yy_cp; |
284 |
|
285 |
#define YY_NUM_RULES 18 |
286 |
#define YY_END_OF_BUFFER 19 |
287 |
static yyconst short int yy_accept[49] = { 0, |
288 |
0, 0, 0, 0, 0, 0, 19, 4, 1, 17, |
289 |
5, 2, 4, 5, 2, 16, 7, 6, 18, 4, |
290 |
1, 2, 2, 4, 0, 4, 0, 2, 2, 2, |
291 |
16, 15, 8, 9, 13, 14, 10, 12, 11, 3, |
292 |
3, 2, 2, 2, 8, 9, 8, 0 |
293 |
}; |
294 |
|
295 |
static yyconst int yy_ec[256] = { 0, |
296 |
1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
297 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
298 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
299 |
1, 2, 1, 4, 5, 1, 1, 1, 1, 1, |
300 |
1, 1, 1, 1, 1, 1, 6, 7, 7, 7, |
301 |
7, 7, 7, 7, 7, 8, 8, 1, 1, 1, |
302 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
303 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
304 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
305 |
1, 9, 1, 1, 1, 1, 1, 10, 1, 1, |
306 |
|
307 |
1, 11, 1, 1, 1, 1, 1, 1, 1, 12, |
308 |
1, 1, 1, 13, 1, 14, 1, 1, 1, 1, |
309 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
310 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
311 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
312 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
313 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
314 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
315 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
316 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
317 |
|
318 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
319 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
320 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
321 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
322 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
323 |
1, 1, 1, 1, 1 |
324 |
}; |
325 |
|
326 |
static yyconst int yy_meta[15] = { 0, |
327 |
1, 2, 3, 4, 1, 1, 1, 1, 5, 1, |
328 |
1, 1, 1, 1 |
329 |
}; |
330 |
|
331 |
static yyconst short int yy_base[64] = { 0, |
332 |
0, 4, 8, 12, 15, 22, 101, 0, 95, 142, |
333 |
142, 18, 17, 90, 30, 0, 142, 142, 36, 0, |
334 |
90, 25, 0, 24, 82, 83, 0, 49, 50, 31, |
335 |
0, 142, 50, 52, 142, 142, 142, 142, 142, 82, |
336 |
0, 60, 59, 52, 57, 59, 61, 142, 69, 74, |
337 |
79, 84, 89, 94, 99, 104, 109, 111, 116, 121, |
338 |
126, 131, 136 |
339 |
}; |
340 |
|
341 |
static yyconst short int yy_def[64] = { 0, |
342 |
49, 49, 50, 50, 51, 51, 48, 52, 48, 48, |
343 |
48, 53, 54, 55, 56, 57, 48, 48, 48, 52, |
344 |
48, 53, 58, 54, 55, 59, 60, 56, 61, 62, |
345 |
57, 48, 48, 48, 48, 48, 48, 48, 48, 59, |
346 |
60, 63, 62, 63, 48, 48, 48, 0, 48, 48, |
347 |
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, |
348 |
48, 48, 48 |
349 |
}; |
350 |
|
351 |
static yyconst short int yy_nxt[157] = { 0, |
352 |
48, 9, 10, 11, 12, 9, 10, 11, 12, 9, |
353 |
10, 14, 15, 9, 10, 14, 15, 17, 18, 23, |
354 |
25, 23, 26, 19, 17, 18, 23, 25, 23, 26, |
355 |
19, 23, 23, 29, 44, 30, 32, 32, 32, 32, |
356 |
32, 32, 33, 34, 32, 35, 36, 37, 38, 39, |
357 |
23, 23, 29, 23, 30, 42, 45, 46, 46, 46, |
358 |
23, 23, 44, 47, 46, 46, 46, 46, 46, 8, |
359 |
8, 8, 8, 8, 13, 13, 13, 13, 13, 16, |
360 |
16, 16, 16, 16, 20, 41, 41, 27, 20, 22, |
361 |
22, 21, 22, 22, 24, 27, 21, 24, 24, 25, |
362 |
|
363 |
48, 48, 25, 25, 28, 28, 48, 28, 28, 31, |
364 |
31, 23, 23, 48, 23, 23, 40, 48, 48, 40, |
365 |
40, 41, 48, 48, 41, 41, 29, 29, 48, 29, |
366 |
29, 43, 43, 48, 43, 43, 44, 44, 48, 44, |
367 |
44, 7, 48, 48, 48, 48, 48, 48, 48, 48, |
368 |
48, 48, 48, 48, 48, 48 |
369 |
}; |
370 |
|
371 |
static yyconst short int yy_chk[157] = { 0, |
372 |
0, 1, 1, 1, 1, 2, 2, 2, 2, 3, |
373 |
3, 3, 3, 4, 4, 4, 4, 5, 5, 12, |
374 |
13, 12, 13, 5, 6, 6, 22, 24, 22, 24, |
375 |
6, 15, 30, 15, 30, 15, 19, 19, 19, 19, |
376 |
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, |
377 |
28, 29, 28, 44, 28, 29, 33, 33, 34, 34, |
378 |
43, 42, 43, 45, 45, 46, 46, 47, 47, 49, |
379 |
49, 49, 49, 49, 50, 50, 50, 50, 50, 51, |
380 |
51, 51, 51, 51, 52, 40, 26, 25, 52, 53, |
381 |
53, 21, 53, 53, 54, 14, 9, 54, 54, 55, |
382 |
|
383 |
7, 0, 55, 55, 56, 56, 0, 56, 56, 57, |
384 |
57, 58, 58, 0, 58, 58, 59, 0, 0, 59, |
385 |
59, 60, 0, 0, 60, 60, 61, 61, 0, 61, |
386 |
61, 62, 62, 0, 62, 62, 63, 63, 0, 63, |
387 |
63, 48, 48, 48, 48, 48, 48, 48, 48, 48, |
388 |
48, 48, 48, 48, 48, 48 |
389 |
}; |
390 |
|
391 |
static yy_state_type yy_last_accepting_state; |
392 |
static char *yy_last_accepting_cpos; |
393 |
|
394 |
/* The intent behind this definition is that it'll catch |
395 |
* any uses of REJECT which flex missed. |
396 |
*/ |
397 |
#define REJECT reject_used_but_not_detected |
398 |
#define yymore() yymore_used_but_not_detected |
399 |
#define YY_MORE_ADJ 0 |
400 |
#define YY_RESTORE_YY_MORE_OFFSET |
401 |
char *yytext; |
402 |
#line 1 "boa_lexer.l" |
403 |
#define INITIAL 0 |
404 |
#line 2 "boa_lexer.l" |
405 |
|
406 |
/* |
407 |
* Boa, an http server |
408 |
* Copyright (C) 1995 Paul Phillips <psp@well.com> |
409 |
* |
410 |
* This program is free software; you can redistribute it and/or modify |
411 |
* it under the terms of the GNU General Public License as published by |
412 |
* the Free Software Foundation; either version 1, or (at your option) |
413 |
* any later version. |
414 |
* |
415 |
* This program is distributed in the hope that it will be useful, |
416 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
417 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
418 |
* GNU General Public License for more details. |
419 |
* |
420 |
* You should have received a copy of the GNU General Public License |
421 |
* along with this program; if not, write to the Free Software |
422 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
423 |
* |
424 |
*/ |
425 |
|
426 |
/* $Id: boa_lexer.l,v 1.4 2002/09/26 14:02:11 nmav Exp $*/ |
427 |
|
428 |
#include "boa_grammar.h" |
429 |
#include <stdlib.h> |
430 |
#include <unistd.h> |
431 |
#include "parse.h" |
432 |
|
433 |
#define MAX_STR_CONST 1024 |
434 |
#define qspush(c) \ |
435 |
if (string_buf_ptr < string_buf+MAX_STR_CONST) \ |
436 |
*string_buf_ptr++ = c; \ |
437 |
else \ |
438 |
yyerror("quoted string overflow"); |
439 |
|
440 |
char *mime_types = NULL; |
441 |
|
442 |
static int file = 0; |
443 |
int lineno = 1; |
444 |
struct ccommand *k; |
445 |
char string_buf[MAX_STR_CONST]; |
446 |
char *string_buf_ptr; |
447 |
#define MIME 1 |
448 |
|
449 |
/* Quoted string handling (almost) straight out of |
450 |
the flex 2.5 man page, April 1995 */ |
451 |
#define STR 2 |
452 |
|
453 |
#line 461 "boa_lexer.c" |
454 |
|
455 |
/* Macros after this point can all be overridden by user definitions in |
456 |
* section 1. |
457 |
*/ |
458 |
|
459 |
#ifndef YY_SKIP_YYWRAP |
460 |
#ifdef __cplusplus |
461 |
extern "C" int yywrap YY_PROTO((void)); |
462 |
#else |
463 |
extern int yywrap YY_PROTO((void)); |
464 |
#endif |
465 |
#endif |
466 |
|
467 |
#ifndef YY_NO_UNPUT |
468 |
static void yyunput YY_PROTO((int c, char *buf_ptr)); |
469 |
#endif |
470 |
|
471 |
#ifndef yytext_ptr |
472 |
static void yy_flex_strncpy YY_PROTO((char *, yyconst char *, int)); |
473 |
#endif |
474 |
|
475 |
#ifdef YY_NEED_STRLEN |
476 |
static int yy_flex_strlen YY_PROTO((yyconst char *)); |
477 |
#endif |
478 |
|
479 |
#ifndef YY_NO_INPUT |
480 |
#ifdef __cplusplus |
481 |
static int yyinput YY_PROTO((void)); |
482 |
#else |
483 |
static int input YY_PROTO((void)); |
484 |
#endif |
485 |
#endif |
486 |
|
487 |
#if YY_STACK_USED |
488 |
static int yy_start_stack_ptr = 0; |
489 |
static int yy_start_stack_depth = 0; |
490 |
static int *yy_start_stack = 0; |
491 |
#ifndef YY_NO_PUSH_STATE |
492 |
static void yy_push_state YY_PROTO((int new_state)); |
493 |
#endif |
494 |
#ifndef YY_NO_POP_STATE |
495 |
static void yy_pop_state YY_PROTO((void)); |
496 |
#endif |
497 |
#ifndef YY_NO_TOP_STATE |
498 |
static int yy_top_state YY_PROTO((void)); |
499 |
#endif |
500 |
|
501 |
#else |
502 |
#define YY_NO_PUSH_STATE 1 |
503 |
#define YY_NO_POP_STATE 1 |
504 |
#define YY_NO_TOP_STATE 1 |
505 |
#endif |
506 |
|
507 |
#ifdef YY_MALLOC_DECL |
508 |
YY_MALLOC_DECL |
509 |
#else |
510 |
#if __STDC__ |
511 |
#ifndef __cplusplus |
512 |
#include <stdlib.h> |
513 |
#endif |
514 |
#else |
515 |
/* Just try to get by without declaring the routines. This will fail |
516 |
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) |
517 |
* or sizeof(void*) != sizeof(int). |
518 |
*/ |
519 |
#endif |
520 |
#endif |
521 |
|
522 |
/* Amount of stuff to slurp up with each read. */ |
523 |
#ifndef YY_READ_BUF_SIZE |
524 |
#define YY_READ_BUF_SIZE 8192 |
525 |
#endif |
526 |
|
527 |
/* Copy whatever the last rule matched to the standard output. */ |
528 |
|
529 |
#ifndef ECHO |
530 |
/* This used to be an fputs(), but since the string might contain NUL's, |
531 |
* we now use fwrite(). |
532 |
*/ |
533 |
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
534 |
#endif |
535 |
|
536 |
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
537 |
* is returned in "result". |
538 |
*/ |
539 |
#ifndef YY_INPUT |
540 |
#define YY_INPUT(buf,result,max_size) \ |
541 |
if ( yy_current_buffer->yy_is_interactive ) \ |
542 |
{ \ |
543 |
int c = '*', n; \ |
544 |
for ( n = 0; n < max_size && \ |
545 |
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
546 |
buf[n] = (char) c; \ |
547 |
if ( c == '\n' ) \ |
548 |
buf[n++] = (char) c; \ |
549 |
if ( c == EOF && ferror( yyin ) ) \ |
550 |
YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
551 |
result = n; \ |
552 |
} \ |
553 |
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ |
554 |
&& ferror( yyin ) ) \ |
555 |
YY_FATAL_ERROR( "input in flex scanner failed" ); |
556 |
#endif |
557 |
|
558 |
/* No semi-colon after return; correct usage is to write "yyterminate();" - |
559 |
* we don't want an extra ';' after the "return" because that will cause |
560 |
* some compilers to complain about unreachable statements. |
561 |
*/ |
562 |
#ifndef yyterminate |
563 |
#define yyterminate() return YY_NULL |
564 |
#endif |
565 |
|
566 |
/* Number of entries by which start-condition stack grows. */ |
567 |
#ifndef YY_START_STACK_INCR |
568 |
#define YY_START_STACK_INCR 25 |
569 |
#endif |
570 |
|
571 |
/* Report a fatal error. */ |
572 |
#ifndef YY_FATAL_ERROR |
573 |
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
574 |
#endif |
575 |
|
576 |
/* Default declaration of generated scanner - a define so the user can |
577 |
* easily add parameters. |
578 |
*/ |
579 |
#ifndef YY_DECL |
580 |
#define YY_DECL int yylex YY_PROTO(( void )) |
581 |
#endif |
582 |
|
583 |
/* Code executed at the beginning of each rule, after yytext and yyleng |
584 |
* have been set up. |
585 |
*/ |
586 |
#ifndef YY_USER_ACTION |
587 |
#define YY_USER_ACTION |
588 |
#endif |
589 |
|
590 |
/* Code executed at the end of each rule. */ |
591 |
#ifndef YY_BREAK |
592 |
#define YY_BREAK break; |
593 |
#endif |
594 |
|
595 |
#define YY_RULE_SETUP \ |
596 |
YY_USER_ACTION |
597 |
|
598 |
YY_DECL { |
599 |
register yy_state_type yy_current_state; |
600 |
register char *yy_cp, *yy_bp; |
601 |
register int yy_act; |
602 |
|
603 |
#line 51 "boa_lexer.l" |
604 |
|
605 |
|
606 |
#line 615 "boa_lexer.c" |
607 |
|
608 |
if (yy_init) { |
609 |
yy_init = 0; |
610 |
|
611 |
#ifdef YY_USER_INIT |
612 |
YY_USER_INIT; |
613 |
#endif |
614 |
|
615 |
if (!yy_start) |
616 |
yy_start = 1; /* first start state */ |
617 |
|
618 |
if (!yyin) |
619 |
yyin = stdin; |
620 |
|
621 |
if (!yyout) |
622 |
yyout = stdout; |
623 |
|
624 |
if (!yy_current_buffer) |
625 |
yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); |
626 |
|
627 |
yy_load_buffer_state(); |
628 |
} |
629 |
|
630 |
while (1) { /* loops until end-of-file is reached */ |
631 |
yy_cp = yy_c_buf_p; |
632 |
|
633 |
/* Support of yytext. */ |
634 |
*yy_cp = yy_hold_char; |
635 |
|
636 |
/* yy_bp points to the position in yy_ch_buf of the start of |
637 |
* the current run. |
638 |
*/ |
639 |
yy_bp = yy_cp; |
640 |
|
641 |
yy_current_state = yy_start; |
642 |
yy_match: |
643 |
do { |
644 |
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
645 |
if (yy_accept[yy_current_state]) { |
646 |
yy_last_accepting_state = yy_current_state; |
647 |
yy_last_accepting_cpos = yy_cp; |
648 |
} |
649 |
while (yy_chk[yy_base[yy_current_state] + yy_c] != |
650 |
yy_current_state) { |
651 |
yy_current_state = (int) yy_def[yy_current_state]; |
652 |
if (yy_current_state >= 49) |
653 |
yy_c = yy_meta[(unsigned int) yy_c]; |
654 |
} |
655 |
yy_current_state = |
656 |
yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
657 |
++yy_cp; |
658 |
} |
659 |
while (yy_base[yy_current_state] != 142); |
660 |
|
661 |
yy_find_action: |
662 |
yy_act = yy_accept[yy_current_state]; |
663 |
if (yy_act == 0) { /* have to back up */ |
664 |
yy_cp = yy_last_accepting_cpos; |
665 |
yy_current_state = yy_last_accepting_state; |
666 |
yy_act = yy_accept[yy_current_state]; |
667 |
} |
668 |
|
669 |
YY_DO_BEFORE_ACTION; |
670 |
|
671 |
|
672 |
do_action: /* This label is used only to access EOF actions. */ |
673 |
|
674 |
|
675 |
switch (yy_act) { /* beginning of action switch */ |
676 |
case 0: /* must back up */ |
677 |
/* undo the effects of YY_DO_BEFORE_ACTION */ |
678 |
*yy_cp = yy_hold_char; |
679 |
yy_cp = yy_last_accepting_cpos; |
680 |
yy_current_state = yy_last_accepting_state; |
681 |
goto yy_find_action; |
682 |
|
683 |
case 1: |
684 |
YY_RULE_SETUP |
685 |
#line 53 "boa_lexer.l" |
686 |
; |
687 |
YY_BREAK case 2: |
688 |
YY_RULE_SETUP |
689 |
#line 54 "boa_lexer.l" |
690 |
; |
691 |
YY_BREAK case 3: |
692 |
YY_RULE_SETUP |
693 |
#line 56 "boa_lexer.l" |
694 |
{ |
695 |
yylval.sval = yytext; |
696 |
return MIMETYPE; |
697 |
} |
698 |
YY_BREAK case 4: |
699 |
YY_RULE_SETUP |
700 |
#line 59 "boa_lexer.l" |
701 |
{ /* XXX could use better checks that we are in a state to |
702 |
* accept keywords; this version matches original behavior */ |
703 |
if ((YYSTATE == INITIAL) && (k = lookup_keyword(yytext))) { |
704 |
yylval.cval = k; |
705 |
return (k->type); |
706 |
} else { |
707 |
yylval.sval = yytext; |
708 |
return STRING; |
709 |
} |
710 |
} |
711 |
YY_BREAK case 5: |
712 |
YY_RULE_SETUP |
713 |
#line 67 "boa_lexer.l" |
714 |
{ |
715 |
string_buf_ptr = string_buf; |
716 |
BEGIN(STR); |
717 |
} |
718 |
YY_BREAK case 6: |
719 |
YY_RULE_SETUP |
720 |
#line 73 "boa_lexer.l" |
721 |
{ /* saw closing quote - all done */ |
722 |
BEGIN(INITIAL); |
723 |
*string_buf_ptr = '\0'; |
724 |
/* return string constant token type and value to parser */ |
725 |
yylval.sval = string_buf; |
726 |
return STRING; |
727 |
} |
728 |
YY_BREAK case 7: |
729 |
YY_RULE_SETUP |
730 |
#line 80 "boa_lexer.l" |
731 |
{ |
732 |
/* error - unterminated string constant */ |
733 |
/* generate error message */ |
734 |
yyerror("unterminated string constant"); |
735 |
} |
736 |
YY_BREAK case 8: |
737 |
YY_RULE_SETUP |
738 |
#line 86 "boa_lexer.l" |
739 |
{ |
740 |
/* octal escape sequence */ |
741 |
int result; |
742 |
|
743 |
(void) sscanf(yytext + 1, "%o", &result); |
744 |
|
745 |
if (result > 0xff) { /* error, constant is out-of-bounds */ |
746 |
} |
747 |
|
748 |
qspush(result); |
749 |
} |
750 |
YY_BREAK case 9: |
751 |
YY_RULE_SETUP |
752 |
#line 98 "boa_lexer.l" |
753 |
{ |
754 |
/* generate error - bad escape sequence; something |
755 |
* like '\48' or '\0777777' |
756 |
*/ |
757 |
yyerror("bad escape sequence"); |
758 |
} |
759 |
YY_BREAK case 10: |
760 |
YY_RULE_SETUP |
761 |
#line 105 "boa_lexer.l" |
762 |
qspush('\n'); |
763 |
YY_BREAK case 11: |
764 |
YY_RULE_SETUP |
765 |
#line 106 "boa_lexer.l" |
766 |
qspush('\t'); |
767 |
YY_BREAK case 12: |
768 |
YY_RULE_SETUP |
769 |
#line 107 "boa_lexer.l" |
770 |
qspush('\r'); |
771 |
YY_BREAK case 13: |
772 |
YY_RULE_SETUP |
773 |
#line 108 "boa_lexer.l" |
774 |
qspush('\b'); |
775 |
YY_BREAK case 14: |
776 |
YY_RULE_SETUP |
777 |
#line 109 "boa_lexer.l" |
778 |
qspush('\f'); |
779 |
YY_BREAK case 15: |
780 |
YY_RULE_SETUP |
781 |
#line 112 "boa_lexer.l" |
782 |
* string_buf_ptr++ = yytext[1]; |
783 |
YY_BREAK case 16: |
784 |
YY_RULE_SETUP |
785 |
#line 114 "boa_lexer.l" |
786 |
{ |
787 |
char *yptr = yytext; |
788 |
while (*yptr) |
789 |
qspush(*yptr++); |
790 |
} |
791 |
YY_BREAK |
792 |
/* End of <STR> dependence */ |
793 |
case 17: |
794 |
YY_RULE_SETUP |
795 |
#line 121 "boa_lexer.l" |
796 |
{ |
797 |
lineno++; |
798 |
} |
799 |
YY_BREAK case 18: |
800 |
YY_RULE_SETUP |
801 |
#line 122 "boa_lexer.l" |
802 |
ECHO; |
803 |
YY_BREAK |
804 |
#line 828 "boa_lexer.c" |
805 |
case YY_STATE_EOF(INITIAL): |
806 |
case YY_STATE_EOF(MIME): |
807 |
case YY_STATE_EOF(STR): |
808 |
yyterminate(); |
809 |
|
810 |
case YY_END_OF_BUFFER: |
811 |
{ |
812 |
/* Amount of text matched not including the EOB char. */ |
813 |
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; |
814 |
|
815 |
/* Undo the effects of YY_DO_BEFORE_ACTION. */ |
816 |
*yy_cp = yy_hold_char; |
817 |
YY_RESTORE_YY_MORE_OFFSET |
818 |
if (yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW) { |
819 |
/* We're scanning a new file or input source. It's |
820 |
* possible that this happened because the user |
821 |
* just pointed yyin at a new source and called |
822 |
* yylex(). If so, then we have to assure |
823 |
* consistency between yy_current_buffer and our |
824 |
* globals. Here is the right place to do so, because |
825 |
* this is the first action (other than possibly a |
826 |
* back-up) that will match for the new input source. |
827 |
*/ |
828 |
yy_n_chars = yy_current_buffer->yy_n_chars; |
829 |
yy_current_buffer->yy_input_file = yyin; |
830 |
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; |
831 |
} |
832 |
|
833 |
/* Note that here we test for yy_c_buf_p "<=" to the position |
834 |
* of the first EOB in the buffer, since yy_c_buf_p will |
835 |
* already have been incremented past the NUL character |
836 |
* (since all states make transitions on EOB to the |
837 |
* end-of-buffer state). Contrast this with the test |
838 |
* in input(). |
839 |
*/ |
840 |
if (yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars]) { /* This was really a NUL. */ |
841 |
yy_state_type yy_next_state; |
842 |
|
843 |
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; |
844 |
|
845 |
yy_current_state = yy_get_previous_state(); |
846 |
|
847 |
/* Okay, we're now positioned to make the NUL |
848 |
* transition. We couldn't have |
849 |
* yy_get_previous_state() go ahead and do it |
850 |
* for us because it doesn't know how to deal |
851 |
* with the possibility of jamming (and we don't |
852 |
* want to build jamming into it because then it |
853 |
* will run more slowly). |
854 |
*/ |
855 |
|
856 |
yy_next_state = yy_try_NUL_trans(yy_current_state); |
857 |
|
858 |
yy_bp = yytext_ptr + YY_MORE_ADJ; |
859 |
|
860 |
if (yy_next_state) { |
861 |
/* Consume the NUL. */ |
862 |
yy_cp = ++yy_c_buf_p; |
863 |
yy_current_state = yy_next_state; |
864 |
goto yy_match; |
865 |
} |
866 |
|
867 |
else { |
868 |
yy_cp = yy_c_buf_p; |
869 |
goto yy_find_action; |
870 |
} |
871 |
} |
872 |
|
873 |
else |
874 |
switch (yy_get_next_buffer()) { |
875 |
case EOB_ACT_END_OF_FILE: |
876 |
{ |
877 |
yy_did_buffer_switch_on_eof = 0; |
878 |
|
879 |
if (yywrap()) { |
880 |
/* Note: because we've taken care in |
881 |
* yy_get_next_buffer() to have set up |
882 |
* yytext, we can now set up |
883 |
* yy_c_buf_p so that if some total |
884 |
* hoser (like flex itself) wants to |
885 |
* call the scanner after we return the |
886 |
* YY_NULL, it'll still work - another |
887 |
* YY_NULL will get returned. |
888 |
*/ |
889 |
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; |
890 |
|
891 |
yy_act = YY_STATE_EOF(YY_START); |
892 |
goto do_action; |
893 |
} |
894 |
|
895 |
else { |
896 |
if (!yy_did_buffer_switch_on_eof) |
897 |
YY_NEW_FILE; |
898 |
} |
899 |
break; |
900 |
} |
901 |
|
902 |
case EOB_ACT_CONTINUE_SCAN: |
903 |
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; |
904 |
|
905 |
yy_current_state = yy_get_previous_state(); |
906 |
|
907 |
yy_cp = yy_c_buf_p; |
908 |
yy_bp = yytext_ptr + YY_MORE_ADJ; |
909 |
goto yy_match; |
910 |
|
911 |
case EOB_ACT_LAST_MATCH: |
912 |
yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; |
913 |
|
914 |
yy_current_state = yy_get_previous_state(); |
915 |
|
916 |
yy_cp = yy_c_buf_p; |
917 |
yy_bp = yytext_ptr + YY_MORE_ADJ; |
918 |
goto yy_find_action; |
919 |
} |
920 |
break; |
921 |
} |
922 |
|
923 |
default: |
924 |
YY_FATAL_ERROR |
925 |
("fatal flex scanner internal error--no action found"); |
926 |
} /* end of action switch */ |
927 |
} /* end of scanning one token */ |
928 |
} /* end of yylex */ |
929 |
|
930 |
|
931 |
/* yy_get_next_buffer - try to read in a new buffer |
932 |
* |
933 |
* Returns a code representing an action: |
934 |
* EOB_ACT_LAST_MATCH - |
935 |
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
936 |
* EOB_ACT_END_OF_FILE - end of file |
937 |
*/ |
938 |
|
939 |
static int yy_get_next_buffer() |
940 |
{ |
941 |
register char *dest = yy_current_buffer->yy_ch_buf; |
942 |
register char *source = yytext_ptr; |
943 |
register int number_to_move, i; |
944 |
int ret_val; |
945 |
|
946 |
if (yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1]) |
947 |
YY_FATAL_ERROR |
948 |
("fatal flex scanner internal error--end of buffer missed"); |
949 |
|
950 |
if (yy_current_buffer->yy_fill_buffer == 0) { /* Don't try to fill the buffer, so this is an EOF. */ |
951 |
if (yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1) { |
952 |
/* We matched a single character, the EOB, so |
953 |
* treat this as a final EOF. |
954 |
*/ |
955 |
return EOB_ACT_END_OF_FILE; |
956 |
} |
957 |
|
958 |
else { |
959 |
/* We matched some text prior to the EOB, first |
960 |
* process it. |
961 |
*/ |
962 |
return EOB_ACT_LAST_MATCH; |
963 |
} |
964 |
} |
965 |
|
966 |
/* Try to read more data. */ |
967 |
|
968 |
/* First move last chars to start of buffer. */ |
969 |
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; |
970 |
|
971 |
for (i = 0; i < number_to_move; ++i) |
972 |
*(dest++) = *(source++); |
973 |
|
974 |
if (yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING) |
975 |
/* don't do the read, it's not guaranteed to return an EOF, |
976 |
* just force an EOF |
977 |
*/ |
978 |
yy_current_buffer->yy_n_chars = yy_n_chars = 0; |
979 |
|
980 |
else { |
981 |
int num_to_read = |
982 |
yy_current_buffer->yy_buf_size - number_to_move - 1; |
983 |
|
984 |
while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */ |
985 |
#ifdef YY_USES_REJECT |
986 |
YY_FATAL_ERROR |
987 |
("input buffer overflow, can't enlarge buffer because scanner uses REJECT"); |
988 |
#else |
989 |
|
990 |
/* just a shorter name for the current buffer */ |
991 |
YY_BUFFER_STATE b = yy_current_buffer; |
992 |
|
993 |
int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); |
994 |
|
995 |
if (b->yy_is_our_buffer) { |
996 |
int new_size = b->yy_buf_size * 2; |
997 |
|
998 |
if (new_size <= 0) |
999 |
b->yy_buf_size += b->yy_buf_size / 8; |
1000 |
else |
1001 |
b->yy_buf_size *= 2; |
1002 |
|
1003 |
b->yy_ch_buf = (char *) |
1004 |
/* Include room in for 2 EOB chars. */ |
1005 |
yy_flex_realloc((void *) b->yy_ch_buf, b->yy_buf_size + 2); |
1006 |
} else |
1007 |
/* Can't grow it, we don't own it. */ |
1008 |
b->yy_ch_buf = 0; |
1009 |
|
1010 |
if (!b->yy_ch_buf) |
1011 |
YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); |
1012 |
|
1013 |
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
1014 |
|
1015 |
num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; |
1016 |
#endif |
1017 |
} |
1018 |
|
1019 |
if (num_to_read > YY_READ_BUF_SIZE) |
1020 |
num_to_read = YY_READ_BUF_SIZE; |
1021 |
|
1022 |
/* Read in more data. */ |
1023 |
YY_INPUT((&yy_current_buffer->yy_ch_buf[number_to_move]), |
1024 |
yy_n_chars, num_to_read); |
1025 |
|
1026 |
yy_current_buffer->yy_n_chars = yy_n_chars; |
1027 |
} |
1028 |
|
1029 |
if (yy_n_chars == 0) { |
1030 |
if (number_to_move == YY_MORE_ADJ) { |
1031 |
ret_val = EOB_ACT_END_OF_FILE; |
1032 |
yyrestart(yyin); |
1033 |
} |
1034 |
|
1035 |
else { |
1036 |
ret_val = EOB_ACT_LAST_MATCH; |
1037 |
yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; |
1038 |
} |
1039 |
} |
1040 |
|
1041 |
else |
1042 |
ret_val = EOB_ACT_CONTINUE_SCAN; |
1043 |
|
1044 |
yy_n_chars += number_to_move; |
1045 |
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
1046 |
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
1047 |
|
1048 |
yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; |
1049 |
|
1050 |
return ret_val; |
1051 |
} |
1052 |
|
1053 |
|
1054 |
/* yy_get_previous_state - get the state just before the EOB char was reached */ |
1055 |
|
1056 |
static yy_state_type yy_get_previous_state() |
1057 |
{ |
1058 |
register yy_state_type yy_current_state; |
1059 |
register char *yy_cp; |
1060 |
|
1061 |
yy_current_state = yy_start; |
1062 |
|
1063 |
for (yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp) { |
1064 |
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
1065 |
if (yy_accept[yy_current_state]) { |
1066 |
yy_last_accepting_state = yy_current_state; |
1067 |
yy_last_accepting_cpos = yy_cp; |
1068 |
} |
1069 |
while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { |
1070 |
yy_current_state = (int) yy_def[yy_current_state]; |
1071 |
if (yy_current_state >= 49) |
1072 |
yy_c = yy_meta[(unsigned int) yy_c]; |
1073 |
} |
1074 |
yy_current_state = |
1075 |
yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
1076 |
} |
1077 |
|
1078 |
return yy_current_state; |
1079 |
} |
1080 |
|
1081 |
|
1082 |
/* yy_try_NUL_trans - try to make a transition on the NUL character |
1083 |
* |
1084 |
* synopsis |
1085 |
* next_state = yy_try_NUL_trans( current_state ); |
1086 |
*/ |
1087 |
|
1088 |
#ifdef YY_USE_PROTOS |
1089 |
static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state) |
1090 |
#else |
1091 |
static yy_state_type yy_try_NUL_trans(yy_current_state) |
1092 |
yy_state_type yy_current_state; |
1093 |
#endif |
1094 |
{ |
1095 |
register int yy_is_jam; |
1096 |
register char *yy_cp = yy_c_buf_p; |
1097 |
|
1098 |
register YY_CHAR yy_c = 1; |
1099 |
if (yy_accept[yy_current_state]) { |
1100 |
yy_last_accepting_state = yy_current_state; |
1101 |
yy_last_accepting_cpos = yy_cp; |
1102 |
} |
1103 |
while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { |
1104 |
yy_current_state = (int) yy_def[yy_current_state]; |
1105 |
if (yy_current_state >= 49) |
1106 |
yy_c = yy_meta[(unsigned int) yy_c]; |
1107 |
} |
1108 |
yy_current_state = |
1109 |
yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
1110 |
yy_is_jam = (yy_current_state == 48); |
1111 |
|
1112 |
return yy_is_jam ? 0 : yy_current_state; |
1113 |
} |
1114 |
|
1115 |
|
1116 |
#ifndef YY_NO_UNPUT |
1117 |
#ifdef YY_USE_PROTOS |
1118 |
static void yyunput(int c, register char *yy_bp) |
1119 |
#else |
1120 |
static void yyunput(c, yy_bp) |
1121 |
int c; |
1122 |
register char *yy_bp; |
1123 |
#endif |
1124 |
{ |
1125 |
register char *yy_cp = yy_c_buf_p; |
1126 |
|
1127 |
/* undo effects of setting up yytext */ |
1128 |
*yy_cp = yy_hold_char; |
1129 |
|
1130 |
if (yy_cp < yy_current_buffer->yy_ch_buf + 2) { /* need to shift things up to make room */ |
1131 |
/* +2 for EOB chars. */ |
1132 |
register int number_to_move = yy_n_chars + 2; |
1133 |
register char *dest = |
1134 |
&yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + |
1135 |
2]; |
1136 |
register char *source = |
1137 |
&yy_current_buffer->yy_ch_buf[number_to_move]; |
1138 |
|
1139 |
while (source > yy_current_buffer->yy_ch_buf) |
1140 |
*--dest = *--source; |
1141 |
|
1142 |
yy_cp += (int) (dest - source); |
1143 |
yy_bp += (int) (dest - source); |
1144 |
yy_current_buffer->yy_n_chars = |
1145 |
yy_n_chars = yy_current_buffer->yy_buf_size; |
1146 |
|
1147 |
if (yy_cp < yy_current_buffer->yy_ch_buf + 2) |
1148 |
YY_FATAL_ERROR("flex scanner push-back overflow"); |
1149 |
} |
1150 |
|
1151 |
*--yy_cp = (char) c; |
1152 |
|
1153 |
|
1154 |
yytext_ptr = yy_bp; |
1155 |
yy_hold_char = *yy_cp; |
1156 |
yy_c_buf_p = yy_cp; |
1157 |
} |
1158 |
#endif /* ifndef YY_NO_UNPUT */ |
1159 |
|
1160 |
|
1161 |
#ifdef __cplusplus |
1162 |
static int yyinput() |
1163 |
#else |
1164 |
static int input() |
1165 |
#endif |
1166 |
{ |
1167 |
int c; |
1168 |
|
1169 |
*yy_c_buf_p = yy_hold_char; |
1170 |
|
1171 |
if (*yy_c_buf_p == YY_END_OF_BUFFER_CHAR) { |
1172 |
/* yy_c_buf_p now points to the character we want to return. |
1173 |
* If this occurs *before* the EOB characters, then it's a |
1174 |
* valid NUL; if not, then we've hit the end of the buffer. |
1175 |
*/ |
1176 |
if (yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars]) |
1177 |
/* This was really a NUL. */ |
1178 |
*yy_c_buf_p = '\0'; |
1179 |
|
1180 |
else { /* need more input */ |
1181 |
int offset = yy_c_buf_p - yytext_ptr; |
1182 |
++yy_c_buf_p; |
1183 |
|
1184 |
switch (yy_get_next_buffer()) { |
1185 |
case EOB_ACT_LAST_MATCH: |
1186 |
/* This happens because yy_g_n_b() |
1187 |
* sees that we've accumulated a |
1188 |
* token and flags that we need to |
1189 |
* try matching the token before |
1190 |
* proceeding. But for input(), |
1191 |
* there's no matching to consider. |
1192 |
* So convert the EOB_ACT_LAST_MATCH |
1193 |
* to EOB_ACT_END_OF_FILE. |
1194 |
*/ |
1195 |
|
1196 |
/* Reset buffer status. */ |
1197 |
yyrestart(yyin); |
1198 |
|
1199 |
/* fall through */ |
1200 |
|
1201 |
case EOB_ACT_END_OF_FILE: |
1202 |
{ |
1203 |
if (yywrap()) |
1204 |
return EOF; |
1205 |
|
1206 |
if (!yy_did_buffer_switch_on_eof) |
1207 |
YY_NEW_FILE; |
1208 |
#ifdef __cplusplus |
1209 |
return yyinput(); |
1210 |
#else |
1211 |
return input(); |
1212 |
#endif |
1213 |
} |
1214 |
|
1215 |
case EOB_ACT_CONTINUE_SCAN: |
1216 |
yy_c_buf_p = yytext_ptr + offset; |
1217 |
break; |
1218 |
} |
1219 |
} |
1220 |
} |
1221 |
|
1222 |
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ |
1223 |
*yy_c_buf_p = '\0'; /* preserve yytext */ |
1224 |
yy_hold_char = *++yy_c_buf_p; |
1225 |
|
1226 |
|
1227 |
return c; |
1228 |
} |
1229 |
|
1230 |
|
1231 |
#ifdef YY_USE_PROTOS |
1232 |
void yyrestart(FILE * input_file) |
1233 |
#else |
1234 |
void yyrestart(input_file) |
1235 |
FILE *input_file; |
1236 |
#endif |
1237 |
{ |
1238 |
if (!yy_current_buffer) |
1239 |
yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); |
1240 |
|
1241 |
yy_init_buffer(yy_current_buffer, input_file); |
1242 |
yy_load_buffer_state(); |
1243 |
} |
1244 |
|
1245 |
|
1246 |
#ifdef YY_USE_PROTOS |
1247 |
void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) |
1248 |
#else |
1249 |
void yy_switch_to_buffer(new_buffer) |
1250 |
YY_BUFFER_STATE new_buffer; |
1251 |
#endif |
1252 |
{ |
1253 |
if (yy_current_buffer == new_buffer) |
1254 |
return; |
1255 |
|
1256 |
if (yy_current_buffer) { |
1257 |
/* Flush out information for old buffer. */ |
1258 |
*yy_c_buf_p = yy_hold_char; |
1259 |
yy_current_buffer->yy_buf_pos = yy_c_buf_p; |
1260 |
yy_current_buffer->yy_n_chars = yy_n_chars; |
1261 |
} |
1262 |
|
1263 |
yy_current_buffer = new_buffer; |
1264 |
yy_load_buffer_state(); |
1265 |
|
1266 |
/* We don't actually know whether we did this switch during |
1267 |
* EOF (yywrap()) processing, but the only time this flag |
1268 |
* is looked at is after yywrap() is called, so it's safe |
1269 |
* to go ahead and always set it. |
1270 |
*/ |
1271 |
yy_did_buffer_switch_on_eof = 1; |
1272 |
} |
1273 |
|
1274 |
|
1275 |
#ifdef YY_USE_PROTOS |
1276 |
void yy_load_buffer_state(void) |
1277 |
#else |
1278 |
void yy_load_buffer_state() |
1279 |
#endif |
1280 |
{ |
1281 |
yy_n_chars = yy_current_buffer->yy_n_chars; |
1282 |
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; |
1283 |
yyin = yy_current_buffer->yy_input_file; |
1284 |
yy_hold_char = *yy_c_buf_p; |
1285 |
} |
1286 |
|
1287 |
|
1288 |
#ifdef YY_USE_PROTOS |
1289 |
YY_BUFFER_STATE yy_create_buffer(FILE * file, int size) |
1290 |
#else |
1291 |
YY_BUFFER_STATE yy_create_buffer(file, size) |
1292 |
FILE *file; |
1293 |
int size; |
1294 |
#endif |
1295 |
{ |
1296 |
YY_BUFFER_STATE b; |
1297 |
|
1298 |
b = (YY_BUFFER_STATE) yy_flex_alloc(sizeof(struct yy_buffer_state)); |
1299 |
if (!b) |
1300 |
YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); |
1301 |
|
1302 |
b->yy_buf_size = size; |
1303 |
|
1304 |
/* yy_ch_buf has to be 2 characters longer than the size given because |
1305 |
* we need to put in 2 end-of-buffer characters. |
1306 |
*/ |
1307 |
b->yy_ch_buf = (char *) yy_flex_alloc(b->yy_buf_size + 2); |
1308 |
if (!b->yy_ch_buf) |
1309 |
YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); |
1310 |
|
1311 |
b->yy_is_our_buffer = 1; |
1312 |
|
1313 |
yy_init_buffer(b, file); |
1314 |
|
1315 |
return b; |
1316 |
} |
1317 |
|
1318 |
|
1319 |
#ifdef YY_USE_PROTOS |
1320 |
void yy_delete_buffer(YY_BUFFER_STATE b) |
1321 |
#else |
1322 |
void yy_delete_buffer(b) |
1323 |
YY_BUFFER_STATE b; |
1324 |
#endif |
1325 |
{ |
1326 |
if (!b) |
1327 |
return; |
1328 |
|
1329 |
if (b == yy_current_buffer) |
1330 |
yy_current_buffer = (YY_BUFFER_STATE) 0; |
1331 |
|
1332 |
if (b->yy_is_our_buffer) |
1333 |
yy_flex_free((void *) b->yy_ch_buf); |
1334 |
|
1335 |
yy_flex_free((void *) b); |
1336 |
} |
1337 |
|
1338 |
|
1339 |
#ifndef YY_ALWAYS_INTERACTIVE |
1340 |
#ifndef YY_NEVER_INTERACTIVE |
1341 |
extern int isatty YY_PROTO((int)); |
1342 |
#endif |
1343 |
#endif |
1344 |
|
1345 |
#ifdef YY_USE_PROTOS |
1346 |
void yy_init_buffer(YY_BUFFER_STATE b, FILE * file) |
1347 |
#else |
1348 |
void yy_init_buffer(b, file) |
1349 |
YY_BUFFER_STATE b; |
1350 |
FILE *file; |
1351 |
#endif |
1352 |
|
1353 |
|
1354 |
{ |
1355 |
yy_flush_buffer(b); |
1356 |
|
1357 |
b->yy_input_file = file; |
1358 |
b->yy_fill_buffer = 1; |
1359 |
|
1360 |
#if YY_ALWAYS_INTERACTIVE |
1361 |
b->yy_is_interactive = 1; |
1362 |
#else |
1363 |
#if YY_NEVER_INTERACTIVE |
1364 |
b->yy_is_interactive = 0; |
1365 |
#else |
1366 |
b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0; |
1367 |
#endif |
1368 |
#endif |
1369 |
} |
1370 |
|
1371 |
|
1372 |
#ifdef YY_USE_PROTOS |
1373 |
void yy_flush_buffer(YY_BUFFER_STATE b) |
1374 |
#else |
1375 |
void yy_flush_buffer(b) |
1376 |
YY_BUFFER_STATE b; |
1377 |
#endif |
1378 |
|
1379 |
{ |
1380 |
if (!b) |
1381 |
return; |
1382 |
|
1383 |
b->yy_n_chars = 0; |
1384 |
|
1385 |
/* We always need two end-of-buffer characters. The first causes |
1386 |
* a transition to the end-of-buffer state. The second causes |
1387 |
* a jam in that state. |
1388 |
*/ |
1389 |
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
1390 |
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
1391 |
|
1392 |
b->yy_buf_pos = &b->yy_ch_buf[0]; |
1393 |
|
1394 |
b->yy_at_bol = 1; |
1395 |
b->yy_buffer_status = YY_BUFFER_NEW; |
1396 |
|
1397 |
if (b == yy_current_buffer) |
1398 |
yy_load_buffer_state(); |
1399 |
} |
1400 |
|
1401 |
|
1402 |
#ifndef YY_NO_SCAN_BUFFER |
1403 |
#ifdef YY_USE_PROTOS |
1404 |
YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size) |
1405 |
#else |
1406 |
YY_BUFFER_STATE yy_scan_buffer(base, size) |
1407 |
char *base; |
1408 |
yy_size_t size; |
1409 |
#endif |
1410 |
{ |
1411 |
YY_BUFFER_STATE b; |
1412 |
|
1413 |
if (size < 2 || |
1414 |
base[size - 2] != YY_END_OF_BUFFER_CHAR || |
1415 |
base[size - 1] != YY_END_OF_BUFFER_CHAR) |
1416 |
/* They forgot to leave room for the EOB's. */ |
1417 |
return 0; |
1418 |
|
1419 |
b = (YY_BUFFER_STATE) yy_flex_alloc(sizeof(struct yy_buffer_state)); |
1420 |
if (!b) |
1421 |
YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); |
1422 |
|
1423 |
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
1424 |
b->yy_buf_pos = b->yy_ch_buf = base; |
1425 |
b->yy_is_our_buffer = 0; |
1426 |
b->yy_input_file = 0; |
1427 |
b->yy_n_chars = b->yy_buf_size; |
1428 |
b->yy_is_interactive = 0; |
1429 |
b->yy_at_bol = 1; |
1430 |
b->yy_fill_buffer = 0; |
1431 |
b->yy_buffer_status = YY_BUFFER_NEW; |
1432 |
|
1433 |
yy_switch_to_buffer(b); |
1434 |
|
1435 |
return b; |
1436 |
} |
1437 |
#endif |
1438 |
|
1439 |
|
1440 |
#ifndef YY_NO_SCAN_STRING |
1441 |
#ifdef YY_USE_PROTOS |
1442 |
YY_BUFFER_STATE yy_scan_string(yyconst char *yy_str) |
1443 |
#else |
1444 |
YY_BUFFER_STATE yy_scan_string(yy_str) |
1445 |
yyconst char *yy_str; |
1446 |
#endif |
1447 |
{ |
1448 |
int len; |
1449 |
for (len = 0; yy_str[len]; ++len); |
1450 |
|
1451 |
return yy_scan_bytes(yy_str, len); |
1452 |
} |
1453 |
#endif |
1454 |
|
1455 |
|
1456 |
#ifndef YY_NO_SCAN_BYTES |
1457 |
#ifdef YY_USE_PROTOS |
1458 |
YY_BUFFER_STATE yy_scan_bytes(yyconst char *bytes, int len) |
1459 |
#else |
1460 |
YY_BUFFER_STATE yy_scan_bytes(bytes, len) |
1461 |
yyconst char *bytes; |
1462 |
int len; |
1463 |
#endif |
1464 |
{ |
1465 |
YY_BUFFER_STATE b; |
1466 |
char *buf; |
1467 |
yy_size_t n; |
1468 |
int i; |
1469 |
|
1470 |
/* Get memory for full buffer, including space for trailing EOB's. */ |
1471 |
n = len + 2; |
1472 |
buf = (char *) yy_flex_alloc(n); |
1473 |
if (!buf) |
1474 |
YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); |
1475 |
|
1476 |
for (i = 0; i < len; ++i) |
1477 |
buf[i] = bytes[i]; |
1478 |
|
1479 |
buf[len] = buf[len + 1] = YY_END_OF_BUFFER_CHAR; |
1480 |
|
1481 |
b = yy_scan_buffer(buf, n); |
1482 |
if (!b) |
1483 |
YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); |
1484 |
|
1485 |
/* It's okay to grow etc. this buffer, and we should throw it |
1486 |
* away when we're done. |
1487 |
*/ |
1488 |
b->yy_is_our_buffer = 1; |
1489 |
|
1490 |
return b; |
1491 |
} |
1492 |
#endif |
1493 |
|
1494 |
|
1495 |
#ifndef YY_NO_PUSH_STATE |
1496 |
#ifdef YY_USE_PROTOS |
1497 |
static void yy_push_state(int new_state) |
1498 |
#else |
1499 |
static void yy_push_state(new_state) |
1500 |
int new_state; |
1501 |
#endif |
1502 |
{ |
1503 |
if (yy_start_stack_ptr >= yy_start_stack_depth) { |
1504 |
yy_size_t new_size; |
1505 |
|
1506 |
yy_start_stack_depth += YY_START_STACK_INCR; |
1507 |
new_size = yy_start_stack_depth * sizeof(int); |
1508 |
|
1509 |
if (!yy_start_stack) |
1510 |
yy_start_stack = (int *) yy_flex_alloc(new_size); |
1511 |
|
1512 |
else |
1513 |
yy_start_stack = (int *) yy_flex_realloc((void *) yy_start_stack, |
1514 |
new_size); |
1515 |
|
1516 |
if (!yy_start_stack) |
1517 |
YY_FATAL_ERROR("out of memory expanding start-condition stack"); |
1518 |
} |
1519 |
|
1520 |
yy_start_stack[yy_start_stack_ptr++] = YY_START; |
1521 |
|
1522 |
BEGIN(new_state); |
1523 |
} |
1524 |
#endif |
1525 |
|
1526 |
|
1527 |
#ifndef YY_NO_POP_STATE |
1528 |
static void yy_pop_state() |
1529 |
{ |
1530 |
if (--yy_start_stack_ptr < 0) |
1531 |
YY_FATAL_ERROR("start-condition stack underflow"); |
1532 |
|
1533 |
BEGIN(yy_start_stack[yy_start_stack_ptr]); |
1534 |
} |
1535 |
#endif |
1536 |
|
1537 |
|
1538 |
#ifndef YY_NO_TOP_STATE |
1539 |
static int yy_top_state() |
1540 |
{ |
1541 |
return yy_start_stack[yy_start_stack_ptr - 1]; |
1542 |
} |
1543 |
#endif |
1544 |
|
1545 |
#ifndef YY_EXIT_FAILURE |
1546 |
#define YY_EXIT_FAILURE 2 |
1547 |
#endif |
1548 |
|
1549 |
#ifdef YY_USE_PROTOS |
1550 |
static void yy_fatal_error(yyconst char msg[]) |
1551 |
#else |
1552 |
static void yy_fatal_error(msg) |
1553 |
char msg[]; |
1554 |
#endif |
1555 |
{ |
1556 |
(void) fprintf(stderr, "%s\n", msg); |
1557 |
exit(YY_EXIT_FAILURE); |
1558 |
} |
1559 |
|
1560 |
|
1561 |
|
1562 |
/* Redefine yyless() so it works in section 3 code. */ |
1563 |
|
1564 |
#undef yyless |
1565 |
#define yyless(n) \ |
1566 |
do \ |
1567 |
{ \ |
1568 |
/* Undo effects of setting up yytext. */ \ |
1569 |
yytext[yyleng] = yy_hold_char; \ |
1570 |
yy_c_buf_p = yytext + n; \ |
1571 |
yy_hold_char = *yy_c_buf_p; \ |
1572 |
*yy_c_buf_p = '\0'; \ |
1573 |
yyleng = n; \ |
1574 |
} \ |
1575 |
while ( 0 ) |
1576 |
|
1577 |
|
1578 |
/* Internal utility routines. */ |
1579 |
|
1580 |
#ifndef yytext_ptr |
1581 |
#ifdef YY_USE_PROTOS |
1582 |
static void yy_flex_strncpy(char *s1, yyconst char *s2, int n) |
1583 |
#else |
1584 |
static void yy_flex_strncpy(s1, s2, n) |
1585 |
char *s1; |
1586 |
yyconst char *s2; |
1587 |
int n; |
1588 |
#endif |
1589 |
{ |
1590 |
register int i; |
1591 |
for (i = 0; i < n; ++i) |
1592 |
s1[i] = s2[i]; |
1593 |
} |
1594 |
#endif |
1595 |
|
1596 |
#ifdef YY_NEED_STRLEN |
1597 |
#ifdef YY_USE_PROTOS |
1598 |
static int yy_flex_strlen(yyconst char *s) |
1599 |
#else |
1600 |
static int yy_flex_strlen(s) |
1601 |
yyconst char *s; |
1602 |
#endif |
1603 |
{ |
1604 |
register int n; |
1605 |
for (n = 0; s[n]; ++n); |
1606 |
|
1607 |
return n; |
1608 |
} |
1609 |
#endif |
1610 |
|
1611 |
|
1612 |
#ifdef YY_USE_PROTOS |
1613 |
static void *yy_flex_alloc(yy_size_t size) |
1614 |
#else |
1615 |
static void *yy_flex_alloc(size) |
1616 |
yy_size_t size; |
1617 |
#endif |
1618 |
{ |
1619 |
return (void *) malloc(size); |
1620 |
} |
1621 |
|
1622 |
#ifdef YY_USE_PROTOS |
1623 |
static void *yy_flex_realloc(void *ptr, yy_size_t size) |
1624 |
#else |
1625 |
static void *yy_flex_realloc(ptr, size) |
1626 |
void *ptr; |
1627 |
yy_size_t size; |
1628 |
#endif |
1629 |
{ |
1630 |
/* The cast to (char *) in the following accommodates both |
1631 |
* implementations that use char* generic pointers, and those |
1632 |
* that use void* generic pointers. It works with the latter |
1633 |
* because both ANSI C and C++ allow castless assignment from |
1634 |
* any pointer type to void*, and deal with argument conversions |
1635 |
* as though doing an assignment. |
1636 |
*/ |
1637 |
return (void *) realloc((char *) ptr, size); |
1638 |
} |
1639 |
|
1640 |
#ifdef YY_USE_PROTOS |
1641 |
static void yy_flex_free(void *ptr) |
1642 |
#else |
1643 |
static void yy_flex_free(ptr) |
1644 |
void *ptr; |
1645 |
#endif |
1646 |
{ |
1647 |
free(ptr); |
1648 |
} |
1649 |
|
1650 |
#if YY_MAIN |
1651 |
int main() |
1652 |
{ |
1653 |
yylex(); |
1654 |
return 0; |
1655 |
} |
1656 |
#endif |
1657 |
#line 122 "boa_lexer.l" |
1658 |
|
1659 |
|
1660 |
/* In yywrap we track which file we are on. |
1661 |
* 1: close hydra.conf, open mime.types |
1662 |
* 2: return 1; |
1663 |
*/ |
1664 |
|
1665 |
int yywrap() |
1666 |
{ |
1667 |
fclose(yyin); |
1668 |
file++; |
1669 |
|
1670 |
switch (file) { |
1671 |
case 1: |
1672 |
yyin = fopen(mime_types, "r"); |
1673 |
if (!yyin) { |
1674 |
fprintf(stderr, "Could not open mime.types file, \"%s\", " |
1675 |
"for reading\n", mime_types); |
1676 |
exit(1); |
1677 |
} |
1678 |
BEGIN MIME; |
1679 |
return 0; |
1680 |
default: |
1681 |
BEGIN INITIAL; |
1682 |
file = 0; /* in case we reread config files */ |
1683 |
return 1; |
1684 |
} |
1685 |
} |
1686 |
|
1687 |
int yyerror(char *msg) |
1688 |
{ |
1689 |
fprintf(stderr, "Error on line %d of %s: %s\n", lineno, |
1690 |
(file == 0 ? "hydra.conf" : "mime.types"), msg); |
1691 |
return 1; |
1692 |
} |