g2o
Loading...
Searching...
No Matches
flex_scanner.cpp
Go to the documentation of this file.
1#line 2 "flex_scanner.cpp"
2
3#line 4 "flex_scanner.cpp"
4
5#define YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
8
9#define FLEX_SCANNER
10#define YY_FLEX_MAJOR_VERSION 2
11#define YY_FLEX_MINOR_VERSION 6
12#define YY_FLEX_SUBMINOR_VERSION 4
13#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA
15#endif
16
17/* The c++ scanner is a mess. The FlexLexer.h header file relies on the
18 * following macro. This is required in order to pass the c++-multiple-scanners
19 * test in the regression suite. We get reports that it breaks inheritance.
20 * We will address this in a future release of flex, or omit the C++ scanner
21 * altogether.
22 */
23#define yyFlexLexer SlamFlexLexer
24
25#ifdef yyalloc
26#define Slamalloc_ALREADY_DEFINED
27#else
28#define yyalloc Slamalloc
29#endif
30
31#ifdef yyrealloc
32#define Slamrealloc_ALREADY_DEFINED
33#else
34#define yyrealloc Slamrealloc
35#endif
36
37#ifdef yyfree
38#define Slamfree_ALREADY_DEFINED
39#else
40#define yyfree Slamfree
41#endif
42
43/* First, we deal with platform-specific or compiler-specific issues. */
44
45/* begin standard C headers. */
46
47/* end standard C headers. */
48
49/* flex integer type definitions */
50
51#ifndef FLEXINT_H
52#define FLEXINT_H
53
54/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
55
56#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
57
58/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
59 * if you want the limit (max/min) macros for int types.
60 */
61#ifndef __STDC_LIMIT_MACROS
62#define __STDC_LIMIT_MACROS 1
63#endif
64
65#include <inttypes.h>
66typedef int8_t flex_int8_t;
67typedef uint8_t flex_uint8_t;
68typedef int16_t flex_int16_t;
69typedef uint16_t flex_uint16_t;
70typedef int32_t flex_int32_t;
71typedef uint32_t flex_uint32_t;
72#else
73typedef signed char flex_int8_t;
74typedef short int flex_int16_t;
75typedef int flex_int32_t;
76typedef unsigned char flex_uint8_t;
77typedef unsigned short int flex_uint16_t;
78typedef unsigned int flex_uint32_t;
79
80/* Limits of integral types. */
81#ifndef INT8_MIN
82#define INT8_MIN (-128)
83#endif
84#ifndef INT16_MIN
85#define INT16_MIN (-32767 - 1)
86#endif
87#ifndef INT32_MIN
88#define INT32_MIN (-2147483647 - 1)
89#endif
90#ifndef INT8_MAX
91#define INT8_MAX (127)
92#endif
93#ifndef INT16_MAX
94#define INT16_MAX (32767)
95#endif
96#ifndef INT32_MAX
97#define INT32_MAX (2147483647)
98#endif
99#ifndef UINT8_MAX
100#define UINT8_MAX (255U)
101#endif
102#ifndef UINT16_MAX
103#define UINT16_MAX (65535U)
104#endif
105#ifndef UINT32_MAX
106#define UINT32_MAX (4294967295U)
107#endif
108
109#ifndef SIZE_MAX
110#define SIZE_MAX (~(size_t)0)
111#endif
112
113#endif /* ! C99 */
114
115#endif /* ! FLEXINT_H */
116
117/* begin standard C++ headers. */
118#include <errno.h>
119
120#include <cstdio>
121#include <cstdlib>
122#include <cstring>
123#include <iostream>
124/* end standard C++ headers. */
125
126/* TODO: this is always defined, so inline it */
127#define yyconst const
128
129#if defined(__GNUC__) && __GNUC__ >= 3
130#define yynoreturn __attribute__((__noreturn__))
131#else
132#define yynoreturn
133#endif
134
135/* Returned upon end-of-file. */
136#define YY_NULL 0
137
138/* Promotes a possibly negative, possibly signed char to an
139 * integer in range [0..255] for use as an array index.
140 */
141#define YY_SC_TO_UI(c) ((YY_CHAR)(c))
142
143/* Enter a start condition. This macro really ought to take a parameter,
144 * but we do it the disgusting crufty way forced on us by the ()-less
145 * definition of BEGIN.
146 */
147#define BEGIN (yy_start) = 1 + 2 *
148/* Translate the current start state into a value that can be later handed
149 * to BEGIN to return to the state. The YYSTATE alias is for lex
150 * compatibility.
151 */
152#define YY_START (((yy_start)-1) / 2)
153#define YYSTATE YY_START
154/* Action number for EOF rule of a given start state. */
155#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156/* Special action meaning "start processing a new file". */
157#define YY_NEW_FILE yyrestart(yyin)
158#define YY_END_OF_BUFFER_CHAR 0
159
160/* Size of default input buffer. */
161#ifndef YY_BUF_SIZE
162#ifdef __ia64__
163/* On IA-64, the buffer size is 16k, not 8k.
164 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
165 * Ditto for the __ia64__ case accordingly.
166 */
167#define YY_BUF_SIZE 32768
168#else
169#define YY_BUF_SIZE 16384
170#endif /* __ia64__ */
171#endif
172
173/* The state buf must be large enough to hold one state per character in the
174 * main buffer.
175 */
176#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
177
178#ifndef YY_TYPEDEF_YY_BUFFER_STATE
179#define YY_TYPEDEF_YY_BUFFER_STATE
181#endif
182
183#ifndef YY_TYPEDEF_YY_SIZE_T
184#define YY_TYPEDEF_YY_SIZE_T
185typedef size_t yy_size_t;
186#endif
187
188extern int yyleng;
189
190#define EOB_ACT_CONTINUE_SCAN 0
191#define EOB_ACT_END_OF_FILE 1
192#define EOB_ACT_LAST_MATCH 2
193
194#define YY_LESS_LINENO(n)
195#define YY_LINENO_REWIND_TO(ptr)
196
197/* Return all but the first "n" matched characters back to the input stream. */
198#define yyless(n) \
199 do { \
200 /* Undo effects of setting up yytext. */ \
201 int yyless_macro_arg = (n); \
202 YY_LESS_LINENO(yyless_macro_arg); \
203 *yy_cp = (yy_hold_char); \
204 YY_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) = yy_cp = \
205 yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
206 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
207 } while (0)
208#define unput(c) yyunput(c, (yytext_ptr))
209
210#ifndef YY_STRUCT_YY_BUFFER_STATE
211#define YY_STRUCT_YY_BUFFER_STATE
213 std::streambuf* yy_input_file;
214
215 char* yy_ch_buf; /* input buffer */
216 char* yy_buf_pos; /* current position in input buffer */
217
218 /* Size of input buffer in bytes, not including room for EOB
219 * characters.
220 */
222
223 /* Number of characters read into yy_ch_buf, not including EOB
224 * characters.
225 */
227
228 /* Whether we "own" the buffer - i.e., we know we created it,
229 * and can realloc() it to grow it, and should free() it to
230 * delete it.
231 */
233
234 /* Whether this is an "interactive" input source; if so, and
235 * if we're using stdio for input, then we want to use getc()
236 * instead of fread(), to make sure we stop fetching input after
237 * each newline.
238 */
240
241 /* Whether we're considered to be at the beginning of a line.
242 * If so, '^' rules will be active on the next match, otherwise
243 * not.
244 */
246
250 /* Whether to try to fill the input buffer when we reach the
251 * end of it.
252 */
254
256
257#define YY_BUFFER_NEW 0
258#define YY_BUFFER_NORMAL 1
259 /* When an EOF's been seen but there's still some text to process
260 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261 * shouldn't try reading from the input source any more. We might
262 * still have a bunch of tokens to match, though, because of
263 * possible backing-up.
264 *
265 * When we actually see the EOF, we change the status to "new"
266 * (via yyrestart()), so that the user can continue scanning by
267 * just pointing yyin at a new input file.
268 */
269#define YY_BUFFER_EOF_PENDING 2
270};
271#endif /* !YY_STRUCT_YY_BUFFER_STATE */
272
273/* We provide macros for accessing buffer states in case in the
274 * future we want to put the buffer states in a more general
275 * "scanner state".
276 *
277 * Returns the top of the stack, or NULL.
278 */
279#define YY_CURRENT_BUFFER \
280 ((yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : NULL)
281/* Same as previous macro, but useful when we know that the buffer stack is not
282 * NULL or when we need an lvalue. For internal use only.
283 */
284#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
285
286void* yyalloc(yy_size_t);
287void* yyrealloc(void*, yy_size_t);
288void yyfree(void*);
289
290#define yy_new_buffer yy_create_buffer
291#define yy_set_interactive(is_interactive) \
292 { \
293 if (!YY_CURRENT_BUFFER) { \
294 yyensure_buffer_stack(); \
295 YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \
296 } \
297 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
298 }
299#define yy_set_bol(at_bol) \
300 { \
301 if (!YY_CURRENT_BUFFER) { \
302 yyensure_buffer_stack(); \
303 YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \
304 } \
305 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
306 }
307#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
308
309/* Begin user sect3 */
311
312#define yytext_ptr yytext
313
314#include <FlexLexer.h>
315
316/* Done after the current pattern has been matched and before the
317 * corresponding action - sets up yytext.
318 */
319#define YY_DO_BEFORE_ACTION \
320 (yytext_ptr) = yy_bp; \
321 yyleng = (int)(yy_cp - yy_bp); \
322 (yy_hold_char) = *yy_cp; \
323 *yy_cp = '\0'; \
324 (yy_c_buf_p) = yy_cp;
325#define YY_NUM_RULES 15
326#define YY_END_OF_BUFFER 16
327/* This struct is not used in this scanner,
328 but its presence is necessary. */
333static const flex_int16_t yy_accept[77] = {
334 0, 0, 0, 16, 14, 12, 13, 14, 14, 1, 11, 11, 11, 11, 11, 11,
335 11, 12, 0, 1, 2, 2, 1, 0, 11, 11, 11, 11, 11, 11, 11, 2,
336 0, 2, 3, 11, 8, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
337 11, 11, 11, 11, 11, 11, 11, 11, 6, 11, 11, 11, 11, 11, 11, 11,
338 11, 11, 11, 11, 4, 11, 7, 10, 9, 11, 11, 5, 0};
339
340static const YY_CHAR yy_ec[256] = {
341 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 4, 5, 6, 7, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8,
344 8, 1, 1, 1, 1, 1, 1, 1, 9, 10, 10, 11, 12, 13, 14, 10, 15, 10, 10,
345 16, 10, 10, 17, 18, 19, 20, 21, 22, 23, 24, 10, 25, 26, 27, 1, 1, 1, 1,
346 28, 1, 29, 10, 10, 30,
347
348 31, 32, 33, 10, 34, 10, 10, 35, 10, 10, 36, 37, 38, 39, 40, 41, 42, 43, 10,
349 44, 45, 46, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 1, 1, 1,
354
355 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
356 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
357 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
358
359static const YY_CHAR yy_meta[47] = {
360 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
361 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
362
363static const flex_int16_t yy_base[78] = {
364 0, 0, 0, 170, 173, 167, 173, 40, 160, 42, 40, 0, 41,
365 38, 32, 39, 45, 163, 153, 51, 52, 53, 73, 82, 0, 57,
366 63, 53, 67, 73, 71, 87, 147, 146, 0, 80, 0, 73, 70,
367 78, 103, 75, 90, 91, 80, 41, 39, 81, 81, 88, 93, 38,
368 105, 93, 94, 92, 0, 103, 120, 121, 111, 120, 117, 118, 121,
369 115, 132, 133, 0, 127, 0, 0, 0, 134, 127, 0, 173, 60};
370
371static const flex_int16_t yy_def[78] = {
372 0, 76, 1, 76, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77,
373 77, 76, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 76,
374 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
375 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
376 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 0, 76};
377
378static const flex_int16_t yy_nxt[220] = {
379 0, 4, 5, 6, 7, 4, 7, 8, 9, 10, 11, 11, 12, 13, 11, 11, 11, 11, 11,
380 14, 11, 15, 11, 11, 16, 11, 11, 11, 4, 10, 11, 12, 13, 11, 11, 11, 11, 11,
381 14, 11, 15, 11, 11, 16, 11, 11, 11, 18, 19, 21, 22, 25, 26, 27, 23, 28, 29,
382 30, 21, 22, 20, 31, 24, 23, 23, 23, 55, 50, 34, 49, 25, 26, 27, 23, 28, 29,
383 30, 35, 36, 37, 21, 22, 23, 23, 23, 23, 32, 34, 32, 38, 33, 39, 40, 41, 42,
384 31, 35, 36, 37, 23, 43,
385
386 45, 46, 47, 23, 48, 51, 52, 38, 53, 39, 40, 41, 42, 54, 58, 59, 60, 23, 43,
387 45, 46, 47, 61, 48, 51, 52, 56, 53, 62, 63, 44, 57, 54, 58, 59, 60, 64, 65,
388 66, 67, 70, 61, 68, 71, 72, 56, 73, 69, 62, 63, 57, 74, 75, 33, 33, 64, 65,
389 66, 67, 70, 20, 68, 71, 72, 17, 73, 69, 20, 17, 76, 74, 75, 3, 76, 76, 76,
390 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
391 76, 76, 76, 76, 76,
392
393 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76};
394
395static const flex_int16_t yy_chk[220] = {
396 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 9, 9, 10, 12, 13, 9, 14, 15,
399 16, 19, 19, 20, 21, 77, 19, 20, 21, 51, 46, 25, 45, 10, 12, 13, 9, 14, 15,
400 16, 26, 27, 28, 22, 22, 19, 20, 21, 22, 23, 25, 23, 29, 23, 30, 35, 37, 38,
401 31, 26, 27, 28, 31, 39,
402
403 41, 42, 43, 22, 44, 47, 48, 29, 49, 30, 35, 37, 38, 50, 53, 54, 55, 31, 39,
404 41, 42, 43, 57, 44, 47, 48, 52, 49, 58, 59, 40, 52, 50, 53, 54, 55, 60, 61,
405 62, 63, 65, 57, 64, 66, 67, 52, 69, 64, 58, 59, 52, 73, 74, 33, 32, 60, 61,
406 62, 63, 65, 18, 64, 66, 67, 17, 69, 64, 8, 5, 3, 73, 74, 76, 76, 76, 76,
407 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
408 76, 76, 76, 76, 76,
409
410 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76};
411
412/* The intent behind this definition is that it'll catch
413 * any uses of REJECT which flex missed.
414 */
415#define REJECT reject_used_but_not_detected
416#define yymore() yymore_used_but_not_detected
417#define YY_MORE_ADJ 0
418#define YY_RESTORE_YY_MORE_OFFSET
419#line 1 "scanner.l"
420#line 2 "scanner.l"
421
422#include <string>
423#include <vector>
424
425#include "scanner.h"
426
427/* import the parser's token type into a local typedef */
430
431/* By default yylex returns int, we use token_type. Unfortunately yyterminate
432 * by default returns 0, which is not of token_type. */
433#define yyterminate() return token::END
434
435/* This disables inclusion of unistd.h, which is not available under Visual C++
436 * on Win32. The C++ scanner uses STL streams instead. */
437#define YY_NO_UNISTD_H
438
439#line 501 "flex_scanner.cpp"
440/*** Flex Declarations and Options ***/
441/* enable c++ scanner class generation */
442/* change the name of the scanner class. results in "SlamFlexLexer" */
443/* the manual says "somewhat more optimized" */
444/* enable scanner to generate debug output. disable this for release
445 * versions. */
446/*%option debug*/
447/* no support for include files is planned */
448/* enables the use of start condition stacks */
449/* The following paragraph suffices to track locations accurately. Each time
450 * yylex is invoked, the begin position is moved onto the end position. */
451#line 46 "scanner.l"
452#define YY_USER_ACTION yylloc->columns(yyleng);
453#line 515 "flex_scanner.cpp"
454#line 516 "flex_scanner.cpp"
455
456#define INITIAL 0
457
458#ifndef YY_NO_UNISTD_H
459/* Special case for "unistd.h", since it is non-ANSI. We include it way
460 * down here because we want the user's section 1 to have been scanned first.
461 * The user has a chance to override it with an option.
462 */
463#include <unistd.h>
464#endif
465
466#ifndef YY_EXTRA_TYPE
467#define YY_EXTRA_TYPE void*
468#endif
469
470#ifndef yytext_ptr
471static void yy_flex_strncpy(char*, const char*, int);
472#endif
473
474#ifdef YY_NEED_STRLEN
475static int yy_flex_strlen(const char*);
476#endif
477
478#ifndef YY_NO_INPUT
479
480#endif
481
482/* Amount of stuff to slurp up with each read. */
483#ifndef YY_READ_BUF_SIZE
484#ifdef __ia64__
485/* On IA-64, the buffer size is 16k, not 8k */
486#define YY_READ_BUF_SIZE 16384
487#else
488#define YY_READ_BUF_SIZE 8192
489#endif /* __ia64__ */
490#endif
491
492/* Copy whatever the last rule matched to the standard output. */
493#ifndef ECHO
494#define ECHO LexerOutput(yytext, yyleng)
495#endif
496
497/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
498 * is returned in "result".
499 */
500#ifndef YY_INPUT
501#define YY_INPUT(buf, result, max_size) \
502 \
503 if ((int)(result = LexerInput((char*)buf, max_size)) < 0) \
504 YY_FATAL_ERROR("input in flex scanner failed");
505
506#endif
507
508/* No semi-colon after return; correct usage is to write "yyterminate();" -
509 * we don't want an extra ';' after the "return" because that will cause
510 * some compilers to complain about unreachable statements.
511 */
512#ifndef yyterminate
513#define yyterminate() return YY_NULL
514#endif
515
516/* Number of entries by which start-condition stack grows. */
517#ifndef YY_START_STACK_INCR
518#define YY_START_STACK_INCR 25
519#endif
520
521/* Report a fatal error. */
522#ifndef YY_FATAL_ERROR
523#define YY_FATAL_ERROR(msg) LexerError(msg)
524#endif
525
526/* end tables serialization structures and prototypes */
527
528/* Default declaration of generated scanner - a define so the user can
529 * easily add parameters.
530 */
531#ifndef YY_DECL
532#define YY_DECL_IS_OURS 1
533#define YY_DECL int yyFlexLexer::yylex()
534#endif /* !YY_DECL */
535
536/* Code executed at the beginning of each rule, after yytext and yyleng
537 * have been set up.
538 */
539#ifndef YY_USER_ACTION
540#define YY_USER_ACTION
541#endif
542
543/* Code executed at the end of each rule. */
544#ifndef YY_BREAK
545#define YY_BREAK /*LINTED*/ break;
546#endif
547
548#define YY_RULE_SETUP YY_USER_ACTION
549
553 yy_state_type yy_current_state;
554 char *yy_cp, *yy_bp;
556
557 if (!(yy_init)) {
558 (yy_init) = 1;
559
560#ifdef YY_USER_INIT
561 YY_USER_INIT;
562#endif
563
564 if (!(yy_start)) (yy_start) = 1; /* first start state */
565
566 if (!yyin) yyin.rdbuf(std::cin.rdbuf());
567
568 if (!yyout) yyout.rdbuf(std::cout.rdbuf());
569
570 if (!YY_CURRENT_BUFFER) {
571 yyensure_buffer_stack();
572 YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE);
573 }
574
575 yy_load_buffer_state();
576 }
577
578 {
579#line 49 "scanner.l"
580
581#line 52 "scanner.l"
582 /* code to place at the beginning of yylex() */
583
584 // reset location
585 yylloc->step();
586
587 /*** BEGIN EXAMPLE - Change the example lexer rules below ***/
588
589#line 660 "flex_scanner.cpp"
590
591 while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */
592 {
593 yy_cp = (yy_c_buf_p);
594
595 /* Support of yytext. */
596 *yy_cp = (yy_hold_char);
597
598 /* yy_bp points to the position in yy_ch_buf of the start of
599 * the current run.
600 */
601 yy_bp = yy_cp;
602
603 yy_current_state = (yy_start);
604 yy_match:
605 do {
606 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
607 if (yy_accept[yy_current_state]) {
608 (yy_last_accepting_state) = yy_current_state;
609 (yy_last_accepting_cpos) = yy_cp;
610 }
611 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
612 yy_current_state = (int)yy_def[yy_current_state];
613 if (yy_current_state >= 77) yy_c = yy_meta[yy_c];
614 }
615 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
616 ++yy_cp;
617 } while (yy_current_state != 76);
618 yy_cp = (yy_last_accepting_cpos);
619 yy_current_state = (yy_last_accepting_state);
620
621 yy_find_action:
622 yy_act = yy_accept[yy_current_state];
623
625
626 do_action: /* This label is used only to access EOF actions. */
627
628 switch (yy_act) { /* beginning of action switch */
629 case 0: /* must back up */
630 /* undo the effects of YY_DO_BEFORE_ACTION */
631 *yy_cp = (yy_hold_char);
632 yy_cp = (yy_last_accepting_cpos);
633 yy_current_state = (yy_last_accepting_state);
634 goto yy_find_action;
635
636 case 1:
638#line 60 "scanner.l"
639 {
640 yylval->integerVal = atoi(yytext);
641 return token::INTEGER;
642 }
644 case 2:
646#line 65 "scanner.l"
647 {
648 yylval->doubleVal = atof(yytext);
649 return token::DOUBLE;
650 }
652 case 3:
654#line 70 "scanner.l"
655 {
656 /*yylval->stringVal = new std::string(yytext, yyleng);*/
657 return token::ADD;
658 }
660 case 4:
662#line 75 "scanner.l"
663 {
664 yylval->stringVal = new std::string(yytext, yyleng);
665 return token::V_SE2;
666 }
668 case 5:
670#line 80 "scanner.l"
671 {
672 yylval->stringVal = new std::string(yytext, yyleng);
673 return token::V_SE3;
674 }
676 case 6:
678#line 85 "scanner.l"
679 {
680 yylval->stringVal = new std::string(yytext, yyleng);
681 return token::E_SE2;
682 }
684 case 7:
686#line 90 "scanner.l"
687 {
688 yylval->stringVal = new std::string(yytext, yyleng);
689 return token::E_SE3;
690 }
692 case 8:
694#line 95 "scanner.l"
695 {
696 /*yylval->stringVal = new std::string(yytext, yyleng);*/
697 return token::FIX;
698 }
700 case 9:
702#line 100 "scanner.l"
703 {
704 /*yylval->stringVal = new std::string(yytext, yyleng);*/
705 return token::SOLVE_STATE;
706 }
708 case 10:
710#line 105 "scanner.l"
711 {
712 /*yylval->stringVal = new std::string(yytext, yyleng);*/
713 return token::QUERY_STATE;
714 }
716 case 11:
718#line 110 "scanner.l"
719 {
720 yylval->stringVal = new std::string(yytext, yyleng);
721 return token::STRING;
722 }
724 /* gobble up white-spaces */
725 case 12:
727#line 116 "scanner.l"
728 {
729 yylloc->step();
730 }
732 /* gobble up end-of-lines */
733 case 13:
734 /* rule 13 can match eol */
736#line 121 "scanner.l"
737 {
738 yylloc->lines(yyleng);
739 yylloc->step();
740 return token::EOL;
741 }
743 /* pass all other characters up to bison */
744 case 14:
746#line 127 "scanner.l"
747 {
748 return static_cast<token_type>(*yytext);
749 }
751 /*** END EXAMPLE - Change the example lexer rules above ***/
752 case 15:
754#line 133 "scanner.l"
755 ECHO;
757#line 833 "flex_scanner.cpp"
758 case YY_STATE_EOF(INITIAL):
759 yyterminate();
760
761 case YY_END_OF_BUFFER: {
762 /* Amount of text matched not including the EOB char. */
763 int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1;
764
765 /* Undo the effects of YY_DO_BEFORE_ACTION. */
766 *yy_cp = (yy_hold_char);
768
769 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) {
770 /* We're scanning a new file or input source. It's
771 * possible that this happened because the user
772 * just pointed yyin at a new source and called
773 * yylex(). If so, then we have to assure
774 * consistency between YY_CURRENT_BUFFER and our
775 * globals. Here is the right place to do so, because
776 * this is the first action (other than possibly a
777 * back-up) that will match for the new input source.
778 */
779 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
780 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf();
781 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
782 }
783
784 /* Note that here we test for yy_c_buf_p "<=" to the position
785 * of the first EOB in the buffer, since yy_c_buf_p will
786 * already have been incremented past the NUL character
787 * (since all states make transitions on EOB to the
788 * end-of-buffer state). Contrast this with the test
789 * in input().
790 */
791 if ((yy_c_buf_p) <=
793 ->yy_ch_buf[(yy_n_chars)]) { /* This was really a NUL. */
794 yy_state_type yy_next_state;
795
796 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
797
798 yy_current_state = yy_get_previous_state();
799
800 /* Okay, we're now positioned to make the NUL
801 * transition. We couldn't have
802 * yy_get_previous_state() go ahead and do it
803 * for us because it doesn't know how to deal
804 * with the possibility of jamming (and we don't
805 * want to build jamming into it because then it
806 * will run more slowly).
807 */
808
809 yy_next_state = yy_try_NUL_trans(yy_current_state);
810
812
813 if (yy_next_state) {
814 /* Consume the NUL. */
815 yy_cp = ++(yy_c_buf_p);
816 yy_current_state = yy_next_state;
817 goto yy_match;
818 }
819
820 else {
821 yy_cp = (yy_last_accepting_cpos);
822 yy_current_state = (yy_last_accepting_state);
823 goto yy_find_action;
824 }
825 }
826
827 else
828 switch (yy_get_next_buffer()) {
829 case EOB_ACT_END_OF_FILE: {
830 (yy_did_buffer_switch_on_eof) = 0;
831
832 if (yywrap()) {
833 /* Note: because we've taken care in
834 * yy_get_next_buffer() to have set up
835 * yytext, we can now set up
836 * yy_c_buf_p so that if some total
837 * hoser (like flex itself) wants to
838 * call the scanner after we return the
839 * YY_NULL, it'll still work - another
840 * YY_NULL will get returned.
841 */
842 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
843
845 goto do_action;
846 }
847
848 else {
849 if (!(yy_did_buffer_switch_on_eof)) YY_NEW_FILE;
850 }
851 break;
852 }
853
855 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
856
857 yy_current_state = yy_get_previous_state();
858
859 yy_cp = (yy_c_buf_p);
861 goto yy_match;
862
864 (yy_c_buf_p) =
865 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
866
867 yy_current_state = yy_get_previous_state();
868
869 yy_cp = (yy_c_buf_p);
871 goto yy_find_action;
872 }
873 break;
874 }
875
876 default:
877 YY_FATAL_ERROR("fatal flex scanner internal error--no action found");
878 } /* end of action switch */
879 } /* end of scanning one token */
880 } /* end of user's declarations */
881} /* end of yylex */
882
883/* The contents of this function are C++ specific, so the () macro is not used.
884 * This constructor simply maintains backward compatibility.
885 * DEPRECATED
886 */
887yyFlexLexer::yyFlexLexer(std::istream* arg_yyin, std::ostream* arg_yyout)
888 : yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
889 yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf()) {
890 ctor_common();
891}
892
893/* The contents of this function are C++ specific, so the () macro is not used.
894 */
895yyFlexLexer::yyFlexLexer(std::istream& arg_yyin, std::ostream& arg_yyout)
896 : yyin(arg_yyin.rdbuf()), yyout(arg_yyout.rdbuf()) {
897 ctor_common();
898}
899
900/* The contents of this function are C++ specific, so the () macro is not used.
901 */
903 yy_c_buf_p = 0;
904 yy_init = 0;
905 yy_start = 0;
906 yy_flex_debug = 0;
907 yylineno = 1; // this will only get updated if %option yylineno
908
910
912 yy_more_flag = 0;
913 yy_more_len = 0;
915
917 yy_start_stack = NULL;
918
919 yy_buffer_stack = NULL;
922
923 yy_state_buf = 0;
924}
925
926/* The contents of this function are C++ specific, so the () macro is not used.
927 */
934
935/* The contents of this function are C++ specific, so the () macro is not used.
936 */
937void yyFlexLexer::switch_streams(std::istream& new_in, std::ostream& new_out) {
938 // was if( new_in )
941
942 // was if( new_out )
943 yyout.rdbuf(new_out.rdbuf());
944}
945
946/* The contents of this function are C++ specific, so the () macro is not used.
947 */
948void yyFlexLexer::switch_streams(std::istream* new_in, std::ostream* new_out) {
949 if (!new_in) {
950 new_in = &yyin;
951 }
952
953 if (!new_out) {
954 new_out = &yyout;
955 }
956
957 switch_streams(*new_in, *new_out);
958}
959
960#ifdef YY_INTERACTIVE
961int yyFlexLexer::LexerInput(char* buf, int /* max_size */)
962#else
963int yyFlexLexer::LexerInput(char* buf, int max_size)
964#endif
965{
966 if (yyin.eof() || yyin.fail()) return 0;
967
968#ifdef YY_INTERACTIVE
969 yyin.get(buf[0]);
970
971 if (yyin.eof()) return 0;
972
973 if (yyin.bad()) return -1;
974
975 return 1;
976
977#else
978 (void)yyin.read(buf, max_size);
979
980 if (yyin.bad())
981 return -1;
982 else
983 return yyin.gcount();
984#endif
985}
986
987void yyFlexLexer::LexerOutput(const char* buf, int size) {
988 (void)yyout.write(buf, size);
989}
990
991/* yy_get_next_buffer - try to read in a new buffer
992 *
993 * Returns a code representing an action:
994 * EOB_ACT_LAST_MATCH -
995 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
996 * EOB_ACT_END_OF_FILE - end of file
997 */
999 char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1000 char* source = (yytext_ptr);
1001 int number_to_move, i;
1002 int ret_val;
1003
1004 if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1])
1005 YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed");
1006
1007 if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer ==
1008 0) { /* Don't try to fill the buffer, so this is an EOF. */
1009 if ((yy_c_buf_p) - (yytext_ptr)-YY_MORE_ADJ == 1) {
1010 /* We matched a single character, the EOB, so
1011 * treat this as a final EOF.
1012 */
1013 return EOB_ACT_END_OF_FILE;
1014 }
1015
1016 else {
1017 /* We matched some text prior to the EOB, first
1018 * process it.
1019 */
1020 return EOB_ACT_LAST_MATCH;
1021 }
1022 }
1023
1024 /* Try to read more data. */
1025
1026 /* First move last chars to start of buffer. */
1027 number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)-1);
1028
1029 for (i = 0; i < number_to_move; ++i) *(dest++) = *(source++);
1030
1031 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
1032 /* don't do the read, it's not guaranteed to return an EOF,
1033 * just force an EOF
1034 */
1035 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1036
1037 else {
1038 int num_to_read =
1039 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1040
1041 while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */
1042
1043 /* just a shorter name for the current buffer */
1045
1046 int yy_c_buf_p_offset = (int)((yy_c_buf_p)-b->yy_ch_buf);
1047
1048 if (b->yy_is_our_buffer) {
1049 int new_size = b->yy_buf_size * 2;
1050
1051 if (new_size <= 0)
1052 b->yy_buf_size += b->yy_buf_size / 8;
1053 else
1054 b->yy_buf_size *= 2;
1055
1056 b->yy_ch_buf = (char*)
1057 /* Include room in for 2 EOB chars. */
1058 yyrealloc((void*)b->yy_ch_buf, (yy_size_t)(b->yy_buf_size + 2));
1059 } else
1060 /* Can't grow it, we don't own it. */
1061 b->yy_ch_buf = NULL;
1062
1063 if (!b->yy_ch_buf)
1064 YY_FATAL_ERROR("fatal error - scanner input buffer overflow");
1065
1066 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1067
1068 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1069 }
1070
1071 if (num_to_read > YY_READ_BUF_SIZE) num_to_read = YY_READ_BUF_SIZE;
1072
1073 /* Read in more data. */
1074 YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1075 (yy_n_chars), num_to_read);
1076
1077 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1078 }
1079
1080 if ((yy_n_chars) == 0) {
1081 if (number_to_move == YY_MORE_ADJ) {
1082 ret_val = EOB_ACT_END_OF_FILE;
1083 yyrestart(yyin);
1084 }
1085
1086 else {
1087 ret_val = EOB_ACT_LAST_MATCH;
1089 }
1090 }
1091
1092 else
1093 ret_val = EOB_ACT_CONTINUE_SCAN;
1094
1095 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1096 /* Extend the array by 50%, plus the number we really need. */
1097 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1098 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char*)yyrealloc(
1099 (void*)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t)new_size);
1100 if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1101 YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
1102 /* "- 2" to take care of EOB's */
1103 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2);
1104 }
1105
1106 (yy_n_chars) += number_to_move;
1109
1110 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1111
1112 return ret_val;
1113}
1114
1115/* yy_get_previous_state - get the state just before the EOB char was reached */
1116
1118 yy_state_type yy_current_state;
1119 char* yy_cp;
1120
1121 yy_current_state = (yy_start);
1122
1123 for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) {
1124 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1125 if (yy_accept[yy_current_state]) {
1126 (yy_last_accepting_state) = yy_current_state;
1128 }
1129 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1130 yy_current_state = (int)yy_def[yy_current_state];
1131 if (yy_current_state >= 77) yy_c = yy_meta[yy_c];
1132 }
1133 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1134 }
1135
1136 return yy_current_state;
1137}
1138
1139/* yy_try_NUL_trans - try to make a transition on the NUL character
1140 *
1141 * synopsis
1142 * next_state = yy_try_NUL_trans( current_state );
1143 */
1145 int yy_is_jam;
1146 char* yy_cp = (yy_c_buf_p);
1147
1148 YY_CHAR yy_c = 1;
1149 if (yy_accept[yy_current_state]) {
1150 (yy_last_accepting_state) = yy_current_state;
1152 }
1153 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1154 yy_current_state = (int)yy_def[yy_current_state];
1155 if (yy_current_state >= 77) yy_c = yy_meta[yy_c];
1156 }
1157 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1158 yy_is_jam = (yy_current_state == 76);
1159
1160 return yy_is_jam ? 0 : yy_current_state;
1161}
1162
1163#ifndef YY_NO_UNPUT
1164void yyFlexLexer::yyunput(int c, char* yy_bp) {
1165 char* yy_cp;
1166
1167 yy_cp = (yy_c_buf_p);
1168
1169 /* undo effects of setting up yytext */
1170 *yy_cp = (yy_hold_char);
1171
1172 if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf +
1173 2) { /* need to shift things up to make room */
1174 /* +2 for EOB chars. */
1175 int number_to_move = (yy_n_chars) + 2;
1176 char* dest = &YY_CURRENT_BUFFER_LVALUE
1177 ->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1178 char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1179
1180 while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) *--dest = *--source;
1181
1182 yy_cp += (int)(dest - source);
1183 yy_bp += (int)(dest - source);
1184 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) =
1185 (int)YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1186
1187 if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1188 YY_FATAL_ERROR("flex scanner push-back overflow");
1189 }
1190
1191 *--yy_cp = (char)c;
1192
1193 (yytext_ptr) = yy_bp;
1194 (yy_hold_char) = *yy_cp;
1195 (yy_c_buf_p) = yy_cp;
1196}
1197#endif
1198
1200 int c;
1201
1202 *(yy_c_buf_p) = (yy_hold_char);
1203
1205 /* yy_c_buf_p now points to the character we want to return.
1206 * If this occurs *before* the EOB characters, then it's a
1207 * valid NUL; if not, then we've hit the end of the buffer.
1208 */
1209 if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
1210 /* This was really a NUL. */
1211 *(yy_c_buf_p) = '\0';
1212
1213 else { /* need more input */
1214 int offset = (int)((yy_c_buf_p) - (yytext_ptr));
1215 ++(yy_c_buf_p);
1216
1217 switch (yy_get_next_buffer()) {
1218 case EOB_ACT_LAST_MATCH:
1219 /* This happens because yy_g_n_b()
1220 * sees that we've accumulated a
1221 * token and flags that we need to
1222 * try matching the token before
1223 * proceeding. But for input(),
1224 * there's no matching to consider.
1225 * So convert the EOB_ACT_LAST_MATCH
1226 * to EOB_ACT_END_OF_FILE.
1227 */
1228
1229 /* Reset buffer status. */
1230 yyrestart(yyin);
1231
1232 /*FALLTHROUGH*/
1233
1234 case EOB_ACT_END_OF_FILE: {
1235 if (yywrap()) return 0;
1236
1238#ifdef __cplusplus
1239 return yyinput();
1240#else
1241 return input();
1242#endif
1243 }
1244
1246 (yy_c_buf_p) = (yytext_ptr) + offset;
1247 break;
1248 }
1249 }
1250 }
1251
1252 c = *(unsigned char*)(yy_c_buf_p); /* cast for 8-bit char's */
1253 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1254 (yy_hold_char) = *++(yy_c_buf_p);
1255
1256 return c;
1257}
1258
1264void yyFlexLexer::yyrestart(std::istream& input_file) {
1265 if (!YY_CURRENT_BUFFER) {
1268 }
1269
1270 yy_init_buffer(YY_CURRENT_BUFFER, input_file);
1272}
1273
1279void yyFlexLexer::yyrestart(std::istream* input_file) {
1280 if (!input_file) {
1281 input_file = &yyin;
1282 }
1283 yyrestart(*input_file);
1284}
1285
1291 /* TODO. We should be able to replace this entire function body
1292 * with
1293 * yypop_buffer_state();
1294 * yypush_buffer_state(new_buffer);
1295 */
1297 if (YY_CURRENT_BUFFER == new_buffer) return;
1298
1299 if (YY_CURRENT_BUFFER) {
1300 /* Flush out information for old buffer. */
1301 *(yy_c_buf_p) = (yy_hold_char);
1302 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1303 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1304 }
1305
1306 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1308
1309 /* We don't actually know whether we did this switch during
1310 * EOF (yywrap()) processing, but the only time this flag
1311 * is looked at is after yywrap() is called, so it's safe
1312 * to go ahead and always set it.
1313 */
1315}
1316
1318 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1320 yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file);
1321 (yy_hold_char) = *(yy_c_buf_p);
1322}
1323
1331YY_BUFFER_STATE yyFlexLexer::yy_create_buffer(std::istream& file, int size) {
1333
1334 b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state));
1335 if (!b) 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*)yyalloc((yy_size_t)(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
1361YY_BUFFER_STATE yyFlexLexer::yy_create_buffer(std::istream* file, int size) {
1362 return yy_create_buffer(*file, size);
1363}
1364
1370 if (!b) return;
1371
1372 if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
1374
1375 if (b->yy_is_our_buffer) yyfree((void*)b->yy_ch_buf);
1376
1377 yyfree((void*)b);
1378}
1379
1380/* Initializes or reinitializes a buffer.
1381 * This function is sometimes called more than once on the same buffer,
1382 * such as during a yyrestart() or at EOF.
1383 */
1385
1386{
1387 int oerrno = errno;
1388
1389 yy_flush_buffer(b);
1390
1391 b->yy_input_file = file.rdbuf();
1392 b->yy_fill_buffer = 1;
1393
1394 /* If b is the current buffer, then yy_init_buffer was _probably_
1395 * called from yyrestart() or through yy_get_next_buffer.
1396 * In that case, we don't want to reset the lineno or column.
1397 */
1398 if (b != YY_CURRENT_BUFFER) {
1399 b->yy_bs_lineno = 1;
1400 b->yy_bs_column = 0;
1401 }
1402
1403 b->yy_is_interactive = 0;
1404 errno = oerrno;
1405}
1406
1412 if (!b) return;
1413
1414 b->yy_n_chars = 0;
1415
1416 /* We always need two end-of-buffer characters. The first causes
1417 * a transition to the end-of-buffer state. The second causes
1418 * a jam in that state.
1419 */
1422
1423 b->yy_buf_pos = &b->yy_ch_buf[0];
1424
1425 b->yy_at_bol = 1;
1427
1429}
1430
1438 if (new_buffer == NULL) return;
1439
1441
1442 /* This block is copied from yy_switch_to_buffer. */
1443 if (YY_CURRENT_BUFFER) {
1444 /* Flush out information for old buffer. */
1445 *(yy_c_buf_p) = (yy_hold_char);
1446 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1447 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1448 }
1449
1450 /* Only push if top exists. Otherwise, replace top. */
1452 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1453
1454 /* copied from yy_switch_to_buffer. */
1457}
1458
1475
1476/* Allocates the stack if it does not exist.
1477 * Guarantees space for at least one push.
1478 */
1480 yy_size_t num_to_alloc;
1481
1482 if (!(yy_buffer_stack)) {
1483 /* First allocation is just for 2 elements, since we don't know if this
1484 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1485 * immediate realloc on the next call.
1486 */
1487 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1489 num_to_alloc * sizeof(struct yy_buffer_state*));
1490 if (!(yy_buffer_stack))
1491 YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1492
1493 memset((yy_buffer_stack), 0,
1494 num_to_alloc * sizeof(struct yy_buffer_state*));
1495
1496 (yy_buffer_stack_max) = num_to_alloc;
1497 (yy_buffer_stack_top) = 0;
1498 return;
1499 }
1500
1501 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) {
1502 /* Increase the buffer to prepare for a possible push. */
1503 yy_size_t grow_size = 8 /* arbitrary grow size */;
1504
1505 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1507 (yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*));
1508 if (!(yy_buffer_stack))
1509 YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1510
1511 /* zero only the new slots.*/
1512 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0,
1513 grow_size * sizeof(struct yy_buffer_state*));
1514 (yy_buffer_stack_max) = num_to_alloc;
1515 }
1516}
1517
1518void yyFlexLexer::yy_push_state(int _new_state) {
1520 yy_size_t new_size;
1521
1523 new_size = (yy_size_t)(yy_start_stack_depth) * sizeof(int);
1524
1525 if (!(yy_start_stack))
1526 (yy_start_stack) = (int*)yyalloc(new_size);
1527
1528 else
1529 (yy_start_stack) = (int*)yyrealloc((void*)(yy_start_stack), new_size);
1530
1531 if (!(yy_start_stack))
1532 YY_FATAL_ERROR("out of memory expanding start-condition stack");
1533 }
1534
1536
1537 BEGIN(_new_state);
1538}
1539
1541 if (--(yy_start_stack_ptr) < 0)
1542 YY_FATAL_ERROR("start-condition stack underflow");
1543
1545}
1546
1550
1551#ifndef YY_EXIT_FAILURE
1552#define YY_EXIT_FAILURE 2
1553#endif
1554
1555void yyFlexLexer::LexerError(const char* msg) {
1556 std::cerr << msg << std::endl;
1557 exit(YY_EXIT_FAILURE);
1558}
1559
1560/* Redefine yyless() so it works in section 3 code. */
1561
1562#undef yyless
1563#define yyless(n) \
1564 do { \
1565 /* Undo effects of setting up yytext. */ \
1566 int yyless_macro_arg = (n); \
1567 YY_LESS_LINENO(yyless_macro_arg); \
1568 yytext[yyleng] = (yy_hold_char); \
1569 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1570 (yy_hold_char) = *(yy_c_buf_p); \
1571 *(yy_c_buf_p) = '\0'; \
1572 yyleng = yyless_macro_arg; \
1573 } while (0)
1574
1575/* Accessor methods (get/set functions) to struct members. */
1576
1577/*
1578 * Internal utility routines.
1579 */
1580
1581#ifndef yytext_ptr
1582static void yy_flex_strncpy(char* s1, const char* s2, int n) {
1583 int i;
1584 for (i = 0; i < n; ++i) s1[i] = s2[i];
1585}
1586#endif
1587
1588#ifdef YY_NEED_STRLEN
1589static int yy_flex_strlen(const char* s) {
1590 int n;
1591 for (n = 0; s[n]; ++n)
1592 ;
1593
1594 return n;
1595}
1596#endif
1597
1598void* yyalloc(yy_size_t size) { return malloc(size); }
1599
1600void* yyrealloc(void* ptr, yy_size_t size) {
1601 /* The cast to (char *) in the following accommodates both
1602 * implementations that use char* generic pointers, and those
1603 * that use void* generic pointers. It works with the latter
1604 * because both ANSI C and C++ allow castless assignment from
1605 * any pointer type to void*, and deal with argument conversions
1606 * as though doing an assignment.
1607 */
1608 return realloc(ptr, size);
1609}
1610
1611void yyfree(void* ptr) {
1612 free((char*)ptr); /* see yyrealloc() for (char *) cast */
1613}
1614
1615#define YYTABLES_NAME "yytables"
1616
1617#line 133 "scanner.l"
1618
1619namespace SlamParser {
1620
1621Scanner::Scanner(std::istream* in, std::ostream* out)
1622 : SlamFlexLexer(in, out) {}
1623
1625
1627
1628} // namespace SlamParser
1629
1630#ifdef yylex
1631#undef yylex
1632#endif
1633
1634int SlamFlexLexer::yylex() {
1635 std::cerr << "in SlamFlexLexer::yylex() !" << std::endl;
1636 return 0;
1637}
1638
1639/* When the scanner receives an end-of-file indication from YY_INPUT, it then
1640 * checks the yywrap() function. If yywrap() returns false (zero), then it is
1641 * assumed that the function has gone ahead and set up `yyin' to point to
1642 * another input file, and scanning continues. If it returns true (non-zero),
1643 * then the scanner terminates, returning 0 to its caller. */
1644
1645int SlamFlexLexer::yywrap() {
1646 // std::cerr << "in SlamFlexLexer::yywrap() !" << std::endl;
1647 return 1;
1648}
int yy_state_type
Definition FlexLexer.h:56
int yylineno
Definition FlexLexer.h:98
Scanner(std::istream *arg_yyin=0, std::ostream *arg_yyout=0)
yyFlexLexer(std::istream &arg_yyin, std::ostream &arg_yyout)
char * yy_c_buf_p
Definition FlexLexer.h:175
char yy_hold_char
Definition FlexLexer.h:169
void yyensure_buffer_stack(void)
virtual int yywrap()
int yy_start_stack_depth
Definition FlexLexer.h:154
virtual int LexerInput(char *buf, int max_size)
virtual void switch_streams(std::istream &new_in, std::ostream &new_out)
int yy_get_next_buffer()
void yypop_buffer_state()
int yy_more_flag
Definition FlexLexer.h:205
int yy_start_stack_ptr
Definition FlexLexer.h:153
yy_buffer_state ** yy_buffer_stack
Definition FlexLexer.h:186
char * yy_last_accepting_cpos
Definition FlexLexer.h:193
int yy_more_len
Definition FlexLexer.h:206
void yyrestart(std::istream *s)
void yyunput(int c, char *buf_ptr)
void yy_flush_buffer(yy_buffer_state *b)
void yy_push_state(int new_state)
virtual ~yyFlexLexer()
yy_state_type yy_last_accepting_state
Definition FlexLexer.h:192
void yy_init_buffer(yy_buffer_state *b, std::istream &s)
yy_state_type yy_get_previous_state()
virtual void LexerError(const char *msg)
void yy_switch_to_buffer(yy_buffer_state *new_buffer)
yy_state_type * yy_state_buf
Definition FlexLexer.h:195
int * yy_start_stack
Definition FlexLexer.h:155
int yy_looking_for_trail_begin
Definition FlexLexer.h:203
std::ostream yyout
Definition FlexLexer.h:166
std::istream yyin
Definition FlexLexer.h:165
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
void yy_load_buffer_state()
size_t yy_buffer_stack_top
Definition FlexLexer.h:184
void yy_delete_buffer(yy_buffer_state *b)
size_t yy_buffer_stack_max
Definition FlexLexer.h:185
void yypush_buffer_state(yy_buffer_state *new_buffer)
virtual void LexerOutput(const char *buf, int size)
int yy_more_offset
Definition FlexLexer.h:207
yy_buffer_state * yy_create_buffer(std::istream *s, int size)
int yy_prev_more_offset
Definition FlexLexer.h:208
int yy_did_buffer_switch_on_eof
Definition FlexLexer.h:182
#define YY_NEW_FILE
unsigned char flex_uint8_t
int yyleng
#define YY_START_STACK_INCR
short int flex_int16_t
unsigned int flex_uint32_t
SlamParser::Parser::token_type token_type
#define YY_BREAK
int yy_act
static const flex_int16_t yy_base[78]
struct yy_buffer_state * YY_BUFFER_STATE
#define yyfree
#define YY_BUFFER_NEW
#define YY_RESTORE_YY_MORE_OFFSET
#define YY_BUFFER_NORMAL
char * yy_cp
#define YY_MORE_ADJ
#define YY_RULE_SETUP
static const flex_int16_t yy_nxt[220]
#define yytext_ptr
SlamParser::Parser::token token
signed char flex_int8_t
#define EOB_ACT_END_OF_FILE
#define yyalloc
#define YY_CURRENT_BUFFER_LVALUE
int flex_int32_t
#define YY_START
static const flex_int16_t yy_def[78]
#define YY_CURRENT_BUFFER
#define INITIAL
char * yy_bp
#define YY_READ_BUF_SIZE
#define YY_INPUT(buf, result, max_size)
#define ECHO
static const flex_int16_t yy_chk[220]
#define yyrealloc
#define YY_END_OF_BUFFER
#define YY_STATE_EOF(state)
#define BEGIN
#define YY_END_OF_BUFFER_CHAR
YY_DECL
#define YY_FATAL_ERROR(msg)
#define yyterminate()
unsigned short int flex_uint16_t
flex_uint8_t YY_CHAR
#define YY_DO_BEFORE_ACTION
#define EOB_ACT_LAST_MATCH
size_t yy_size_t
#define YY_BUFFER_EOF_PENDING
static const YY_CHAR yy_ec[256]
#define EOB_ACT_CONTINUE_SCAN
#define YY_BUF_SIZE
#define YY_EXIT_FAILURE
static const YY_CHAR yy_meta[47]
static const flex_int16_t yy_accept[77]
#define YY_SC_TO_UI(c)
Definition jet.h:876
std::ostream out yy_flex_debug
Definition scanner.l:148
std::ostream * out
Definition scanner.l:138
return static_cast< token_type > * yytext
Definition scanner.l:127
std::streambuf * yy_input_file
flex_int32_t yy_verify
flex_int32_t yy_nxt