1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-27 14:03:40 +03:00

csrf-fix: Improve parsing, corner cases

This commit is contained in:
Carlos Martín 2014-06-09 16:18:43 +02:00
parent 2ec2563ed7
commit 5818b8ea40
4 changed files with 191 additions and 165 deletions

View File

@ -28,7 +28,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 39 #define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
@ -161,7 +161,15 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */ /* Size of default input buffer. */
#ifndef YY_BUF_SIZE #ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384 #define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif #endif
/* The state buf must be large enough to hold one state per character in the main buffer. /* The state buf must be large enough to hold one state per character in the main buffer.
@ -173,12 +181,7 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif #endif
#ifndef YY_TYPEDEF_YY_SIZE_T extern int template_leng;
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
extern yy_size_t template_leng;
extern FILE *template_in, *template_out; extern FILE *template_in, *template_out;
@ -200,13 +203,6 @@ extern FILE *template_in, *template_out;
if ( template_text[yyl] == '\n' )\ if ( template_text[yyl] == '\n' )\
--template_lineno;\ --template_lineno;\
}while(0) }while(0)
#define YY_LINENO_REWIND_TO(dst) \
do {\
const char *p;\
for ( p = yy_cp-1; p >= (dst); --p)\
if ( *p == '\n' )\
--template_lineno;\
}while(0)
/* Return all but the first "n" matched characters back to the input stream. */ /* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \ #define yyless(n) \
@ -224,6 +220,11 @@ extern FILE *template_in, *template_out;
#define unput(c) yyunput( c, (yytext_ptr) ) #define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE #ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state struct yy_buffer_state
@ -241,7 +242,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB /* Number of characters read into yy_ch_buf, not including EOB
* characters. * characters.
*/ */
yy_size_t yy_n_chars; int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it, /* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to * and can realloc() it to grow it, and should free() it to
@ -311,8 +312,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when template_text is formed. */ /* yy_hold_char holds the character lost when template_text is formed. */
static char yy_hold_char; static char yy_hold_char;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ static int yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t template_leng; int template_leng;
/* Points to current character in buffer. */ /* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0; static char *yy_c_buf_p = (char *) 0;
@ -340,7 +341,7 @@ static void template__init_buffer (YY_BUFFER_STATE b,FILE *file );
YY_BUFFER_STATE template__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE template__scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE template__scan_string (yyconst char *yy_str ); YY_BUFFER_STATE template__scan_string (yyconst char *yy_str );
YY_BUFFER_STATE template__scan_bytes (yyconst char *bytes,yy_size_t len ); YY_BUFFER_STATE template__scan_bytes (yyconst char *bytes,int len );
void *template_alloc (yy_size_t ); void *template_alloc (yy_size_t );
void *template_realloc (void *,yy_size_t ); void *template_realloc (void *,yy_size_t );
@ -409,13 +410,13 @@ struct yy_trans_info
flex_int32_t yy_verify; flex_int32_t yy_verify;
flex_int32_t yy_nxt; flex_int32_t yy_nxt;
}; };
static yyconst flex_int16_t yy_accept[46] = static yyconst flex_int16_t yy_accept[48] =
{ 0, { 0,
0, 0, 0, 0, 12, 11, 2, 2, 11, 6, 0, 0, 0, 0, 12, 11, 2, 2, 11, 6,
3, 4, 7, 10, 11, 10, 8, 2, 2, 0, 3, 4, 7, 10, 11, 10, 8, 2, 2, 0,
6, 4, 7, 0, 1, 6, 3, 4, 5, 7, 6, 4, 7, 0, 1, 6, 3, 4, 5, 7,
10, 0, 8, 10, 0, 9, 10, 0, 8, 9, 10, 0, 8, 10, 0, 9, 10, 0, 8, 9,
0, 9, 0, 9, 0 0, 9, 0, 0, 9, 0, 0
} ; } ;
static yyconst flex_int32_t yy_ec[256] = static yyconst flex_int32_t yy_ec[256] =
@ -456,22 +457,24 @@ static yyconst flex_int32_t yy_meta[13] =
1, 3 1, 3
} ; } ;
static yyconst flex_int16_t yy_base[51] = static yyconst flex_int16_t yy_base[53] =
{ 0, { 0,
0, 0, 12, 0, 45, 90, 23, 34, 41, 0, 0, 0, 12, 0, 51, 90, 23, 34, 47, 0,
36, 45, 0, 0, 47, 57, 0, 0, 0, 39, 38, 45, 0, 0, 47, 57, 0, 0, 0, 41,
0, 0, 0, 38, 90, 0, 32, 0, 90, 0, 0, 0, 0, 40, 90, 0, 35, 0, 90, 0,
0, 0, 0, 0, 69, 0, 34, 70, 0, 90, 0, 0, 0, 0, 69, 0, 37, 70, 0, 90,
30, 0, 74, 0, 90, 86, 31, 30, 29, 25 35, 0, 34, 74, 0, 30, 90, 86, 31, 30,
29, 25
} ; } ;
static yyconst flex_int16_t yy_def[51] = static yyconst flex_int16_t yy_def[53] =
{ 0, { 0,
45, 1, 45, 3, 45, 45, 45, 45, 46, 47, 47, 1, 47, 3, 47, 47, 47, 47, 48, 49,
45, 45, 48, 49, 45, 45, 50, 7, 8, 46, 47, 47, 50, 51, 47, 47, 52, 7, 8, 48,
47, 12, 48, 46, 45, 47, 45, 12, 45, 48, 49, 12, 50, 48, 47, 49, 47, 12, 47, 50,
49, 15, 50, 16, 16, 49, 16, 35, 50, 45, 51, 15, 52, 16, 16, 51, 16, 35, 52, 47,
35, 16, 35, 35, 0, 45, 45, 45, 45, 45 35, 16, 35, 35, 35, 35, 0, 47, 47, 47,
47, 47
} ; } ;
static yyconst flex_int16_t yy_nxt[103] = static yyconst flex_int16_t yy_nxt[103] =
@ -479,31 +482,31 @@ static yyconst flex_int16_t yy_nxt[103] =
6, 7, 8, 6, 9, 10, 11, 12, 6, 6, 6, 7, 8, 6, 9, 10, 11, 12, 6, 6,
6, 13, 14, 15, 6, 16, 6, 6, 14, 6, 6, 13, 14, 15, 6, 16, 6, 6, 14, 6,
14, 17, 14, 6, 18, 19, 39, 20, 21, 31, 14, 17, 14, 6, 18, 19, 39, 20, 21, 31,
22, 30, 26, 44, 23, 19, 19, 42, 27, 21, 22, 30, 26, 45, 23, 19, 19, 45, 45, 21,
25, 25, 27, 25, 45, 23, 28, 29, 32, 45, 42, 27, 25, 25, 27, 23, 28, 29, 32, 25,
45, 45, 45, 45, 45, 45, 33, 34, 35, 35, 47, 47, 47, 47, 47, 47, 33, 34, 35, 35,
36, 35, 35, 34, 35, 34, 35, 37, 38, 35, 36, 35, 35, 34, 35, 34, 35, 37, 38, 35,
45, 45, 40, 45, 45, 35, 45, 35, 45, 41, 47, 47, 40, 47, 47, 35, 47, 35, 47, 41,
35, 43, 45, 45, 35, 35, 24, 24, 24, 5, 43, 44, 47, 47, 46, 35, 24, 24, 24, 5,
45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
45, 45 47, 47
} ; } ;
static yyconst flex_int16_t yy_chk[103] = static yyconst flex_int16_t yy_chk[103] =
{ 0, { 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 7, 7, 50, 7, 7, 49, 3, 3, 3, 3, 7, 7, 52, 7, 7, 51,
7, 48, 47, 41, 7, 8, 8, 37, 27, 8, 7, 50, 49, 46, 7, 8, 8, 43, 41, 8,
24, 20, 11, 9, 5, 8, 12, 12, 15, 0, 37, 27, 24, 20, 11, 8, 12, 12, 15, 9,
0, 0, 0, 0, 0, 0, 15, 16, 16, 16, 5, 0, 0, 0, 0, 0, 15, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 35, 16, 16, 16, 16, 16, 16, 16, 16, 16, 35,
0, 0, 35, 0, 0, 35, 0, 35, 0, 35, 0, 0, 35, 0, 0, 35, 0, 35, 0, 35,
38, 38, 43, 0, 43, 43, 46, 46, 46, 45, 38, 38, 44, 0, 44, 44, 48, 48, 48, 47,
45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
45, 45 47, 47
} ; } ;
/* Table of booleans, true if rule could match eol. */ /* Table of booleans, true if rule could match eol. */
@ -559,7 +562,7 @@ char *template_text;
llocp->first_column = llocp->last_column; \ llocp->first_column = llocp->last_column; \
llocp->last_column += template_leng; llocp->last_column += template_leng;
#line 563 "template_parser.c" #line 566 "template_parser.c"
#define INITIAL 0 #define INITIAL 0
#define VALUE 1 #define VALUE 1
@ -599,7 +602,7 @@ FILE *template_get_out (void );
void template_set_out (FILE * out_str ); void template_set_out (FILE * out_str );
yy_size_t template_get_leng (void ); int template_get_leng (void );
char *template_get_text (void ); char *template_get_text (void );
@ -639,7 +642,12 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */ /* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE #ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192 #define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif #endif
/* Copy whatever the last rule matched to the standard output. */ /* Copy whatever the last rule matched to the standard output. */
@ -740,6 +748,14 @@ YY_DECL
register char *yy_cp, *yy_bp; register char *yy_cp, *yy_bp;
register int yy_act; register int yy_act;
#line 44 "template_parser.l"
/* ------------------------------------------------------------------------- */
/* Comments (lines with an starting #), and empty lines */
/* ------------------------------------------------------------------------- */
#line 758 "template_parser.c"
if ( !(yy_init) ) if ( !(yy_init) )
{ {
(yy_init) = 1; (yy_init) = 1;
@ -766,15 +782,6 @@ YY_DECL
template__load_buffer_state( ); template__load_buffer_state( );
} }
{
#line 44 "template_parser.l"
/* ------------------------------------------------------------------------- */
/* Comments (lines with an starting #), and empty lines */
/* ------------------------------------------------------------------------- */
#line 777 "template_parser.c"
while ( 1 ) /* loops until end-of-file is reached */ while ( 1 ) /* loops until end-of-file is reached */
{ {
yy_cp = (yy_c_buf_p); yy_cp = (yy_c_buf_p);
@ -791,7 +798,7 @@ YY_DECL
yy_match: yy_match:
do do
{ {
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
(yy_last_accepting_state) = yy_current_state; (yy_last_accepting_state) = yy_current_state;
@ -800,7 +807,7 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 46 ) if ( yy_current_state >= 48 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@ -821,7 +828,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{ {
yy_size_t yyl; int yyl;
for ( yyl = 0; yyl < template_leng; ++yyl ) for ( yyl = 0; yyl < template_leng; ++yyl )
if ( template_text[yyl] == '\n' ) if ( template_text[yyl] == '\n' )
@ -925,7 +932,7 @@ YY_RULE_SETUP
#line 90 "template_parser.l" #line 90 "template_parser.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 929 "template_parser.c" #line 936 "template_parser.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(VALUE): case YY_STATE_EOF(VALUE):
yyterminate(); yyterminate();
@ -1057,7 +1064,6 @@ case YY_STATE_EOF(VALUE):
"fatal flex scanner internal error--no action found" ); "fatal flex scanner internal error--no action found" );
} /* end of action switch */ } /* end of action switch */
} /* end of scanning one token */ } /* end of scanning one token */
} /* end of user's declarations */
} /* end of template_lex */ } /* end of template_lex */
/* yy_get_next_buffer - try to read in a new buffer /* yy_get_next_buffer - try to read in a new buffer
@ -1113,21 +1119,21 @@ static int yy_get_next_buffer (void)
else else
{ {
yy_size_t num_to_read = int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 ) while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */ { /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */ /* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset = int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf); (int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer ) if ( b->yy_is_our_buffer )
{ {
yy_size_t new_size = b->yy_buf_size * 2; int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 ) if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8; b->yy_buf_size += b->yy_buf_size / 8;
@ -1158,7 +1164,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */ /* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), num_to_read ); (yy_n_chars), (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
} }
@ -1219,7 +1225,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 46 ) if ( yy_current_state >= 48 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@ -1247,13 +1253,13 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 46 ) if ( yy_current_state >= 48 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 45); yy_is_jam = (yy_current_state == 47);
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
#ifndef YY_NO_INPUT #ifndef YY_NO_INPUT
@ -1280,7 +1286,7 @@ static int yy_get_next_buffer (void)
else else
{ /* need more input */ { /* need more input */
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); int offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p); ++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) ) switch ( yy_get_next_buffer( ) )
@ -1445,6 +1451,10 @@ static void template__load_buffer_state (void)
template_free((void *) b ); template_free((void *) b );
} }
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer. /* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer, * This function is sometimes called more than once on the same buffer,
* such as during a template_restart() or at EOF. * such as during a template_restart() or at EOF.
@ -1557,7 +1567,7 @@ void template_pop_buffer_state (void)
*/ */
static void template_ensure_buffer_stack (void) static void template_ensure_buffer_stack (void)
{ {
yy_size_t num_to_alloc; int num_to_alloc;
if (!(yy_buffer_stack)) { if (!(yy_buffer_stack)) {
@ -1654,12 +1664,12 @@ YY_BUFFER_STATE template__scan_string (yyconst char * yystr )
* *
* @return the newly allocated buffer state object. * @return the newly allocated buffer state object.
*/ */
YY_BUFFER_STATE template__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) YY_BUFFER_STATE template__scan_bytes (yyconst char * yybytes, int _yybytes_len )
{ {
YY_BUFFER_STATE b; YY_BUFFER_STATE b;
char *buf; char *buf;
yy_size_t n; yy_size_t n;
yy_size_t i; int i;
/* Get memory for full buffer, including space for trailing EOB's. */ /* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2; n = _yybytes_len + 2;
@ -1741,7 +1751,7 @@ FILE *template_get_out (void)
/** Get the length of the current token. /** Get the length of the current token.
* *
*/ */
yy_size_t template_get_leng (void) int template_get_leng (void)
{ {
return template_leng; return template_leng;
} }

View File

@ -75,7 +75,7 @@ STRING [^=#[:blank:]\n,\[\]]+
/* - String in double quoted form */ /* - String in double quoted form */
/* - Anything but =,][# and blanks */ /* - Anything but =,][# and blanks */
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
<VALUE>\"([^\"\]]|"\\\""|\][^\"\]]|\]\][^\"\>])*(\]|\]\])?\" { <VALUE>\"([^\"\]]|"\\\""|"\]\\\""|"\]\]\\\""|\][^\"\]]|\]\][^\"\>])*(\]|\]\])?\" {
lvalp->val_str = mem_collector_strdup(mc,yytext+1); lvalp->val_str = mem_collector_strdup(mc,yytext+1);
lvalp->val_str[yyleng-2] = '\0'; lvalp->val_str[yyleng-2] = '\0';
BEGIN(INITIAL); return STRING; } BEGIN(INITIAL); return STRING; }

View File

@ -28,7 +28,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 39 #define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
@ -161,7 +161,15 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */ /* Size of default input buffer. */
#ifndef YY_BUF_SIZE #ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384 #define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif #endif
/* The state buf must be large enough to hold one state per character in the main buffer. /* The state buf must be large enough to hold one state per character in the main buffer.
@ -173,12 +181,7 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif #endif
#ifndef YY_TYPEDEF_YY_SIZE_T extern int vm_var_leng;
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
extern yy_size_t vm_var_leng;
extern FILE *vm_var_in, *vm_var_out; extern FILE *vm_var_in, *vm_var_out;
@ -200,13 +203,6 @@ extern FILE *vm_var_in, *vm_var_out;
if ( vm_var_text[yyl] == '\n' )\ if ( vm_var_text[yyl] == '\n' )\
--vm_var_lineno;\ --vm_var_lineno;\
}while(0) }while(0)
#define YY_LINENO_REWIND_TO(dst) \
do {\
const char *p;\
for ( p = yy_cp-1; p >= (dst); --p)\
if ( *p == '\n' )\
--vm_var_lineno;\
}while(0)
/* Return all but the first "n" matched characters back to the input stream. */ /* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \ #define yyless(n) \
@ -224,6 +220,11 @@ extern FILE *vm_var_in, *vm_var_out;
#define unput(c) yyunput( c, (yytext_ptr) ) #define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE #ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state struct yy_buffer_state
@ -241,7 +242,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB /* Number of characters read into yy_ch_buf, not including EOB
* characters. * characters.
*/ */
yy_size_t yy_n_chars; int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it, /* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to * and can realloc() it to grow it, and should free() it to
@ -311,8 +312,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when vm_var_text is formed. */ /* yy_hold_char holds the character lost when vm_var_text is formed. */
static char yy_hold_char; static char yy_hold_char;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ static int yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t vm_var_leng; int vm_var_leng;
/* Points to current character in buffer. */ /* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0; static char *yy_c_buf_p = (char *) 0;
@ -340,7 +341,7 @@ static void vm_var__init_buffer (YY_BUFFER_STATE b,FILE *file );
YY_BUFFER_STATE vm_var__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE vm_var__scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE vm_var__scan_string (yyconst char *yy_str ); YY_BUFFER_STATE vm_var__scan_string (yyconst char *yy_str );
YY_BUFFER_STATE vm_var__scan_bytes (yyconst char *bytes,yy_size_t len ); YY_BUFFER_STATE vm_var__scan_bytes (yyconst char *bytes,int len );
void *vm_var_alloc (yy_size_t ); void *vm_var_alloc (yy_size_t );
void *vm_var_realloc (void *,yy_size_t ); void *vm_var_realloc (void *,yy_size_t );
@ -545,7 +546,7 @@ char *vm_var_text;
llocp->last_column += vm_var_leng; llocp->last_column += vm_var_leng;
#line 549 "vm_var_parser.c" #line 550 "vm_var_parser.c"
#define INITIAL 0 #define INITIAL 0
#define VAR 1 #define VAR 1
@ -586,7 +587,7 @@ FILE *vm_var_get_out (void );
void vm_var_set_out (FILE * out_str ); void vm_var_set_out (FILE * out_str );
yy_size_t vm_var_get_leng (void ); int vm_var_get_leng (void );
char *vm_var_get_text (void ); char *vm_var_get_text (void );
@ -626,7 +627,12 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */ /* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE #ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192 #define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif #endif
/* Copy whatever the last rule matched to the standard output. */ /* Copy whatever the last rule matched to the standard output. */
@ -727,6 +733,19 @@ YY_DECL
register char *yy_cp, *yy_bp; register char *yy_cp, *yy_bp;
register int yy_act; register int yy_act;
#line 43 "vm_var_parser.l"
/* ------------------------------------------------------------------------- */
/* Parse variables in the form: */
/* $VARIABLE */
/* $VARIABLE[ATTR] */
/* $VARIABLE[ATTR,ATTR=VALUE] */
/* $NUM.CONTEXT_VARIABLE */
/* ------------------------------------------------------------------------- */
#line 748 "vm_var_parser.c"
if ( !(yy_init) ) if ( !(yy_init) )
{ {
(yy_init) = 1; (yy_init) = 1;
@ -753,20 +772,6 @@ YY_DECL
vm_var__load_buffer_state( ); vm_var__load_buffer_state( );
} }
{
#line 43 "vm_var_parser.l"
/* ------------------------------------------------------------------------- */
/* Parse variables in the form: */
/* $VARIABLE */
/* $VARIABLE[ATTR] */
/* $VARIABLE[ATTR,ATTR=VALUE] */
/* $NUM.CONTEXT_VARIABLE */
/* ------------------------------------------------------------------------- */
#line 769 "vm_var_parser.c"
while ( 1 ) /* loops until end-of-file is reached */ while ( 1 ) /* loops until end-of-file is reached */
{ {
yy_cp = (yy_c_buf_p); yy_cp = (yy_c_buf_p);
@ -783,7 +788,7 @@ YY_DECL
yy_match: yy_match:
do do
{ {
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
(yy_last_accepting_state) = yy_current_state; (yy_last_accepting_state) = yy_current_state;
@ -813,7 +818,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{ {
yy_size_t yyl; int yyl;
for ( yyl = 0; yyl < vm_var_leng; ++yyl ) for ( yyl = 0; yyl < vm_var_leng; ++yyl )
if ( vm_var_text[yyl] == '\n' ) if ( vm_var_text[yyl] == '\n' )
@ -915,7 +920,7 @@ YY_RULE_SETUP
#line 92 "vm_var_parser.l" #line 92 "vm_var_parser.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 919 "vm_var_parser.c" #line 924 "vm_var_parser.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(VALUE): case YY_STATE_EOF(VALUE):
yyterminate(); yyterminate();
@ -1047,7 +1052,6 @@ case YY_STATE_EOF(VALUE):
"fatal flex scanner internal error--no action found" ); "fatal flex scanner internal error--no action found" );
} /* end of action switch */ } /* end of action switch */
} /* end of scanning one token */ } /* end of scanning one token */
} /* end of user's declarations */
} /* end of vm_var_lex */ } /* end of vm_var_lex */
/* yy_get_next_buffer - try to read in a new buffer /* yy_get_next_buffer - try to read in a new buffer
@ -1103,21 +1107,21 @@ static int yy_get_next_buffer (void)
else else
{ {
yy_size_t num_to_read = int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 ) while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */ { /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */ /* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset = int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf); (int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer ) if ( b->yy_is_our_buffer )
{ {
yy_size_t new_size = b->yy_buf_size * 2; int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 ) if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8; b->yy_buf_size += b->yy_buf_size / 8;
@ -1148,7 +1152,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */ /* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), num_to_read ); (yy_n_chars), (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
} }
@ -1243,7 +1247,7 @@ static int yy_get_next_buffer (void)
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 33); yy_is_jam = (yy_current_state == 33);
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
#ifndef YY_NO_INPUT #ifndef YY_NO_INPUT
@ -1270,7 +1274,7 @@ static int yy_get_next_buffer (void)
else else
{ /* need more input */ { /* need more input */
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); int offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p); ++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) ) switch ( yy_get_next_buffer( ) )
@ -1435,6 +1439,10 @@ static void vm_var__load_buffer_state (void)
vm_var_free((void *) b ); vm_var_free((void *) b );
} }
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer. /* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer, * This function is sometimes called more than once on the same buffer,
* such as during a vm_var_restart() or at EOF. * such as during a vm_var_restart() or at EOF.
@ -1547,7 +1555,7 @@ void vm_var_pop_buffer_state (void)
*/ */
static void vm_var_ensure_buffer_stack (void) static void vm_var_ensure_buffer_stack (void)
{ {
yy_size_t num_to_alloc; int num_to_alloc;
if (!(yy_buffer_stack)) { if (!(yy_buffer_stack)) {
@ -1644,12 +1652,12 @@ YY_BUFFER_STATE vm_var__scan_string (yyconst char * yystr )
* *
* @return the newly allocated buffer state object. * @return the newly allocated buffer state object.
*/ */
YY_BUFFER_STATE vm_var__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) YY_BUFFER_STATE vm_var__scan_bytes (yyconst char * yybytes, int _yybytes_len )
{ {
YY_BUFFER_STATE b; YY_BUFFER_STATE b;
char *buf; char *buf;
yy_size_t n; yy_size_t n;
yy_size_t i; int i;
/* Get memory for full buffer, including space for trailing EOB's. */ /* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2; n = _yybytes_len + 2;
@ -1731,7 +1739,7 @@ FILE *vm_var_get_out (void)
/** Get the length of the current token. /** Get the length of the current token.
* *
*/ */
yy_size_t vm_var_get_leng (void) int vm_var_get_leng (void)
{ {
return vm_var_leng; return vm_var_leng;
} }

View File

@ -28,7 +28,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 39 #define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
@ -161,7 +161,15 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */ /* Size of default input buffer. */
#ifndef YY_BUF_SIZE #ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384 #define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif #endif
/* The state buf must be large enough to hold one state per character in the main buffer. /* The state buf must be large enough to hold one state per character in the main buffer.
@ -173,12 +181,7 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif #endif
#ifndef YY_TYPEDEF_YY_SIZE_T extern int expr_leng;
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
extern yy_size_t expr_leng;
extern FILE *expr_in, *expr_out; extern FILE *expr_in, *expr_out;
@ -200,13 +203,6 @@ extern FILE *expr_in, *expr_out;
if ( expr_text[yyl] == '\n' )\ if ( expr_text[yyl] == '\n' )\
--expr_lineno;\ --expr_lineno;\
}while(0) }while(0)
#define YY_LINENO_REWIND_TO(dst) \
do {\
const char *p;\
for ( p = yy_cp-1; p >= (dst); --p)\
if ( *p == '\n' )\
--expr_lineno;\
}while(0)
/* Return all but the first "n" matched characters back to the input stream. */ /* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \ #define yyless(n) \
@ -224,6 +220,11 @@ extern FILE *expr_in, *expr_out;
#define unput(c) yyunput( c, (yytext_ptr) ) #define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE #ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state struct yy_buffer_state
@ -241,7 +242,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB /* Number of characters read into yy_ch_buf, not including EOB
* characters. * characters.
*/ */
yy_size_t yy_n_chars; int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it, /* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to * and can realloc() it to grow it, and should free() it to
@ -311,8 +312,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when expr_text is formed. */ /* yy_hold_char holds the character lost when expr_text is formed. */
static char yy_hold_char; static char yy_hold_char;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ static int yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t expr_leng; int expr_leng;
/* Points to current character in buffer. */ /* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0; static char *yy_c_buf_p = (char *) 0;
@ -340,7 +341,7 @@ static void expr__init_buffer (YY_BUFFER_STATE b,FILE *file );
YY_BUFFER_STATE expr__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE expr__scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE expr__scan_string (yyconst char *yy_str ); YY_BUFFER_STATE expr__scan_string (yyconst char *yy_str );
YY_BUFFER_STATE expr__scan_bytes (yyconst char *bytes,yy_size_t len ); YY_BUFFER_STATE expr__scan_bytes (yyconst char *bytes,int len );
void *expr_alloc (yy_size_t ); void *expr_alloc (yy_size_t );
void *expr_realloc (void *,yy_size_t ); void *expr_realloc (void *,yy_size_t );
@ -532,7 +533,7 @@ char *expr_text;
#define YY_USER_ACTION llocp->first_line = expr_lineno; \ #define YY_USER_ACTION llocp->first_line = expr_lineno; \
llocp->first_column = llocp->last_column; \ llocp->first_column = llocp->last_column; \
llocp->last_column += expr_leng; llocp->last_column += expr_leng;
#line 536 "expr_parser.c" #line 537 "expr_parser.c"
#define INITIAL 0 #define INITIAL 0
@ -571,7 +572,7 @@ FILE *expr_get_out (void );
void expr_set_out (FILE * out_str ); void expr_set_out (FILE * out_str );
yy_size_t expr_get_leng (void ); int expr_get_leng (void );
char *expr_get_text (void ); char *expr_get_text (void );
@ -611,7 +612,12 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */ /* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE #ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192 #define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif #endif
/* Copy whatever the last rule matched to the standard output. */ /* Copy whatever the last rule matched to the standard output. */
@ -712,6 +718,12 @@ YY_DECL
register char *yy_cp, *yy_bp; register char *yy_cp, *yy_bp;
register int yy_act; register int yy_act;
#line 39 "expr_parser.l"
/* --- Tokens --- */
#line 726 "expr_parser.c"
if ( !(yy_init) ) if ( !(yy_init) )
{ {
(yy_init) = 1; (yy_init) = 1;
@ -738,13 +750,6 @@ YY_DECL
expr__load_buffer_state( ); expr__load_buffer_state( );
} }
{
#line 39 "expr_parser.l"
/* --- Tokens --- */
#line 747 "expr_parser.c"
while ( 1 ) /* loops until end-of-file is reached */ while ( 1 ) /* loops until end-of-file is reached */
{ {
yy_cp = (yy_c_buf_p); yy_cp = (yy_c_buf_p);
@ -761,7 +766,7 @@ YY_DECL
yy_match: yy_match:
do do
{ {
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
(yy_last_accepting_state) = yy_current_state; (yy_last_accepting_state) = yy_current_state;
@ -791,7 +796,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{ {
yy_size_t yyl; int yyl;
for ( yyl = 0; yyl < expr_leng; ++yyl ) for ( yyl = 0; yyl < expr_leng; ++yyl )
if ( expr_text[yyl] == '\n' ) if ( expr_text[yyl] == '\n' )
@ -860,7 +865,7 @@ YY_RULE_SETUP
#line 68 "expr_parser.l" #line 68 "expr_parser.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 864 "expr_parser.c" #line 869 "expr_parser.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
yyterminate(); yyterminate();
@ -991,7 +996,6 @@ case YY_STATE_EOF(INITIAL):
"fatal flex scanner internal error--no action found" ); "fatal flex scanner internal error--no action found" );
} /* end of action switch */ } /* end of action switch */
} /* end of scanning one token */ } /* end of scanning one token */
} /* end of user's declarations */
} /* end of expr_lex */ } /* end of expr_lex */
/* yy_get_next_buffer - try to read in a new buffer /* yy_get_next_buffer - try to read in a new buffer
@ -1047,21 +1051,21 @@ static int yy_get_next_buffer (void)
else else
{ {
yy_size_t num_to_read = int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 ) while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */ { /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */ /* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset = int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf); (int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer ) if ( b->yy_is_our_buffer )
{ {
yy_size_t new_size = b->yy_buf_size * 2; int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 ) if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8; b->yy_buf_size += b->yy_buf_size / 8;
@ -1092,7 +1096,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */ /* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), num_to_read ); (yy_n_chars), (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
} }
@ -1187,7 +1191,7 @@ static int yy_get_next_buffer (void)
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 19); yy_is_jam = (yy_current_state == 19);
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
#ifndef YY_NO_INPUT #ifndef YY_NO_INPUT
@ -1214,7 +1218,7 @@ static int yy_get_next_buffer (void)
else else
{ /* need more input */ { /* need more input */
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); int offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p); ++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) ) switch ( yy_get_next_buffer( ) )
@ -1379,6 +1383,10 @@ static void expr__load_buffer_state (void)
expr_free((void *) b ); expr_free((void *) b );
} }
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer. /* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer, * This function is sometimes called more than once on the same buffer,
* such as during a expr_restart() or at EOF. * such as during a expr_restart() or at EOF.
@ -1491,7 +1499,7 @@ void expr_pop_buffer_state (void)
*/ */
static void expr_ensure_buffer_stack (void) static void expr_ensure_buffer_stack (void)
{ {
yy_size_t num_to_alloc; int num_to_alloc;
if (!(yy_buffer_stack)) { if (!(yy_buffer_stack)) {
@ -1588,12 +1596,12 @@ YY_BUFFER_STATE expr__scan_string (yyconst char * yystr )
* *
* @return the newly allocated buffer state object. * @return the newly allocated buffer state object.
*/ */
YY_BUFFER_STATE expr__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) YY_BUFFER_STATE expr__scan_bytes (yyconst char * yybytes, int _yybytes_len )
{ {
YY_BUFFER_STATE b; YY_BUFFER_STATE b;
char *buf; char *buf;
yy_size_t n; yy_size_t n;
yy_size_t i; int i;
/* Get memory for full buffer, including space for trailing EOB's. */ /* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2; n = _yybytes_len + 2;
@ -1675,7 +1683,7 @@ FILE *expr_get_out (void)
/** Get the length of the current token. /** Get the length of the current token.
* *
*/ */
yy_size_t expr_get_leng (void) int expr_get_leng (void)
{ {
return expr_leng; return expr_leng;
} }