source: ThirdParty/mpqc_open/src/lib/util/keyval/ipv2_scan.cc@ 4464ef

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 4464ef was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

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