Sat Sep 25 22:11:10 PDT 2004
- Previous message: [Slony1-commit] By darcyb: Opps copy/paste function prototypeing is bad mojo, fix
- Next message: [Slony1-commit] By xfade: Typo fix, noticed by Justin Clift
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message: ----------- These are generated files and really should not be in CVS. Removed Files: ------------- slony1-engine/src/slonik: parser.c scan.c -------------- next part -------------- --- src/slonik/scan.c +++ /dev/null @@ -1,2175 +0,0 @@ -#line 2 "scan.c" -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /usr/local/cvsroot/slony1/slony1-engine/src/slonik/Attic/scan.c,v 1.19 2004/09/07 17:10:34 wieck Exp $ - * $FreeBSD: src/usr.bin/lex/flex.skl,v 1.4 1999/10/27 07:56:44 obrien Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include <stdio.h> - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include <stdlib.h> -#include <unistd.h> - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include <io.h> -#include <stdlib.h> -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define yywrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 77 -#define YY_END_OF_BUFFER 78 -static yyconst short int yy_acclist[423] = - { 0, - 78, 76, 77, 68, 76, 77, 68, 77, 75, 76, - 77, 69, 76, 77, 66, 76, 77, 67, 76, 77, - 67, 76, 77, 67, 76, 77, 67, 76, 77, 67, - 76, 77, 67, 76, 77, 67, 76, 77, 67, 76, - 77, 67, 76, 77, 67, 76, 77, 67, 76, 77, - 67, 76, 77, 67, 76, 77, 67, 76, 77, 67, - 76, 77, 67, 76, 77, 67, 76, 77, 67, 76, - 77, 67, 76, 77, 67, 76, 77, 67, 76, 77, - 74, 77, 73, 77, 71, 77, 68, 75, 66, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 26, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 35, 67, 67, 67, 39, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 74, 72, 70, - 1, 67, 67, 3, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 21, 67, 67, 67, 67, 28, 67, 67, 67, 67, - 67, 67, 34, 67, 67, 37, 67, 38, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 51, - 67, 67, 67, 67, 67, 67, 67, 67, 59, 67, - - 67, 67, 67, 67, 67, 64, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 12, 67, 13, 67, 67, - 67, 67, 17, 67, 67, 67, 67, 67, 23, 67, - 67, 27, 67, 67, 30, 67, 67, 32, 67, 33, - 67, 36, 67, 40, 67, 67, 42, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 58, 67, 67, 67, 67, 67, 65, 67, - 2, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 14, 67, 15, 67, 67, 67, 19, 67, 67, 67, - 24, 67, 67, 67, 31, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 52, 67, 67, 67, 55, - 67, 67, 67, 67, 67, 67, 67, 4, 67, 5, - 67, 67, 67, 67, 67, 67, 11, 67, 67, 67, - 67, 67, 67, 29, 67, 41, 67, 67, 67, 67, - 67, 47, 67, 67, 49, 67, 50, 67, 67, 67, - 67, 67, 67, 61, 67, 67, 63, 67, 6, 67, - 7, 67, 67, 67, 67, 16, 67, 67, 67, 22, - 67, 67, 67, 67, 67, 46, 67, 67, 67, 54, - 67, 56, 67, 57, 67, 67, 67, 67, 9, 67, - 67, 18, 67, 20, 67, 67, 43, 67, 67, 45, - - 67, 48, 67, 67, 67, 67, 8, 67, 10, 67, - 25, 67, 44, 67, 53, 67, 60, 67, 67, 67, - 62, 67 - } ; - -static yyconst short int yy_accept[309] = - { 0, - 1, 1, 1, 1, 1, 2, 4, 7, 9, 12, - 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, - 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, - 75, 78, 81, 83, 85, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 118, 119, 120, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 143, 144, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - - 157, 158, 159, 160, 161, 163, 164, 165, 166, 168, - 169, 170, 171, 172, 173, 175, 176, 178, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 192, - 193, 194, 195, 196, 197, 198, 199, 201, 202, 203, - 204, 205, 206, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 218, 220, 221, 222, 223, 225, 226, 227, - 228, 229, 231, 232, 234, 235, 237, 238, 240, 242, - 244, 246, 247, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 265, 266, - 267, 268, 269, 271, 273, 274, 275, 276, 277, 278, - - 279, 280, 281, 283, 285, 286, 287, 289, 290, 291, - 293, 294, 295, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 308, 309, 310, 312, 313, 314, 315, - 316, 317, 318, 320, 322, 323, 324, 325, 326, 327, - 329, 330, 331, 332, 333, 334, 336, 338, 339, 340, - 341, 342, 344, 345, 347, 349, 350, 351, 352, 353, - 354, 356, 357, 359, 361, 363, 364, 365, 366, 368, - 369, 370, 372, 373, 374, 375, 376, 378, 379, 380, - 382, 384, 386, 387, 388, 389, 391, 392, 394, 396, - 397, 399, 400, 402, 404, 405, 406, 407, 409, 411, - - 413, 415, 417, 419, 420, 421, 423, 423 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 2, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 5, 6, 1, 1, 7, 1, - 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, - 1, 1, 1, 1, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 10, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 10, - 1, 9, 1, 1, 10, 1, 11, 12, 13, 14, - - 15, 16, 17, 18, 19, 10, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 10, 1, 1, 1, 1, 1, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10 - } ; - -static yyconst int yy_meta[35] = - { 0, - 1, 1, 2, 3, 1, 4, 5, 4, 5, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4 - } ; - -static yyconst short int yy_base[313] = - { 0, - 0, 0, 28, 29, 332, 333, 37, 40, 0, 333, - 323, 0, 31, 319, 26, 302, 33, 37, 35, 313, - 35, 47, 54, 47, 46, 297, 311, 62, 61, 56, - 314, 309, 0, 316, 0, 80, 0, 314, 0, 71, - 300, 307, 57, 67, 304, 294, 299, 289, 300, 36, - 75, 293, 286, 74, 0, 293, 277, 282, 296, 281, - 276, 284, 273, 290, 287, 288, 280, 281, 270, 274, - 286, 73, 269, 73, 271, 91, 282, 271, 79, 86, - 278, 272, 262, 0, 333, 333, 0, 270, 0, 268, - 272, 258, 263, 92, 273, 258, 258, 257, 257, 266, - - 249, 256, 248, 260, 242, 252, 259, 242, 0, 241, - 249, 251, 252, 251, 0, 250, 0, 0, 230, 246, - 244, 230, 239, 244, 229, 238, 226, 87, 0, 228, - 226, 240, 231, 236, 233, 234, 0, 225, 223, 216, - 234, 215, 0, 220, 212, 218, 211, 224, 219, 92, - 208, 0, 0, 209, 206, 204, 0, 209, 217, 208, - 219, 195, 199, 0, 212, 0, 211, 0, 0, 0, - 0, 206, 0, 205, 204, 203, 210, 195, 204, 207, - 202, 201, 202, 199, 198, 188, 194, 0, 182, 196, - 196, 178, 0, 0, 181, 176, 189, 180, 175, 178, - - 185, 184, 0, 0, 169, 166, 0, 185, 168, 0, - 175, 170, 0, 169, 177, 174, 158, 161, 158, 163, - 164, 157, 0, 156, 154, 0, 151, 165, 150, 158, - 149, 161, 0, 0, 148, 145, 151, 156, 142, 0, - 155, 154, 146, 153, 142, 0, 0, 150, 145, 148, - 133, 0, 148, 0, 0, 141, 131, 129, 130, 145, - 0, 142, 0, 0, 0, 139, 129, 125, 0, 124, - 135, 0, 126, 121, 132, 119, 0, 130, 132, 0, - 0, 0, 122, 115, 127, 0, 106, 0, 0, 111, - 0, 121, 0, 0, 112, 105, 98, 0, 0, 0, - - 0, 0, 0, 104, 97, 0, 333, 119, 124, 106, - 129, 133 - } ; - -static yyconst short int yy_def[313] = - { 0, - 307, 1, 308, 308, 307, 307, 307, 307, 309, 307, - 307, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 311, 307, 312, 307, 309, 307, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 311, 307, 307, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - - 310, 310, 310, 310, 310, 310, 0, 307, 307, 307, - 307, 307 - } ; - -static yyconst short int yy_nxt[368] = - { 0, - 6, 7, 8, 7, 9, 6, 10, 11, 6, 12, - 13, 14, 15, 16, 17, 18, 12, 12, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 12, 31, 12, 32, 34, 34, 35, 35, 36, 36, - 36, 36, 36, 36, 40, 47, 43, 51, 55, 44, - 100, 41, 45, 58, 101, 52, 69, 56, 59, 48, - 53, 60, 65, 49, 62, 50, 54, 66, 63, 67, - 61, 77, 70, 68, 73, 91, 74, 64, 80, 78, - 81, 36, 36, 36, 87, 124, 92, 79, 93, 94, - 75, 76, 88, 102, 106, 103, 107, 135, 127, 128, - - 125, 129, 131, 132, 138, 180, 139, 149, 136, 39, - 200, 306, 137, 140, 150, 305, 304, 181, 201, 33, - 33, 33, 33, 33, 37, 303, 302, 37, 37, 84, - 84, 84, 84, 86, 301, 86, 86, 86, 300, 299, - 298, 297, 296, 295, 294, 293, 292, 291, 290, 289, - 288, 287, 286, 285, 284, 283, 282, 281, 280, 279, - 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, - 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, - 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, - 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, - - 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, - 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, - 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, - 208, 207, 206, 205, 204, 203, 202, 199, 198, 197, - 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, - 186, 185, 184, 183, 182, 179, 178, 177, 176, 175, - 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, - 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, - 154, 153, 152, 151, 148, 147, 146, 145, 144, 143, - 142, 141, 134, 133, 130, 126, 123, 122, 121, 120, - - 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, - 109, 108, 105, 104, 99, 98, 97, 96, 95, 90, - 89, 38, 85, 83, 82, 72, 71, 57, 46, 42, - 38, 307, 5, 307, 307, 307, 307, 307, 307, 307, - 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, - 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, - 307, 307, 307, 307, 307, 307, 307 - } ; - -static yyconst short int yy_chk[368] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 4, 3, 4, 7, 7, - 7, 8, 8, 8, 13, 17, 15, 18, 19, 15, - 50, 13, 15, 21, 50, 18, 25, 19, 21, 17, - 18, 22, 24, 17, 23, 17, 18, 24, 23, 24, - 22, 29, 25, 24, 28, 43, 28, 23, 30, 29, - 30, 36, 36, 36, 40, 72, 43, 29, 44, 44, - 28, 28, 40, 51, 54, 51, 54, 79, 74, 74, - - 72, 74, 76, 76, 80, 128, 80, 94, 79, 310, - 150, 305, 79, 80, 94, 304, 297, 128, 150, 308, - 308, 308, 308, 308, 309, 296, 295, 309, 309, 311, - 311, 311, 311, 312, 292, 312, 312, 312, 290, 287, - 285, 284, 283, 279, 278, 276, 275, 274, 273, 271, - 270, 268, 267, 266, 262, 260, 259, 258, 257, 256, - 253, 251, 250, 249, 248, 245, 244, 243, 242, 241, - 239, 238, 237, 236, 235, 232, 231, 230, 229, 228, - 227, 225, 224, 222, 221, 220, 219, 218, 217, 216, - 215, 214, 212, 211, 209, 208, 206, 205, 202, 201, - - 200, 199, 198, 197, 196, 195, 192, 191, 190, 189, - 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, - 177, 176, 175, 174, 172, 167, 165, 163, 162, 161, - 160, 159, 158, 156, 155, 154, 151, 149, 148, 147, - 146, 145, 144, 142, 141, 140, 139, 138, 136, 135, - 134, 133, 132, 131, 130, 127, 126, 125, 124, 123, - 122, 121, 120, 119, 116, 114, 113, 112, 111, 110, - 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, - 98, 97, 96, 95, 93, 92, 91, 90, 88, 83, - 82, 81, 78, 77, 75, 73, 71, 70, 69, 68, - - 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, - 57, 56, 53, 52, 49, 48, 47, 46, 45, 42, - 41, 38, 34, 32, 31, 27, 26, 20, 16, 14, - 11, 5, 307, 307, 307, 307, 307, 307, 307, 307, - 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, - 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, - 307, 307, 307, 307, 307, 307, 307 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "scan.l" -#define INITIAL 0 -#line 2 "scan.l" -/*------------------------------------------------------------------------- - * scan.l - * - * Flex keyword and token scanner for slonik - * - * Copyright (c) 2003-2004, PostgreSQL Global Development Group - * Author: Jan Wieck, Afilias USA INC. - * - * $Id: scan.c,v 1.19 2004/09/07 17:10:34 wieck Exp $ - *------------------------------------------------------------------------- - */ -#define YY_NO_UNPUT 1 -#define IN_STRING 1 - -/* -quoted_ident (\"[^\"]*\")+ -identifier ({ident_start}{ident_cont}*|{quoted_ident}) -*/ -#line 627 "scan.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include <stdlib.h> -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 34 "scan.l" - - - char *start_charpos = NULL; - - BEGIN(INITIAL); - -#line 785 "scan.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 308 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 333 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - ++yylineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 40 "scan.l" -{ return K_ADD; } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 41 "scan.l" -{ return K_ADMIN; } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 42 "scan.l" -{ return K_ALL; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 43 "scan.l" -{ return K_BACKUP; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 44 "scan.l" -{ return K_CLIENT; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 45 "scan.l" -{ return K_CLUSTER; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 46 "scan.l" -{ return K_COMMENT; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 47 "scan.l" -{ return K_CONFIRMED; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 48 "scan.l" -{ return K_CONNINFO; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 49 "scan.l" -{ return K_CONNRETRY; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 50 "scan.l" -{ return K_CREATE; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 51 "scan.l" -{ return K_DROP; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 52 "scan.l" -{ return K_ECHO; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 53 "scan.l" -{ return K_ERROR; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 54 "scan.l" -{ return K_EVENT; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 55 "scan.l" -{ return K_EXECUTE; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 56 "scan.l" -{ return K_EXIT; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 57 "scan.l" -{ return K_FAILOVER; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 58 "scan.l" -{ return K_FALSE; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 59 "scan.l" -{ return K_FILENAME; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 60 "scan.l" -{ return K_FOR; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 61 "scan.l" -{ return K_FORWARD; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 62 "scan.l" -{ return K_FULL; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 63 "scan.l" -{ return K_FULL; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 64 "scan.l" -{ return K_FUNCTIONS; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 65 "scan.l" -{ return K_ID; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 66 "scan.l" -{ return K_INIT; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 67 "scan.l" -{ return K_KEY; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 68 "scan.l" -{ return K_LISTEN; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 69 "scan.l" -{ return K_LOCK; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 70 "scan.l" -{ return K_MERGE; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 71 "scan.l" -{ return K_MOVE; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 72 "scan.l" -{ return K_NAME; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 73 "scan.l" -{ return K_NEW; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 74 "scan.l" -{ return K_NO; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 75 "scan.l" -{ return K_NODE; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 76 "scan.l" -{ return K_OFF; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 77 "scan.l" -{ return K_OLD; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 78 "scan.l" -{ return K_ON; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 79 "scan.l" -{ return K_ONLY; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 80 "scan.l" -{ return K_ORIGIN; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 81 "scan.l" -{ return K_PATH; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 82 "scan.l" -{ return K_PROVIDER; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 83 "scan.l" -{ return K_QUALIFIED; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 84 "scan.l" -{ return K_RECEIVER; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 85 "scan.l" -{ return K_RESTART; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 86 "scan.l" -{ return K_SCRIPT; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 87 "scan.l" -{ return K_SEQUENCE; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 88 "scan.l" -{ return K_SERIAL; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 89 "scan.l" -{ return K_SERVER; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 90 "scan.l" -{ return K_SET; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 91 "scan.l" -{ return K_STORE; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 92 "scan.l" -{ return K_SUBSCRIBE; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 93 "scan.l" -{ return K_SUCCESS; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 94 "scan.l" -{ return K_TABLE; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 95 "scan.l" -{ return K_TIMEOUT; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 96 "scan.l" -{ return K_TRIGGER; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 97 "scan.l" -{ return K_TRUE; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 98 "scan.l" -{ return K_TRY; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 99 "scan.l" -{ return K_UNINSTALL; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 100 "scan.l" -{ return K_UNLOCK; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 101 "scan.l" -{ return K_UNSUBSCRIBE; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 102 "scan.l" -{ return K_UPDATE; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 103 "scan.l" -{ return K_YES; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 104 "scan.l" -{ return K_WAIT; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 106 "scan.l" -{ return T_NUMBER; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 107 "scan.l" -{ return T_IDENT; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 109 "scan.l" -; - YY_BREAK -case 69: -YY_RULE_SETUP -#line 111 "scan.l" -{ - start_charpos = yytext; - BEGIN(IN_STRING); - } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 115 "scan.l" -{ } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 116 "scan.l" -{ } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 117 "scan.l" -{ } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 118 "scan.l" -{ - yyleng += (yytext - start_charpos) - 2; - yytext = start_charpos + 1; - BEGIN(INITIAL); - return T_LITERAL; - } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 124 "scan.l" -{} - YY_BREAK -case 75: -YY_RULE_SETUP -#line 126 "scan.l" -; - YY_BREAK -case 76: -YY_RULE_SETUP -#line 128 "scan.l" -{ return yytext[0]; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 130 "scan.l" -ECHO; - YY_BREAK -#line 1269 "scan.c" - case YY_STATE_EOF(INITIAL): - case YY_STATE_EOF(IN_STRING): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 308 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 308 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 307); - if ( ! yy_is_jam ) - *yy_state_ptr++ = yy_current_state; - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --yylineno; - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - if ( c == '\n' ) - ++yylineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 130 "scan.l" - - -void -scan_new_input_file(FILE *in) -{ - SlonDString ds; - char buf[8192]; - int len; - - if (YY_CURRENT_BUFFER) - yy_delete_buffer(YY_CURRENT_BUFFER); - - dstring_init(&ds); - while ((len = fread(&buf, 1, 8192, in)) > 0) - { - dstring_nappend(&ds, buf, len); - } - dstring_terminate(&ds); - yy_switch_to_buffer(yy_scan_string(dstring_data(&ds))); - - dstring_free(&ds); -} --- src/slonik/parser.c +++ /dev/null @@ -1,3359 +0,0 @@ -/* A Bison parser, made by GNU Bison 1.875. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - K_ADD = 258, - K_ADMIN = 259, - K_ALL = 260, - K_BACKUP = 261, - K_CLIENT = 262, - K_CLUSTER = 263, - K_CLUSTERNAME = 264, - K_COMMENT = 265, - K_CONFIRMED = 266, - K_CONNINFO = 267, - K_CONNRETRY = 268, - K_CREATE = 269, - K_DROP = 270, - K_ECHO = 271, - K_ERROR = 272, - K_EVENT = 273, - K_EXECUTE = 274, - K_EXIT = 275, - K_FAILOVER = 276, - K_FALSE = 277, - K_FILENAME = 278, - K_FOR = 279, - K_FORWARD = 280, - K_FULL = 281, - K_FUNCTIONS = 282, - K_ID = 283, - K_INIT = 284, - K_KEY = 285, - K_LISTEN = 286, - K_LOCK = 287, - K_MERGE = 288, - K_MOVE = 289, - K_NAME = 290, - K_NEW = 291, - K_NO = 292, - K_NODE = 293, - K_OFF = 294, - K_OLD = 295, - K_ON = 296, - K_ONLY = 297, - K_ORIGIN = 298, - K_PATH = 299, - K_PROVIDER = 300, - K_QUALIFIED = 301, - K_RECEIVER = 302, - K_RESTART = 303, - K_SCRIPT = 304, - K_SEQUENCE = 305, - K_SERIAL = 306, - K_SERVER = 307, - K_SET = 308, - K_STORE = 309, - K_SUBSCRIBE = 310, - K_SUCCESS = 311, - K_TABLE = 312, - K_TIMEOUT = 313, - K_TRIGGER = 314, - K_TRUE = 315, - K_TRY = 316, - K_UNINSTALL = 317, - K_UNLOCK = 318, - K_UNSUBSCRIBE = 319, - K_UPDATE = 320, - K_YES = 321, - K_WAIT = 322, - T_IDENT = 323, - T_LITERAL = 324, - T_NUMBER = 325 - }; -#endif -#define K_ADD 258 -#define K_ADMIN 259 -#define K_ALL 260 -#define K_BACKUP 261 -#define K_CLIENT 262 -#define K_CLUSTER 263 -#define K_CLUSTERNAME 264 -#define K_COMMENT 265 -#define K_CONFIRMED 266 -#define K_CONNINFO 267 -#define K_CONNRETRY 268 -#define K_CREATE 269 -#define K_DROP 270 -#define K_ECHO 271 -#define K_ERROR 272 -#define K_EVENT 273 -#define K_EXECUTE 274 -#define K_EXIT 275 -#define K_FAILOVER 276 -#define K_FALSE 277 -#define K_FILENAME 278 -#define K_FOR 279 -#define K_FORWARD 280 -#define K_FULL 281 -#define K_FUNCTIONS 282 -#define K_ID 283 -#define K_INIT 284 -#define K_KEY 285 -#define K_LISTEN 286 -#define K_LOCK 287 -#define K_MERGE 288 -#define K_MOVE 289 -#define K_NAME 290 -#define K_NEW 291 -#define K_NO 292 -#define K_NODE 293 -#define K_OFF 294 -#define K_OLD 295 -#define K_ON 296 -#define K_ONLY 297 -#define K_ORIGIN 298 -#define K_PATH 299 -#define K_PROVIDER 300 -#define K_QUALIFIED 301 -#define K_RECEIVER 302 -#define K_RESTART 303 -#define K_SCRIPT 304 -#define K_SEQUENCE 305 -#define K_SERIAL 306 -#define K_SERVER 307 -#define K_SET 308 -#define K_STORE 309 -#define K_SUBSCRIBE 310 -#define K_SUCCESS 311 -#define K_TABLE 312 -#define K_TIMEOUT 313 -#define K_TRIGGER 314 -#define K_TRUE 315 -#define K_TRY 316 -#define K_UNINSTALL 317 -#define K_UNLOCK 318 -#define K_UNSUBSCRIBE 319 -#define K_UPDATE 320 -#define K_YES 321 -#define K_WAIT 322 -#define T_IDENT 323 -#define T_LITERAL 324 -#define T_NUMBER 325 - - - - -/* Copy the first part of user declarations. */ -#line 1 "parser.y" - -/*------------------------------------------------------------------------- - * parser.y - * - * The slonik command language grammar - * - * Copyright (c) 2003-2004, PostgreSQL Global Development Group - * Author: Jan Wieck, Afilias USA INC. - * - * $Id: parser.c,v 1.18 2004/09/07 17:10:26 wieck Exp $ - *------------------------------------------------------------------------- - */ - -#include "postgres.h" -#include "libpq-fe.h" -#include "slonik.h" - - -/* - * Common option types - */ -typedef enum { - O_ADD_ID, - O_BACKUP_NODE, - O_CLIENT, - O_COMMENT, - O_CONNINFO, - O_CONNRETRY, - O_EVENT_NODE, - O_EXECUTE_ONLY_ON, - O_FILENAME, - O_FORWARD, - O_FQNAME, - O_ID, - O_NEW_ORIGIN, - O_NODE_ID, - O_OLD_ORIGIN, - O_ORIGIN, - O_PROVIDER, - O_RECEIVER, - O_SERVER, - O_SER_KEY, - O_SET_ID, - O_TAB_ID, - O_TIMEOUT, - O_TRIG_NAME, - O_USE_KEY, - O_WAIT_CONFIRMED, - O_WAIT_ON, - - END_OF_OPTIONS = -1 -} option_code; - - -/* - * Common given option list - */ -typedef struct option_list { - option_code opt_code; - int lineno; - int32 ival; - char *str; - - struct option_list *next; -} option_list; - - -/* - * Common per statement possible option strcture - */ -typedef struct statement_option { - option_code opt_code; - int lineno; - int ival; - char *str; -} statement_option; -#define STMT_OPTION_INT(_code,_dfl) {_code, -1, _dfl, NULL} -#define STMT_OPTION_STR(_code,_dfl) {_code, -1, -1, _dfl} -#define STMT_OPTION_YN(_code,_dfl) {_code, -1, -1, _dfl} -#define STMT_OPTION_END {END_OF_OPTIONS, -1, -1, NULL} - - -/* - * Global data - */ -char *current_file = "<stdin>"; -extern int yyleng; - - -/* - * Local functions - */ -static int assign_options(statement_option *so, option_list *ol); - - - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 102 "parser.y" -typedef union YYSTYPE { - int32 ival; - char *str; - option_list *opt_list; - SlonikAdmInfo *adm_info; - SlonikStmt *statement; -} YYSTYPE; -/* Line 191 of yacc.c. */ -#line 321 "y.tab.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 214 of yacc.c. */ -#line 333 "y.tab.c" - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 4 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 297 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 79 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 55 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 127 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 279 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 325 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 76, 77, 2, 2, 78, 75, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 72, - 2, 71, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 73, 2, 74, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short yyprhs[] = -{ - 0, 0, 3, 7, 14, 16, 19, 28, 30, 33, - 35, 37, 44, 52, 60, 67, 73, 79, 85, 87, - 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, - 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, - 130, 132, 134, 136, 138, 140, 142, 144, 146, 147, - 151, 156, 161, 167, 169, 172, 175, 180, 185, 190, - 194, 199, 204, 209, 214, 219, 224, 229, 234, 240, - 246, 252, 257, 262, 267, 272, 277, 282, 287, 292, - 297, 303, 305, 310, 312, 316, 320, 325, 330, 334, - 338, 342, 347, 352, 356, 360, 364, 368, 372, 377, - 382, 387, 392, 397, 403, 407, 411, 415, 419, 423, - 427, 431, 436, 440, 446, 448, 450, 452, 454, 456, - 458, 460, 462, 464, 466, 468, 470, 472 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short yyrhs[] = -{ - 80, 0, -1, 81, 82, 84, -1, 133, 8, 35, - 71, 131, 72, -1, 83, -1, 83, 82, -1, 133, - 38, 130, 4, 12, 71, 132, 72, -1, 85, -1, - 85, 84, -1, 86, -1, 90, -1, 133, 61, 73, - 89, 74, 87, -1, 133, 61, 73, 89, 74, 88, - 87, -1, 133, 61, 73, 89, 74, 87, 88, -1, - 133, 61, 73, 89, 74, 88, -1, 133, 61, 73, - 89, 74, -1, 41, 17, 73, 84, 74, -1, 41, - 56, 73, 84, 74, -1, 90, -1, 90, 89, -1, - 92, -1, 93, -1, 94, -1, 97, -1, 98, -1, - 99, -1, 100, -1, 101, -1, 102, -1, 103, -1, - 104, -1, 105, -1, 106, -1, 107, -1, 108, -1, - 109, -1, 110, -1, 111, -1, 112, -1, 113, -1, - 114, -1, 115, -1, 116, -1, 117, -1, 118, -1, - 119, -1, 120, -1, 121, -1, -1, 96, 72, 91, - -1, 133, 16, 132, 72, -1, 133, 20, 95, 72, - -1, 133, 48, 38, 130, 72, -1, 70, -1, 75, - 95, -1, 133, 1, -1, 133, 29, 8, 122, -1, - 133, 54, 38, 122, -1, 133, 15, 38, 122, -1, - 133, 21, 122, -1, 133, 62, 38, 122, -1, 133, - 54, 44, 122, -1, 133, 15, 44, 122, -1, 133, - 54, 31, 122, -1, 133, 15, 31, 122, -1, 133, - 14, 53, 122, -1, 133, 15, 53, 122, -1, 133, - 33, 53, 122, -1, 133, 57, 3, 30, 122, -1, - 133, 53, 3, 57, 122, -1, 133, 53, 3, 50, - 122, -1, 133, 54, 59, 122, -1, 133, 15, 59, - 122, -1, 133, 55, 53, 122, -1, 133, 64, 53, - 122, -1, 133, 32, 53, 122, -1, 133, 63, 53, - 122, -1, 133, 34, 53, 122, -1, 133, 19, 49, - 122, -1, 133, 65, 27, 122, -1, 133, 67, 24, - 18, 122, -1, 72, -1, 76, 123, 77, 72, -1, - 124, -1, 124, 78, 123, -1, 28, 71, 125, -1, - 6, 38, 71, 125, -1, 18, 38, 71, 125, -1, - 52, 71, 125, -1, 7, 71, 125, -1, 43, 71, - 125, -1, 40, 43, 71, 125, -1, 36, 43, 71, - 125, -1, 47, 71, 125, -1, 45, 71, 125, -1, - 13, 71, 125, -1, 10, 71, 126, -1, 12, 71, - 126, -1, 53, 28, 71, 125, -1, 3, 28, 71, - 125, -1, 38, 28, 71, 125, -1, 57, 28, 71, - 125, -1, 59, 35, 71, 126, -1, 26, 46, 35, - 71, 126, -1, 30, 71, 126, -1, 30, 71, 51, - -1, 25, 71, 127, -1, 23, 71, 126, -1, 43, - 71, 5, -1, 11, 71, 125, -1, 11, 71, 5, - -1, 67, 41, 71, 125, -1, 58, 71, 125, -1, - 19, 42, 41, 71, 125, -1, 130, -1, 132, -1, - 128, -1, 129, -1, 66, -1, 41, -1, 60, -1, - 37, -1, 39, -1, 22, -1, 70, -1, 68, -1, - 69, -1, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = -{ - 0, 244, 244, 259, 265, 267, 271, 289, 291, 295, - 297, 301, 318, 336, 354, 371, 388, 391, 395, 397, - 401, 403, 405, 407, 409, 411, 413, 415, 417, 419, - 421, 423, 425, 427, 429, 431, 433, 435, 437, 439, - 441, 443, 445, 447, 449, 451, 453, 455, 457, 457, - 461, 478, 495, 512, 514, 518, 533, 561, 591, 619, - 647, 673, 705, 735, 765, 795, 825, 853, 883, 911, - 949, 983, 1013, 1043, 1075, 1103, 1131, 1159, 1189, 1222, - 1248, 1280, 1282, 1286, 1288, 1292, 1297, 1302, 1307, 1312, - 1317, 1322, 1327, 1332, 1337, 1342, 1347, 1352, 1357, 1362, - 1367, 1372, 1377, 1382, 1387, 1392, 1405, 1410, 1415, 1428, - 1433, 1446, 1451, 1456, 1463, 1477, 1491, 1503, 1517, 1518, - 1519, 1522, 1523, 1524, 1527, 1533, 1545, 1558 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "K_ADD", "K_ADMIN", "K_ALL", "K_BACKUP", - "K_CLIENT", "K_CLUSTER", "K_CLUSTERNAME", "K_COMMENT", "K_CONFIRMED", - "K_CONNINFO", "K_CONNRETRY", "K_CREATE", "K_DROP", "K_ECHO", "K_ERROR", - "K_EVENT", "K_EXECUTE", "K_EXIT", "K_FAILOVER", "K_FALSE", "K_FILENAME", - "K_FOR", "K_FORWARD", "K_FULL", "K_FUNCTIONS", "K_ID", "K_INIT", - "K_KEY", "K_LISTEN", "K_LOCK", "K_MERGE", "K_MOVE", "K_NAME", "K_NEW", - "K_NO", "K_NODE", "K_OFF", "K_OLD", "K_ON", "K_ONLY", "K_ORIGIN", - "K_PATH", "K_PROVIDER", "K_QUALIFIED", "K_RECEIVER", "K_RESTART", - "K_SCRIPT", "K_SEQUENCE", "K_SERIAL", "K_SERVER", "K_SET", "K_STORE", - "K_SUBSCRIBE", "K_SUCCESS", "K_TABLE", "K_TIMEOUT", "K_TRIGGER", - "K_TRUE", "K_TRY", "K_UNINSTALL", "K_UNLOCK", "K_UNSUBSCRIBE", - "K_UPDATE", "K_YES", "K_WAIT", "T_IDENT", "T_LITERAL", "T_NUMBER", - "'='", "';'", "'{'", "'}'", "'-'", "'('", "')'", "','", "$accept", - "script", "hdr_clustername", "hdr_admconninfos", "hdr_admconninfo", - "stmts", "stmt", "stmt_try", "try_on_error", "try_on_success", - "try_stmts", "try_stmt", "@1", "stmt_echo", "stmt_exit", - "stmt_restart_node", "exit_code", "stmt_error", "stmt_init_cluster", - "stmt_store_node", "stmt_drop_node", "stmt_failed_node", - "stmt_uninstall_node", "stmt_store_path", "stmt_drop_path", - "stmt_store_listen", "stmt_drop_listen", "stmt_create_set", - "stmt_drop_set", "stmt_merge_set", "stmt_table_add_key", - "stmt_set_add_table", "stmt_set_add_sequence", "stmt_store_trigger", - "stmt_drop_trigger", "stmt_subscribe_set", "stmt_unsubscribe_set", - "stmt_lock_set", "stmt_unlock_set", "stmt_move_set", "stmt_ddl_script", - "stmt_update_functions", "stmt_wait_event", "option_list", - "option_list_items", "option_list_item", "option_item_id", - "option_item_literal", "option_item_yn", "option_item_yn_yes", - "option_item_yn_no", "id", "ident", "literal", "lno", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 61, 59, 123, 125, 45, 40, 41, 44 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 79, 80, 81, 82, 82, 83, 84, 84, 85, - 85, 86, 86, 86, 86, 86, 87, 88, 89, 89, - 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, 91, 90, - 92, 93, 94, 95, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 122, 123, 123, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 125, 126, 127, 127, 128, 128, - 128, 129, 129, 129, 130, 131, 132, 133 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 3, 6, 1, 2, 8, 1, 2, 1, - 1, 6, 7, 7, 6, 5, 5, 5, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, - 4, 4, 5, 1, 2, 2, 4, 4, 4, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, - 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 1, 4, 1, 3, 3, 4, 4, 3, 3, - 3, 4, 4, 3, 3, 3, 3, 3, 4, 4, - 4, 4, 4, 5, 3, 3, 3, 3, 3, 3, - 3, 4, 3, 5, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 127, 0, 127, 0, 1, 127, 4, 0, 0, 2, - 127, 9, 10, 20, 21, 22, 0, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 0, 5, 0, 0, 8, 48, 55, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 0, 0, 49, 0, 0, 0, 0, 0, 0, - 126, 0, 0, 53, 0, 0, 81, 0, 59, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 127, 0, 0, 0, 0, 0, 0, 125, 0, - 65, 64, 58, 62, 66, 72, 50, 78, 54, 51, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 83, 56, 75, - 67, 77, 0, 0, 0, 63, 57, 61, 71, 73, - 0, 0, 127, 0, 60, 76, 74, 79, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, - 70, 69, 68, 15, 19, 80, 0, 0, 0, 89, - 114, 96, 115, 110, 109, 97, 95, 0, 0, 107, - 123, 121, 122, 119, 120, 118, 106, 116, 117, 0, - 85, 105, 104, 0, 0, 0, 108, 90, 94, 93, - 88, 0, 0, 112, 0, 0, 82, 84, 0, 11, - 14, 0, 99, 86, 87, 0, 0, 92, 100, 91, - 98, 101, 102, 111, 0, 0, 0, 13, 0, 12, - 6, 113, 103, 127, 127, 0, 0, 16, 17 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = -{ - -1, 1, 2, 5, 6, 9, 10, 11, 249, 250, - 161, 12, 73, 13, 14, 15, 85, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 88, 146, 147, 209, 211, 226, 227, - 228, 210, 109, 212, 42 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -135 -static const short yypact[] = -{ - -135, 8, -135, 12, -135, -135, -15, 7, 18, -135, - 4, -135, -135, -135, -135, -135, -30, -135, -135, -135, - -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, - -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, - -135, -135, 112, -135, -1, 5, -135, -135, -135, 19, - 37, -8, 22, -24, -13, 69, 26, 29, 31, 48, - 84, -9, 39, 90, 21, 59, 45, 51, 78, 82, - -135, 105, 42, -135, -13, -13, -13, -13, -13, -13, - -135, 43, -13, -135, -24, 44, -135, 230, -135, -13, - -13, -13, -13, -1, -29, -13, -13, -13, -13, -13, - 87, -135, -13, -13, -13, -13, 96, 106, -135, 47, - -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, - 92, 85, 54, 58, 63, 64, 65, 99, 80, 67, - 68, 94, 71, 72, 104, 102, 107, 77, 81, 83, - 88, 121, 123, 91, 118, 114, 79, 86, -135, -135, - -135, -135, 89, -13, -13, -135, -135, -135, -135, -135, - -13, 97, 98, 167, -135, -135, -135, -135, -13, 109, - -135, 113, 119, -1, -8, 0, -8, -1, 120, 117, - -8, 25, 135, -1, -33, 122, 124, 126, 10, -1, - -1, -1, 127, 131, -1, 132, 133, 134, 230, -135, - -135, -135, -135, 137, -135, -135, -8, -1, -1, -135, - -135, -135, -135, -135, -135, -135, -135, -1, 136, -135, - -135, -135, -135, -135, -135, -135, -135, -135, -135, 138, - -135, -135, -135, -1, -1, -1, -135, -135, -135, -135, - -135, -1, -1, -135, -8, -1, -135, -135, 2, 144, - 148, 139, -135, -135, -135, -1, -8, -135, -135, -135, - -135, -135, -135, -135, 140, 141, 149, -135, 175, -135, - -135, -135, -135, -135, -135, 142, 143, -135, -135 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = -{ - -135, -135, -135, 188, -135, -10, -135, -135, -42, -39, - 50, -95, -135, -135, -135, -135, 151, -135, -135, -135, - -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, - -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, - -135, -135, -135, -65, 20, -135, -134, -132, -135, -135, - -135, -28, -135, -49, 1 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -128 -static const short yytable[] = -{ - 46, 3, 81, 7, -7, 213, 162, 7, 4, 110, - 111, 112, 113, 114, 115, 236, 71, 117, 231, 264, - 8, 153, 95, -127, 148, 149, 150, 151, 154, 96, - 155, 156, 157, 158, 159, 97, 80, 164, 165, 166, - 167, 214, 47, 216, 215, 44, 83, 220, 219, 230, - 98, 84, 232, 45, 237, 238, 239, 240, 265, 86, - 243, 80, 221, 87, 222, 152, 223, 162, 75, 70, - 70, 82, 74, 252, 253, 76, 72, 89, -7, 90, - 70, 77, 91, 254, 92, 224, 93, 94, 200, 201, - 78, 225, 99, 100, 101, 202, 79, 102, 103, 257, - 258, 259, 163, 205, 104, 105, 106, 260, 261, 107, - 108, 263, 262, 48, 168, 116, 119, 160, 169, 170, - 171, 271, 179, 172, 272, 173, 49, 50, 51, 174, - 186, 52, 53, 54, 175, 176, 177, 178, 180, 181, - 182, 55, 183, 184, 56, 57, 58, 185, 188, 192, - 187, 193, 189, 195, 190, 196, 197, 251, 218, 191, - 59, 199, 194, 163, 198, 60, 61, 62, 48, 63, - 229, 203, -18, 64, 65, 66, 67, 68, 248, 69, - 206, 49, 50, 51, 207, 266, 52, 53, 54, 268, - 208, 217, 264, 233, 43, 234, 55, 235, 241, 56, - 57, 58, 242, 244, 245, 265, 246, 255, 269, 256, - 267, 270, 204, 273, 274, 59, 277, 278, 247, 0, - 60, 61, 62, 0, 63, 0, 0, 0, 0, 65, - 66, 67, 68, 120, 69, 118, 121, 122, 0, 0, - 123, 124, 125, 126, 0, 0, 0, 0, 127, 128, - 0, 0, 0, 129, 0, 130, 131, 0, 132, 0, - 133, 0, 0, 275, 276, 0, 134, 0, 135, 0, - 136, 0, 0, 137, 0, 138, 0, 139, 0, 0, - 0, 0, 140, 141, 0, 0, 0, 142, 143, 144, - 0, 0, 0, 0, 0, 0, 0, 145 -}; - -static const short yycheck[] = -{ - 10, 0, 51, 2, 0, 5, 101, 6, 0, 74, - 75, 76, 77, 78, 79, 5, 44, 82, 51, 17, - 8, 50, 31, 38, 89, 90, 91, 92, 57, 38, - 95, 96, 97, 98, 99, 44, 69, 102, 103, 104, - 105, 175, 72, 177, 176, 38, 70, 22, 180, 183, - 59, 75, 184, 35, 188, 189, 190, 191, 56, 72, - 194, 69, 37, 76, 39, 93, 41, 162, 31, 70, - 70, 49, 53, 207, 208, 38, 71, 8, 74, 53, - 70, 44, 53, 217, 53, 60, 38, 3, 153, 154, - 53, 66, 53, 3, 73, 160, 59, 38, 53, 233, - 234, 235, 101, 168, 53, 27, 24, 241, 242, 4, - 68, 245, 244, 1, 18, 72, 72, 30, 12, 72, - 28, 255, 42, 38, 256, 71, 14, 15, 16, 71, - 28, 19, 20, 21, 71, 71, 71, 38, 71, 71, - 46, 29, 71, 71, 32, 33, 34, 43, 71, 28, - 43, 28, 71, 35, 71, 41, 77, 206, 41, 71, - 48, 72, 71, 162, 78, 53, 54, 55, 1, 57, - 35, 74, 74, 61, 62, 63, 64, 65, 41, 67, - 71, 14, 15, 16, 71, 41, 19, 20, 21, 41, - 71, 71, 17, 71, 6, 71, 29, 71, 71, 32, - 33, 34, 71, 71, 71, 56, 72, 71, 250, 71, - 249, 72, 162, 73, 73, 48, 74, 74, 198, -1, - 53, 54, 55, -1, 57, -1, -1, -1, -1, 62, - 63, 64, 65, 3, 67, 84, 6, 7, -1, -1, - 10, 11, 12, 13, -1, -1, -1, -1, 18, 19, - -1, -1, -1, 23, -1, 25, 26, -1, 28, -1, - 30, -1, -1, 273, 274, -1, 36, -1, 38, -1, - 40, -1, -1, 43, -1, 45, -1, 47, -1, -1, - -1, -1, 52, 53, -1, -1, -1, 57, 58, 59, - -1, -1, -1, -1, -1, -1, -1, 67 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 80, 81, 133, 0, 82, 83, 133, 8, 84, - 85, 86, 90, 92, 93, 94, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 133, 82, 38, 35, 84, 72, 1, 14, - 15, 16, 19, 20, 21, 29, 32, 33, 34, 48, - 53, 54, 55, 57, 61, 62, 63, 64, 65, 67, - 70, 130, 71, 91, 53, 31, 38, 44, 53, 59, - 69, 132, 49, 70, 75, 95, 72, 76, 122, 8, - 53, 53, 53, 38, 3, 31, 38, 44, 59, 53, - 3, 73, 38, 53, 53, 27, 24, 4, 68, 131, - 122, 122, 122, 122, 122, 122, 72, 122, 95, 72, - 3, 6, 7, 10, 11, 12, 13, 18, 19, 23, - 25, 26, 28, 30, 36, 38, 40, 43, 45, 47, - 52, 53, 57, 58, 59, 67, 123, 124, 122, 122, - 122, 122, 130, 50, 57, 122, 122, 122, 122, 122, - 30, 89, 90, 133, 122, 122, 122, 122, 18, 12, - 72, 28, 38, 71, 71, 71, 71, 71, 38, 42, - 71, 71, 46, 71, 71, 43, 28, 43, 71, 71, - 71, 71, 28, 28, 71, 35, 41, 77, 78, 72, - 122, 122, 122, 74, 89, 122, 71, 71, 71, 125, - 130, 126, 132, 5, 125, 126, 125, 71, 41, 126, - 22, 37, 39, 41, 60, 66, 127, 128, 129, 35, - 125, 51, 126, 71, 71, 71, 5, 125, 125, 125, - 125, 71, 71, 125, 71, 71, 72, 123, 41, 87, - 88, 132, 125, 125, 125, 71, 71, 125, 125, 125, - 125, 125, 126, 125, 17, 56, 41, 88, 41, 87, - 72, 125, 126, 73, 73, 84, 84, 74, 74 -}; - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror ("syntax error: cannot back up");\ - YYERROR; \ - } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.first_line = Rhs[1].first_line; \ - Current.first_column = Rhs[1].first_column; \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; -#endif - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) - -# define YYDSYMPRINTF(Title, Token, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (cinluded). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short *bottom, short *top) -#else -static void -yy_stack_print (bottom, top) - short *bottom; - short *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned int yylineno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylineno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - register const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - register char *yyd = yydest; - register const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -#endif /* !YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yytype, yyvaluep) - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - register int yystate; - register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyoverflowlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 247 "parser.y" - { - parser_script = (SlonikScript *) - malloc(sizeof(SlonikScript)); - memset(parser_script, 0, sizeof(SlonikScript)); - - parser_script->clustername = yyvsp[-2].str; - parser_script->filename = current_file; - parser_script->adminfo_list = yyvsp[-1].adm_info; - parser_script->script_stmts = yyvsp[0].statement; - } - break; - - case 3: -#line 260 "parser.y" - { - yyval.str = yyvsp[-1].str; - } - break; - - case 4: -#line 266 "parser.y" - { yyval.adm_info = yyvsp[0].adm_info; } - break; - - case 5: -#line 268 "parser.y" - { yyvsp[-1].adm_info->next = yyvsp[0].adm_info; yyval.adm_info = yyvsp[-1].adm_info; } - break; - - case 6: -#line 272 "parser.y" - { - SlonikAdmInfo *new; - - new = (SlonikAdmInfo *) - malloc(sizeof(SlonikAdmInfo)); - memset(new, 0, sizeof(SlonikAdmInfo)); - - new->no_id = yyvsp[-5].ival; - new->stmt_filename = current_file; - new->stmt_lno = yyvsp[-7].ival; - new->conninfo = yyvsp[-1].str; - new->last_event = -1; - - yyval.adm_info = new; - } - break; - - case 7: -#line 290 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 8: -#line 292 "parser.y" - { yyvsp[-1].statement->next = yyvsp[0].statement; yyval.statement = yyvsp[-1].statement; } - break; - - case 9: -#line 296 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 10: -#line 298 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 11: -#line 303 "parser.y" - { - SlonikStmt_try *new; - - new = (SlonikStmt_try *) - malloc(sizeof(SlonikStmt_try)); - memset(new, 0, sizeof(SlonikStmt_try)); - new->hdr.stmt_type = STMT_TRY; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-5].ival; - - new->try_block = yyvsp[-2].statement; - new->error_block = yyvsp[0].statement; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 12: -#line 320 "parser.y" - { - SlonikStmt_try *new; - - new = (SlonikStmt_try *) - malloc(sizeof(SlonikStmt_try)); - memset(new, 0, sizeof(SlonikStmt_try)); - new->hdr.stmt_type = STMT_TRY; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-6].ival; - - new->try_block = yyvsp[-3].statement; - new->success_block = yyvsp[-1].statement; - new->error_block = yyvsp[0].statement; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 13: -#line 338 "parser.y" - { - SlonikStmt_try *new; - - new = (SlonikStmt_try *) - malloc(sizeof(SlonikStmt_try)); - memset(new, 0, sizeof(SlonikStmt_try)); - new->hdr.stmt_type = STMT_TRY; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-6].ival; - - new->try_block = yyvsp[-3].statement; - new->success_block = yyvsp[0].statement; - new->error_block = yyvsp[-1].statement; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 14: -#line 356 "parser.y" - { - SlonikStmt_try *new; - - new = (SlonikStmt_try *) - malloc(sizeof(SlonikStmt_try)); - memset(new, 0, sizeof(SlonikStmt_try)); - new->hdr.stmt_type = STMT_TRY; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-5].ival; - - new->try_block = yyvsp[-2].statement; - new->success_block = yyvsp[0].statement; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 15: -#line 372 "parser.y" - { - SlonikStmt_try *new; - - new = (SlonikStmt_try *) - malloc(sizeof(SlonikStmt_try)); - memset(new, 0, sizeof(SlonikStmt_try)); - new->hdr.stmt_type = STMT_TRY; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-4].ival; - - new->try_block = yyvsp[-1].statement; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 16: -#line 389 "parser.y" - { yyval.statement = yyvsp[-1].statement; } - break; - - case 17: -#line 392 "parser.y" - { yyval.statement = yyvsp[-1].statement; } - break; - - case 18: -#line 396 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 19: -#line 398 "parser.y" - { yyvsp[-1].statement->next = yyvsp[0].statement; yyval.statement = yyvsp[-1].statement; } - break; - - case 20: -#line 402 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 21: -#line 404 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 22: -#line 406 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 23: -#line 408 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 24: -#line 410 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 25: -#line 412 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 26: -#line 414 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 27: -#line 416 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 28: -#line 418 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 29: -#line 420 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 30: -#line 422 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 31: -#line 424 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 32: -#line 426 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 33: -#line 428 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 34: -#line 430 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 35: -#line 432 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 36: -#line 434 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 37: -#line 436 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 38: -#line 438 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 39: -#line 440 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 40: -#line 442 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 41: -#line 444 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 42: -#line 446 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 43: -#line 448 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 44: -#line 450 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 45: -#line 452 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 46: -#line 454 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 47: -#line 456 "parser.y" - { yyval.statement = yyvsp[0].statement; } - break; - - case 48: -#line 457 "parser.y" - { yyerrok; } - break; - - case 49: -#line 458 "parser.y" - { yyval.statement = yyvsp[-2].statement; } - break; - - case 50: -#line 462 "parser.y" - { - SlonikStmt_echo *new; - - new = (SlonikStmt_echo *) - malloc(sizeof(SlonikStmt_echo)); - memset(new, 0, sizeof(SlonikStmt_echo)); - new->hdr.stmt_type = STMT_ECHO; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - new->str = yyvsp[-1].str; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 51: -#line 479 "parser.y" - { - SlonikStmt_exit *new; - - new = (SlonikStmt_exit *) - malloc(sizeof(SlonikStmt_exit)); - memset(new, 0, sizeof(SlonikStmt_exit)); - new->hdr.stmt_type = STMT_EXIT; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - new->exitcode = yyvsp[-1].ival; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 52: -#line 496 "parser.y" - { - SlonikStmt_restart_node *new; - - new = (SlonikStmt_restart_node *) - malloc(sizeof(SlonikStmt_restart_node)); - memset(new, 0, sizeof(SlonikStmt_restart_node)); - new->hdr.stmt_type = STMT_RESTART_NODE; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-4].ival; - - new->no_id = yyvsp[-1].ival; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 53: -#line 513 "parser.y" - { yyval.ival = strtol(yytext, NULL, 10); } - break; - - case 54: -#line 515 "parser.y" - { yyval.ival = -yyvsp[0].ival; } - break; - - case 55: -#line 519 "parser.y" - { - SlonikStmt *new; - - new = (SlonikStmt *) - malloc(sizeof(SlonikStmt)); - memset(new, 0, sizeof(SlonikStmt)); - new->stmt_type = STMT_ERROR; - new->stmt_filename = current_file; - new->stmt_lno = yyvsp[-1].ival; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 56: -#line 534 "parser.y" - { - SlonikStmt_init_cluster *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, 1 ), - STMT_OPTION_STR( O_COMMENT, "Primary Node 1" ), - STMT_OPTION_END - }; - - new = (SlonikStmt_init_cluster *) - malloc(sizeof(SlonikStmt_init_cluster)); - memset(new, 0, sizeof(SlonikStmt_init_cluster)); - new->hdr.stmt_type = STMT_INIT_CLUSTER; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->no_id = opt[0].ival; - new->no_comment = opt[1].str; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 57: -#line 562 "parser.y" - { - SlonikStmt_store_node *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_STR( O_COMMENT, NULL ), - STMT_OPTION_INT( O_EVENT_NODE, 1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_store_node *) - malloc(sizeof(SlonikStmt_store_node)); - memset(new, 0, sizeof(SlonikStmt_store_node)); - new->hdr.stmt_type = STMT_STORE_NODE; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->no_id = opt[0].ival; - new->no_comment = opt[1].str; - new->ev_origin = opt[2].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 58: -#line 592 "parser.y" - { - SlonikStmt_drop_node *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_EVENT_NODE, 1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_drop_node *) - malloc(sizeof(SlonikStmt_drop_node)); - memset(new, 0, sizeof(SlonikStmt_drop_node)); - new->hdr.stmt_type = STMT_DROP_NODE; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->no_id = opt[0].ival; - new->ev_origin = opt[1].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 59: -#line 620 "parser.y" - { - SlonikStmt_failed_node *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_BACKUP_NODE, 1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_failed_node *) - malloc(sizeof(SlonikStmt_failed_node)); - memset(new, 0, sizeof(SlonikStmt_failed_node)); - new->hdr.stmt_type = STMT_FAILED_NODE; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-2].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->no_id = opt[0].ival; - new->backup_node = opt[1].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 60: -#line 648 "parser.y" - { - SlonikStmt_uninstall_node *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_uninstall_node *) - malloc(sizeof(SlonikStmt_uninstall_node)); - memset(new, 0, sizeof(SlonikStmt_uninstall_node)); - new->hdr.stmt_type = STMT_UNINSTALL_NODE; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->no_id = opt[0].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 61: -#line 674 "parser.y" - { - SlonikStmt_store_path *new; - statement_option opt[] = { - STMT_OPTION_INT( O_SERVER, -1 ), - STMT_OPTION_INT( O_CLIENT, -1 ), - STMT_OPTION_STR( O_CONNINFO, NULL ), - STMT_OPTION_INT( O_CONNRETRY, 10 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_store_path *) - malloc(sizeof(SlonikStmt_store_path)); - memset(new, 0, sizeof(SlonikStmt_store_path)); - new->hdr.stmt_type = STMT_STORE_PATH; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->pa_server = opt[0].ival; - new->pa_client = opt[1].ival; - new->pa_conninfo = opt[2].str; - new->pa_connretry = opt[3].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 62: -#line 706 "parser.y" - { - SlonikStmt_drop_path *new; - statement_option opt[] = { - STMT_OPTION_INT( O_SERVER, -1 ), - STMT_OPTION_INT( O_CLIENT, -1 ), - STMT_OPTION_INT( O_EVENT_NODE, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_drop_path *) - malloc(sizeof(SlonikStmt_drop_path)); - memset(new, 0, sizeof(SlonikStmt_drop_path)); - new->hdr.stmt_type = STMT_DROP_PATH; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->pa_server = opt[0].ival; - new->pa_client = opt[1].ival; - new->ev_origin = opt[2].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 63: -#line 736 "parser.y" - { - SlonikStmt_store_listen *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_INT( O_RECEIVER, -1 ), - STMT_OPTION_INT( O_PROVIDER, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_store_listen *) - malloc(sizeof(SlonikStmt_store_listen)); - memset(new, 0, sizeof(SlonikStmt_store_listen)); - new->hdr.stmt_type = STMT_STORE_LISTEN; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->li_origin = opt[0].ival; - new->li_receiver = opt[1].ival; - new->li_provider = opt[2].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 64: -#line 766 "parser.y" - { - SlonikStmt_drop_listen *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_INT( O_RECEIVER, -1 ), - STMT_OPTION_INT( O_PROVIDER, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_drop_listen *) - malloc(sizeof(SlonikStmt_drop_listen)); - memset(new, 0, sizeof(SlonikStmt_drop_listen)); - new->hdr.stmt_type = STMT_DROP_LISTEN; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->li_origin = opt[0].ival; - new->li_receiver = opt[1].ival; - new->li_provider = opt[2].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 65: -#line 796 "parser.y" - { - SlonikStmt_create_set *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_STR( O_COMMENT, NULL ), - STMT_OPTION_END - }; - - new = (SlonikStmt_create_set *) - malloc(sizeof(SlonikStmt_create_set)); - memset(new, 0, sizeof(SlonikStmt_create_set)); - new->hdr.stmt_type = STMT_CREATE_SET; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->set_id = opt[0].ival; - new->set_origin = opt[1].ival; - new->set_comment = opt[2].str; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 66: -#line 826 "parser.y" - { - SlonikStmt_drop_set *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_drop_set *) - malloc(sizeof(SlonikStmt_drop_set)); - memset(new, 0, sizeof(SlonikStmt_drop_set)); - new->hdr.stmt_type = STMT_DROP_SET; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->set_id = opt[0].ival; - new->set_origin = opt[1].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 67: -#line 854 "parser.y" - { - SlonikStmt_merge_set *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_ADD_ID, -1 ), - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_merge_set *) - malloc(sizeof(SlonikStmt_merge_set)); - memset(new, 0, sizeof(SlonikStmt_merge_set)); - new->hdr.stmt_type = STMT_MERGE_SET; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->set_id = opt[0].ival; - new->add_id = opt[1].ival; - new->set_origin = opt[2].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 68: -#line 884 "parser.y" - { - SlonikStmt_table_add_key *new; - statement_option opt[] = { - STMT_OPTION_INT( O_NODE_ID, -1 ), - STMT_OPTION_STR( O_FQNAME, NULL ), - STMT_OPTION_END - }; - - new = (SlonikStmt_table_add_key *) - malloc(sizeof(SlonikStmt_table_add_key)); - memset(new, 0, sizeof(SlonikStmt_table_add_key)); - new->hdr.stmt_type = STMT_TABLE_ADD_KEY; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-4].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->no_id = opt[0].ival; - new->tab_fqname = opt[1].str; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 69: -#line 912 "parser.y" - { - SlonikStmt_set_add_table *new; - statement_option opt[] = { - STMT_OPTION_INT( O_SET_ID, -1 ), - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_STR( O_FQNAME, NULL ), - STMT_OPTION_STR( O_USE_KEY, NULL ), - STMT_OPTION_INT( O_SER_KEY, 0 ), - STMT_OPTION_STR( O_COMMENT, NULL ), - STMT_OPTION_END - }; - - new = (SlonikStmt_set_add_table *) - malloc(sizeof(SlonikStmt_set_add_table)); - memset(new, 0, sizeof(SlonikStmt_set_add_table)); - new->hdr.stmt_type = STMT_SET_ADD_TABLE; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-4].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->set_id = opt[0].ival; - new->set_origin = opt[1].ival; - new->tab_id = opt[2].ival; - new->tab_fqname = opt[3].str; - new->use_key = opt[4].str; - new->use_serial = opt[5].ival; - new->tab_comment = opt[6].str; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 70: -#line 950 "parser.y" - { - SlonikStmt_set_add_sequence *new; - statement_option opt[] = { - STMT_OPTION_INT( O_SET_ID, -1 ), - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_STR( O_FQNAME, NULL ), - STMT_OPTION_STR( O_COMMENT, NULL ), - STMT_OPTION_END - }; - - new = (SlonikStmt_set_add_sequence *) - malloc(sizeof(SlonikStmt_set_add_sequence)); - memset(new, 0, sizeof(SlonikStmt_set_add_sequence)); - new->hdr.stmt_type = STMT_SET_ADD_SEQUENCE; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-4].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->set_id = opt[0].ival; - new->set_origin = opt[1].ival; - new->seq_id = opt[2].ival; - new->seq_fqname = opt[3].str; - new->seq_comment = opt[4].str; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 71: -#line 984 "parser.y" - { - SlonikStmt_store_trigger *new; - statement_option opt[] = { - STMT_OPTION_INT( O_TAB_ID, -1 ), - STMT_OPTION_STR( O_TRIG_NAME, NULL ), - STMT_OPTION_INT( O_EVENT_NODE, 1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_store_trigger *) - malloc(sizeof(SlonikStmt_store_trigger)); - memset(new, 0, sizeof(SlonikStmt_store_trigger)); - new->hdr.stmt_type = STMT_STORE_TRIGGER; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->trig_tabid = opt[0].ival; - new->trig_tgname = opt[1].str; - new->ev_origin = opt[2].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 72: -#line 1014 "parser.y" - { - SlonikStmt_drop_trigger *new; - statement_option opt[] = { - STMT_OPTION_INT( O_TAB_ID, -1 ), - STMT_OPTION_STR( O_TRIG_NAME, NULL ), - STMT_OPTION_INT( O_EVENT_NODE, 1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_drop_trigger *) - malloc(sizeof(SlonikStmt_drop_trigger)); - memset(new, 0, sizeof(SlonikStmt_drop_trigger)); - new->hdr.stmt_type = STMT_DROP_TRIGGER; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->trig_tabid = opt[0].ival; - new->trig_tgname = opt[1].str; - new->ev_origin = opt[2].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 73: -#line 1044 "parser.y" - { - SlonikStmt_subscribe_set *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_PROVIDER, -1 ), - STMT_OPTION_INT( O_RECEIVER, -1 ), - STMT_OPTION_YN( O_FORWARD, 0 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_subscribe_set *) - malloc(sizeof(SlonikStmt_subscribe_set)); - memset(new, 0, sizeof(SlonikStmt_subscribe_set)); - new->hdr.stmt_type = STMT_SUBSCRIBE_SET; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->sub_setid = opt[0].ival; - new->sub_provider = opt[1].ival; - new->sub_receiver = opt[2].ival; - new->sub_forward = opt[3].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 74: -#line 1076 "parser.y" - { - SlonikStmt_unsubscribe_set *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_RECEIVER, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_unsubscribe_set *) - malloc(sizeof(SlonikStmt_unsubscribe_set)); - memset(new, 0, sizeof(SlonikStmt_unsubscribe_set)); - new->hdr.stmt_type = STMT_UNSUBSCRIBE_SET; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->sub_setid = opt[0].ival; - new->sub_receiver = opt[1].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 75: -#line 1104 "parser.y" - { - SlonikStmt_lock_set *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_lock_set *) - malloc(sizeof(SlonikStmt_lock_set)); - memset(new, 0, sizeof(SlonikStmt_lock_set)); - new->hdr.stmt_type = STMT_LOCK_SET; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->set_id = opt[0].ival; - new->set_origin = opt[1].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 76: -#line 1132 "parser.y" - { - SlonikStmt_unlock_set *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_unlock_set *) - malloc(sizeof(SlonikStmt_unlock_set)); - memset(new, 0, sizeof(SlonikStmt_unlock_set)); - new->hdr.stmt_type = STMT_UNLOCK_SET; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->set_id = opt[0].ival; - new->set_origin = opt[1].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 77: -#line 1160 "parser.y" - { - SlonikStmt_move_set *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, -1 ), - STMT_OPTION_INT( O_OLD_ORIGIN, -1 ), - STMT_OPTION_INT( O_NEW_ORIGIN, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_move_set *) - malloc(sizeof(SlonikStmt_move_set)); - memset(new, 0, sizeof(SlonikStmt_move_set)); - new->hdr.stmt_type = STMT_MOVE_SET; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->set_id = opt[0].ival; - new->old_origin = opt[1].ival; - new->new_origin = opt[2].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 78: -#line 1190 "parser.y" - { - SlonikStmt_ddl_script *new; - statement_option opt[] = { - STMT_OPTION_INT( O_SET_ID, -1 ), - STMT_OPTION_STR( O_FILENAME, NULL ), - STMT_OPTION_INT( O_EVENT_NODE, 1 ), - STMT_OPTION_INT( O_EXECUTE_ONLY_ON, -1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_ddl_script *) - malloc(sizeof(SlonikStmt_ddl_script)); - memset(new, 0, sizeof(SlonikStmt_ddl_script)); - new->hdr.stmt_type = STMT_DDL_SCRIPT; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->ddl_setid = opt[0].ival; - new->ddl_fname = opt[1].str; - new->ev_origin = opt[2].ival; - new->only_on_node = opt[3].ival; - new->ddl_fd = -1; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 79: -#line 1223 "parser.y" - { - SlonikStmt_update_functions *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ID, 1 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_update_functions *) - malloc(sizeof(SlonikStmt_update_functions)); - memset(new, 0, sizeof(SlonikStmt_update_functions)); - new->hdr.stmt_type = STMT_UPDATE_FUNCTIONS; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-3].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->no_id = opt[0].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 80: -#line 1249 "parser.y" - { - SlonikStmt_wait_event *new; - statement_option opt[] = { - STMT_OPTION_INT( O_ORIGIN, -1 ), - STMT_OPTION_INT( O_WAIT_CONFIRMED, -1 ), - STMT_OPTION_INT( O_WAIT_ON, 1 ), - STMT_OPTION_INT( O_TIMEOUT, 600 ), - STMT_OPTION_END - }; - - new = (SlonikStmt_wait_event *) - malloc(sizeof(SlonikStmt_wait_event)); - memset(new, 0, sizeof(SlonikStmt_wait_event)); - new->hdr.stmt_type = STMT_WAIT_EVENT; - new->hdr.stmt_filename = current_file; - new->hdr.stmt_lno = yyvsp[-4].ival; - - if (assign_options(opt, yyvsp[0].opt_list) == 0) - { - new->wait_origin = opt[0].ival; - new->wait_confirmed = opt[1].ival; - new->wait_on = opt[2].ival; - new->wait_timeout = opt[3].ival; - } - else - parser_errors++; - - yyval.statement = (SlonikStmt *)new; - } - break; - - case 81: -#line 1281 "parser.y" - { yyval.opt_list = NULL; } - break; - - case 82: -#line 1283 "parser.y" - { yyval.opt_list = yyvsp[-2].opt_list; } - break; - - case 83: -#line 1287 "parser.y" - { yyval.opt_list = yyvsp[0].opt_list; } - break; - - case 84: -#line 1289 "parser.y" - { yyvsp[-2].opt_list->next = yyvsp[0].opt_list; yyval.opt_list = yyvsp[-2].opt_list; } - break; - - case 85: -#line 1293 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_ID; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 86: -#line 1298 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_BACKUP_NODE; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 87: -#line 1303 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_EVENT_NODE; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 88: -#line 1308 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_SERVER; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 89: -#line 1313 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_CLIENT; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 90: -#line 1318 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_ORIGIN; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 91: -#line 1323 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_OLD_ORIGIN; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 92: -#line 1328 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_NEW_ORIGIN; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 93: -#line 1333 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_RECEIVER; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 94: -#line 1338 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_PROVIDER; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 95: -#line 1343 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_CONNRETRY; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 96: -#line 1348 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_COMMENT; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 97: -#line 1353 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_CONNINFO; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 98: -#line 1358 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_SET_ID; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 99: -#line 1363 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_ADD_ID; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 100: -#line 1368 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_NODE_ID; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 101: -#line 1373 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_TAB_ID; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 102: -#line 1378 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_TRIG_NAME; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 103: -#line 1383 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_FQNAME; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 104: -#line 1388 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_USE_KEY; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 105: -#line 1393 "parser.y" - { - option_list *new; - new = (option_list *)malloc(sizeof(option_list)); - - new->opt_code = O_SER_KEY; - new->ival = 1; - new->str = NULL; - new->lineno = yylineno; - new->next = NULL; - - yyval.opt_list = new; - } - break; - - case 106: -#line 1406 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_FORWARD; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 107: -#line 1411 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_FILENAME; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 108: -#line 1416 "parser.y" - { - option_list *new; - new = (option_list *)malloc(sizeof(option_list)); - - new->opt_code = O_ORIGIN; - new->ival = -2; - new->str = NULL; - new->lineno = yylineno; - new->next = NULL; - - yyval.opt_list = new; - } - break; - - case 109: -#line 1429 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_WAIT_CONFIRMED; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 110: -#line 1434 "parser.y" - { - option_list *new; - new = (option_list *)malloc(sizeof(option_list)); - - new->opt_code = O_WAIT_CONFIRMED; - new->ival = -2; - new->str = NULL; - new->lineno = yylineno; - new->next = NULL; - - yyval.opt_list = new; - } - break; - - case 111: -#line 1447 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_WAIT_ON; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 112: -#line 1452 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_TIMEOUT; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 113: -#line 1457 "parser.y" - { - yyvsp[0].opt_list->opt_code = O_EXECUTE_ONLY_ON; - yyval.opt_list = yyvsp[0].opt_list; - } - break; - - case 114: -#line 1464 "parser.y" - { - option_list *new; - new = (option_list *)malloc(sizeof(option_list)); - - new->ival = yyvsp[0].ival; - new->str = NULL; - new->lineno = yylineno; - new->next = NULL; - - yyval.opt_list = new; - } - break; - - case 115: -#line 1478 "parser.y" - { - option_list *new; - new = (option_list *)malloc(sizeof(option_list)); - - new->ival = -1; - new->str = yyvsp[0].str; - new->lineno = yylineno; - new->next = NULL; - - yyval.opt_list = new; - } - break; - - case 116: -#line 1492 "parser.y" - { - option_list *new; - new = (option_list *)malloc(sizeof(option_list)); - - new->ival = 1; - new->str = NULL; - new->lineno = yylineno; - new->next = NULL; - - yyval.opt_list = new; - } - break; - - case 117: -#line 1504 "parser.y" - { - option_list *new; - new = (option_list *)malloc(sizeof(option_list)); - - new->ival = 0; - new->str = NULL; - new->lineno = yylineno; - new->next = NULL; - - yyval.opt_list = new; - } - break; - - case 124: -#line 1528 "parser.y" - { - yyval.ival = strtol(yytext, NULL, 10); - } - break; - - case 125: -#line 1534 "parser.y" - { - char *ret; - - ret = malloc(yyleng + 1); - memcpy(ret, yytext, yyleng); - ret[yyleng] = '\0'; - - yyval.str = ret; - } - break; - - case 126: -#line 1546 "parser.y" - { - char *ret; - - ret = malloc(yyleng + 1); - memcpy(ret, yytext, yyleng); - ret[yyleng] = '\0'; - - yyval.str = ret; - } - break; - - case 127: -#line 1558 "parser.y" - { yyval.ival = yylineno; } - break; - - - } - -/* Line 991 of yacc.c. */ -#line 3039 "y.tab.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - char *yymsg; - int yyx, yycount; - - yycount = 0; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("syntax error, unexpected ") + 1; - yysize += yystrlen (yytname[yytype]); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - - if (yycount < 5) - { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); - yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - /* Return failure if at end of input. */ - if (yychar == YYEOF) - { - /* Pop the error token. */ - YYPOPSTACK; - /* Pop the rest of the stack. */ - while (yyss < yyssp) - { - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - YYPOPSTACK; - } - YYABORT; - } - - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); - yychar = YYEMPTY; - - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab2; - - -/*----------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action. | -`----------------------------------------------------*/ -yyerrlab1: - - /* Suppress GCC warning that yyerrlab1 is unused when no action - invokes YYERROR. */ -#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) - __attribute__ ((__unused__)) -#endif - - - goto yyerrlab2; - - -/*---------------------------------------------------------------. -| yyerrlab2 -- pop states until the error token can be shifted. | -`---------------------------------------------------------------*/ -yyerrlab2: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); - yyvsp--; - yystate = *--yyssp; - - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - YYDPRINTF ((stderr, "Shifting error token, ")); - - *++yyvsp = yylval; - - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 1561 "parser.y" - - - -/* ---------- - * option_str - * - * Returns a string representation of a common option type - * ---------- - */ -static char * -option_str(option_code opt_code) -{ - switch (opt_code) - { - case O_ADD_ID: return "add id"; - case O_BACKUP_NODE: return "backup node"; - case O_CLIENT: return "client"; - case O_COMMENT: return "comment"; - case O_CONNINFO: return "conninfo"; - case O_CONNRETRY: return "connretry"; - case O_EVENT_NODE: return "event node"; - case O_EXECUTE_ONLY_ON: return "execute only on"; - case O_FILENAME: return "filename"; - case O_FORWARD: return "forward"; - case O_FQNAME: return "full qualified name"; - case O_ID: return "id"; - case O_NEW_ORIGIN: return "new origin"; - case O_NODE_ID: return "node id"; - case O_OLD_ORIGIN: return "old origin"; - case O_ORIGIN: return "origin"; - case O_PROVIDER: return "provider"; - case O_RECEIVER: return "receiver"; - case O_SERVER: return "server"; - case O_SER_KEY: return "key"; - case O_SET_ID: return "set id"; - case O_TAB_ID: return "table id"; - case O_TIMEOUT: return "timeout"; - case O_TRIG_NAME: return "trigger name"; - case O_USE_KEY: return "key"; - case O_WAIT_CONFIRMED: return "confirmed"; - case O_WAIT_ON: return "wait on"; - case END_OF_OPTIONS: return "???"; - } - return "???"; -} - -/* ---------- - * assign_options - * - * Try to map the actually given options to the statements specific - * possible options. - * ---------- - */ -static int -assign_options(statement_option *so, option_list *ol) -{ - statement_option *s_opt; - option_list *u_opt; - int errors = 0; - - for (u_opt = ol; u_opt; u_opt = u_opt->next) - { - for (s_opt = so; s_opt->opt_code >= 0; s_opt++) - { - if (s_opt->opt_code == u_opt->opt_code) - break; - } - - if (s_opt->opt_code < 0) - { - fprintf(stderr, "%s:%d: option %s not allowed here\n", - current_file, u_opt->lineno, - option_str(u_opt->opt_code)); - errors++; - continue; - } - - if (s_opt->lineno >= 0) - { - fprintf(stderr, "%s:%d: option %s already defined on line %d\n", - current_file, u_opt->lineno, - option_str(u_opt->opt_code), s_opt->lineno); - errors++; - continue; - } - - s_opt->lineno = u_opt->lineno; - s_opt->ival = u_opt->ival; - s_opt->str = u_opt->str; - } - - return errors; -} - - -void -yyerror(const char *msg) -{ - fprintf(stderr, "%s:%d: ERROR: %s at or near %s\n", current_file, - yylineno, msg, yytext); - parser_errors++; -} - - -/* - * Include the output of fles for the scanner here. - */ -#include "scan.c" - - -
- Previous message: [Slony1-commit] By darcyb: Opps copy/paste function prototypeing is bad mojo, fix
- Next message: [Slony1-commit] By xfade: Typo fix, noticed by Justin Clift
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list