Mon Nov 24 15:34:07 2008

Asterisk developer's documentation


ast_expr2f.c

Go to the documentation of this file.
00001 #line 2 "ast_expr2f.c"
00002 
00003 #line 4 "ast_expr2f.c"
00004 
00005 #define  YY_INT_ALIGNED short int
00006 
00007 /* A lexical scanner generated by flex */
00008 
00009 #define FLEX_SCANNER
00010 #define YY_FLEX_MAJOR_VERSION 2
00011 #define YY_FLEX_MINOR_VERSION 5
00012 #define YY_FLEX_SUBMINOR_VERSION 33
00013 #if YY_FLEX_SUBMINOR_VERSION > 0
00014 #define FLEX_BETA
00015 #endif
00016 
00017 /* First, we deal with  platform-specific or compiler-specific issues. */
00018 
00019 /* begin standard C headers. */
00020 #include <stdio.h>
00021 #include <string.h>
00022 #include <errno.h>
00023 #include <stdlib.h>
00024 
00025 /* end standard C headers. */
00026 
00027 /* flex integer type definitions */
00028 
00029 #ifndef FLEXINT_H
00030 #define FLEXINT_H
00031 
00032 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
00033 
00034 #if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L
00035 
00036 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
00037  * if you want the limit (max/min) macros for int types. 
00038  */
00039 #ifndef __STDC_LIMIT_MACROS
00040 #define __STDC_LIMIT_MACROS 1
00041 #endif
00042 
00043 #include <inttypes.h>
00044 typedef int8_t flex_int8_t;
00045 typedef uint8_t flex_uint8_t;
00046 typedef int16_t flex_int16_t;
00047 typedef uint16_t flex_uint16_t;
00048 typedef int32_t flex_int32_t;
00049 typedef uint32_t flex_uint32_t;
00050 #else
00051 typedef signed char flex_int8_t;
00052 typedef short int flex_int16_t;
00053 typedef int flex_int32_t;
00054 typedef unsigned char flex_uint8_t; 
00055 typedef unsigned short int flex_uint16_t;
00056 typedef unsigned int flex_uint32_t;
00057 #endif /* ! C99 */
00058 
00059 /* Limits of integral types. */
00060 #ifndef INT8_MIN
00061 #define INT8_MIN               (-128)
00062 #endif
00063 #ifndef INT16_MIN
00064 #define INT16_MIN              (-32767-1)
00065 #endif
00066 #ifndef INT32_MIN
00067 #define INT32_MIN              (-2147483647-1)
00068 #endif
00069 #ifndef INT8_MAX
00070 #define INT8_MAX               (127)
00071 #endif
00072 #ifndef INT16_MAX
00073 #define INT16_MAX              (32767)
00074 #endif
00075 #ifndef INT32_MAX
00076 #define INT32_MAX              (2147483647)
00077 #endif
00078 #ifndef UINT8_MAX
00079 #define UINT8_MAX              (255U)
00080 #endif
00081 #ifndef UINT16_MAX
00082 #define UINT16_MAX             (65535U)
00083 #endif
00084 #ifndef UINT32_MAX
00085 #define UINT32_MAX             (4294967295U)
00086 #endif
00087 
00088 #endif /* ! FLEXINT_H */
00089 
00090 #ifdef __cplusplus
00091 
00092 /* The "const" storage-class-modifier is valid. */
00093 #define YY_USE_CONST
00094 
00095 #else /* ! __cplusplus */
00096 
00097 #if __STDC__
00098 
00099 #define YY_USE_CONST
00100 
00101 #endif   /* __STDC__ */
00102 #endif   /* ! __cplusplus */
00103 
00104 #ifdef YY_USE_CONST
00105 #define yyconst const
00106 #else
00107 #define yyconst
00108 #endif
00109 
00110 /* Returned upon end-of-file. */
00111 #define YY_NULL 0
00112 
00113 /* Promotes a possibly negative, possibly signed char to an unsigned
00114  * integer for use as an array index.  If the signed char is negative,
00115  * we want to instead treat it as an 8-bit unsigned char, hence the
00116  * double cast.
00117  */
00118 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00119 
00120 /* An opaque pointer. */
00121 #ifndef YY_TYPEDEF_YY_SCANNER_T
00122 #define YY_TYPEDEF_YY_SCANNER_T
00123 typedef void* yyscan_t;
00124 #endif
00125 
00126 /* For convenience, these vars (plus the bison vars far below)
00127    are macros in the reentrant scanner. */
00128 #define yyin yyg->yyin_r
00129 #define yyout yyg->yyout_r
00130 #define yyextra yyg->yyextra_r
00131 #define yyleng yyg->yyleng_r
00132 #define yytext yyg->yytext_r
00133 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
00134 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
00135 #define yy_flex_debug yyg->yy_flex_debug_r
00136 
00137 int ast_yylex_init (yyscan_t* scanner);
00138 
00139 /* Enter a start condition.  This macro really ought to take a parameter,
00140  * but we do it the disgusting crufty way forced on us by the ()-less
00141  * definition of BEGIN.
00142  */
00143 #define BEGIN yyg->yy_start = 1 + 2 *
00144 
00145 /* Translate the current start state into a value that can be later handed
00146  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00147  * compatibility.
00148  */
00149 #define YY_START ((yyg->yy_start - 1) / 2)
00150 #define YYSTATE YY_START
00151 
00152 /* Action number for EOF rule of a given start state. */
00153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00154 
00155 /* Special action meaning "start processing a new file". */
00156 #define YY_NEW_FILE ast_yyrestart(yyin ,yyscanner )
00157 
00158 #define YY_END_OF_BUFFER_CHAR 0
00159 
00160 /* Size of default input buffer. */
00161 #ifndef YY_BUF_SIZE
00162 #define YY_BUF_SIZE 16384
00163 #endif
00164 
00165 /* The state buf must be large enough to hold one state per character in the main buffer.
00166  */
00167 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
00168 
00169 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
00170 #define YY_TYPEDEF_YY_BUFFER_STATE
00171 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00172 #endif
00173 
00174 #define EOB_ACT_CONTINUE_SCAN 0
00175 #define EOB_ACT_END_OF_FILE 1
00176 #define EOB_ACT_LAST_MATCH 2
00177 
00178     #define YY_LESS_LINENO(n)
00179     
00180 /* Return all but the first "n" matched characters back to the input stream. */
00181 #define yyless(n) \
00182    do \
00183       { \
00184       /* Undo effects of setting up yytext. */ \
00185         int yyless_macro_arg = (n); \
00186         YY_LESS_LINENO(yyless_macro_arg);\
00187       *yy_cp = yyg->yy_hold_char; \
00188       YY_RESTORE_YY_MORE_OFFSET \
00189       yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
00190       YY_DO_BEFORE_ACTION; /* set up yytext again */ \
00191       } \
00192    while ( 0 )
00193 
00194 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
00195 
00196 /* The following is because we cannot portably get our hands on size_t
00197  * (without autoconf's help, which isn't available because we want
00198  * flex-generated scanners to compile on their own).
00199  */
00200 
00201 #ifndef YY_TYPEDEF_YY_SIZE_T
00202 #define YY_TYPEDEF_YY_SIZE_T
00203 typedef unsigned int yy_size_t;
00204 #endif
00205 
00206 #ifndef YY_STRUCT_YY_BUFFER_STATE
00207 #define YY_STRUCT_YY_BUFFER_STATE
00208 struct yy_buffer_state
00209    {
00210    FILE *yy_input_file;
00211 
00212    char *yy_ch_buf;     /* input buffer */
00213    char *yy_buf_pos;    /* current position in input buffer */
00214 
00215    /* Size of input buffer in bytes, not including room for EOB
00216     * characters.
00217     */
00218    yy_size_t yy_buf_size;
00219 
00220    /* Number of characters read into yy_ch_buf, not including EOB
00221     * characters.
00222     */
00223    int yy_n_chars;
00224 
00225    /* Whether we "own" the buffer - i.e., we know we created it,
00226     * and can realloc() it to grow it, and should free() it to
00227     * delete it.
00228     */
00229    int yy_is_our_buffer;
00230 
00231    /* Whether this is an "interactive" input source; if so, and
00232     * if we're using stdio for input, then we want to use getc()
00233     * instead of fread(), to make sure we stop fetching input after
00234     * each newline.
00235     */
00236    int yy_is_interactive;
00237 
00238    /* Whether we're considered to be at the beginning of a line.
00239     * If so, '^' rules will be active on the next match, otherwise
00240     * not.
00241     */
00242    int yy_at_bol;
00243 
00244     int yy_bs_lineno; /**< The line count. */
00245     int yy_bs_column; /**< The column count. */
00246     
00247    /* Whether to try to fill the input buffer when we reach the
00248     * end of it.
00249     */
00250    int yy_fill_buffer;
00251 
00252    int yy_buffer_status;
00253 
00254 #define YY_BUFFER_NEW 0
00255 #define YY_BUFFER_NORMAL 1
00256    /* When an EOF's been seen but there's still some text to process
00257     * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00258     * shouldn't try reading from the input source any more.  We might
00259     * still have a bunch of tokens to match, though, because of
00260     * possible backing-up.
00261     *
00262     * When we actually see the EOF, we change the status to "new"
00263     * (via ast_yyrestart()), so that the user can continue scanning by
00264     * just pointing yyin at a new input file.
00265     */
00266 #define YY_BUFFER_EOF_PENDING 2
00267 
00268    };
00269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
00270 
00271 /* We provide macros for accessing buffer states in case in the
00272  * future we want to put the buffer states in a more general
00273  * "scanner state".
00274  *
00275  * Returns the top of the stack, or NULL.
00276  */
00277 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
00278                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
00279                           : NULL)
00280 
00281 /* Same as previous macro, but useful when we know that the buffer stack is not
00282  * NULL or when we need an lvalue. For internal use only.
00283  */
00284 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
00285 
00286 void ast_yyrestart (FILE *input_file ,yyscan_t yyscanner );
00287 void ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
00288 YY_BUFFER_STATE ast_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
00289 void ast_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
00290 void ast_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
00291 void ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
00292 void ast_yypop_buffer_state (yyscan_t yyscanner );
00293 
00294 static void ast_yyensure_buffer_stack (yyscan_t yyscanner );
00295 static void ast_yy_load_buffer_state (yyscan_t yyscanner );
00296 static void ast_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
00297 
00298 #define YY_FLUSH_BUFFER ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
00299 
00300 YY_BUFFER_STATE ast_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
00301 YY_BUFFER_STATE ast_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
00302 YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
00303 
00304 void *ast_yyalloc (yy_size_t ,yyscan_t yyscanner );
00305 void *ast_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
00306 void ast_yyfree (void * ,yyscan_t yyscanner );
00307 
00308 #define yy_new_buffer ast_yy_create_buffer
00309 
00310 #define yy_set_interactive(is_interactive) \
00311    { \
00312    if ( ! YY_CURRENT_BUFFER ){ \
00313         ast_yyensure_buffer_stack (yyscanner); \
00314       YY_CURRENT_BUFFER_LVALUE =    \
00315             ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
00316    } \
00317    YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
00318    }
00319 
00320 #define yy_set_bol(at_bol) \
00321    { \
00322    if ( ! YY_CURRENT_BUFFER ){\
00323         ast_yyensure_buffer_stack (yyscanner); \
00324       YY_CURRENT_BUFFER_LVALUE =    \
00325             ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
00326    } \
00327    YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
00328    }
00329 
00330 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
00331 
00332 /* Begin user sect3 */
00333 
00334 #define ast_yywrap(n) 1
00335 #define YY_SKIP_YYWRAP
00336 
00337 typedef unsigned char YY_CHAR;
00338 
00339 typedef int yy_state_type;
00340 
00341 #define yytext_ptr yytext_r
00342 
00343 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
00344 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
00345 static int yy_get_next_buffer (yyscan_t yyscanner );
00346 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
00347 
00348 /* Done after the current pattern has been matched and before the
00349  * corresponding action - sets up yytext.
00350  */
00351 #define YY_DO_BEFORE_ACTION \
00352    yyg->yytext_ptr = yy_bp; \
00353    yyg->yytext_ptr -= yyg->yy_more_len; \
00354    yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
00355    yyg->yy_hold_char = *yy_cp; \
00356    *yy_cp = '\0'; \
00357    yyg->yy_c_buf_p = yy_cp;
00358 
00359 #define YY_NUM_RULES 35
00360 #define YY_END_OF_BUFFER 36
00361 /* This struct is not used in this scanner,
00362    but its presence is necessary. */
00363 struct yy_trans_info
00364    {
00365    flex_int32_t yy_verify;
00366    flex_int32_t yy_nxt;
00367    };
00368 static yyconst flex_int16_t yy_accept[55] =
00369     {   0,
00370         0,    0,    0,    0,   32,   32,   36,   35,   25,   27,
00371        19,   35,   29,   29,   17,    2,   22,   23,   15,   13,
00372        14,   16,   28,   20,    9,    3,    8,   18,    1,   35,
00373        31,   30,   32,   33,   33,   12,    0,   26,   29,   24,
00374         5,   28,   21,   11,    6,    7,   10,    4,    0,   31,
00375        30,   32,   34,    0
00376     } ;
00377 
00378 static yyconst flex_int32_t yy_ec[256] =
00379     {   0,
00380         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00381         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
00382         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00383         1,    2,    4,    5,    6,    7,    8,    9,    6,   10,
00384        11,   12,   13,    6,   14,    6,   15,   16,   16,   16,
00385        16,   16,   16,   16,   16,   16,   16,   17,    6,   18,
00386        19,   20,   21,    6,    6,    6,    6,    6,    6,    6,
00387         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
00388         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
00389         1,    6,    1,    6,    6,    1,    6,    6,    6,    6,
00390 
00391         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
00392         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
00393         6,    6,   22,   23,   24,   25,    1,    1,    1,    1,
00394         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00395         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00396         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00397         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00398         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00399         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00400         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00401 
00402         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00403         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00404         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00405         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00406         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00407         1,    1,    1,    1,    1
00408     } ;
00409 
00410 static yyconst flex_int32_t yy_meta[26] =
00411     {   0,
00412         1,    2,    2,    2,    1,    3,    4,    2,    2,    2,
00413         2,    2,    2,    2,    2,    3,    2,    2,    2,    2,
00414         2,    3,    2,    1,    1
00415     } ;
00416 
00417 static yyconst flex_int16_t yy_base[61] =
00418     {   0,
00419         0,    0,    4,    5,   29,   54,   71,  101,  101,  101,
00420        50,   63,   25,   45,  101,   56,  101,  101,  101,  101,
00421       101,  101,   31,   47,   44,   14,   43,  101,   29,   18,
00422       101,  101,    0,  101,   28,  101,   38,  101,   42,  101,
00423       101,   50,  101,  101,  101,  101,  101,  101,   22,  101,
00424       101,    0,  101,  101,   79,   83,   87,   89,   93,   97
00425     } ;
00426 
00427 static yyconst flex_int16_t yy_def[61] =
00428     {   0,
00429        54,    1,   55,   55,   56,   56,   54,   54,   54,   54,
00430        54,   57,   54,   58,   54,   54,   54,   54,   54,   54,
00431        54,   54,   54,   54,   54,   54,   54,   54,   54,   59,
00432        54,   54,   60,   54,   54,   54,   57,   54,   54,   54,
00433        54,   54,   54,   54,   54,   54,   54,   54,   59,   54,
00434        54,   60,   54,    0,   54,   54,   54,   54,   54,   54
00435     } ;
00436 
00437 static yyconst flex_int16_t yy_nxt[127] =
00438     {   0,
00439         8,    9,   10,   11,   12,   13,   14,   15,   16,   17,
00440        18,   19,   20,   21,   22,   23,   24,   25,   26,   27,
00441        28,    8,   29,    8,    8,   31,   31,   32,   32,   33,
00442        39,   39,   45,   33,   33,   35,   39,   39,   46,   50,
00443        39,   51,   38,   50,   33,   51,   42,   39,   39,   53,
00444        33,   48,   33,   33,   33,   39,   39,   39,   33,   33,
00445        35,   47,   44,   43,   41,   42,   40,   38,   36,   33,
00446        54,   54,   54,   54,   54,   33,   54,   33,   33,   30,
00447        30,   30,   30,   34,   34,   34,   34,   37,   37,   37,
00448        37,   39,   39,   49,   49,   49,   49,   52,   54,   52,
00449 
00450         7,   54,   54,   54,   54,   54,   54,   54,   54,   54,
00451        54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
00452        54,   54,   54,   54,   54,   54
00453     } ;
00454 
00455 static yyconst flex_int16_t yy_chk[127] =
00456     {   0,
00457         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00458         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00459         1,    1,    1,    1,    1,    3,    4,    3,    4,    5,
00460        13,   13,   26,    5,    5,    5,   23,   23,   26,   30,
00461        13,   30,   37,   49,    5,   49,   23,   39,   39,   35,
00462         5,   29,    5,    5,    6,   42,   42,   39,    6,    6,
00463         6,   27,   25,   24,   16,   42,   14,   12,   11,    6,
00464         7,    0,    0,    0,    0,    6,    0,    6,    6,   55,
00465        55,   55,   55,   56,   56,   56,   56,   57,   57,   57,
00466        57,   58,   58,   59,   59,   59,   59,   60,    0,   60,
00467 
00468        54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
00469        54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
00470        54,   54,   54,   54,   54,   54
00471     } ;
00472 
00473 /* The intent behind this definition is that it'll catch
00474  * any uses of REJECT which flex missed.
00475  */
00476 #define REJECT reject_used_but_not_detected
00477 #define yymore() (yyg->yy_more_flag = 1)
00478 #define YY_MORE_ADJ yyg->yy_more_len
00479 #define YY_RESTORE_YY_MORE_OFFSET
00480 #line 1 "ast_expr2.fl"
00481 #line 2 "ast_expr2.fl"
00482 /*
00483  * Asterisk -- An open source telephony toolkit.
00484  *
00485  * Copyright (C) 1999 - 2006, Digium, Inc.
00486  *
00487  * Mark Spencer <markster@digium.com>
00488  *
00489  * See http://www.asterisk.org for more information about
00490  * the Asterisk project. Please do not directly contact
00491  * any of the maintainers of this project for assistance;
00492  * the project provides a web site, mailing lists and IRC
00493  * channels for your use.
00494  *
00495  * This program is free software, distributed under the terms of
00496  * the GNU General Public License Version 2. See the LICENSE file
00497  * at the top of the source tree.
00498  */
00499 
00500 /*! \file
00501  *
00502  * \brief Dialplan Expression Lexical Scanner
00503  */
00504 
00505 #include "asterisk.h"
00506 
00507 #ifndef STANDALONE
00508 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 97849 $")
00509 #endif
00510 
00511 #include <sys/types.h>
00512 #include <stdio.h>
00513 #include <stdlib.h>
00514 #include <string.h>
00515 #include <locale.h>
00516 #include <ctype.h>
00517 #if !defined(SOLARIS) && !defined(__CYGWIN__)
00518 /* #include <err.h> */
00519 #else
00520 #define quad_t int64_t
00521 #endif
00522 #include <errno.h>
00523 #include <regex.h>
00524 #include <limits.h>
00525 
00526 #include "asterisk/ast_expr.h"
00527 #include "asterisk/logger.h"
00528 #include "asterisk/strings.h"
00529 
00530 enum valtype {
00531    AST_EXPR_integer, AST_EXPR_numeric_string, AST_EXPR_string
00532 } ;
00533 
00534 struct val {
00535    enum valtype type;
00536    union {
00537       char *s;
00538       quad_t i;
00539    } u;
00540 } ;
00541 
00542 #include "ast_expr2.h" /* the o/p of the bison on ast_expr2.y */
00543 
00544 #define SET_COLUMNS  do {     \
00545    yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); \
00546    yylloc_param->last_column += yyleng - 1; \
00547    yylloc_param->first_line = yylloc_param->last_line = 1; \
00548    } while (0)
00549 
00550 #define SET_STRING   do {     \
00551    yylval_param->val = calloc(1, sizeof(struct val)); \
00552    yylval_param->val->type = AST_EXPR_string;      \
00553    yylval_param->val->u.s = strdup(yytext);     \
00554    } while (0)
00555 
00556 #define SET_NUMERIC_STRING do {  \
00557    yylval_param->val = calloc(1, sizeof(struct val)); \
00558    yylval_param->val->type = AST_EXPR_numeric_string; \
00559    yylval_param->val->u.s = strdup(yytext);  \
00560    } while (0)
00561 
00562 struct parse_io
00563 {
00564    char *string;
00565    struct val *val;
00566    yyscan_t scanner;
00567 };
00568  
00569 void ast_yyset_column(int column_no, yyscan_t yyscanner);
00570 int ast_yyget_column(yyscan_t yyscanner);
00571 static int curlycount = 0;
00572 static char *expr2_token_subst(const char *mess);
00573 
00574 #line 575 "ast_expr2f.c"
00575 
00576 #define INITIAL 0
00577 #define var 1
00578 #define trail 2
00579 
00580 #ifndef YY_NO_UNISTD_H
00581 /* Special case for "unistd.h", since it is non-ANSI. We include it way
00582  * down here because we want the user's section 1 to have been scanned first.
00583  * The user has a chance to override it with an option.
00584  */
00585 #include <unistd.h>
00586 #endif
00587 
00588 #ifndef YY_EXTRA_TYPE
00589 #define YY_EXTRA_TYPE void *
00590 #endif
00591 
00592 /* Holds the entire state of the reentrant scanner. */
00593 struct yyguts_t
00594     {
00595 
00596     /* User-defined. Not touched by flex. */
00597     YY_EXTRA_TYPE yyextra_r;
00598 
00599     /* The rest are the same as the globals declared in the non-reentrant scanner. */
00600     FILE *yyin_r, *yyout_r;
00601     size_t yy_buffer_stack_top; /**< index of top of stack. */
00602     size_t yy_buffer_stack_max; /**< capacity of stack. */
00603     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
00604     char yy_hold_char;
00605     int yy_n_chars;
00606     int yyleng_r;
00607     char *yy_c_buf_p;
00608     int yy_init;
00609     int yy_start;
00610     int yy_did_buffer_switch_on_eof;
00611     int yy_start_stack_ptr;
00612     int yy_start_stack_depth;
00613     int *yy_start_stack;
00614     yy_state_type yy_last_accepting_state;
00615     char* yy_last_accepting_cpos;
00616 
00617     int yylineno_r;
00618     int yy_flex_debug_r;
00619 
00620     char *yytext_r;
00621     int yy_more_flag;
00622     int yy_more_len;
00623 
00624     YYSTYPE * yylval_r;
00625 
00626     YYLTYPE * yylloc_r;
00627 
00628     }; /* end struct yyguts_t */
00629 
00630 static int yy_init_globals (yyscan_t yyscanner );
00631 
00632     /* This must go here because YYSTYPE and YYLTYPE are included
00633      * from bison output in section 1.*/
00634     #    define yylval yyg->yylval_r
00635     
00636     #    define yylloc yyg->yylloc_r
00637     
00638 /* Accessor methods to globals.
00639    These are made visible to non-reentrant scanners for convenience. */
00640 
00641 int ast_yylex_destroy (yyscan_t yyscanner );
00642 
00643 int ast_yyget_debug (yyscan_t yyscanner );
00644 
00645 void ast_yyset_debug (int debug_flag ,yyscan_t yyscanner );
00646 
00647 YY_EXTRA_TYPE ast_yyget_extra (yyscan_t yyscanner );
00648 
00649 void ast_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
00650 
00651 FILE *ast_yyget_in (yyscan_t yyscanner );
00652 
00653 void ast_yyset_in  (FILE * in_str ,yyscan_t yyscanner );
00654 
00655 FILE *ast_yyget_out (yyscan_t yyscanner );
00656 
00657 void ast_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
00658 
00659 int ast_yyget_leng (yyscan_t yyscanner );
00660 
00661 char *ast_yyget_text (yyscan_t yyscanner );
00662 
00663 int ast_yyget_lineno (yyscan_t yyscanner );
00664 
00665 void ast_yyset_lineno (int line_number ,yyscan_t yyscanner );
00666 
00667 YYSTYPE * ast_yyget_lval (yyscan_t yyscanner );
00668 
00669 void ast_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
00670 
00671        YYLTYPE *ast_yyget_lloc (yyscan_t yyscanner );
00672     
00673         void ast_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
00674     
00675 /* Macros after this point can all be overridden by user definitions in
00676  * section 1.
00677  */
00678 
00679 #ifndef YY_SKIP_YYWRAP
00680 #ifdef __cplusplus
00681 extern "C" int ast_yywrap (yyscan_t yyscanner );
00682 #else
00683 extern int ast_yywrap (yyscan_t yyscanner );
00684 #endif
00685 #endif
00686 
00687     static void yyunput (int c,char *buf_ptr  ,yyscan_t yyscanner);
00688     
00689 #ifndef yytext_ptr
00690 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
00691 #endif
00692 
00693 #ifdef YY_NEED_STRLEN
00694 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
00695 #endif
00696 
00697 #ifndef YY_NO_INPUT
00698 
00699 #ifdef __cplusplus
00700 static int yyinput (yyscan_t yyscanner );
00701 #else
00702 static int input (yyscan_t yyscanner );
00703 #endif
00704 
00705 #endif
00706 
00707 /* Amount of stuff to slurp up with each read. */
00708 #ifndef YY_READ_BUF_SIZE
00709 #define YY_READ_BUF_SIZE 8192
00710 #endif
00711 
00712 /* Copy whatever the last rule matched to the standard output. */
00713 #ifndef ECHO
00714 /* This used to be an fputs(), but since the string might contain NUL's,
00715  * we now use fwrite().
00716  */
00717 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
00718 #endif
00719 
00720 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00721  * is returned in "result".
00722  */
00723 #ifndef YY_INPUT
00724 #define YY_INPUT(buf,result,max_size) \
00725    if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
00726       { \
00727       int c = '*'; \
00728       size_t n; \
00729       for ( n = 0; n < max_size && \
00730               (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00731          buf[n] = (char) c; \
00732       if ( c == '\n' ) \
00733          buf[n++] = (char) c; \
00734       if ( c == EOF && ferror( yyin ) ) \
00735          YY_FATAL_ERROR( "input in flex scanner failed" ); \
00736       result = n; \
00737       } \
00738    else \
00739       { \
00740       errno=0; \
00741       while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
00742          { \
00743          if( errno != EINTR) \
00744             { \
00745             YY_FATAL_ERROR( "input in flex scanner failed" ); \
00746             break; \
00747             } \
00748          errno=0; \
00749          clearerr(yyin); \
00750          } \
00751       }\
00752 \
00753 
00754 #endif
00755 
00756 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00757  * we don't want an extra ';' after the "return" because that will cause
00758  * some compilers to complain about unreachable statements.
00759  */
00760 #ifndef yyterminate
00761 #define yyterminate() return YY_NULL
00762 #endif
00763 
00764 /* Number of entries by which start-condition stack grows. */
00765 #ifndef YY_START_STACK_INCR
00766 #define YY_START_STACK_INCR 25
00767 #endif
00768 
00769 /* Report a fatal error. */
00770 #ifndef YY_FATAL_ERROR
00771 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
00772 #endif
00773 
00774 /* end tables serialization structures and prototypes */
00775 
00776 /* Default declaration of generated scanner - a define so the user can
00777  * easily add parameters.
00778  */
00779 #ifndef YY_DECL
00780 #define YY_DECL_IS_OURS 1
00781 
00782 extern int ast_yylex (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
00783 
00784 #define YY_DECL int ast_yylex (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
00785 #endif /* !YY_DECL */
00786 
00787 /* Code executed at the beginning of each rule, after yytext and yyleng
00788  * have been set up.
00789  */
00790 #ifndef YY_USER_ACTION
00791 #define YY_USER_ACTION
00792 #endif
00793 
00794 /* Code executed at the end of each rule. */
00795 #ifndef YY_BREAK
00796 #define YY_BREAK break;
00797 #endif
00798 
00799 #define YY_RULE_SETUP \
00800    YY_USER_ACTION
00801 
00802 /** The main scanner function which does all the work.
00803  */
00804 YY_DECL
00805 {
00806    register yy_state_type yy_current_state;
00807    register char *yy_cp, *yy_bp;
00808    register int yy_act;
00809     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
00810 
00811 #line 105 "ast_expr2.fl"
00812 
00813 
00814 #line 815 "ast_expr2f.c"
00815 
00816     yylval = yylval_param;
00817 
00818     yylloc = yylloc_param;
00819 
00820    if ( !yyg->yy_init )
00821       {
00822       yyg->yy_init = 1;
00823 
00824 #ifdef YY_USER_INIT
00825       YY_USER_INIT;
00826 #endif
00827 
00828       if ( ! yyg->yy_start )
00829          yyg->yy_start = 1;   /* first start state */
00830 
00831       if ( ! yyin )
00832          yyin = stdin;
00833 
00834       if ( ! yyout )
00835          yyout = stdout;
00836 
00837       if ( ! YY_CURRENT_BUFFER ) {
00838          ast_yyensure_buffer_stack (yyscanner);
00839          YY_CURRENT_BUFFER_LVALUE =
00840             ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
00841       }
00842 
00843       ast_yy_load_buffer_state(yyscanner );
00844       }
00845 
00846    while ( 1 )    /* loops until end-of-file is reached */
00847       {
00848       yyg->yy_more_len = 0;
00849       if ( yyg->yy_more_flag )
00850          {
00851          yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
00852          yyg->yy_more_flag = 0;
00853          }
00854       yy_cp = yyg->yy_c_buf_p;
00855 
00856       /* Support of yytext. */
00857       *yy_cp = yyg->yy_hold_char;
00858 
00859       /* yy_bp points to the position in yy_ch_buf of the start of
00860        * the current run.
00861        */
00862       yy_bp = yy_cp;
00863 
00864       yy_current_state = yyg->yy_start;
00865 yy_match:
00866       do
00867          {
00868          register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00869          if ( yy_accept[yy_current_state] )
00870             {
00871             yyg->yy_last_accepting_state = yy_current_state;
00872             yyg->yy_last_accepting_cpos = yy_cp;
00873             }
00874          while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00875             {
00876             yy_current_state = (int) yy_def[yy_current_state];
00877             if ( yy_current_state >= 55 )
00878                yy_c = yy_meta[(unsigned int) yy_c];
00879             }
00880          yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00881          ++yy_cp;
00882          }
00883       while ( yy_current_state != 54 );
00884       yy_cp = yyg->yy_last_accepting_cpos;
00885       yy_current_state = yyg->yy_last_accepting_state;
00886 
00887 yy_find_action:
00888       yy_act = yy_accept[yy_current_state];
00889 
00890       YY_DO_BEFORE_ACTION;
00891 
00892 do_action:  /* This label is used only to access EOF actions. */
00893 
00894       switch ( yy_act )
00895    { /* beginning of action switch */
00896          case 0: /* must back up */
00897          /* undo the effects of YY_DO_BEFORE_ACTION */
00898          *yy_cp = yyg->yy_hold_char;
00899          yy_cp = yyg->yy_last_accepting_cpos;
00900          yy_current_state = yyg->yy_last_accepting_state;
00901          goto yy_find_action;
00902 
00903 case 1:
00904 YY_RULE_SETUP
00905 #line 107 "ast_expr2.fl"
00906 { SET_COLUMNS; SET_STRING; return TOK_OR;}
00907    YY_BREAK
00908 case 2:
00909 YY_RULE_SETUP
00910 #line 108 "ast_expr2.fl"
00911 { SET_COLUMNS; SET_STRING; return TOK_AND;}
00912    YY_BREAK
00913 case 3:
00914 YY_RULE_SETUP
00915 #line 109 "ast_expr2.fl"
00916 { SET_COLUMNS; SET_STRING; return TOK_EQ;}
00917    YY_BREAK
00918 case 4:
00919 YY_RULE_SETUP
00920 #line 110 "ast_expr2.fl"
00921 { SET_COLUMNS; SET_STRING; return TOK_OR;}
00922    YY_BREAK
00923 case 5:
00924 YY_RULE_SETUP
00925 #line 111 "ast_expr2.fl"
00926 { SET_COLUMNS; SET_STRING; return TOK_AND;}
00927    YY_BREAK
00928 case 6:
00929 YY_RULE_SETUP
00930 #line 112 "ast_expr2.fl"
00931 { SET_COLUMNS; SET_STRING; return TOK_EQ;}
00932    YY_BREAK
00933 case 7:
00934 YY_RULE_SETUP
00935 #line 113 "ast_expr2.fl"
00936 { SET_COLUMNS; SET_STRING; return TOK_EQTILDE;}
00937    YY_BREAK
00938 case 8:
00939 YY_RULE_SETUP
00940 #line 114 "ast_expr2.fl"
00941 { SET_COLUMNS; SET_STRING; return TOK_GT;}
00942    YY_BREAK
00943 case 9:
00944 YY_RULE_SETUP
00945 #line 115 "ast_expr2.fl"
00946 { SET_COLUMNS; SET_STRING; return TOK_LT;}
00947    YY_BREAK
00948 case 10:
00949 YY_RULE_SETUP
00950 #line 116 "ast_expr2.fl"
00951 { SET_COLUMNS; SET_STRING; return TOK_GE;}
00952    YY_BREAK
00953 case 11:
00954 YY_RULE_SETUP
00955 #line 117 "ast_expr2.fl"
00956 { SET_COLUMNS; SET_STRING; return TOK_LE;}
00957    YY_BREAK
00958 case 12:
00959 YY_RULE_SETUP
00960 #line 118 "ast_expr2.fl"
00961 { SET_COLUMNS; SET_STRING; return TOK_NE;}
00962    YY_BREAK
00963 case 13:
00964 YY_RULE_SETUP
00965 #line 119 "ast_expr2.fl"
00966 { SET_COLUMNS; SET_STRING; return TOK_PLUS;}
00967    YY_BREAK
00968 case 14:
00969 YY_RULE_SETUP
00970 #line 120 "ast_expr2.fl"
00971 { SET_COLUMNS; SET_STRING; return TOK_MINUS;}
00972    YY_BREAK
00973 case 15:
00974 YY_RULE_SETUP
00975 #line 121 "ast_expr2.fl"
00976 { SET_COLUMNS; SET_STRING; return TOK_MULT;}
00977    YY_BREAK
00978 case 16:
00979 YY_RULE_SETUP
00980 #line 122 "ast_expr2.fl"
00981 { SET_COLUMNS; SET_STRING; return TOK_DIV;}
00982    YY_BREAK
00983 case 17:
00984 YY_RULE_SETUP
00985 #line 123 "ast_expr2.fl"
00986 { SET_COLUMNS; SET_STRING; return TOK_MOD;}
00987    YY_BREAK
00988 case 18:
00989 YY_RULE_SETUP
00990 #line 124 "ast_expr2.fl"
00991 { SET_COLUMNS; SET_STRING; return TOK_COND;}
00992    YY_BREAK
00993 case 19:
00994 YY_RULE_SETUP
00995 #line 125 "ast_expr2.fl"
00996 { SET_COLUMNS; SET_STRING; return TOK_COMPL;}
00997    YY_BREAK
00998 case 20:
00999 YY_RULE_SETUP
01000 #line 126 "ast_expr2.fl"
01001 { SET_COLUMNS; SET_STRING; return TOK_COLON;}
01002    YY_BREAK
01003 case 21:
01004 YY_RULE_SETUP
01005 #line 127 "ast_expr2.fl"
01006 { SET_COLUMNS; SET_STRING; return TOK_COLONCOLON;}
01007    YY_BREAK
01008 case 22:
01009 YY_RULE_SETUP
01010 #line 128 "ast_expr2.fl"
01011 { SET_COLUMNS; SET_STRING; return TOK_LP;}
01012    YY_BREAK
01013 case 23:
01014 YY_RULE_SETUP
01015 #line 129 "ast_expr2.fl"
01016 { SET_COLUMNS; SET_STRING; return TOK_RP;}
01017    YY_BREAK
01018 case 24:
01019 YY_RULE_SETUP
01020 #line 130 "ast_expr2.fl"
01021 {
01022       /* gather the contents of ${} expressions, with trailing stuff,
01023        * into a single TOKEN.
01024        * They are much more complex now than they used to be
01025        */
01026       curlycount = 0;
01027       BEGIN(var);
01028       yymore();
01029    }
01030    YY_BREAK
01031 case 25:
01032 YY_RULE_SETUP
01033 #line 140 "ast_expr2.fl"
01034 {}
01035    YY_BREAK
01036 case 26:
01037 /* rule 26 can match eol */
01038 YY_RULE_SETUP
01039 #line 141 "ast_expr2.fl"
01040 {SET_COLUMNS; SET_STRING; return TOKEN;}
01041    YY_BREAK
01042 case 27:
01043 /* rule 27 can match eol */
01044 YY_RULE_SETUP
01045 #line 143 "ast_expr2.fl"
01046 {/* what to do with eol */}
01047    YY_BREAK
01048 case 28:
01049 YY_RULE_SETUP
01050 #line 144 "ast_expr2.fl"
01051 {
01052       SET_COLUMNS;
01053       /* the original behavior of the expression parser was
01054        * to bring in numbers as a numeric string
01055        */
01056       SET_NUMERIC_STRING;
01057       return TOKEN;
01058    }
01059    YY_BREAK
01060 case 29:
01061 YY_RULE_SETUP
01062 #line 153 "ast_expr2.fl"
01063 {
01064       SET_COLUMNS;
01065       SET_STRING;
01066       return TOKEN;
01067    }
01068    YY_BREAK
01069 case 30:
01070 /* rule 30 can match eol */
01071 YY_RULE_SETUP
01072 #line 160 "ast_expr2.fl"
01073 {
01074       curlycount--;
01075       if (curlycount < 0) {
01076          BEGIN(trail);
01077          yymore();
01078       } else {
01079          yymore();
01080       }
01081    }
01082    YY_BREAK
01083 case 31:
01084 /* rule 31 can match eol */
01085 YY_RULE_SETUP
01086 #line 170 "ast_expr2.fl"
01087 {
01088       curlycount++;
01089       yymore();
01090    }
01091    YY_BREAK
01092 case 32:
01093 YY_RULE_SETUP
01094 #line 176 "ast_expr2.fl"
01095 {
01096       BEGIN(0);
01097       SET_COLUMNS;
01098       SET_STRING;
01099       return TOKEN;
01100    }
01101    YY_BREAK
01102 case 33:
01103 /* rule 33 can match eol */
01104 YY_RULE_SETUP
01105 #line 183 "ast_expr2.fl"
01106 {
01107       char c = yytext[yyleng-1];
01108       BEGIN(0);
01109       unput(c);
01110       SET_COLUMNS;
01111       SET_STRING;
01112       return TOKEN;
01113    }
01114    YY_BREAK
01115 case 34:
01116 YY_RULE_SETUP
01117 #line 192 "ast_expr2.fl"
01118 {
01119       curlycount = 0;
01120       BEGIN(var);
01121       yymore();
01122    }
01123    YY_BREAK
01124 case YY_STATE_EOF(trail):
01125 #line 198 "ast_expr2.fl"
01126 {
01127       BEGIN(0);
01128       SET_COLUMNS;
01129       SET_STRING;
01130       return TOKEN;
01131       /*actually, if an expr is only a variable ref, this could happen a LOT */
01132    }
01133    YY_BREAK
01134 case 35:
01135 YY_RULE_SETUP
01136 #line 206 "ast_expr2.fl"
01137 ECHO;
01138    YY_BREAK
01139 #line 1140 "ast_expr2f.c"
01140 case YY_STATE_EOF(INITIAL):
01141 case YY_STATE_EOF(var):
01142    yyterminate();
01143 
01144    case YY_END_OF_BUFFER:
01145       {
01146       /* Amount of text matched not including the EOB char. */
01147       int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
01148 
01149       /* Undo the effects of YY_DO_BEFORE_ACTION. */
01150       *yy_cp = yyg->yy_hold_char;
01151       YY_RESTORE_YY_MORE_OFFSET
01152 
01153       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
01154          {
01155          /* We're scanning a new file or input source.  It's
01156           * possible that this happened because the user
01157           * just pointed yyin at a new source and called
01158           * ast_yylex().  If so, then we have to assure
01159           * consistency between YY_CURRENT_BUFFER and our
01160           * globals.  Here is the right place to do so, because
01161           * this is the first action (other than possibly a
01162           * back-up) that will match for the new input source.
01163           */
01164          yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01165          YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
01166          YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
01167          }
01168 
01169       /* Note that here we test for yy_c_buf_p "<=" to the position
01170        * of the first EOB in the buffer, since yy_c_buf_p will
01171        * already have been incremented past the NUL character
01172        * (since all states make transitions on EOB to the
01173        * end-of-buffer state).  Contrast this with the test
01174        * in input().
01175        */
01176       if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
01177          { /* This was really a NUL. */
01178          yy_state_type yy_next_state;
01179 
01180          yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
01181 
01182          yy_current_state = yy_get_previous_state( yyscanner );
01183 
01184          /* Okay, we're now positioned to make the NUL
01185           * transition.  We couldn't have
01186           * yy_get_previous_state() go ahead and do it
01187           * for us because it doesn't know how to deal
01188           * with the possibility of jamming (and we don't
01189           * want to build jamming into it because then it
01190           * will run more slowly).
01191           */
01192 
01193          yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
01194 
01195          yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
01196 
01197          if ( yy_next_state )
01198             {
01199             /* Consume the NUL. */
01200             yy_cp = ++yyg->yy_c_buf_p;
01201             yy_current_state = yy_next_state;
01202             goto yy_match;
01203             }
01204 
01205          else
01206             {
01207             yy_cp = yyg->yy_last_accepting_cpos;
01208             yy_current_state = yyg->yy_last_accepting_state;
01209             goto yy_find_action;
01210             }
01211          }
01212 
01213       else switch ( yy_get_next_buffer( yyscanner ) )
01214          {
01215          case EOB_ACT_END_OF_FILE:
01216             {
01217             yyg->yy_did_buffer_switch_on_eof = 0;
01218 
01219             if ( ast_yywrap(yyscanner ) )
01220                {
01221                /* Note: because we've taken care in
01222                 * yy_get_next_buffer() to have set up
01223                 * yytext, we can now set up
01224                 * yy_c_buf_p so that if some total
01225                 * hoser (like flex itself) wants to
01226                 * call the scanner after we return the
01227                 * YY_NULL, it'll still work - another
01228                 * YY_NULL will get returned.
01229                 */
01230                yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
01231 
01232                yy_act = YY_STATE_EOF(YY_START);
01233                goto do_action;
01234                }
01235 
01236             else
01237                {
01238                if ( ! yyg->yy_did_buffer_switch_on_eof )
01239                   YY_NEW_FILE;
01240                }
01241             break;
01242             }
01243 
01244          case EOB_ACT_CONTINUE_SCAN:
01245             yyg->yy_c_buf_p =
01246                yyg->yytext_ptr + yy_amount_of_matched_text;
01247 
01248             yy_current_state = yy_get_previous_state( yyscanner );
01249 
01250             yy_cp = yyg->yy_c_buf_p;
01251             yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
01252             goto yy_match;
01253 
01254          case EOB_ACT_LAST_MATCH:
01255             yyg->yy_c_buf_p =
01256             &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
01257 
01258             yy_current_state = yy_get_previous_state( yyscanner );
01259 
01260             yy_cp = yyg->yy_c_buf_p;
01261             yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
01262             goto yy_find_action;
01263          }
01264       break;
01265       }
01266 
01267    default:
01268       YY_FATAL_ERROR(
01269          "fatal flex scanner internal error--no action found" );
01270    } /* end of action switch */
01271       } /* end of scanning one token */
01272 } /* end of ast_yylex */
01273 
01274 /* yy_get_next_buffer - try to read in a new buffer
01275  *
01276  * Returns a code representing an action:
01277  * EOB_ACT_LAST_MATCH -
01278  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01279  * EOB_ACT_END_OF_FILE - end of file
01280  */
01281 static int yy_get_next_buffer (yyscan_t yyscanner)
01282 {
01283     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01284    register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
01285    register char *source = yyg->yytext_ptr;
01286    register int number_to_move, i;
01287    int ret_val;
01288 
01289    if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
01290       YY_FATAL_ERROR(
01291       "fatal flex scanner internal error--end of buffer missed" );
01292 
01293    if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
01294       { /* Don't try to fill the buffer, so this is an EOF. */
01295       if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
01296          {
01297          /* We matched a single character, the EOB, so
01298           * treat this as a final EOF.
01299           */
01300          return EOB_ACT_END_OF_FILE;
01301          }
01302 
01303       else
01304          {
01305          /* We matched some text prior to the EOB, first
01306           * process it.
01307           */
01308          return EOB_ACT_LAST_MATCH;
01309          }
01310       }
01311 
01312    /* Try to read more data. */
01313 
01314    /* First move last chars to start of buffer. */
01315    number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
01316 
01317    for ( i = 0; i < number_to_move; ++i )
01318       *(dest++) = *(source++);
01319 
01320    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01321       /* don't do the read, it's not guaranteed to return an EOF,
01322        * just force an EOF
01323        */
01324       YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
01325 
01326    else
01327       {
01328          int num_to_read =
01329          YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
01330 
01331       while ( num_to_read <= 0 )
01332          { /* Not enough room in the buffer - grow it. */
01333 
01334          /* just a shorter name for the current buffer */
01335          YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
01336 
01337          int yy_c_buf_p_offset =
01338             (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
01339 
01340          if ( b->yy_is_our_buffer )
01341             {
01342             int new_size = b->yy_buf_size * 2;
01343 
01344             if ( new_size <= 0 )
01345                b->yy_buf_size += b->yy_buf_size / 8;
01346             else
01347                b->yy_buf_size *= 2;
01348 
01349             b->yy_ch_buf = (char *)
01350                /* Include room in for 2 EOB chars. */
01351                ast_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
01352             }
01353          else
01354             /* Can't grow it, we don't own it. */
01355             b->yy_ch_buf = 0;
01356 
01357          if ( ! b->yy_ch_buf )
01358             YY_FATAL_ERROR(
01359             "fatal error - scanner input buffer overflow" );
01360 
01361          yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
01362 
01363          num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
01364                   number_to_move - 1;
01365 
01366          }
01367 
01368       if ( num_to_read > YY_READ_BUF_SIZE )
01369          num_to_read = YY_READ_BUF_SIZE;
01370 
01371       /* Read in more data. */
01372       YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
01373          yyg->yy_n_chars, num_to_read );
01374 
01375       YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01376       }
01377 
01378    if ( yyg->yy_n_chars == 0 )
01379       {
01380       if ( number_to_move == YY_MORE_ADJ )
01381          {
01382          ret_val = EOB_ACT_END_OF_FILE;
01383          ast_yyrestart(yyin  ,yyscanner);
01384          }
01385 
01386       else
01387          {
01388          ret_val = EOB_ACT_LAST_MATCH;
01389          YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
01390             YY_BUFFER_EOF_PENDING;
01391          }
01392       }
01393 
01394    else
01395       ret_val = EOB_ACT_CONTINUE_SCAN;
01396 
01397    yyg->yy_n_chars += number_to_move;
01398    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
01399    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
01400 
01401    yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
01402 
01403    return ret_val;
01404 }
01405 
01406 /* yy_get_previous_state - get the state just before the EOB char was reached */
01407 
01408     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
01409 {
01410    register yy_state_type yy_current_state;
01411    register char *yy_cp;
01412     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01413 
01414    yy_current_state = yyg->yy_start;
01415 
01416    for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
01417       {
01418       register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01419       if ( yy_accept[yy_current_state] )
01420          {
01421          yyg->yy_last_accepting_state = yy_current_state;
01422          yyg->yy_last_accepting_cpos = yy_cp;
01423          }
01424       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01425          {
01426          yy_current_state = (int) yy_def[yy_current_state];
01427          if ( yy_current_state >= 55 )
01428             yy_c = yy_meta[(unsigned int) yy_c];
01429          }
01430       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01431       }
01432 
01433    return yy_current_state;
01434 }
01435 
01436 /* yy_try_NUL_trans - try to make a transition on the NUL character
01437  *
01438  * synopsis
01439  * next_state = yy_try_NUL_trans( current_state );
01440  */
01441     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
01442 {
01443    register int yy_is_jam;
01444     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
01445    register char *yy_cp = yyg->yy_c_buf_p;
01446 
01447    register YY_CHAR yy_c = 1;
01448    if ( yy_accept[yy_current_state] )
01449       {
01450       yyg->yy_last_accepting_state = yy_current_state;
01451       yyg->yy_last_accepting_cpos = yy_cp;
01452       }
01453    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01454       {
01455       yy_current_state = (int) yy_def[yy_current_state];
01456       if ( yy_current_state >= 55 )
01457          yy_c = yy_meta[(unsigned int) yy_c];
01458       }
01459    yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01460    yy_is_jam = (yy_current_state == 54);
01461 
01462    return yy_is_jam ? 0 : yy_current_state;
01463 }
01464 
01465     static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
01466 {
01467    register char *yy_cp;
01468     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01469 
01470     yy_cp = yyg->yy_c_buf_p;
01471 
01472    /* undo effects of setting up yytext */
01473    *yy_cp = yyg->yy_hold_char;
01474 
01475    if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
01476       { /* need to shift things up to make room */
01477       /* +2 for EOB chars. */
01478       register int number_to_move = yyg->yy_n_chars + 2;
01479       register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
01480                YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
01481       register char *source =
01482             &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
01483 
01484       while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01485          *--dest = *--source;
01486 
01487       yy_cp += (int) (dest - source);
01488       yy_bp += (int) (dest - source);
01489       YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
01490          yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
01491 
01492       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
01493          YY_FATAL_ERROR( "flex scanner push-back overflow" );
01494       }
01495 
01496    *--yy_cp = (char) c;
01497 
01498    yyg->yytext_ptr = yy_bp;
01499    yyg->yy_hold_char = *yy_cp;
01500    yyg->yy_c_buf_p = yy_cp;
01501 }
01502 
01503 #ifndef YY_NO_INPUT
01504 #ifdef __cplusplus
01505     static int yyinput (yyscan_t yyscanner)
01506 #else
01507     static int input  (yyscan_t yyscanner)
01508 #endif
01509 
01510 {
01511    int c;
01512     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01513 
01514    *yyg->yy_c_buf_p = yyg->yy_hold_char;
01515 
01516    if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
01517       {
01518       /* yy_c_buf_p now points to the character we want to return.
01519        * If this occurs *before* the EOB characters, then it's a
01520        * valid NUL; if not, then we've hit the end of the buffer.
01521        */
01522       if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
01523          /* This was really a NUL. */
01524          *yyg->yy_c_buf_p = '\0';
01525 
01526       else
01527          { /* need more input */
01528          int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
01529          ++yyg->yy_c_buf_p;
01530 
01531          switch ( yy_get_next_buffer( yyscanner ) )
01532             {
01533             case EOB_ACT_LAST_MATCH:
01534                /* This happens because yy_g_n_b()
01535                 * sees that we've accumulated a
01536                 * token and flags that we need to
01537                 * try matching the token before
01538                 * proceeding.  But for input(),
01539                 * there's no matching to consider.
01540                 * So convert the EOB_ACT_LAST_MATCH
01541                 * to EOB_ACT_END_OF_FILE.
01542                 */
01543 
01544                /* Reset buffer status. */
01545                ast_yyrestart(yyin ,yyscanner);
01546 
01547                /*FALLTHROUGH*/
01548 
01549             case EOB_ACT_END_OF_FILE:
01550                {
01551                if ( ast_yywrap(yyscanner ) )
01552                   return EOF;
01553 
01554                if ( ! yyg->yy_did_buffer_switch_on_eof )
01555                   YY_NEW_FILE;
01556 #ifdef __cplusplus
01557                return yyinput(yyscanner);
01558 #else
01559                return input(yyscanner);
01560 #endif
01561                }
01562 
01563             case EOB_ACT_CONTINUE_SCAN:
01564                yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
01565                break;
01566             }
01567          }
01568       }
01569 
01570    c = *(unsigned char *) yyg->yy_c_buf_p;   /* cast for 8-bit char's */
01571    *yyg->yy_c_buf_p = '\0';   /* preserve yytext */
01572    yyg->yy_hold_char = *++yyg->yy_c_buf_p;
01573 
01574    return c;
01575 }
01576 #endif   /* ifndef YY_NO_INPUT */
01577 
01578 /** Immediately switch to a different input stream.
01579  * @param input_file A readable stream.
01580  * @param yyscanner The scanner object.
01581  * @note This function does not reset the start condition to @c INITIAL .
01582  */
01583     void ast_yyrestart  (FILE * input_file , yyscan_t yyscanner)
01584 {
01585     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01586 
01587    if ( ! YY_CURRENT_BUFFER ){
01588         ast_yyensure_buffer_stack (yyscanner);
01589       YY_CURRENT_BUFFER_LVALUE =
01590             ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
01591    }
01592 
01593    ast_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
01594    ast_yy_load_buffer_state(yyscanner );
01595 }
01596 
01597 /** Switch to a different input buffer.
01598  * @param new_buffer The new input buffer.
01599  * @param yyscanner The scanner object.
01600  */
01601     void ast_yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
01602 {
01603     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01604 
01605    /* TODO. We should be able to replace this entire function body
01606     * with
01607     *    ast_yypop_buffer_state();
01608     *    ast_yypush_buffer_state(new_buffer);
01609      */
01610    ast_yyensure_buffer_stack (yyscanner);
01611    if ( YY_CURRENT_BUFFER == new_buffer )
01612       return;
01613 
01614    if ( YY_CURRENT_BUFFER )
01615       {
01616       /* Flush out information for old buffer. */
01617       *yyg->yy_c_buf_p = yyg->yy_hold_char;
01618       YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
01619       YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01620       }
01621 
01622    YY_CURRENT_BUFFER_LVALUE = new_buffer;
01623    ast_yy_load_buffer_state(yyscanner );
01624 
01625    /* We don't actually know whether we did this switch during
01626     * EOF (ast_yywrap()) processing, but the only time this flag
01627     * is looked at is after ast_yywrap() is called, so it's safe
01628     * to go ahead and always set it.
01629     */
01630    yyg->yy_did_buffer_switch_on_eof = 1;
01631 }
01632 
01633 static void ast_yy_load_buffer_state  (yyscan_t yyscanner)
01634 {
01635     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01636    yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01637    yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
01638    yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
01639    yyg->yy_hold_char = *yyg->yy_c_buf_p;
01640 }
01641 
01642 /** Allocate and initialize an input buffer state.
01643  * @param file A readable stream.
01644  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
01645  * @param yyscanner The scanner object.
01646  * @return the allocated buffer state.
01647  */
01648     YY_BUFFER_STATE ast_yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
01649 {
01650    YY_BUFFER_STATE b;
01651     
01652    b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
01653    if ( ! b )
01654       YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
01655 
01656    b->yy_buf_size = size;
01657 
01658    /* yy_ch_buf has to be 2 characters longer than the size given because
01659     * we need to put in 2 end-of-buffer characters.
01660     */
01661    b->yy_ch_buf = (char *) ast_yyalloc(b->yy_buf_size + 2 ,yyscanner );
01662    if ( ! b->yy_ch_buf )
01663       YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
01664 
01665    b->yy_is_our_buffer = 1;
01666 
01667    ast_yy_init_buffer(b,file ,yyscanner);
01668 
01669    return b;
01670 }
01671 
01672 /** Destroy the buffer.
01673  * @param b a buffer created with ast_yy_create_buffer()
01674  * @param yyscanner The scanner object.
01675  */
01676     void ast_yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
01677 {
01678     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01679 
01680    if ( ! b )
01681       return;
01682 
01683    if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
01684       YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
01685 
01686    if ( b->yy_is_our_buffer )
01687       ast_yyfree((void *) b->yy_ch_buf ,yyscanner );
01688 
01689    ast_yyfree((void *) b ,yyscanner );
01690 }
01691 
01692 #ifndef __cplusplus
01693 extern int isatty (int );
01694 #endif /* __cplusplus */
01695     
01696 /* Initializes or reinitializes a buffer.
01697  * This function is sometimes called more than once on the same buffer,
01698  * such as during a ast_yyrestart() or at EOF.
01699  */
01700     static void ast_yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
01701 
01702 {
01703    int oerrno = errno;
01704     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01705 
01706    ast_yy_flush_buffer(b ,yyscanner);
01707 
01708    b->yy_input_file = file;
01709    b->yy_fill_buffer = 1;
01710 
01711     /* If b is the current buffer, then ast_yy_init_buffer was _probably_
01712      * called from ast_yyrestart() or through yy_get_next_buffer.
01713      * In that case, we don't want to reset the lineno or column.
01714      */
01715     if (b != YY_CURRENT_BUFFER){
01716         b->yy_bs_lineno = 1;
01717         b->yy_bs_column = 0;
01718     }
01719 
01720         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01721     
01722    errno = oerrno;
01723 }
01724 
01725 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
01726  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
01727  * @param yyscanner The scanner object.
01728  */
01729     void ast_yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
01730 {
01731     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01732    if ( ! b )
01733       return;
01734 
01735    b->yy_n_chars = 0;
01736 
01737    /* We always need two end-of-buffer characters.  The first causes
01738     * a transition to the end-of-buffer state.  The second causes
01739     * a jam in that state.
01740     */
01741    b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01742    b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01743 
01744    b->yy_buf_pos = &b->yy_ch_buf[0];
01745 
01746    b->yy_at_bol = 1;
01747    b->yy_buffer_status = YY_BUFFER_NEW;
01748 
01749    if ( b == YY_CURRENT_BUFFER )
01750       ast_yy_load_buffer_state(yyscanner );
01751 }
01752 
01753 /** Pushes the new state onto the stack. The new state becomes
01754  *  the current state. This function will allocate the stack
01755  *  if necessary.
01756  *  @param new_buffer The new state.
01757  *  @param yyscanner The scanner object.
01758  */
01759 void ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
01760 {
01761     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01762    if (new_buffer == NULL)
01763       return;
01764 
01765    ast_yyensure_buffer_stack(yyscanner);
01766 
01767    /* This block is copied from ast_yy_switch_to_buffer. */
01768    if ( YY_CURRENT_BUFFER )
01769       {
01770       /* Flush out information for old buffer. */
01771       *yyg->yy_c_buf_p = yyg->yy_hold_char;
01772       YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
01773       YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01774       }
01775 
01776    /* Only push if top exists. Otherwise, replace top. */
01777    if (YY_CURRENT_BUFFER)
01778       yyg->yy_buffer_stack_top++;
01779    YY_CURRENT_BUFFER_LVALUE = new_buffer;
01780 
01781    /* copied from ast_yy_switch_to_buffer. */
01782    ast_yy_load_buffer_state(yyscanner );
01783    yyg->yy_did_buffer_switch_on_eof = 1;
01784 }
01785 
01786 /** Removes and deletes the top of the stack, if present.
01787  *  The next element becomes the new top.
01788  *  @param yyscanner The scanner object.
01789  */
01790 void ast_yypop_buffer_state (yyscan_t yyscanner)
01791 {
01792     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01793    if (!YY_CURRENT_BUFFER)
01794       return;
01795 
01796    ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
01797    YY_CURRENT_BUFFER_LVALUE = NULL;
01798    if (yyg->yy_buffer_stack_top > 0)
01799       --yyg->yy_buffer_stack_top;
01800 
01801    if (YY_CURRENT_BUFFER) {
01802       ast_yy_load_buffer_state(yyscanner );
01803       yyg->yy_did_buffer_switch_on_eof = 1;
01804    }
01805 }
01806 
01807 /* Allocates the stack if it does not exist.
01808  *  Guarantees space for at least one push.
01809  */
01810 static void ast_yyensure_buffer_stack (yyscan_t yyscanner)
01811 {
01812    int num_to_alloc;
01813     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01814 
01815    if (!yyg->yy_buffer_stack) {
01816 
01817       /* First allocation is just for 2 elements, since we don't know if this
01818        * scanner will even need a stack. We use 2 instead of 1 to avoid an
01819        * immediate realloc on the next call.
01820          */
01821       num_to_alloc = 1;
01822       yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyalloc
01823                         (num_to_alloc * sizeof(struct yy_buffer_state*)
01824                         , yyscanner);
01825       
01826       memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
01827             
01828       yyg->yy_buffer_stack_max = num_to_alloc;
01829       yyg->yy_buffer_stack_top = 0;
01830       return;
01831    }
01832 
01833    if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
01834 
01835       /* Increase the buffer to prepare for a possible push. */
01836       int grow_size = 8 /* arbitrary grow size */;
01837 
01838       num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
01839       yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyrealloc
01840                         (yyg->yy_buffer_stack,
01841                         num_to_alloc * sizeof(struct yy_buffer_state*)
01842                         , yyscanner);
01843 
01844       /* zero only the new slots.*/
01845       memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
01846       yyg->yy_buffer_stack_max = num_to_alloc;
01847    }
01848 }
01849 
01850 /** Setup the input buffer state to scan directly from a user-specified character buffer.
01851  * @param base the character buffer
01852  * @param size the size in bytes of the character buffer
01853  * @param yyscanner The scanner object.
01854  * @return the newly allocated buffer state object. 
01855  */
01856 YY_BUFFER_STATE ast_yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
01857 {
01858    YY_BUFFER_STATE b;
01859     
01860    if ( size < 2 ||
01861         base[size-2] != YY_END_OF_BUFFER_CHAR ||
01862         base[size-1] != YY_END_OF_BUFFER_CHAR )
01863       /* They forgot to leave room for the EOB's. */
01864       return 0;
01865 
01866    b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
01867    if ( ! b )
01868       YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" );
01869 
01870    b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
01871    b->yy_buf_pos = b->yy_ch_buf = base;
01872    b->yy_is_our_buffer = 0;
01873    b->yy_input_file = 0;
01874    b->yy_n_chars = b->yy_buf_size;
01875    b->yy_is_interactive = 0;
01876    b->yy_at_bol = 1;
01877    b->yy_fill_buffer = 0;
01878    b->yy_buffer_status = YY_BUFFER_NEW;
01879 
01880    ast_yy_switch_to_buffer(b ,yyscanner );
01881 
01882    return b;
01883 }
01884 
01885 /** Setup the input buffer state to scan a string. The next call to ast_yylex() will
01886  * scan from a @e copy of @a str.
01887  * @param str a NUL-terminated string to scan
01888  * @param yyscanner The scanner object.
01889  * @return the newly allocated buffer state object.
01890  * @note If you want to scan bytes that may contain NUL values, then use
01891  *       ast_yy_scan_bytes() instead.
01892  */
01893 YY_BUFFER_STATE ast_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
01894 {
01895     
01896    return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
01897 }
01898 
01899 /** Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will
01900  * scan from a @e copy of @a bytes.
01901  * @param bytes the byte buffer to scan
01902  * @param len the number of bytes in the buffer pointed to by @a bytes.
01903  * @param yyscanner The scanner object.
01904  * @return the newly allocated buffer state object.
01905  */
01906 YY_BUFFER_STATE ast_yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
01907 {
01908    YY_BUFFER_STATE b;
01909    char *buf;
01910    yy_size_t n;
01911    int i;
01912     
01913    /* Get memory for full buffer, including space for trailing EOB's. */
01914    n = _yybytes_len + 2;
01915    buf = (char *) ast_yyalloc(n ,yyscanner );
01916    if ( ! buf )
01917       YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" );
01918 
01919    for ( i = 0; i < _yybytes_len; ++i )
01920       buf[i] = yybytes[i];
01921 
01922    buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
01923 
01924    b = ast_yy_scan_buffer(buf,n ,yyscanner);
01925    if ( ! b )
01926       YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" );
01927 
01928    /* It's okay to grow etc. this buffer, and we should throw it
01929     * away when we're done.
01930     */
01931    b->yy_is_our_buffer = 1;
01932 
01933    return b;
01934 }
01935 
01936 #ifndef YY_EXIT_FAILURE
01937 #define YY_EXIT_FAILURE 2
01938 #endif
01939 
01940 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
01941 {
01942       (void) fprintf( stderr, "%s\n", msg );
01943    exit( YY_EXIT_FAILURE );
01944 }
01945 
01946 /* Redefine yyless() so it works in section 3 code. */
01947 
01948 #undef yyless
01949 #define yyless(n) \
01950    do \
01951       { \
01952       /* Undo effects of setting up yytext. */ \
01953         int yyless_macro_arg = (n); \
01954         YY_LESS_LINENO(yyless_macro_arg);\
01955       yytext[yyleng] = yyg->yy_hold_char; \
01956       yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
01957       yyg->yy_hold_char = *yyg->yy_c_buf_p; \
01958       *yyg->yy_c_buf_p = '\0'; \
01959       yyleng = yyless_macro_arg; \
01960       } \
01961    while ( 0 )
01962 
01963 /* Accessor  methods (get/set functions) to struct members. */
01964 
01965 /** Get the user-defined data for this scanner.
01966  * @param yyscanner The scanner object.
01967  */
01968 YY_EXTRA_TYPE ast_yyget_extra  (yyscan_t yyscanner)
01969 {
01970     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01971     return yyextra;
01972 }
01973 
01974 /** Get the current line number.
01975  * @param yyscanner The scanner object.
01976  */
01977 int ast_yyget_lineno  (yyscan_t yyscanner)
01978 {
01979     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01980     
01981         if (! YY_CURRENT_BUFFER)
01982             return 0;
01983     
01984     return yylineno;
01985 }
01986 
01987 /** Get the current column number.
01988  * @param yyscanner The scanner object.
01989  */
01990 int ast_yyget_column  (yyscan_t yyscanner)
01991 {
01992     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01993     
01994         if (! YY_CURRENT_BUFFER)
01995             return 0;
01996     
01997     return yycolumn;
01998 }
01999 
02000 /** Get the input stream.
02001  * @param yyscanner The scanner object.
02002  */
02003 FILE *ast_yyget_in  (yyscan_t yyscanner)
02004 {
02005     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02006     return yyin;
02007 }
02008 
02009 /** Get the output stream.
02010  * @param yyscanner The scanner object.
02011  */
02012 FILE *ast_yyget_out  (yyscan_t yyscanner)
02013 {
02014     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02015     return yyout;
02016 }
02017 
02018 /** Get the length of the current token.
02019  * @param yyscanner The scanner object.
02020  */
02021 int ast_yyget_leng  (yyscan_t yyscanner)
02022 {
02023     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02024     return yyleng;
02025 }
02026 
02027 /** Get the current token.
02028  * @param yyscanner The scanner object.
02029  */
02030 
02031 char *ast_yyget_text  (yyscan_t yyscanner)
02032 {
02033     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02034     return yytext;
02035 }
02036 
02037 /** Set the user-defined data. This data is never touched by the scanner.
02038  * @param user_defined The data to be associated with this scanner.
02039  * @param yyscanner The scanner object.
02040  */
02041 void ast_yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
02042 {
02043     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02044     yyextra = user_defined ;
02045 }
02046 
02047 /** Set the current line number.
02048  * @param line_number
02049  * @param yyscanner The scanner object.
02050  */
02051 void ast_yyset_lineno (int  line_number , yyscan_t yyscanner)
02052 {
02053     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02054 
02055         /* lineno is only valid if an input buffer exists. */
02056         if (! YY_CURRENT_BUFFER )
02057            yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner); 
02058     
02059     yylineno = line_number;
02060 }
02061 
02062 /** Set the current column.
02063  * @param line_number
02064  * @param yyscanner The scanner object.
02065  */
02066 void ast_yyset_column (int  column_no , yyscan_t yyscanner)
02067 {
02068     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02069 
02070         /* column is only valid if an input buffer exists. */
02071         if (! YY_CURRENT_BUFFER )
02072            yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner); 
02073     
02074     yycolumn = column_no;
02075 }
02076 
02077 /** Set the input stream. This does not discard the current
02078  * input buffer.
02079  * @param in_str A readable stream.
02080  * @param yyscanner The scanner object.
02081  * @see ast_yy_switch_to_buffer
02082  */
02083 void ast_yyset_in (FILE *  in_str , yyscan_t yyscanner)
02084 {
02085     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02086     yyin = in_str ;
02087 }
02088 
02089 void ast_yyset_out (FILE *  out_str , yyscan_t yyscanner)
02090 {
02091     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02092     yyout = out_str ;
02093 }
02094 
02095 int ast_yyget_debug  (yyscan_t yyscanner)
02096 {
02097     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02098     return yy_flex_debug;
02099 }
02100 
02101 void ast_yyset_debug (int  bdebug , yyscan_t yyscanner)
02102 {
02103     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02104     yy_flex_debug = bdebug ;
02105 }
02106 
02107 /* Accessor methods for yylval and yylloc */
02108 
02109 YYSTYPE * ast_yyget_lval  (yyscan_t yyscanner)
02110 {
02111     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02112     return yylval;
02113 }
02114 
02115 void ast_yyset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
02116 {
02117     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02118     yylval = yylval_param;
02119 }
02120 
02121 YYLTYPE *ast_yyget_lloc  (yyscan_t yyscanner)
02122 {
02123     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02124     return yylloc;
02125 }
02126     
02127 void ast_yyset_lloc (YYLTYPE *  yylloc_param , yyscan_t yyscanner)
02128 {
02129     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02130     yylloc = yylloc_param;
02131 }
02132     
02133 /* User-visible API */
02134 
02135 /* ast_yylex_init is special because it creates the scanner itself, so it is
02136  * the ONLY reentrant function that doesn't take the scanner as the last argument.
02137  * That's why we explicitly handle the declaration, instead of using our macros.
02138  */
02139 
02140 int ast_yylex_init(yyscan_t* ptr_yy_globals)
02141 
02142 {
02143     if (ptr_yy_globals == NULL){
02144         errno = EINVAL;
02145         return 1;
02146     }
02147 
02148     *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL );
02149 
02150     if (*ptr_yy_globals == NULL){
02151         errno = ENOMEM;
02152         return 1;
02153     }
02154 
02155     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
02156     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
02157 
02158     return yy_init_globals ( *ptr_yy_globals );
02159 }
02160 
02161 static int yy_init_globals (yyscan_t yyscanner)
02162 {
02163     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02164     /* Initialization is the same as for the non-reentrant scanner.
02165      * This function is called from ast_yylex_destroy(), so don't allocate here.
02166      */
02167 
02168     yyg->yy_buffer_stack = 0;
02169     yyg->yy_buffer_stack_top = 0;
02170     yyg->yy_buffer_stack_max = 0;
02171     yyg->yy_c_buf_p = (char *) 0;
02172     yyg->yy_init = 0;
02173     yyg->yy_start = 0;
02174 
02175     yyg->yy_start_stack_ptr = 0;
02176     yyg->yy_start_stack_depth = 0;
02177     yyg->yy_start_stack =  NULL;
02178 
02179 /* Defined in main.c */
02180 #ifdef YY_STDINIT
02181     yyin = stdin;
02182     yyout = stdout;
02183 #else
02184     yyin = (FILE *) 0;
02185     yyout = (FILE *) 0;
02186 #endif
02187 
02188     /* For future reference: Set errno on error, since we are called by
02189      * ast_yylex_init()
02190      */
02191     return 0;
02192 }
02193 
02194 /* ast_yylex_destroy is for both reentrant and non-reentrant scanners. */
02195 int ast_yylex_destroy  (yyscan_t yyscanner)
02196 {
02197     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02198 
02199     /* Pop the buffer stack, destroying each element. */
02200    while(YY_CURRENT_BUFFER){
02201       ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
02202       YY_CURRENT_BUFFER_LVALUE = NULL;
02203       ast_yypop_buffer_state(yyscanner);
02204    }
02205 
02206    /* Destroy the stack itself. */
02207    ast_yyfree(yyg->yy_buffer_stack ,yyscanner);
02208    yyg->yy_buffer_stack = NULL;
02209 
02210     /* Destroy the start condition stack. */
02211         ast_yyfree(yyg->yy_start_stack ,yyscanner );
02212         yyg->yy_start_stack = NULL;
02213 
02214     /* Reset the globals. This is important in a non-reentrant scanner so the next time
02215      * ast_yylex() is called, initialization will occur. */
02216     yy_init_globals( yyscanner);
02217 
02218     /* Destroy the main struct (reentrant only). */
02219     ast_yyfree ( yyscanner , yyscanner );
02220     yyscanner = NULL;
02221     return 0;
02222 }
02223 
02224 /*
02225  * Internal utility routines.
02226  */
02227 
02228 #ifndef yytext_ptr
02229 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
02230 {
02231    register int i;
02232    for ( i = 0; i < n; ++i )
02233       s1[i] = s2[i];
02234 }
02235 #endif
02236 
02237 #ifdef YY_NEED_STRLEN
02238 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
02239 {
02240    register int n;
02241    for ( n = 0; s[n]; ++n )
02242       ;
02243 
02244    return n;
02245 }
02246 #endif
02247 
02248 void *ast_yyalloc (yy_size_t  size , yyscan_t yyscanner)
02249 {
02250    return (void *) malloc( size );
02251 }
02252 
02253 void *ast_yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
02254 {
02255    /* The cast to (char *) in the following accommodates both
02256     * implementations that use char* generic pointers, and those
02257     * that use void* generic pointers.  It works with the latter
02258     * because both ANSI C and C++ allow castless assignment from
02259     * any pointer type to void*, and deal with argument conversions
02260     * as though doing an assignment.
02261     */
02262    return (void *) realloc( (char *) ptr, size );
02263 }
02264 
02265 #define YYTABLES_NAME "yytables"
02266 
02267 #line 206 "ast_expr2.fl"
02268 
02269 
02270 
02271 /* I'm putting the interface routine to the whole parse here in the flexer input file
02272    mainly because of all the flexer initialization that has to be done. Shouldn't matter
02273    where it is, as long as it's somewhere. I didn't want to define a prototype for the
02274    ast_yy_scan_string in the .y file, because then, I'd have to define YY_BUFFER_STATE there...
02275    UGH! that would be inappropriate. */
02276 
02277 int ast_yyparse(void *); /* need to/should define this prototype for the call to yyparse */
02278 int ast_yyerror(const char *, YYLTYPE *, struct parse_io *); /* likewise */
02279 
02280 void ast_yyfree(void *ptr, yyscan_t yyscanner)
02281 {
02282       if (ptr) /* the normal generated ast_yyfree func just frees its first arg;
02283                     this get complaints on some systems, as sometimes this
02284                     arg is a nil ptr! It's usually not fatal, but is irritating! */
02285               free( (char *) ptr );
02286 }
02287 
02288 int ast_expr(char *expr, char *buf, int length)
02289 {
02290    struct parse_io io;
02291    int return_value = 0;
02292    
02293    memset(&io, 0, sizeof(io));
02294    io.string = expr;  /* to pass to the error routine */
02295    
02296    ast_yylex_init(&io.scanner);
02297    
02298    ast_yy_scan_string(expr, io.scanner);
02299    
02300    ast_yyparse ((void *) &io);
02301 
02302    ast_yylex_destroy(io.scanner);
02303 
02304    if (!io.val) {
02305       if (length > 1) {
02306          strcpy(buf, "0");
02307          return_value = 1;
02308       }
02309    } else {
02310       if (io.val->type == AST_EXPR_integer) {
02311          int res_length;
02312 
02313          res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i);
02314          return_value = (res_length <= length) ? res_length : length;
02315       } else {
02316 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
02317          strncpy(buf, io.val->u.s, length - 1);
02318 #else /* !STANDALONE && !LOW_MEMORY */
02319          ast_copy_string(buf, io.val->u.s, length);
02320 #endif /* STANDALONE || LOW_MEMORY */
02321          return_value = strlen(buf);
02322          free(io.val->u.s);
02323       }
02324       free(io.val);
02325    }
02326    return return_value;
02327 }
02328 
02329 
02330 char extra_error_message[4095];
02331 int extra_error_message_supplied = 0;
02332 void  ast_expr_register_extra_error_info(char *message);
02333 void  ast_expr_clear_extra_error_info(void);
02334 
02335 void  ast_expr_register_extra_error_info(char *message)
02336 {
02337        extra_error_message_supplied=1;
02338        strcpy(extra_error_message, message);
02339 }
02340 
02341 void  ast_expr_clear_extra_error_info(void)
02342 {
02343        extra_error_message_supplied=0;
02344        extra_error_message[0] = 0;
02345 }
02346 
02347 static char *expr2_token_equivs1[] = 
02348 {
02349    "TOKEN",
02350    "TOK_COND",
02351    "TOK_COLONCOLON",
02352    "TOK_OR",
02353    "TOK_AND",
02354    "TOK_EQ",
02355    "TOK_GT",
02356    "TOK_LT",
02357    "TOK_GE",
02358    "TOK_LE",
02359    "TOK_NE",
02360    "TOK_PLUS",
02361    "TOK_MINUS",
02362    "TOK_MULT",
02363    "TOK_DIV",
02364    "TOK_MOD",
02365    "TOK_COMPL",
02366    "TOK_COLON",
02367    "TOK_EQTILDE",
02368    "TOK_RP",
02369    "TOK_LP"
02370 };
02371 
02372 static char *expr2_token_equivs2[] = 
02373 {
02374    "<token>",
02375    "?",
02376    "::",
02377    "|",
02378    "&",
02379    "=",
02380    ">",
02381    "<",
02382    ">=",
02383    "<=",
02384    "!=",
02385    "+",
02386    "-",
02387    "*",
02388    "/",
02389    "%",
02390    "!",
02391    ":",
02392    "=~",
02393    ")",
02394    "("
02395 };
02396 
02397 
02398 static char *expr2_token_subst(const char *mess)
02399 {
02400    /* calc a length, malloc, fill, and return; yyerror had better free it! */
02401    int len=0,i;
02402    const char *p;
02403    char *res, *s,*t;
02404    int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*);
02405 
02406    for (p=mess; *p; p++) {
02407       for (i=0; i<expr2_token_equivs_entries; i++) {
02408          if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
02409          {
02410             len+=strlen(expr2_token_equivs2[i])+2;
02411             p += strlen(expr2_token_equivs1[i])-1;
02412             break;
02413          }
02414       }
02415       len++;
02416    }
02417    res = (char*)malloc(len+1);
02418    res[0] = 0;
02419    s = res;
02420    for (p=mess; *p;) {
02421       int found = 0;
02422       for (i=0; i<expr2_token_equivs_entries; i++) {
02423          if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
02424             *s++ = '\'';
02425             for (t=expr2_token_equivs2[i]; *t;) {
02426                *s++ = *t++;
02427             }
02428             *s++ = '\'';
02429             p += strlen(expr2_token_equivs1[i]);
02430             found = 1;
02431             break;
02432          }
02433       }
02434       if( !found )
02435          *s++ = *p++;
02436    }
02437    *s++ = 0;
02438    return res;
02439 }
02440 
02441 int ast_yyerror (const char *s,  yyltype *loc, struct parse_io *parseio )
02442 {  
02443    struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
02444    char spacebuf[8000]; /* best safe than sorry */
02445    char spacebuf2[8000]; /* best safe than sorry */
02446    int i=0;
02447    char *s2 = expr2_token_subst(s);
02448    spacebuf[0] = 0;
02449    
02450    for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' ';  /* uh... assuming yyg is defined, then I can use the yycolumn macro,
02451                                                                         which is the same thing as... get this:
02452                                        yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
02453                                        I was tempted to just use yy_buf_pos in the STATE, but..., well:
02454                                           a. the yy_buf_pos is the current position in the buffer, which
02455                                              may not relate to the entire string/buffer because of the
02456                                              buffering.
02457                                           b. but, analysis of the situation is that when you use the
02458                                              ast_yy_scan_string func, it creates a single buffer the size of
02459                                              string, so the two would be the same... 
02460                                        so, in the end, the yycolumn macro is available, shorter, therefore easier. */
02461    spacebuf2[i++]='^';
02462    spacebuf2[i]= 0;
02463 
02464 #ifdef STANDALONE3
02465    /* easier to read in the standalone version */
02466    printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",  
02467          (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
02468 #else
02469    ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",  
02470          (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
02471 #endif
02472 #ifndef STANDALONE
02473    ast_log(LOG_WARNING,"If you have questions, please refer to doc/channelvariables.txt in the asterisk source.\n");
02474 #endif
02475    free(s2);
02476    return(0);
02477 }
02478 

Generated on Mon Nov 24 15:34:07 2008 for Asterisk - the Open Source PBX by  doxygen 1.4.7