/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types.
*/ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif
/* Returned upon end-of-file. */ #define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast.
*/ #define YY_SC_TO_UI(c) ((unsignedint) (unsignedchar) c)
/* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN.
*/ #define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility.
*/ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */ #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 #endif/* __ia64__ */ #endif
/* The state buf must be large enough to hold one state per character in the main buffer.
*/ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
/* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \
{ \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \ while ( 0 )
char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB * characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB * characters.
*/
yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it.
*/ int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline.
*/ int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not.
*/ int yy_at_bol;
int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the * end of it.
*/ int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file.
*/ #define YY_BUFFER_EOF_PENDING 2
}; #endif/* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL.
*/ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)
/* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only.
*/ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
/* yy_hold_char holds the character lost when yytext is formed. */ staticchar yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t yyleng;
/* Points to current character in buffer. */ staticchar *yy_c_buf_p = (char *) 0; staticint yy_init = 0; /* whether we need to initialize */ staticint yy_start = 0; /* start state number */
/* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ...
*/ staticint yy_did_buffer_switch_on_eof;
/* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed.
*/ #define REJECT reject_used_but_not_detected staticint yy_more_flag = 0; staticint yy_more_len = 0; #define yymore() ((yy_more_flag) = 1) #define YY_MORE_ADJ (yy_more_len) #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "scan.l" /* scan.l - scanner for flex input -*-C-*- */ #line 4 "scan.l" /* Copyright (c) 1990 The Regents of the University of California. */ /* All rights reserved. */
/* This code is derived from software contributed to Berkeley by */ /* Vern Paxson. */
/* The United States Government has rights in this work pursuant */ /* to contract no. DE-AC03-76SF00098 between the United States */ /* Department of Energy and the University of California. */
/* This file is part of flex. */
/* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */
/* 1. Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* 2. Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the distribution. */
/* Neither the name of the University nor the names of its contributors */ /* may be used to endorse or promote products derived from this software */ /* without specific prior written permission. */
/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */ /* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */
#include"flexdef.h" #include"parse.h" externbool tablesverify, tablesext; externint trlcontxt; /* Set in parse.y for each rule. */ externconstchar *escaped_qstart, *escaped_qend;
#ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option.
*/ #include <unistd.h> #endif
/* Amount of stuff to slurp up with each read. */ #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 #endif/* __ia64__ */ #endif
/* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite().
*/ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result".
*/ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \ int c = '*'; \
size_t n; \ for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \ if ( c == '\n' ) \
buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \ else \
{ \
errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
{ \ if( errno != EINTR) \
{ \
YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \
} \
errno=0; \
clearerr(yyin); \
} \
}\
\
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements.
*/ #ifndef yyterminate #define yyterminate() return YY_NULL #endif
/* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif
yy_find_action:
yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 )
{ /* have to back up */
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
yy_act = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
{ /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = (yy_hold_char);
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state); goto yy_find_action;
case 1:
YY_RULE_SETUP #line 142 "scan.l"
indented_code = true; BEGIN(CODEBLOCK);
YY_BREAK case 2:
YY_RULE_SETUP #line 143 "scan.l"
ACTION_ECHO; yy_push_state( COMMENT );
YY_BREAK case 3:
YY_RULE_SETUP #line 144 "scan.l"
yy_push_state( LINEDIR );
YY_BREAK case 4:
YY_RULE_SETUP #line 145 "scan.l" return SCDECL;
YY_BREAK case 5:
YY_RULE_SETUP #line 146 "scan.l" return XSCDECL;
YY_BREAK case 6: /* rule 6 can match eol */
YY_RULE_SETUP #line 147 "scan.l"
{
++linenum;
line_directive_out( (FILE *) 0, 1 );
indented_code = false;
BEGIN(CODEBLOCK);
}
YY_BREAK case 7: /* rule 7 can match eol */
YY_RULE_SETUP #line 153 "scan.l"
{
brace_start_line = linenum;
++linenum;
buf_linedir( &top_buf, infilename?infilename:"<stdin>", linenum);
brace_depth = 1;
yy_push_state(CODEBLOCK_MATCH_BRACE);
}
YY_BREAK case 8:
YY_RULE_SETUP #line 161 "scan.l"
synerr( _("malformed '%top' directive") );
YY_BREAK case 9:
YY_RULE_SETUP #line 163 "scan.l" /* discard */
YY_BREAK case 10:
YY_RULE_SETUP #line 165 "scan.l"
{
sectnum = 2;
bracelevel = 0;
mark_defs1();
line_directive_out( (FILE *) 0, 1 );
BEGIN(SECT2PROLOG); return SECTEND;
}
YY_BREAK case 11: /* rule 11 can match eol */
YY_RULE_SETUP #line 174 "scan.l"
yytext_is_array = false; ++linenum;
YY_BREAK case 12: /* rule 12 can match eol */
YY_RULE_SETUP #line 175 "scan.l"
yytext_is_array = true; ++linenum;
YY_BREAK case 13:
YY_RULE_SETUP #line 177 "scan.l"
BEGIN(OPTION); return OPTION_OP;
YY_BREAK case 14: /* rule 14 can match eol */
YY_RULE_SETUP #line 179 "scan.l"
++linenum; /* ignore */
YY_BREAK case 15: /* rule 15 can match eol */
YY_RULE_SETUP #line 180 "scan.l"
++linenum; /* ignore */
YY_BREAK /* xgettext: no-c-format */ case 16: /* rule 16 can match eol */
YY_RULE_SETUP #line 183 "scan.l"
synerr( _( "unrecognized '%' directive" ) );
YY_BREAK case 17:
YY_RULE_SETUP #line 185 "scan.l"
{ if(yyleng < MAXLINE)
{
strcpy( nmstr, yytext );
} else
{
synerr( _("Definition name too long\n"));
FLEX_EXIT(EXIT_FAILURE);
}
didadef = false;
BEGIN(PICKUPDEF);
}
YY_BREAK case 18:
YY_RULE_SETUP #line 200 "scan.l"
RETURNNAME;
YY_BREAK case 19: /* rule 19 can match eol */
YY_RULE_SETUP #line 201 "scan.l"
++linenum; /* allows blank lines in section 1 */
YY_BREAK case 20: /* rule 20 can match eol */
YY_RULE_SETUP #line 202 "scan.l"
ACTION_ECHO; ++linenum; /* maybe end of comment line */
YY_BREAK
case 21:
YY_RULE_SETUP #line 207 "scan.l"
ACTION_ECHO; yy_pop_state();
YY_BREAK case 22:
YY_RULE_SETUP #line 208 "scan.l"
ACTION_ECHO;
YY_BREAK case 23:
YY_RULE_SETUP #line 209 "scan.l"
ACTION_ECHO_QSTART;
YY_BREAK case 24:
YY_RULE_SETUP #line 210 "scan.l"
ACTION_ECHO_QEND;
YY_BREAK case 25:
YY_RULE_SETUP #line 211 "scan.l"
ACTION_ECHO;
YY_BREAK case 26: /* rule 26 can match eol */
YY_RULE_SETUP #line 212 "scan.l"
++linenum; ACTION_ECHO;
YY_BREAK
/* This is the same as COMMENT, but is discarded rather than output. */ case 27:
YY_RULE_SETUP #line 217 "scan.l"
yy_pop_state();
YY_BREAK case 28:
YY_RULE_SETUP #line 218 "scan.l"
;
YY_BREAK case 29:
YY_RULE_SETUP #line 219 "scan.l"
;
YY_BREAK case 30: /* rule 30 can match eol */
YY_RULE_SETUP #line 220 "scan.l"
++linenum;
YY_BREAK
case 31:
YY_RULE_SETUP #line 224 "scan.l"
yy_pop_state();
YY_BREAK case 32:
YY_RULE_SETUP #line 225 "scan.l"
;
YY_BREAK case 33: /* rule 33 can match eol */
YY_RULE_SETUP #line 226 "scan.l"
++linenum;
YY_BREAK
case 131: /* rule 131 can match eol */
YY_RULE_SETUP #line 457 "scan.l"
++linenum; BEGIN(INITIAL);
YY_BREAK
case 132:
YY_RULE_SETUP #line 461 "scan.l"
++bracelevel; yyless( 2 ); /* eat only %{ */
YY_BREAK case 133:
YY_RULE_SETUP #line 462 "scan.l"
--bracelevel; yyless( 2 ); /* eat only %} */
YY_BREAK case 134:
YY_RULE_SETUP #line 464 "scan.l"
ACTION_ECHO; /* indented code in prolog */
YY_BREAK case 135:
YY_RULE_SETUP #line 466 "scan.l"
{ /* non-indented code */ if ( bracelevel <= 0 )
{ /* not in %{ ... %} */
yyless( 0 ); /* put it all back */
yy_set_bol( 1 );
mark_prolog();
BEGIN(SECT2);
} else
ACTION_ECHO;
}
YY_BREAK case 136:
YY_RULE_SETUP #line 478 "scan.l"
ACTION_ECHO;
YY_BREAK case 137: /* rule 137 can match eol */
YY_RULE_SETUP #line 479 "scan.l"
++linenum; ACTION_ECHO;
YY_BREAK case YY_STATE_EOF(SECT2PROLOG): #line 481 "scan.l"
{
mark_prolog();
sectnum = 0;
yyterminate(); /* to stop the parser */
}
YY_BREAK
case 138: /* rule 138 can match eol */
YY_RULE_SETUP #line 489 "scan.l"
++linenum; /* allow blank lines in section 2 */
YY_BREAK case 139:
YY_RULE_SETUP #line 491 "scan.l"
{
indented_code = false;
doing_codeblock = true;
bracelevel = 1;
BEGIN(PERCENT_BRACE_ACTION);
}
YY_BREAK case 140:
YY_RULE_SETUP #line 498 "scan.l"
{ /* Allow "<" to appear in (?x) patterns. */ if (!sf_skip_ws())
BEGIN(SC); return'<';
}
YY_BREAK case 141:
YY_RULE_SETUP #line 504 "scan.l" return'^';
YY_BREAK case 142:
YY_RULE_SETUP #line 505 "scan.l"
BEGIN(QUOTE); return'"';
YY_BREAK case 143:
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
(yy_c_buf_p) = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP #line 506 "scan.l"
{
BEGIN(NUM); if ( lex_compat || posix_compat ) return BEGIN_REPEAT_POSIX; else return BEGIN_REPEAT_FLEX;
}
YY_BREAK case 144: /* rule 144 can match eol */
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
YY_LINENO_REWIND_TO(yy_bp + 1);
(yy_c_buf_p) = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP #line 513 "scan.l" return'$';
YY_BREAK case 145:
YY_RULE_SETUP #line 515 "scan.l"
{
bracelevel = 1;
BEGIN(PERCENT_BRACE_ACTION);
if ( in_rule )
{
doing_rule_action = true;
in_rule = false; return'\n';
}
}
YY_BREAK case 146: /* rule 146 can match eol */
YY_RULE_SETUP #line 526 "scan.l"
{ if (sf_skip_ws()){ /* We're in the middle of a (?x: ) pattern. */ /* Push back everything starting at the "|" */
size_t amt;
amt = strchr (yytext, '|') - yytext;
yyless(amt);
} else {
continued_action = true;
++linenum; return'\n';
}
}
YY_BREAK case 147:
YY_RULE_SETUP #line 541 "scan.l"
{
if (sf_skip_ws()){ /* We're in the middle of a (?x: ) pattern. */
yy_push_state(COMMENT_DISCARD);
} else{
yyless( yyleng - 2 ); /* put back '/', '*' */
bracelevel = 0;
continued_action = false;
BEGIN(ACTION);
}
}
YY_BREAK case 148:
YY_RULE_SETUP #line 555 "scan.l" /* allow indented rules */ ;
YY_BREAK case 149:
YY_RULE_SETUP #line 557 "scan.l"
{ if (sf_skip_ws()){ /* We're in the middle of a (?x: ) pattern. */
} else{ /* This rule is separate from the one below because * otherwise we get variable trailing context, so * we can't build the scanner using -{f,F}.
*/
bracelevel = 0;
continued_action = false;
BEGIN(ACTION);
if ( in_rule )
{
doing_rule_action = true;
in_rule = false; return'\n';
}
}
}
YY_BREAK case 150: /* rule 150 can match eol */
YY_RULE_SETUP #line 579 "scan.l"
{ if (sf_skip_ws()){ /* We're in the middle of a (?x: ) pattern. */
++linenum;
} else{
bracelevel = 0;
continued_action = false;
BEGIN(ACTION);
unput( '\n' ); /* so <ACTION> sees it */
if ( in_rule )
{
doing_rule_action = true;
in_rule = false; return'\n';
}
}
}
YY_BREAK case 151: #line 600 "scan.l" case 152:
YY_RULE_SETUP #line 600 "scan.l" return EOF_OP;
YY_BREAK case 153:
YY_RULE_SETUP #line 602 "scan.l"
{
sectnum = 3;
BEGIN(SECT3);
outn("/* Begin user sect3 */");
yyterminate(); /* to stop the parser */
}
YY_BREAK case 154:
YY_RULE_SETUP #line 609 "scan.l"
{ int cclval;
if(yyleng < MAXLINE)
{
strcpy( nmstr, yytext );
} else
{
synerr( _("Input line too long\n"));
FLEX_EXIT(EXIT_FAILURE);
}
/* Check to see if we've already encountered this * ccl.
*/ if (0 /* <--- This "0" effectively disables the reuse of a * character class (purely based on its source text). * The reason it was disabled is so yacc/bison can parse * ccl operations, such as ccl difference and union.
*/
&& (cclval = ccllookup( (Char *) nmstr )) != 0 )
{ if ( input() != ']' )
synerr( _( "bad character class" ) );
yylval = cclval;
++cclreuse; return PREVCCL;
} else
{ /* We fudge a bit. We know that this ccl will * soon be numbered as lastccl + 1 by cclinit.
*/
cclinstal( (Char *) nmstr, lastccl + 1 );
/* Push back everything but the leading bracket * so the ccl can be rescanned.
*/
yyless( 1 );
BEGIN(FIRSTCCL); return'[';
}
}
YY_BREAK case 155:
YY_RULE_SETUP #line 655 "scan.l" return CCL_OP_DIFF;
YY_BREAK case 156:
YY_RULE_SETUP #line 656 "scan.l" return CCL_OP_UNION;
YY_BREAK /* Check for :space: at the end of the rule so we don't * wrap the expanded regex in '(' ')' -- breaking trailing * context.
*/ case 157: /* rule 157 can match eol */
YY_RULE_SETUP #line 663 "scan.l"
{ Char *nmdefptr; int end_is_ws, end_ch;
else
{ /* push back name surrounded by ()'s */ int len = strlen( (char *) nmdefptr ); if (end_is_ws)
unput(end_ch);
if ( lex_compat || nmdefptr[0] == '^' ||
(len > 0 && nmdefptr[len - 1] == '$')
|| (end_is_ws && trlcontxt && !sf_skip_ws()))
{ /* don't use ()'s after all */
PUT_BACK_STRING((char *) nmdefptr, 0);
if ( nmdefptr[0] == '^' )
BEGIN(CARETISBOL);
}
else
{
unput(')');
PUT_BACK_STRING((char *) nmdefptr, 0);
unput('(');
}
}
}
YY_BREAK case 158:
YY_RULE_SETUP #line 711 "scan.l"
{ if (sf_skip_ws())
yy_push_state(COMMENT_DISCARD); else{ /* Push back the "*" and return "/" as usual. */
yyless(1); return'/';
}
}
YY_BREAK case 159:
YY_RULE_SETUP #line 721 "scan.l"
{ if (lex_compat || posix_compat){ /* Push back the "?#" and treat it like a normal parens. */
yyless(1);
sf_push(); return'(';
} else
yy_push_state(EXTENDED_COMMENT);
}
YY_BREAK case 160:
YY_RULE_SETUP #line 731 "scan.l"
{
sf_push(); if (lex_compat || posix_compat) /* Push back the "?" and treat it like a normal parens. */
yyless(1); else
BEGIN(GROUP_WITH_PARAMS); return'(';
}
YY_BREAK case 161:
YY_RULE_SETUP #line 740 "scan.l"
sf_push(); return'(';
YY_BREAK case 162:
YY_RULE_SETUP #line 741 "scan.l"
sf_pop(); return')';
YY_BREAK case 163:
YY_RULE_SETUP #line 743 "scan.l" return (unsignedchar) yytext[0];
YY_BREAK case 164:
YY_RULE_SETUP #line 744 "scan.l"
RETURNCHAR;
YY_BREAK
case 165: /* rule 165 can match eol */
YY_RULE_SETUP #line 749 "scan.l"
++linenum; /* Allow blank lines & continuations */
YY_BREAK case 166:
YY_RULE_SETUP #line 750 "scan.l" return (unsignedchar) yytext[0];
YY_BREAK case 167:
YY_RULE_SETUP #line 751 "scan.l"
BEGIN(SECT2); return'>';
YY_BREAK case 168:
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
(yy_c_buf_p) = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP #line 752 "scan.l"
BEGIN(CARETISBOL); return'>';
YY_BREAK case 169:
YY_RULE_SETUP #line 753 "scan.l"
RETURNNAME;
YY_BREAK case 170:
YY_RULE_SETUP #line 754 "scan.l"
{
format_synerr( _( "bad <start condition>: %s" ),
yytext );
}
YY_BREAK
case 171:
YY_RULE_SETUP #line 760 "scan.l"
BEGIN(SECT2); return'^';
YY_BREAK
case 172:
YY_RULE_SETUP #line 764 "scan.l"
RETURNCHAR;
YY_BREAK case 173:
YY_RULE_SETUP #line 765 "scan.l"
BEGIN(SECT2); return'"';
YY_BREAK case 174: /* rule 174 can match eol */
YY_RULE_SETUP #line 767 "scan.l"
{
synerr( _( "missing quote" ) );
BEGIN(SECT2);
++linenum; return'"';
}
YY_BREAK
case 175:
YY_RULE_SETUP #line 776 "scan.l"
BEGIN(SECT2);
YY_BREAK case 176:
YY_RULE_SETUP #line 777 "scan.l"
BEGIN(GROUP_MINUS_PARAMS);
YY_BREAK case 177:
YY_RULE_SETUP #line 778 "scan.l"
sf_set_case_ins(1);
YY_BREAK case 178:
YY_RULE_SETUP #line 779 "scan.l"
sf_set_dot_all(1);
YY_BREAK case 179:
YY_RULE_SETUP #line 780 "scan.l"
sf_set_skip_ws(1);
YY_BREAK
case 180:
YY_RULE_SETUP #line 783 "scan.l"
BEGIN(SECT2);
YY_BREAK case 181:
YY_RULE_SETUP #line 784 "scan.l"
sf_set_case_ins(0);
YY_BREAK case 182:
YY_RULE_SETUP #line 785 "scan.l"
sf_set_dot_all(0);
YY_BREAK case 183:
YY_RULE_SETUP #line 786 "scan.l"
sf_set_skip_ws(0);
YY_BREAK
case 184:
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
(yy_c_buf_p) = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP #line 790 "scan.l"
BEGIN(CCL); return'^';
YY_BREAK case 185:
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
(yy_c_buf_p) = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP #line 791 "scan.l" return'^';
YY_BREAK case 186:
YY_RULE_SETUP #line 792 "scan.l"
BEGIN(CCL); RETURNCHAR;
YY_BREAK
case 187:
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
(yy_c_buf_p) = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP #line 796 "scan.l" return'-';
YY_BREAK case 188:
YY_RULE_SETUP #line 797 "scan.l"
RETURNCHAR;
YY_BREAK case 189:
YY_RULE_SETUP #line 798 "scan.l"
BEGIN(SECT2); return']';
YY_BREAK case 190: /* rule 190 can match eol */
YY_RULE_SETUP #line 799 "scan.l"
{
synerr( _( "bad character class" ) );
BEGIN(SECT2); return']';
}
YY_BREAK
case 191:
YY_RULE_SETUP #line 807 "scan.l"
BEGIN(CCL); return CCE_ALNUM;
YY_BREAK case 192:
YY_RULE_SETUP #line 808 "scan.l"
BEGIN(CCL); return CCE_ALPHA;
YY_BREAK case 193:
YY_RULE_SETUP #line 809 "scan.l"
BEGIN(CCL); return CCE_BLANK;
YY_BREAK case 194:
YY_RULE_SETUP #line 810 "scan.l"
BEGIN(CCL); return CCE_CNTRL;
YY_BREAK case 195:
YY_RULE_SETUP #line 811 "scan.l"
BEGIN(CCL); return CCE_DIGIT;
YY_BREAK case 196:
YY_RULE_SETUP #line 812 "scan.l"
BEGIN(CCL); return CCE_GRAPH;
YY_BREAK case 197:
YY_RULE_SETUP #line 813 "scan.l"
BEGIN(CCL); return CCE_LOWER;
YY_BREAK case 198:
YY_RULE_SETUP #line 814 "scan.l"
BEGIN(CCL); return CCE_PRINT;
YY_BREAK case 199:
YY_RULE_SETUP #line 815 "scan.l"
BEGIN(CCL); return CCE_PUNCT;
YY_BREAK case 200:
YY_RULE_SETUP #line 816 "scan.l"
BEGIN(CCL); return CCE_SPACE;
YY_BREAK case 201:
YY_RULE_SETUP #line 817 "scan.l"
BEGIN(CCL); return CCE_UPPER;
YY_BREAK case 202:
YY_RULE_SETUP #line 818 "scan.l"
BEGIN(CCL); return CCE_XDIGIT;
YY_BREAK case 203:
YY_RULE_SETUP #line 820 "scan.l"
BEGIN(CCL); return CCE_NEG_ALNUM;
YY_BREAK case 204:
YY_RULE_SETUP #line 821 "scan.l"
BEGIN(CCL); return CCE_NEG_ALPHA;
YY_BREAK case 205:
YY_RULE_SETUP #line 822 "scan.l"
BEGIN(CCL); return CCE_NEG_BLANK;
YY_BREAK case 206:
YY_RULE_SETUP #line 823 "scan.l"
BEGIN(CCL); return CCE_NEG_CNTRL;
YY_BREAK case 207:
YY_RULE_SETUP #line 824 "scan.l"
BEGIN(CCL); return CCE_NEG_DIGIT;
YY_BREAK case 208:
YY_RULE_SETUP #line 825 "scan.l"
BEGIN(CCL); return CCE_NEG_GRAPH;
YY_BREAK case 209:
YY_RULE_SETUP #line 826 "scan.l"
BEGIN(CCL); return CCE_NEG_LOWER;
YY_BREAK case 210:
YY_RULE_SETUP #line 827 "scan.l"
BEGIN(CCL); return CCE_NEG_PRINT;
YY_BREAK case 211:
YY_RULE_SETUP #line 828 "scan.l"
BEGIN(CCL); return CCE_NEG_PUNCT;
YY_BREAK case 212:
YY_RULE_SETUP #line 829 "scan.l"
BEGIN(CCL); return CCE_NEG_SPACE;
YY_BREAK case 213:
YY_RULE_SETUP #line 830 "scan.l"
BEGIN(CCL); return CCE_NEG_UPPER;
YY_BREAK case 214:
YY_RULE_SETUP #line 831 "scan.l"
BEGIN(CCL); return CCE_NEG_XDIGIT;
YY_BREAK case 215:
YY_RULE_SETUP #line 832 "scan.l"
{
format_synerr(
_( "bad character class expression: %s" ),
yytext );
BEGIN(CCL); return CCE_ALNUM;
}
YY_BREAK
case 216:
YY_RULE_SETUP #line 841 "scan.l"
{
yylval = myctoi( yytext ); return NUMBER;
}
YY_BREAK case 217:
YY_RULE_SETUP #line 846 "scan.l" return',';
YY_BREAK case 218:
YY_RULE_SETUP #line 847 "scan.l"
{
BEGIN(SECT2); if ( lex_compat || posix_compat ) return END_REPEAT_POSIX; else return END_REPEAT_FLEX;
}
YY_BREAK case 219:
YY_RULE_SETUP #line 855 "scan.l"
{
synerr( _( "bad character inside {}'s" ) );
BEGIN(SECT2); return'}';
}
YY_BREAK case 220: /* rule 220 can match eol */
YY_RULE_SETUP #line 861 "scan.l"
{
synerr( _( "missing }" ) );
BEGIN(SECT2);
++linenum; return'}';
}
YY_BREAK
case 240:
YY_RULE_SETUP #line 932 "scan.l"
ACTION_ECHO;
YY_BREAK case 241:
YY_RULE_SETUP #line 933 "scan.l"
ACTION_ECHO;
YY_BREAK case 242: /* rule 242 can match eol */
YY_RULE_SETUP #line 934 "scan.l"
++linenum; ACTION_ECHO; BEGIN(ACTION);
YY_BREAK case 243:
YY_RULE_SETUP #line 935 "scan.l"
ACTION_ECHO; BEGIN(ACTION);
YY_BREAK case 244:
YY_RULE_SETUP #line 936 "scan.l"
ACTION_ECHO;
YY_BREAK
case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(COMMENT_DISCARD): case YY_STATE_EOF(ACTION): case YY_STATE_EOF(ACTION_STRING): #line 939 "scan.l"
{
synerr( _( "EOF encountered inside an action" ) );
yyterminate();
}
YY_BREAK case YY_STATE_EOF(EXTENDED_COMMENT): case YY_STATE_EOF(GROUP_WITH_PARAMS): case YY_STATE_EOF(GROUP_MINUS_PARAMS): #line 944 "scan.l"
{
synerr( _( "EOF encountered inside pattern" ) );
yyterminate();
}
YY_BREAK case 245:
YY_RULE_SETUP #line 949 "scan.l"
{
yylval = myesc( (Char *) yytext );
if ( YY_START == FIRSTCCL )
BEGIN(CCL);
returnCHAR;
}
YY_BREAK
case 246:
YY_RULE_SETUP #line 960 "scan.l"
fwrite (escaped_qstart, 1, strlen(escaped_qstart), yyout);
YY_BREAK case 247:
YY_RULE_SETUP #line 961 "scan.l"
fwrite (escaped_qend, 1, strlen(escaped_qend), yyout);
YY_BREAK case 248: /* rule 248 can match eol */
YY_RULE_SETUP #line 962 "scan.l"
ECHO;
YY_BREAK case 249: /* rule 249 can match eol */
YY_RULE_SETUP #line 963 "scan.l"
ECHO;
YY_BREAK case YY_STATE_EOF(SECT3): #line 964 "scan.l"
sectnum = 0; yyterminate();
YY_BREAK
case 250: /* rule 250 can match eol */
YY_RULE_SETUP #line 967 "scan.l"
format_synerr( _( "bad character: %s" ), yytext );
YY_BREAK case 251:
YY_RULE_SETUP #line 969 "scan.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK #line 3985 "scan.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(SECT2): case YY_STATE_EOF(CODEBLOCK): case YY_STATE_EOF(PICKUPDEF): case YY_STATE_EOF(SC): case YY_STATE_EOF(CARETISBOL): case YY_STATE_EOF(NUM): case YY_STATE_EOF(QUOTE): case YY_STATE_EOF(FIRSTCCL): case YY_STATE_EOF(CCL): case YY_STATE_EOF(RECOVER): case YY_STATE_EOF(PERCENT_BRACE_ACTION): case YY_STATE_EOF(OPTION): case YY_STATE_EOF(LINEDIR):
yyterminate();
case YY_END_OF_BUFFER:
{ /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{ /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source.
*/
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input().
*/ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
/* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly).
*/
if ( yywrap( ) )
{ /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned.
*/
(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
default:
YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file
*/ staticint yy_get_next_buffer (void)
{ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr);
yy_size_t number_to_move, i; int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" );
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
{ /* We matched a single character, the EOB, so * treat this as a final EOF.
*/ return EOB_ACT_END_OF_FILE;
}
else
{ /* We matched some text prior to the EOB, first * process it.
*/ return EOB_ACT_LAST_MATCH;
}
}
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF
*/
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
/* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state );
*/ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{ int yy_is_jam; char *yy_cp = (yy_c_buf_p);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
{ /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer.
*/ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */
*(yy_c_buf_p) = '\0';
else
{ /* need more input */
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
{ case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
yyrestart(yyin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{ if ( yywrap( ) ) return EOF;
/** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL .
*/ void yyrestart (FILE * input_file )
{
/** Switch to a different input buffer. * @param new_buffer The new input buffer. *
*/ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer);
*/
yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return;
if ( YY_CURRENT_BUFFER )
{ /* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
/* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it.
*/
(yy_did_buffer_switch_on_eof) = 1;
}
/** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state.
*/
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_buf_size = (yy_size_t)size;
/* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
yy_init_buffer(b,file );
return b;
}
/** Destroy the buffer. * @param b a buffer created with yy_create_buffer() *
*/ void yy_delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b ) return;
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
yyfree((void *) b->yy_ch_buf );
yyfree((void *) b );
}
/* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF.
*/ staticvoid yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
{ int oerrno = errno;
yy_flush_buffer(b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
/* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column.
*/ if (b != YY_CURRENT_BUFFER){
b->yy_bs_lineno = 1;
b->yy_bs_column = 0;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. *
*/ void yy_flush_buffer (YY_BUFFER_STATE b )
{ if ( ! b ) return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state.
*/
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
if ( b == YY_CURRENT_BUFFER )
yy_load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. *
*/ void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
{ if (new_buffer == NULL) return;
yyensure_buffer_stack();
/* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER )
{ /* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
/* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER)
(yy_buffer_stack_top)++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
/** Removes and deletes the top of the stack, if present. * The next element becomes the new top. *
*/ void yypop_buffer_state (void)
{ if (!YY_CURRENT_BUFFER) return;
yy_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
/* Allocates the stack if it does not exist. * Guarantees space for at least one push.
*/ staticvoid yyensure_buffer_stack (void)
{
yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call.
*/
num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
); if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
/* Increase the buffer to prepare for a possible push. */
yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
); if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
}
}
/** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0;
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
yy_switch_to_buffer(b );
return b;
}
/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead.
*/
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
{
return yy_scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
YY_BUFFER_STATE b; char *buf;
yy_size_t n;
yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) yyalloc(n ); if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number. *
*/ int yyget_lineno (void)
{
return yylineno;
}
/** Get the input stream. *
*/
FILE *yyget_in (void)
{ return yyin;
}
/** Get the output stream. *
*/
FILE *yyget_out (void)
{ return yyout;
}
/** Get the length of the current token. *
*/
yy_size_t yyget_leng (void)
{ return yyleng;
}
/** Get the current token. *
*/
char *yyget_text (void)
{ return yytext;
}
/** Set the current line number. * @param _line_number line number *
*/ void yyset_lineno (int _line_number )
{
yylineno = _line_number;
}
/** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see yy_switch_to_buffer
*/ void yyset_in (FILE * _in_str )
{
yyin = _in_str ;
}
staticint yy_init_globals (void)
{ /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here.
*/
/* Reset the globals. This is important in a non-reentrant scanner so the next time
* yylex() is called, initialization will occur. */
yy_init_globals( );
return 0;
}
/* * Internal utility routines.
*/
#ifndef yytext_ptr staticvoid yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
int i; for ( i = 0; i < n; ++i )
s1[i] = s2[i];
} #endif
#ifdef YY_NEED_STRLEN staticint yy_flex_strlen (yyconst char * s )
{ int n; for ( n = 0; s[n]; ++n )
;
/* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment.
*/ return (void *) realloc( (char *) ptr, size );
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.