GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
lex.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1993-2024 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
31  // This one needs to be global.
32 # pragma GCC diagnostic ignored "-Wunused-function"
33  // Disable these warnings for code that is generated by flex,
34  // including pattern rules. Push the current state so we can
35  // restore the warning state prior to functions we define at
36  // the bottom of the file.
37 # pragma GCC diagnostic push
38 # pragma GCC diagnostic ignored "-Wold-style-cast"
39 # pragma GCC diagnostic ignored "-Wsign-compare"
40 # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
41 # if defined (HAVE_WARN_IMPLICIT_FALLTHROUGH)
42 # pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
43 # endif
44 #endif
45 
46 // Define away the deprecated register storage class specifier to avoid
47 // potential warnings about it.
48 #if ! defined (register)
49 # define register
50 #endif
51 
52 #line 53 "libinterp/parse-tree/lex.cc"
53 
54 #define YY_INT_ALIGNED short int
55 
56 /* A lexical scanner generated by flex */
57 
58 #define FLEX_SCANNER
59 #define YY_FLEX_MAJOR_VERSION 2
60 #define YY_FLEX_MINOR_VERSION 6
61 #define YY_FLEX_SUBMINOR_VERSION 4
62 #if YY_FLEX_SUBMINOR_VERSION > 0
63 #define FLEX_BETA
64 #endif
65 
66 #ifdef yy_create_buffer
67 #define octave__create_buffer_ALREADY_DEFINED
68 #else
69 #define yy_create_buffer octave__create_buffer
70 #endif
71 
72 #ifdef yy_delete_buffer
73 #define octave__delete_buffer_ALREADY_DEFINED
74 #else
75 #define yy_delete_buffer octave__delete_buffer
76 #endif
77 
78 #ifdef yy_scan_buffer
79 #define octave__scan_buffer_ALREADY_DEFINED
80 #else
81 #define yy_scan_buffer octave__scan_buffer
82 #endif
83 
84 #ifdef yy_scan_string
85 #define octave__scan_string_ALREADY_DEFINED
86 #else
87 #define yy_scan_string octave__scan_string
88 #endif
89 
90 #ifdef yy_scan_bytes
91 #define octave__scan_bytes_ALREADY_DEFINED
92 #else
93 #define yy_scan_bytes octave__scan_bytes
94 #endif
95 
96 #ifdef yy_init_buffer
97 #define octave__init_buffer_ALREADY_DEFINED
98 #else
99 #define yy_init_buffer octave__init_buffer
100 #endif
101 
102 #ifdef yy_flush_buffer
103 #define octave__flush_buffer_ALREADY_DEFINED
104 #else
105 #define yy_flush_buffer octave__flush_buffer
106 #endif
107 
108 #ifdef yy_load_buffer_state
109 #define octave__load_buffer_state_ALREADY_DEFINED
110 #else
111 #define yy_load_buffer_state octave__load_buffer_state
112 #endif
113 
114 #ifdef yy_switch_to_buffer
115 #define octave__switch_to_buffer_ALREADY_DEFINED
116 #else
117 #define yy_switch_to_buffer octave__switch_to_buffer
118 #endif
119 
120 #ifdef yypush_buffer_state
121 #define octave_push_buffer_state_ALREADY_DEFINED
122 #else
123 #define yypush_buffer_state octave_push_buffer_state
124 #endif
125 
126 #ifdef yypop_buffer_state
127 #define octave_pop_buffer_state_ALREADY_DEFINED
128 #else
129 #define yypop_buffer_state octave_pop_buffer_state
130 #endif
131 
132 #ifdef yyensure_buffer_stack
133 #define octave_ensure_buffer_stack_ALREADY_DEFINED
134 #else
135 #define yyensure_buffer_stack octave_ensure_buffer_stack
136 #endif
137 
138 #ifdef yylex
139 #define octave_lex_ALREADY_DEFINED
140 #else
141 #define yylex octave_lex
142 #endif
143 
144 #ifdef yyrestart
145 #define octave_restart_ALREADY_DEFINED
146 #else
147 #define yyrestart octave_restart
148 #endif
149 
150 #ifdef yylex_init
151 #define octave_lex_init_ALREADY_DEFINED
152 #else
153 #define yylex_init octave_lex_init
154 #endif
155 
156 #ifdef yylex_init_extra
157 #define octave_lex_init_extra_ALREADY_DEFINED
158 #else
159 #define yylex_init_extra octave_lex_init_extra
160 #endif
161 
162 #ifdef yylex_destroy
163 #define octave_lex_destroy_ALREADY_DEFINED
164 #else
165 #define yylex_destroy octave_lex_destroy
166 #endif
167 
168 #ifdef yyget_debug
169 #define octave_get_debug_ALREADY_DEFINED
170 #else
171 #define yyget_debug octave_get_debug
172 #endif
173 
174 #ifdef yyset_debug
175 #define octave_set_debug_ALREADY_DEFINED
176 #else
177 #define yyset_debug octave_set_debug
178 #endif
179 
180 #ifdef yyget_extra
181 #define octave_get_extra_ALREADY_DEFINED
182 #else
183 #define yyget_extra octave_get_extra
184 #endif
185 
186 #ifdef yyset_extra
187 #define octave_set_extra_ALREADY_DEFINED
188 #else
189 #define yyset_extra octave_set_extra
190 #endif
191 
192 #ifdef yyget_in
193 #define octave_get_in_ALREADY_DEFINED
194 #else
195 #define yyget_in octave_get_in
196 #endif
197 
198 #ifdef yyset_in
199 #define octave_set_in_ALREADY_DEFINED
200 #else
201 #define yyset_in octave_set_in
202 #endif
203 
204 #ifdef yyget_out
205 #define octave_get_out_ALREADY_DEFINED
206 #else
207 #define yyget_out octave_get_out
208 #endif
209 
210 #ifdef yyset_out
211 #define octave_set_out_ALREADY_DEFINED
212 #else
213 #define yyset_out octave_set_out
214 #endif
215 
216 #ifdef yyget_leng
217 #define octave_get_leng_ALREADY_DEFINED
218 #else
219 #define yyget_leng octave_get_leng
220 #endif
221 
222 #ifdef yyget_text
223 #define octave_get_text_ALREADY_DEFINED
224 #else
225 #define yyget_text octave_get_text
226 #endif
227 
228 #ifdef yyget_lineno
229 #define octave_get_lineno_ALREADY_DEFINED
230 #else
231 #define yyget_lineno octave_get_lineno
232 #endif
233 
234 #ifdef yyset_lineno
235 #define octave_set_lineno_ALREADY_DEFINED
236 #else
237 #define yyset_lineno octave_set_lineno
238 #endif
239 
240 #ifdef yyget_column
241 #define octave_get_column_ALREADY_DEFINED
242 #else
243 #define yyget_column octave_get_column
244 #endif
245 
246 #ifdef yyset_column
247 #define octave_set_column_ALREADY_DEFINED
248 #else
249 #define yyset_column octave_set_column
250 #endif
251 
252 #ifdef yywrap
253 #define octave_wrap_ALREADY_DEFINED
254 #else
255 #define yywrap octave_wrap
256 #endif
257 
258 #ifdef yyget_lval
259 #define octave_get_lval_ALREADY_DEFINED
260 #else
261 #define yyget_lval octave_get_lval
262 #endif
263 
264 #ifdef yyset_lval
265 #define octave_set_lval_ALREADY_DEFINED
266 #else
267 #define yyset_lval octave_set_lval
268 #endif
269 
270 #ifdef yyalloc
271 #define octave_alloc_ALREADY_DEFINED
272 #else
273 #define yyalloc octave_alloc
274 #endif
275 
276 #ifdef yyrealloc
277 #define octave_realloc_ALREADY_DEFINED
278 #else
279 #define yyrealloc octave_realloc
280 #endif
281 
282 #ifdef yyfree
283 #define octave_free_ALREADY_DEFINED
284 #else
285 #define yyfree octave_free
286 #endif
287 
288 /* First, we deal with platform-specific or compiler-specific issues. */
289 
290 /* begin standard C headers. */
291 #include <stdio.h>
292 #include <string.h>
293 #include <errno.h>
294 #include <stdlib.h>
295 
296 /* end standard C headers. */
297 
298 /* flex integer type definitions */
299 
300 #ifndef FLEXINT_H
301 #define FLEXINT_H
302 
303 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
304 
305 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
306 
307 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
308  * if you want the limit (max/min) macros for int types.
309  */
310 #ifndef __STDC_LIMIT_MACROS
311 #define __STDC_LIMIT_MACROS 1
312 #endif
313 
314 #include <inttypes.h>
315 typedef int8_t flex_int8_t;
316 typedef uint8_t flex_uint8_t;
317 typedef int16_t flex_int16_t;
318 typedef uint16_t flex_uint16_t;
319 typedef int32_t flex_int32_t;
320 typedef uint32_t flex_uint32_t;
321 #else
322 typedef signed char flex_int8_t;
323 typedef short int flex_int16_t;
324 typedef int flex_int32_t;
325 typedef unsigned char flex_uint8_t;
326 typedef unsigned short int flex_uint16_t;
327 typedef unsigned int flex_uint32_t;
328 
329 /* Limits of integral types. */
330 #ifndef INT8_MIN
331 #define INT8_MIN (-128)
332 #endif
333 #ifndef INT16_MIN
334 #define INT16_MIN (-32767-1)
335 #endif
336 #ifndef INT32_MIN
337 #define INT32_MIN (-2147483647-1)
338 #endif
339 #ifndef INT8_MAX
340 #define INT8_MAX (127)
341 #endif
342 #ifndef INT16_MAX
343 #define INT16_MAX (32767)
344 #endif
345 #ifndef INT32_MAX
346 #define INT32_MAX (2147483647)
347 #endif
348 #ifndef UINT8_MAX
349 #define UINT8_MAX (255U)
350 #endif
351 #ifndef UINT16_MAX
352 #define UINT16_MAX (65535U)
353 #endif
354 #ifndef UINT32_MAX
355 #define UINT32_MAX (4294967295U)
356 #endif
357 
358 #ifndef SIZE_MAX
359 #define SIZE_MAX (~(size_t)0)
360 #endif
361 
362 #endif /* ! C99 */
363 
364 #endif /* ! FLEXINT_H */
365 
366 /* begin standard C++ headers. */
367 
368 /* TODO: this is always defined, so inline it */
369 #define yyconst const
370 
371 #if defined(__GNUC__) && __GNUC__ >= 3
372 #define yynoreturn __attribute__((__noreturn__))
373 #else
374 #define yynoreturn
375 #endif
376 
377 /* Returned upon end-of-file. */
378 #define YY_NULL 0
379 
380 /* Promotes a possibly negative, possibly signed char to an
381  * integer in range [0..255] for use as an array index.
382  */
383 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
384 
385 /* An opaque pointer. */
386 #ifndef YY_TYPEDEF_YY_SCANNER_T
387 #define YY_TYPEDEF_YY_SCANNER_T
388 typedef void* yyscan_t;
389 #endif
390 
391 /* For convenience, these vars (plus the bison vars far below)
392  are macros in the reentrant scanner. */
393 #define yyin yyg->yyin_r
394 #define yyout yyg->yyout_r
395 #define yyextra yyg->yyextra_r
396 #define yyleng yyg->yyleng_r
397 #define yytext yyg->yytext_r
398 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
399 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
400 #define yy_flex_debug yyg->yy_flex_debug_r
401 
402 /* Enter a start condition. This macro really ought to take a parameter,
403  * but we do it the disgusting crufty way forced on us by the ()-less
404  * definition of BEGIN.
405  */
406 #define BEGIN yyg->yy_start = 1 + 2 *
407 /* Translate the current start state into a value that can be later handed
408  * to BEGIN to return to the state. The YYSTATE alias is for lex
409  * compatibility.
410  */
411 #define YY_START ((yyg->yy_start - 1) / 2)
412 #define YYSTATE YY_START
413 /* Action number for EOF rule of a given start state. */
414 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
415 /* Special action meaning "start processing a new file". */
416 #define YY_NEW_FILE yyrestart( yyin , yyscanner )
417 #define YY_END_OF_BUFFER_CHAR 0
418 
419 /* Size of default input buffer. */
420 #ifndef YY_BUF_SIZE
421 #ifdef __ia64__
422 /* On IA-64, the buffer size is 16k, not 8k.
423  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
424  * Ditto for the __ia64__ case accordingly.
425  */
426 #define YY_BUF_SIZE 32768
427 #else
428 #define YY_BUF_SIZE 16384
429 #endif /* __ia64__ */
430 #endif
431 
432 /* The state buf must be large enough to hold one state per character in the main buffer.
433  */
434 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
435 
436 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
437 #define YY_TYPEDEF_YY_BUFFER_STATE
438 typedef struct yy_buffer_state *YY_BUFFER_STATE;
439 #endif
440 
441 #ifndef YY_TYPEDEF_YY_SIZE_T
442 #define YY_TYPEDEF_YY_SIZE_T
443 typedef size_t yy_size_t;
444 #endif
445 
446 #define EOB_ACT_CONTINUE_SCAN 0
447 #define EOB_ACT_END_OF_FILE 1
448 #define EOB_ACT_LAST_MATCH 2
449 
450  #define YY_LESS_LINENO(n)
451  #define YY_LINENO_REWIND_TO(ptr)
452 
453 /* Return all but the first "n" matched characters back to the input stream. */
454 #define yyless(n) \
455  do \
456  { \
457  /* Undo effects of setting up yytext. */ \
458  int yyless_macro_arg = (n); \
459  YY_LESS_LINENO(yyless_macro_arg);\
460  *yy_cp = yyg->yy_hold_char; \
461  YY_RESTORE_YY_MORE_OFFSET \
462  yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
463  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
464  } \
465  while ( 0 )
466 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
467 
468 #ifndef YY_STRUCT_YY_BUFFER_STATE
469 #define YY_STRUCT_YY_BUFFER_STATE
470 struct yy_buffer_state
471  {
472  FILE *yy_input_file;
473 
474  char *yy_ch_buf; /* input buffer */
475  char *yy_buf_pos; /* current position in input buffer */
476 
477  /* Size of input buffer in bytes, not including room for EOB
478  * characters.
479  */
480  int yy_buf_size;
481 
482  /* Number of characters read into yy_ch_buf, not including EOB
483  * characters.
484  */
485  int yy_n_chars;
486 
487  /* Whether we "own" the buffer - i.e., we know we created it,
488  * and can realloc() it to grow it, and should free() it to
489  * delete it.
490  */
491  int yy_is_our_buffer;
492 
493  /* Whether this is an "interactive" input source; if so, and
494  * if we're using stdio for input, then we want to use getc()
495  * instead of fread(), to make sure we stop fetching input after
496  * each newline.
497  */
498  int yy_is_interactive;
499 
500  /* Whether we're considered to be at the beginning of a line.
501  * If so, '^' rules will be active on the next match, otherwise
502  * not.
503  */
504  int yy_at_bol;
505 
506  int yy_bs_lineno; /**< The line count. */
507  int yy_bs_column; /**< The column count. */
508 
509  /* Whether to try to fill the input buffer when we reach the
510  * end of it.
511  */
512  int yy_fill_buffer;
513 
514  int yy_buffer_status;
515 
516 #define YY_BUFFER_NEW 0
517 #define YY_BUFFER_NORMAL 1
518  /* When an EOF's been seen but there's still some text to process
519  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
520  * shouldn't try reading from the input source any more. We might
521  * still have a bunch of tokens to match, though, because of
522  * possible backing-up.
523  *
524  * When we actually see the EOF, we change the status to "new"
525  * (via yyrestart()), so that the user can continue scanning by
526  * just pointing yyin at a new input file.
527  */
528 #define YY_BUFFER_EOF_PENDING 2
529 
530  };
531 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
532 
533 /* We provide macros for accessing buffer states in case in the
534  * future we want to put the buffer states in a more general
535  * "scanner state".
536  *
537  * Returns the top of the stack, or NULL.
538  */
539 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
540  ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
541  : NULL)
542 /* Same as previous macro, but useful when we know that the buffer stack is not
543  * NULL or when we need an lvalue. For internal use only.
544  */
545 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
546 
547 void yyrestart ( FILE *input_file , yyscan_t yyscanner );
548 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
549 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
550 void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
551 void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
552 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
553 void yypop_buffer_state ( yyscan_t yyscanner );
554 
555 static void yyensure_buffer_stack ( yyscan_t yyscanner );
556 static void yy_load_buffer_state ( yyscan_t yyscanner );
557 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
558 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
559 
560 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
561 YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
562 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
563 
564 void *yyalloc ( yy_size_t , yyscan_t yyscanner );
565 void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
566 void yyfree ( void * , yyscan_t yyscanner );
567 
568 #define yy_new_buffer yy_create_buffer
569 #define yy_set_interactive(is_interactive) \
570  { \
571  if ( ! YY_CURRENT_BUFFER ){ \
572  yyensure_buffer_stack (yyscanner); \
573  YY_CURRENT_BUFFER_LVALUE = \
574  yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
575  } \
576  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
577  }
578 #define yy_set_bol(at_bol) \
579  { \
580  if ( ! YY_CURRENT_BUFFER ){\
581  yyensure_buffer_stack (yyscanner); \
582  YY_CURRENT_BUFFER_LVALUE = \
583  yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
584  } \
585  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
586  }
587 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
588 
589 /* Begin user sect3 */
590 
591 #define octave_wrap(yyscanner) (/*CONSTCOND*/1)
592 #define YY_SKIP_YYWRAP
594 
595 typedef int yy_state_type;
596 
597 #define yytext_ptr yytext_r
598 
599 static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
600 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
601 static int yy_get_next_buffer ( yyscan_t yyscanner );
602 static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
603 
604 /* Done after the current pattern has been matched and before the
605  * corresponding action - sets up yytext.
606  */
607 #define YY_DO_BEFORE_ACTION \
608  yyg->yytext_ptr = yy_bp; \
609  yyleng = (int) (yy_cp - yy_bp); \
610  yyg->yy_hold_char = *yy_cp; \
611  *yy_cp = '\0'; \
612  yyg->yy_c_buf_p = yy_cp;
613 #define YY_NUM_RULES 112
614 #define YY_END_OF_BUFFER 113
615 /* This struct is not used in this scanner,
616  but its presence is necessary. */
617 struct yy_trans_info
618  {
619  flex_int32_t yy_verify;
620  flex_int32_t yy_nxt;
621  };
622 static const flex_int16_t yy_accept[290] =
623  { 0,
624  0, 0, 5, 5, 10, 10, 0, 0, 0, 0,
625  0, 0, 0, 0, 0, 0, 0, 0, 113, 111,
626  53, 61, 61, 88, 63, 111, 74, 62, 93, 94,
627  78, 85, 89, 86, 95, 79, 51, 51, 64, 84,
628  76, 96, 77, 111, 59, 56, 15, 80, 16, 81,
629  56, 56, 109, 75, 110, 87, 53, 111, 9, 8,
630  3, 3, 7, 112, 5, 6, 4, 9, 10, 11,
631  11, 95, 13, 14, 10, 1, 1, 112, 20, 20,
632  112, 112, 24, 24, 24, 24, 24, 24, 39, 40,
633  40, 26, 38, 112, 43, 44, 44, 42, 48, 46,
634 
635  48, 48, 45, 53, 0, 61, 71, 0, 21, 21,
636  82, 107, 99, 91, 97, 92, 98, 90, 65, 0,
637  66, 51, 67, 68, 100, 51, 51, 0, 0, 51,
638  0, 69, 70, 73, 0, 58, 0, 60, 0, 0,
639  56, 0, 101, 105, 56, 56, 108, 83, 72, 53,
640  0, 0, 9, 8, 3, 0, 3, 5, 6, 0,
641  10, 11, 0, 10, 1, 0, 20, 20, 0, 0,
642  0, 0, 0, 0, 24, 0, 23, 23, 0, 0,
643  0, 39, 40, 25, 37, 36, 36, 27, 29, 30,
644  31, 32, 33, 34, 35, 37, 43, 44, 41, 46,
645 
646  48, 0, 0, 0, 45, 102, 0, 103, 51, 104,
647  106, 50, 49, 0, 51, 52, 0, 0, 58, 0,
648  0, 60, 0, 0, 0, 57, 56, 0, 17, 17,
649  0, 0, 0, 18, 18, 0, 19, 19, 0, 22,
650  22, 27, 28, 0, 0, 45, 0, 54, 54, 49,
651  0, 51, 52, 0, 0, 58, 0, 60, 0, 0,
652  0, 57, 0, 55, 0, 2, 2, 0, 12, 12,
653  27, 0, 47, 47, 45, 0, 0, 0, 49, 0,
654  0, 0, 52, 58, 60, 0, 57, 57, 0
655  } ;
656 
657 static const YY_CHAR yy_ec[256] =
658  { 0,
659  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
660  1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
661  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
662  1, 2, 5, 6, 7, 1, 7, 8, 9, 10,
663  11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
664  21, 22, 23, 24, 23, 25, 26, 27, 28, 29,
665  30, 31, 32, 33, 34, 35, 34, 36, 36, 34,
666  37, 37, 38, 38, 37, 37, 37, 37, 37, 37,
667  37, 37, 37, 37, 37, 37, 37, 39, 37, 37,
668  40, 41, 42, 43, 44, 1, 45, 46, 34, 36,
669 
670  47, 48, 49, 37, 38, 38, 37, 37, 37, 50,
671  37, 37, 37, 51, 52, 53, 54, 55, 37, 56,
672  37, 37, 57, 58, 59, 60, 1, 1, 1, 1,
673  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
674  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
675  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
676  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
677  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
678  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
679  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
680 
681  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
682  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
683  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
684  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
685  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
686  1, 1, 1, 1, 1
687  } ;
688 
689 static const YY_CHAR yy_meta[61] =
690  { 0,
691  1, 2, 3, 3, 1, 4, 5, 1, 6, 5,
692  5, 7, 8, 5, 8, 9, 7, 10, 10, 10,
693  10, 10, 10, 10, 10, 10, 1, 5, 1, 1,
694  1, 1, 11, 12, 12, 13, 14, 15, 14, 5,
695  16, 5, 7, 17, 12, 12, 13, 12, 14, 14,
696  14, 18, 14, 18, 14, 14, 5, 1, 5, 1
697  } ;
698 
699 static const flex_int16_t yy_base[334] =
700  { 0,
701  0, 59, 65, 123, 61, 81, 750, 749, 83, 87,
702  94, 102, 112, 132, 108, 110, 181, 236, 752, 1235,
703  71, 1235, 748, 720, 1235, 96, 62, 1235, 1235, 1235,
704  716, 128, 1235, 65, 133, 708, 277, 108, 1235, 1235,
705  707, 706, 705, 732, 731, 144, 1235, 699, 1235, 694,
706  153, 154, 1235, 52, 1235, 693, 150, 164, 0, 720,
707  1235, 718, 1235, 158, 149, 133, 1235, 704, 164, 1235,
708  716, 302, 1235, 1235, 177, 1235, 715, 187, 1235, 714,
709  191, 199, 1235, 197, 713, 204, 203, 208, 0, 1235,
710  709, 701, 1235, 343, 0, 1235, 703, 696, 1235, 702,
711 
712  700, 686, 207, 237, 210, 1235, 1235, 238, 1235, 698,
713  1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 670, 683,
714  666, 207, 665, 664, 1235, 391, 0, 228, 209, 1235,
715  0, 1235, 1235, 1235, 691, 246, 690, 247, 292, 687,
716  304, 539, 1235, 1235, 315, 320, 1235, 1235, 1235, 248,
717  273, 257, 0, 536, 1235, 263, 533, 269, 293, 519,
718  262, 1235, 518, 303, 1235, 324, 1235, 530, 337, 347,
719  352, 355, 327, 366, 1235, 368, 1235, 529, 372, 373,
720  378, 0, 1235, 1235, 1235, 1235, 528, 400, 1235, 1235,
721  1235, 1235, 1235, 1235, 1235, 0, 0, 1235, 1235, 528,
722 
723  1235, 513, 376, 521, 381, 1235, 381, 1235, 390, 1235,
724  1235, 1235, 417, 238, 459, 353, 385, 400, 423, 429,
725  393, 431, 388, 439, 384, 438, 440, 449, 1235, 372,
726  440, 445, 455, 1235, 357, 460, 1235, 346, 463, 1235,
727  339, 456, 0, 478, 336, 444, 480, 1235, 329, 467,
728  468, 269, 416, 475, 276, 486, 266, 488, 489, 493,
729  255, 496, 504, 1235, 504, 1235, 193, 512, 1235, 185,
730  1235, 514, 1235, 178, 508, 154, 152, 109, 1235, 97,
731  88, 80, 1235, 511, 523, 60, 524, 526, 1235, 542,
732  560, 578, 596, 614, 632, 650, 668, 681, 696, 713,
733 
734  730, 748, 766, 784, 802, 820, 838, 856, 873, 882,
735  493, 890, 902, 919, 936, 953, 962, 974, 992, 1001,
736  1009, 1026, 1043, 1060, 1077, 1095, 1113, 1131, 1148, 1165,
737  1182, 1199, 1216
738  } ;
739 
740 static const flex_int16_t yy_def[334] =
741  { 0,
742  289, 1, 290, 290, 1, 1, 291, 291, 292, 292,
743  293, 293, 294, 294, 295, 295, 296, 296, 289, 289,
744  289, 289, 289, 289, 289, 297, 289, 289, 289, 289,
745  289, 289, 289, 289, 298, 289, 289, 37, 289, 289,
746  289, 289, 289, 299, 300, 301, 289, 289, 289, 289,
747  301, 301, 289, 289, 289, 289, 289, 297, 302, 289,
748  289, 289, 289, 303, 289, 289, 289, 289, 289, 289,
749  289, 298, 289, 289, 289, 289, 289, 304, 289, 289,
750  304, 304, 289, 289, 289, 305, 289, 305, 306, 289,
751  289, 289, 289, 307, 308, 289, 289, 289, 289, 289,
752 
753  289, 289, 309, 289, 297, 289, 289, 297, 289, 289,
754  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
755  289, 310, 289, 289, 289, 289, 38, 289, 311, 289,
756  312, 289, 289, 289, 299, 313, 300, 314, 289, 315,
757  301, 316, 289, 289, 301, 301, 289, 289, 289, 289,
758  297, 297, 302, 289, 289, 303, 289, 289, 289, 289,
759  289, 289, 289, 289, 289, 304, 289, 289, 304, 304,
760  304, 304, 289, 305, 289, 305, 289, 289, 289, 305,
761  305, 306, 289, 289, 289, 289, 289, 289, 289, 289,
762  289, 289, 289, 289, 289, 317, 308, 289, 289, 289,
763 
764  289, 289, 289, 318, 309, 289, 319, 289, 310, 289,
765  289, 289, 289, 311, 320, 321, 289, 322, 313, 289,
766  323, 314, 315, 324, 316, 325, 301, 297, 289, 289,
767  326, 327, 304, 289, 289, 304, 289, 289, 305, 289,
768  289, 289, 317, 328, 318, 329, 319, 289, 289, 289,
769  289, 320, 321, 289, 322, 330, 323, 331, 324, 289,
770  332, 325, 289, 289, 326, 289, 289, 327, 289, 289,
771  289, 328, 289, 289, 329, 289, 289, 289, 289, 289,
772  289, 289, 289, 330, 331, 332, 333, 333, 0, 289,
773  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
774 
775  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
776  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
777  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
778  289, 289, 289
779  } ;
780 
781 static const flex_int16_t yy_nxt[1296] =
782  { 0,
783  20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
784  30, 31, 32, 33, 34, 35, 36, 37, 38, 38,
785  38, 38, 38, 38, 38, 38, 39, 40, 41, 42,
786  43, 44, 45, 46, 46, 46, 46, 46, 46, 47,
787  48, 49, 50, 46, 46, 46, 46, 46, 51, 46,
788  46, 52, 46, 46, 46, 46, 53, 54, 55, 56,
789  57, 286, 69, 70, 71, 58, 60, 61, 62, 111,
790  63, 64, 104, 63, 65, 66, 72, 105, 67, 116,
791  68, 147, 75, 70, 71, 79, 80, 58, 81, 79,
792  80, 112, 67, 82, 117, 84, 72, 85, 109, 110,
793 
794  86, 283, 73, 87, 65, 85, 66, 283, 88, 148,
795  96, 97, 96, 97, 90, 91, 98, 92, 98, 74,
796  283, 65, 73, 66, 60, 61, 62, 93, 63, 64,
797  279, 63, 65, 66, 90, 91, 67, 92, 68, 74,
798  114, 118, 289, 159, 119, 139, 289, 93, 120, 121,
799  67, 150, 94, 289, 139, 139, 151, 115, 158, 140,
800  155, 157, 65, 289, 66, 161, 109, 110, 140, 140,
801  105, 279, 94, 123, 159, 124, 142, 279, 164, 65,
802  273, 66, 100, 151, 101, 142, 142, 269, 158, 167,
803  168, 159, 169, 167, 168, 266, 102, 170, 173, 145,
804 
805  146, 167, 168, 174, 179, 158, 177, 178, 203, 180,
806  177, 178, 109, 110, 103, 103, 103, 103, 103, 103,
807  152, 214, 204, 214, 103, 103, 103, 103, 103, 103,
808  103, 103, 103, 103, 103, 103, 103, 100, 104, 101,
809  109, 110, 129, 105, 130, 213, 213, 217, 220, 150,
810  289, 102, 289, 129, 151, 171, 286, 172, 228, 229,
811  230, 218, 221, 161, 181, 155, 157, 257, 105, 103,
812  103, 103, 103, 103, 103, 109, 110, 255, 158, 103,
813  103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
814  103, 103, 126, 139, 127, 127, 127, 127, 127, 127,
815 
816  127, 127, 127, 159, 164, 139, 130, 140, 158, 151,
817  118, 128, 129, 119, 130, 131, 139, 163, 121, 140,
818  127, 139, 128, 129, 142, 158, 167, 168, 173, 152,
819  140, 248, 131, 174, 159, 140, 142, 245, 169, 167,
820  168, 240, 123, 170, 124, 186, 187, 142, 237, 167,
821  168, 159, 142, 233, 234, 235, 236, 237, 238, 234,
822  188, 188, 188, 188, 188, 188, 188, 227, 177, 178,
823  177, 178, 227, 179, 229, 177, 178, 203, 180, 239,
824  240, 241, 203, 248, 249, 225, 217, 189, 190, 223,
825  191, 204, 192, 193, 257, 194, 204, 195, 196, 212,
826 
827  218, 255, 212, 171, 254, 172, 254, 212, 122, 122,
828  122, 122, 122, 122, 122, 122, 122, 242, 242, 242,
829  242, 242, 242, 242, 217, 129, 129, 130, 130, 181,
830  220, 212, 220, 212, 250, 250, 129, 129, 218, 260,
831  139, 263, 266, 267, 221, 203, 221, 269, 270, 264,
832  228, 229, 230, 261, 140, 140, 233, 234, 235, 204,
833  250, 236, 237, 238, 239, 240, 241, 254, 251, 254,
834  251, 142, 142, 271, 271, 271, 271, 271, 271, 271,
835  273, 274, 248, 249, 250, 250, 276, 217, 277, 220,
836  139, 278, 279, 280, 260, 281, 130, 260, 282, 283,
837 
838  215, 218, 215, 221, 140, 263, 266, 267, 261, 203,
839  250, 261, 217, 264, 269, 270, 273, 274, 251, 140,
840  251, 142, 245, 204, 220, 260, 218, 260, 244, 200,
841  186, 177, 167, 232, 231, 155, 142, 154, 221, 261,
842  225, 261, 59, 59, 59, 59, 59, 59, 59, 59,
843  59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
844  76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
845  76, 76, 76, 76, 76, 76, 76, 76, 78, 78,
846  78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
847  78, 78, 78, 78, 78, 78, 83, 83, 83, 83,
848 
849  83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
850  83, 83, 83, 83, 89, 89, 89, 89, 89, 89,
851  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
852  89, 89, 95, 95, 95, 95, 95, 95, 95, 95,
853  95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
854  99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
855  99, 99, 99, 99, 99, 99, 99, 99, 108, 108,
856  108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
857  108, 108, 108, 108, 108, 108, 122, 122, 223, 122,
858  122, 137, 135, 211, 210, 208, 122, 136, 207, 206,
859 
860  109, 202, 201, 200, 199, 198, 184, 136, 136, 136,
861  136, 183, 136, 136, 138, 175, 167, 165, 162, 160,
862  155, 154, 149, 144, 138, 138, 138, 138, 143, 138,
863  138, 141, 137, 135, 134, 133, 132, 125, 141, 141,
864  141, 141, 141, 141, 141, 113, 141, 141, 153, 107,
865  106, 289, 77, 77, 153, 153, 289, 153, 153, 153,
866  153, 153, 153, 153, 153, 153, 156, 156, 156, 156,
867  156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
868  156, 156, 156, 156, 166, 166, 166, 166, 166, 166,
869  166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
870 
871  166, 166, 176, 176, 176, 176, 176, 176, 176, 176,
872  176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
873  182, 182, 289, 289, 182, 182, 182, 182, 289, 182,
874  182, 182, 182, 182, 182, 289, 182, 182, 185, 185,
875  185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
876  185, 185, 185, 185, 185, 185, 197, 197, 289, 197,
877  197, 289, 197, 197, 197, 197, 197, 197, 197, 197,
878  197, 197, 197, 197, 205, 289, 289, 289, 289, 289,
879  289, 205, 205, 289, 205, 205, 205, 205, 289, 205,
880  205, 209, 289, 289, 209, 289, 209, 289, 209, 216,
881 
882  289, 216, 216, 219, 289, 289, 289, 289, 289, 289,
883  219, 219, 289, 219, 219, 219, 219, 289, 219, 219,
884  222, 289, 289, 289, 289, 289, 289, 222, 222, 289,
885  222, 222, 222, 222, 289, 222, 222, 224, 289, 289,
886  289, 289, 289, 289, 289, 289, 289, 224, 224, 224,
887  224, 289, 224, 224, 226, 289, 289, 289, 289, 289,
888  289, 289, 289, 289, 226, 226, 226, 226, 289, 226,
889  226, 243, 289, 243, 243, 246, 289, 289, 289, 289,
890  289, 289, 289, 289, 289, 246, 246, 246, 246, 289,
891  246, 246, 247, 247, 247, 247, 247, 247, 247, 247,
892 
893  247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
894  252, 289, 289, 289, 289, 252, 289, 252, 253, 289,
895  253, 253, 289, 289, 289, 253, 253, 256, 289, 289,
896  289, 289, 289, 289, 289, 289, 289, 256, 256, 256,
897  256, 289, 256, 256, 258, 289, 289, 289, 289, 289,
898  289, 289, 289, 289, 258, 258, 258, 258, 289, 258,
899  258, 259, 289, 289, 289, 289, 289, 289, 259, 259,
900  259, 259, 259, 259, 259, 289, 259, 259, 262, 289,
901  289, 289, 289, 289, 289, 262, 262, 289, 262, 262,
902  262, 262, 289, 262, 262, 265, 265, 265, 265, 265,
903 
904  265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
905  265, 265, 265, 268, 268, 268, 268, 268, 268, 268,
906  268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
907  268, 272, 272, 272, 272, 272, 272, 272, 272, 272,
908  272, 272, 272, 272, 272, 272, 272, 272, 272, 275,
909  289, 289, 289, 289, 289, 289, 275, 275, 289, 275,
910  275, 275, 275, 289, 275, 275, 284, 289, 289, 289,
911  289, 289, 289, 284, 284, 289, 284, 284, 284, 284,
912  289, 284, 284, 285, 289, 289, 289, 289, 289, 289,
913  285, 285, 289, 285, 285, 285, 285, 289, 285, 285,
914 
915  287, 289, 289, 289, 289, 289, 289, 289, 289, 289,
916  287, 287, 287, 287, 289, 287, 287, 288, 289, 289,
917  289, 289, 289, 289, 288, 288, 289, 288, 288, 288,
918  288, 289, 288, 288, 19, 289, 289, 289, 289, 289,
919  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
920  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
921  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
922  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
923  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
924  289, 289, 289, 289, 289
925 
926  } ;
927 
928 static const flex_int16_t yy_chk[1296] =
929  { 0,
930  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
931  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
932  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
933  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
934  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
935  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
936  2, 286, 5, 5, 5, 2, 3, 3, 3, 27,
937  3, 3, 21, 3, 3, 3, 5, 21, 3, 34,
938  3, 54, 6, 6, 6, 9, 9, 6, 10, 10,
939  10, 27, 3, 10, 34, 11, 6, 11, 26, 26,
940 
941  11, 282, 5, 12, 3, 12, 3, 281, 12, 54,
942  15, 15, 16, 16, 13, 13, 15, 13, 16, 5,
943  280, 3, 6, 3, 4, 4, 4, 13, 4, 4,
944  278, 4, 4, 4, 14, 14, 4, 14, 4, 6,
945  32, 35, 38, 66, 35, 46, 38, 14, 35, 35,
946  4, 57, 13, 38, 51, 52, 57, 32, 65, 46,
947  64, 64, 4, 38, 4, 69, 58, 58, 51, 52,
948  69, 277, 14, 35, 66, 35, 46, 276, 75, 4,
949  274, 4, 17, 75, 17, 51, 52, 270, 65, 78,
950  78, 66, 81, 81, 81, 267, 17, 81, 84, 51,
951 
952  52, 82, 82, 84, 87, 65, 86, 86, 103, 87,
953  88, 88, 105, 105, 17, 17, 17, 17, 17, 17,
954  58, 129, 103, 129, 17, 17, 17, 17, 17, 17,
955  17, 17, 17, 17, 17, 17, 17, 18, 104, 18,
956  108, 108, 122, 104, 122, 128, 128, 136, 138, 150,
957  214, 18, 214, 122, 150, 82, 261, 82, 152, 152,
958  152, 136, 138, 161, 88, 156, 156, 257, 161, 18,
959  18, 18, 18, 18, 18, 151, 151, 255, 158, 18,
960  18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
961  18, 18, 37, 139, 37, 37, 37, 37, 37, 37,
962 
963  37, 37, 37, 159, 164, 141, 252, 139, 158, 164,
964  72, 37, 37, 72, 37, 37, 145, 72, 72, 141,
965  37, 146, 37, 37, 139, 158, 166, 166, 173, 151,
966  145, 249, 37, 173, 159, 146, 141, 245, 169, 169,
967  169, 241, 72, 169, 72, 94, 94, 145, 238, 170,
968  170, 159, 146, 171, 171, 171, 172, 172, 172, 235,
969  94, 94, 94, 94, 94, 94, 94, 145, 174, 174,
970  176, 176, 146, 179, 230, 180, 180, 203, 179, 181,
971  181, 181, 205, 207, 207, 225, 217, 94, 94, 223,
972  94, 203, 94, 94, 221, 94, 205, 94, 94, 126,
973 
974  217, 218, 126, 170, 216, 170, 216, 126, 126, 126,
975  126, 126, 126, 126, 126, 126, 126, 188, 188, 188,
976  188, 188, 188, 188, 219, 209, 126, 209, 126, 180,
977  220, 126, 222, 126, 213, 213, 209, 126, 219, 226,
978  224, 227, 231, 231, 220, 246, 222, 232, 232, 227,
979  228, 228, 228, 226, 224, 227, 233, 233, 233, 246,
980  213, 236, 236, 236, 239, 239, 239, 253, 213, 253,
981  213, 224, 227, 242, 242, 242, 242, 242, 242, 242,
982  244, 244, 247, 247, 250, 250, 251, 256, 251, 258,
983  259, 251, 251, 254, 260, 254, 215, 262, 254, 254,
984 
985  311, 256, 311, 258, 259, 263, 265, 265, 260, 275,
986  250, 262, 284, 263, 268, 268, 272, 272, 250, 263,
987  250, 259, 204, 275, 285, 287, 284, 288, 202, 200,
988  187, 178, 168, 163, 160, 157, 263, 154, 285, 287,
989  142, 288, 290, 290, 290, 290, 290, 290, 290, 290,
990  290, 290, 290, 290, 290, 290, 290, 290, 290, 290,
991  291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
992  291, 291, 291, 291, 291, 291, 291, 291, 292, 292,
993  292, 292, 292, 292, 292, 292, 292, 292, 292, 292,
994  292, 292, 292, 292, 292, 292, 293, 293, 293, 293,
995 
996  293, 293, 293, 293, 293, 293, 293, 293, 293, 293,
997  293, 293, 293, 293, 294, 294, 294, 294, 294, 294,
998  294, 294, 294, 294, 294, 294, 294, 294, 294, 294,
999  294, 294, 295, 295, 295, 295, 295, 295, 295, 295,
1000  295, 295, 295, 295, 295, 295, 295, 295, 295, 295,
1001  296, 296, 296, 296, 296, 296, 296, 296, 296, 296,
1002  296, 296, 296, 296, 296, 296, 296, 296, 297, 297,
1003  297, 297, 297, 297, 297, 297, 297, 297, 297, 297,
1004  297, 297, 297, 297, 297, 297, 298, 298, 140, 298,
1005  298, 137, 135, 124, 123, 121, 298, 299, 120, 119,
1006 
1007  110, 102, 101, 100, 98, 97, 92, 299, 299, 299,
1008  299, 91, 299, 299, 300, 85, 80, 77, 71, 68,
1009  62, 60, 56, 50, 300, 300, 300, 300, 48, 300,
1010  300, 301, 45, 44, 43, 42, 41, 36, 301, 301,
1011  301, 301, 301, 301, 301, 31, 301, 301, 302, 24,
1012  23, 19, 8, 7, 302, 302, 0, 302, 302, 302,
1013  302, 302, 302, 302, 302, 302, 303, 303, 303, 303,
1014  303, 303, 303, 303, 303, 303, 303, 303, 303, 303,
1015  303, 303, 303, 303, 304, 304, 304, 304, 304, 304,
1016  304, 304, 304, 304, 304, 304, 304, 304, 304, 304,
1017 
1018  304, 304, 305, 305, 305, 305, 305, 305, 305, 305,
1019  305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
1020  306, 306, 0, 0, 306, 306, 306, 306, 0, 306,
1021  306, 306, 306, 306, 306, 0, 306, 306, 307, 307,
1022  307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
1023  307, 307, 307, 307, 307, 307, 308, 308, 0, 308,
1024  308, 0, 308, 308, 308, 308, 308, 308, 308, 308,
1025  308, 308, 308, 308, 309, 0, 0, 0, 0, 0,
1026  0, 309, 309, 0, 309, 309, 309, 309, 0, 309,
1027  309, 310, 0, 0, 310, 0, 310, 0, 310, 312,
1028 
1029  0, 312, 312, 313, 0, 0, 0, 0, 0, 0,
1030  313, 313, 0, 313, 313, 313, 313, 0, 313, 313,
1031  314, 0, 0, 0, 0, 0, 0, 314, 314, 0,
1032  314, 314, 314, 314, 0, 314, 314, 315, 0, 0,
1033  0, 0, 0, 0, 0, 0, 0, 315, 315, 315,
1034  315, 0, 315, 315, 316, 0, 0, 0, 0, 0,
1035  0, 0, 0, 0, 316, 316, 316, 316, 0, 316,
1036  316, 317, 0, 317, 317, 318, 0, 0, 0, 0,
1037  0, 0, 0, 0, 0, 318, 318, 318, 318, 0,
1038  318, 318, 319, 319, 319, 319, 319, 319, 319, 319,
1039 
1040  319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
1041  320, 0, 0, 0, 0, 320, 0, 320, 321, 0,
1042  321, 321, 0, 0, 0, 321, 321, 322, 0, 0,
1043  0, 0, 0, 0, 0, 0, 0, 322, 322, 322,
1044  322, 0, 322, 322, 323, 0, 0, 0, 0, 0,
1045  0, 0, 0, 0, 323, 323, 323, 323, 0, 323,
1046  323, 324, 0, 0, 0, 0, 0, 0, 324, 324,
1047  324, 324, 324, 324, 324, 0, 324, 324, 325, 0,
1048  0, 0, 0, 0, 0, 325, 325, 0, 325, 325,
1049  325, 325, 0, 325, 325, 326, 326, 326, 326, 326,
1050 
1051  326, 326, 326, 326, 326, 326, 326, 326, 326, 326,
1052  326, 326, 326, 327, 327, 327, 327, 327, 327, 327,
1053  327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
1054  327, 328, 328, 328, 328, 328, 328, 328, 328, 328,
1055  328, 328, 328, 328, 328, 328, 328, 328, 328, 329,
1056  0, 0, 0, 0, 0, 0, 329, 329, 0, 329,
1057  329, 329, 329, 0, 329, 329, 330, 0, 0, 0,
1058  0, 0, 0, 330, 330, 0, 330, 330, 330, 330,
1059  0, 330, 330, 331, 0, 0, 0, 0, 0, 0,
1060  331, 331, 0, 331, 331, 331, 331, 0, 331, 331,
1061 
1062  332, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1063  332, 332, 332, 332, 0, 332, 332, 333, 0, 0,
1064  0, 0, 0, 0, 333, 333, 0, 333, 333, 333,
1065  333, 0, 333, 333, 289, 289, 289, 289, 289, 289,
1066  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
1067  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
1068  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
1069  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
1070  289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
1071  289, 289, 289, 289, 289
1072 
1073  } ;
1074 
1075 /* The intent behind this definition is that it'll catch
1076  * any uses of REJECT which flex missed.
1077  */
1078 #define REJECT reject_used_but_not_detected
1079 #define yymore() yymore_used_but_not_detected
1080 #define YY_MORE_ADJ 0
1081 #define YY_RESTORE_YY_MORE_OFFSET
1082 #line 1 "../libinterp/parse-tree/lex.ll"
1083 /*
1084 
1085 We are using the pure parser interface and the reentrant lexer interface
1086 but the Octave parser and lexer are NOT properly reentrant because both
1087 still use many global variables. It should be safe to create a parser
1088 object and call it while another parser object is active (to parse a
1089 callback function while the main interactive parser is waiting for
1090 input, for example) if you take care to properly save and restore
1091 (typically with an unwind_protect object) relevant global values before
1092 and after the nested call.
1093 
1094 */
1095 
1096 
1097 
1098 
1099 
1100 
1101 
1102 
1103 
1104 #line 91 "../libinterp/parse-tree/lex.ll"
1105 
1106 #include <cctype>
1107 #include <cstring>
1108 
1109 #include <algorithm>
1110 #include <iostream>
1111 #include <set>
1112 #include <sstream>
1113 #include <string>
1114 #include <stack>
1115 
1116 #include "cmd-edit.h"
1117 #include "lo-mappers.h"
1118 #include "quit.h"
1119 #include "unistd-wrappers.h"
1120 
1121 // These would be alphabetical, but oct-parse.h must be included before
1122 // oct-gperf.h and oct-parse.h must be included after token.h and the tree
1123 // class declarations. We can't include oct-parse.h in oct-gperf.h
1124 // because it may not be protected to allow it to be included multiple
1125 // times.
1126 
1127 #include "Cell.h"
1128 #include "defun.h"
1129 #include "error.h"
1130 #include "errwarn.h"
1131 #include "input.h"
1132 #include "interpreter.h"
1133 #include "lex.h"
1134 #include "octave.h"
1135 #include "ov-magic-int.h"
1136 #include "ov.h"
1137 #include "parse.h"
1138 #include "pt-all.h"
1139 #include "symtab.h"
1140 #include "token.h"
1141 #include "utils.h"
1142 #include "variables.h"
1143 #include "oct-parse.h"
1144 #include "oct-gperf.h"
1145 
1146 // FIXME: with bison 3.x, OCTAVE_STYPE appears in the generated
1147 // oct-parse.h file, but there is no definition for YYSTYPE, which is
1148 // needed by the code that is generated by flex. I can't seem to find a
1149 // way to tell flex to use OCTAVE_STYPE instead of YYSTYPE in the code
1150 // it generates, or to tell bison to provide the definition of YYSTYPE
1151 // in the generated oct-parse.h file.
1152 
1153 #if defined (OCTAVE_STYPE_IS_DECLARED) && ! defined YYSTYPE
1154 # define YYSTYPE OCTAVE_STYPE
1155 #endif
1156 
1157 #define YY_NO_UNISTD_H 1
1158 #define isatty octave_isatty_wrapper
1159 
1160 #if ! (defined (FLEX_SCANNER) \
1161  && defined (YY_FLEX_MAJOR_VERSION) && YY_FLEX_MAJOR_VERSION >= 2 \
1162  && defined (YY_FLEX_MINOR_VERSION) && YY_FLEX_MINOR_VERSION >= 5)
1163 #error lex.l requires flex version 2.5.4 or later
1164 #endif
1165 
1166 #define YY_EXTRA_TYPE octave::base_lexer *
1167 #define curr_lexer yyextra
1168 
1169 // Arrange to get input via readline.
1170 
1171 #if defined (YY_INPUT)
1172 # undef YY_INPUT
1173 #endif
1174 #define YY_INPUT(buf, result, max_size) \
1175  result = curr_lexer->fill_flex_buffer (buf, max_size)
1176 
1177 // Try to avoid crashing out completely on fatal scanner errors.
1178 
1179 #if defined (YY_FATAL_ERROR)
1180 # undef YY_FATAL_ERROR
1181 #endif
1182 #define YY_FATAL_ERROR(msg) \
1183  (yyget_extra (yyscanner))->fatal_error (msg)
1184 
1185 #define CMD_OR_OP(PATTERN, TOK, COMPAT) \
1186  do \
1187  { \
1188  curr_lexer->lexer_debug (PATTERN); \
1189  \
1190  if (curr_lexer->looks_like_command_arg ()) \
1191  { \
1192  yyless (0); \
1193  curr_lexer->push_start_state (COMMAND_START); \
1194  } \
1195  else \
1196  return curr_lexer->handle_op (TOK, false, COMPAT); \
1197  } \
1198  while (0)
1199 
1200 #define CMD_OR_UNARY_OP(PATTERN, TOK, COMPAT) \
1201  do \
1202  { \
1203  curr_lexer->lexer_debug (PATTERN); \
1204  \
1205  if (curr_lexer->previous_token_may_be_command ()) \
1206  { \
1207  if (curr_lexer->looks_like_command_arg ()) \
1208  { \
1209  yyless (0); \
1210  curr_lexer->push_start_state (COMMAND_START); \
1211  } \
1212  else \
1213  return curr_lexer->handle_op (TOK, false, COMPAT); \
1214  } \
1215  else \
1216  { \
1217  if (curr_lexer->maybe_unput_comma_before_unary_op (TOK)) \
1218  { \
1219  yyless (0); \
1220  curr_lexer->xunput (','); \
1221  } \
1222  else \
1223  return curr_lexer->handle_op (TOK, false, COMPAT); \
1224  } \
1225  } \
1226  while (0)
1227 
1228 #define HANDLE_EOB_OR_EOF(STATUS) \
1229  do \
1230  { \
1231  if (curr_lexer->is_push_lexer ()) \
1232  { \
1233  if (curr_lexer->at_end_of_buffer ()) \
1234  return STATUS; \
1235  \
1236  if (curr_lexer->at_end_of_file ()) \
1237  return curr_lexer->handle_end_of_input (); \
1238  } \
1239  } \
1240  while (0)
1241 
1242 // If we are at the end of the buffer, ask for more input.
1243 // If we are at the end of the file, deal with it.
1244 // Otherwise, just keep going with the text from the current buffer.
1245 #define HANDLE_STRING_CONTINUATION \
1246  do \
1247  { \
1248  curr_lexer->m_filepos.next_line (); \
1249  \
1250  HANDLE_EOB_OR_EOF (-1); \
1251  } \
1252  while (0)
1253 
1254 #define HANDLE_NUMBER(PATTERN, BASE) \
1255  do \
1256  { \
1257  curr_lexer->lexer_debug (PATTERN); \
1258  \
1259  if (curr_lexer->previous_token_may_be_command () \
1260  && curr_lexer->space_follows_previous_token ()) \
1261  { \
1262  yyless (0); \
1263  curr_lexer->push_start_state (COMMAND_START); \
1264  } \
1265  else \
1266  { \
1267  int tok = curr_lexer->previous_token_value (); \
1268  \
1269  if (curr_lexer->whitespace_is_significant () \
1270  && curr_lexer->space_follows_previous_token () \
1271  && ! (tok == '[' || tok == '{' \
1272  || curr_lexer->previous_token_is_binop ())) \
1273  { \
1274  yyless (0); \
1275  curr_lexer->xunput (','); \
1276  } \
1277  else \
1278  return curr_lexer->handle_number<BASE> (); \
1279  } \
1280  } \
1281  while (0)
1282 
1283 #define HANDLE_IDENTIFIER(pattern, get_set) \
1284  do \
1285  { \
1286  curr_lexer->lexer_debug (pattern); \
1287  \
1288  int tok = curr_lexer->previous_token_value (); \
1289  \
1290  if (curr_lexer->whitespace_is_significant () \
1291  && curr_lexer->space_follows_previous_token () \
1292  && ! (tok == '[' || tok == '{' \
1293  || curr_lexer->previous_token_is_binop ())) \
1294  { \
1295  yyless (0); \
1296  curr_lexer->xunput (','); \
1297  } \
1298  else \
1299  { \
1300  if (! curr_lexer->m_looking_at_decl_list \
1301  && curr_lexer->previous_token_may_be_command ()) \
1302  { \
1303  yyless (0); \
1304  curr_lexer->push_start_state (COMMAND_START); \
1305  } \
1306  else \
1307  { \
1308  if (get_set) \
1309  { \
1310  yyless (3); \
1311  curr_lexer->m_filepos.increment_column (3); \
1312  curr_lexer->m_maybe_classdef_get_set_method = false; \
1313  } \
1314  \
1315  return curr_lexer->handle_identifier (); \
1316  } \
1317  } \
1318  } \
1319  while (0)
1320 
1321 static inline bool
1322 is_space_or_tab (char c)
1323 {
1324  return c == ' ' || c == '\t';
1325 }
1326 
1327 static inline bool
1328 is_space_or_tab_or_eol (char c)
1329 {
1330  return c == ' ' || c == '\t' || c == '\n' || c == '\r';
1331 }
1332 
1334 
1335  bool iskeyword (const std::string& s)
1336  {
1337  // Parsing function names like "set.property_name" inside
1338  // classdef-style class definitions is simplified by handling the
1339  // "set" and "get" portions of the names using the same mechanism
1340  // as is used for keywords. However, they are not really keywords
1341  // in the language, so omit them from the list of possible
1342  // keywords. Likewise for "arguments", "enumeration", "events",
1343  // "methods", and "properties".
1344 
1345  // FIXME: The following check is duplicated in Fiskeyword.
1346  return (octave_kw_hash::in_word_set (s.c_str (), s.length ()) != nullptr
1347  && ! (s == "set" || s == "get" || s == "arguments"
1348  || s == "enumeration" || s == "events"
1349  || s == "methods" || s == "properties"));
1350  }
1351 
1352 OCTAVE_END_NAMESPACE(octave)
1353 
1354 #line 1355 "libinterp/parse-tree/lex.cc"
1355 #line 351 "../libinterp/parse-tree/lex.ll"
1356 // Decimal numbers may be real or imaginary but always create
1357 // double precision constants initially. Any conversion to single
1358 // precision happens as part of an expression evaluation in the
1359 // interpreter, not the lexer and parser.
1360 #line 1361 "libinterp/parse-tree/lex.cc"
1361 #line 364 "../libinterp/parse-tree/lex.ll"
1362 // It is possible to specify signedness and size for binary and
1363 // hexadecimal numbers but there is no special syntax for imaginary
1364 // constants. Binary and hexadecimal constants always create integer
1365 // valued constants ({u,}int{8,16,32,64}). If a size is not specified,
1366 // the smallest integer type that will hold the value is used. Negative
1367 // values may be created with a signed size specification by applying
1368 // twos-complement conversion (for example, 0xffs8 produces an 8-bit
1369 // signed integer equal to -1 and 0b10000000s8 produces an 8-bit signed
1370 // integer equal to -128).
1371 #line 1372 "libinterp/parse-tree/lex.cc"
1372 #line 1373 "libinterp/parse-tree/lex.cc"
1373 
1374 #define INITIAL 0
1375 #define COMMAND_START 1
1376 #define MATRIX_START 2
1377 #define INPUT_FILE_START 3
1378 #define BLOCK_COMMENT_START 4
1379 #define LINE_COMMENT_START 5
1380 #define DQ_STRING_START 6
1381 #define SQ_STRING_START 7
1382 #define FQ_IDENT_START 8
1383 
1384 #ifndef YY_NO_UNISTD_H
1385 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1386  * down here because we want the user's section 1 to have been scanned first.
1387  * The user has a chance to override it with an option.
1388  */
1389 #include <unistd.h>
1390 #endif
1391 
1392 #ifndef YY_EXTRA_TYPE
1393 #define YY_EXTRA_TYPE void *
1394 #endif
1395 
1396 /* Holds the entire state of the reentrant scanner. */
1397 struct yyguts_t
1398  {
1399 
1400  /* User-defined. Not touched by flex. */
1401  YY_EXTRA_TYPE yyextra_r;
1402 
1403  /* The rest are the same as the globals declared in the non-reentrant scanner. */
1404  FILE *yyin_r, *yyout_r;
1405  size_t yy_buffer_stack_top; /**< index of top of stack. */
1406  size_t yy_buffer_stack_max; /**< capacity of stack. */
1407  YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1408  char yy_hold_char;
1409  int yy_n_chars;
1410  int yyleng_r;
1411  char *yy_c_buf_p;
1412  int yy_init;
1413  int yy_start;
1414  int yy_did_buffer_switch_on_eof;
1415  int yy_start_stack_ptr;
1416  int yy_start_stack_depth;
1417  int *yy_start_stack;
1418  yy_state_type yy_last_accepting_state;
1419  char* yy_last_accepting_cpos;
1420 
1421  int yylineno_r;
1422  int yy_flex_debug_r;
1423 
1424  char *yytext_r;
1425  int yy_more_flag;
1426  int yy_more_len;
1427 
1428  YYSTYPE * yylval_r;
1429 
1430  }; /* end struct yyguts_t */
1431 
1432 static int yy_init_globals ( yyscan_t yyscanner );
1433 
1434  /* This must go here because YYSTYPE and YYLTYPE are included
1435  * from bison output in section 1.*/
1436  # define yylval yyg->yylval_r
1437 
1438 int yylex_init (yyscan_t* scanner);
1439 
1440 int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
1441 
1442 /* Accessor methods to globals.
1443  These are made visible to non-reentrant scanners for convenience. */
1444 
1445 int yylex_destroy ( yyscan_t yyscanner );
1446 
1447 int yyget_debug ( yyscan_t yyscanner );
1448 
1449 void yyset_debug ( int debug_flag , yyscan_t yyscanner );
1450 
1451 YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
1452 
1453 void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
1454 
1455 FILE *yyget_in ( yyscan_t yyscanner );
1456 
1457 void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
1458 
1459 FILE *yyget_out ( yyscan_t yyscanner );
1460 
1461 void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
1462 
1463  int yyget_leng ( yyscan_t yyscanner );
1464 
1465 char *yyget_text ( yyscan_t yyscanner );
1466 
1467 int yyget_lineno ( yyscan_t yyscanner );
1468 
1469 void yyset_lineno ( int _line_number , yyscan_t yyscanner );
1470 
1471 int yyget_column ( yyscan_t yyscanner );
1472 
1473 void yyset_column ( int _column_no , yyscan_t yyscanner );
1474 
1475 YYSTYPE * yyget_lval ( yyscan_t yyscanner );
1476 
1477 void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
1478 
1479 /* Macros after this point can all be overridden by user definitions in
1480  * section 1.
1481  */
1482 
1483 #ifndef YY_SKIP_YYWRAP
1484 #ifdef __cplusplus
1485 extern "C" int yywrap ( yyscan_t yyscanner );
1486 #else
1487 extern int yywrap ( yyscan_t yyscanner );
1488 #endif
1489 #endif
1490 
1491 #ifndef YY_NO_UNPUT
1492 
1493  static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
1494 
1495 #endif
1496 
1497 #ifndef yytext_ptr
1498 static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
1499 #endif
1500 
1501 #ifdef YY_NEED_STRLEN
1502 static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
1503 #endif
1504 
1505 #ifndef YY_NO_INPUT
1506 #ifdef __cplusplus
1507 static int yyinput ( yyscan_t yyscanner );
1508 #else
1509 static int input ( yyscan_t yyscanner );
1510 #endif
1511 
1512 #endif
1513 
1514 /* Amount of stuff to slurp up with each read. */
1515 #ifndef YY_READ_BUF_SIZE
1516 #ifdef __ia64__
1517 /* On IA-64, the buffer size is 16k, not 8k */
1518 #define YY_READ_BUF_SIZE 16384
1519 #else
1520 #define YY_READ_BUF_SIZE 8192
1521 #endif /* __ia64__ */
1522 #endif
1523 
1524 /* Copy whatever the last rule matched to the standard output. */
1525 #ifndef ECHO
1526 /* This used to be an fputs(), but since the string might contain NUL's,
1527  * we now use fwrite().
1528  */
1529 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1530 #endif
1531 
1532 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1533  * is returned in "result".
1534  */
1535 #ifndef YY_INPUT
1536 #define YY_INPUT(buf,result,max_size) \
1537  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1538  { \
1539  int c = '*'; \
1540  int n; \
1541  for ( n = 0; n < max_size && \
1542  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1543  buf[n] = (char) c; \
1544  if ( c == '\n' ) \
1545  buf[n++] = (char) c; \
1546  if ( c == EOF && ferror( yyin ) ) \
1547  YY_FATAL_ERROR( "input in flex scanner failed" ); \
1548  result = n; \
1549  } \
1550  else \
1551  { \
1552  errno=0; \
1553  while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1554  { \
1555  if( errno != EINTR) \
1556  { \
1557  YY_FATAL_ERROR( "input in flex scanner failed" ); \
1558  break; \
1559  } \
1560  errno=0; \
1561  clearerr(yyin); \
1562  } \
1563  }\
1564 \
1565 
1566 #endif
1567 
1568 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1569  * we don't want an extra ';' after the "return" because that will cause
1570  * some compilers to complain about unreachable statements.
1571  */
1572 #ifndef yyterminate
1573 #define yyterminate() return YY_NULL
1574 #endif
1575 
1576 /* Number of entries by which start-condition stack grows. */
1577 #ifndef YY_START_STACK_INCR
1578 #define YY_START_STACK_INCR 25
1579 #endif
1580 
1581 /* Report a fatal error. */
1582 #ifndef YY_FATAL_ERROR
1583 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1584 #endif
1585 
1586 /* end tables serialization structures and prototypes */
1587 
1588 /* Default declaration of generated scanner - a define so the user can
1589  * easily add parameters.
1590  */
1591 #ifndef YY_DECL
1592 #define YY_DECL_IS_OURS 1
1593 
1594 extern int yylex \
1595  (YYSTYPE * yylval_param , yyscan_t yyscanner);
1596 
1597 #define YY_DECL int yylex \
1598  (YYSTYPE * yylval_param , yyscan_t yyscanner)
1599 #endif /* !YY_DECL */
1600 
1601 /* Code executed at the beginning of each rule, after yytext and yyleng
1602  * have been set up.
1603  */
1604 #ifndef YY_USER_ACTION
1605 #define YY_USER_ACTION
1606 #endif
1607 
1608 /* Code executed at the end of each rule. */
1609 #ifndef YY_BREAK
1610 #define YY_BREAK /*LINTED*/break;
1611 #endif
1612 
1613 #define YY_RULE_SETUP \
1614  if ( yyleng > 0 ) \
1615  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1616  (yytext[yyleng - 1] == '\n'); \
1617  YY_USER_ACTION
1618 
1619 /** The main scanner function which does all the work.
1620  */
1622 {
1623  yy_state_type yy_current_state;
1624  char *yy_cp, *yy_bp;
1625  int yy_act;
1626  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1627 
1628  yylval = yylval_param;
1629 
1630  if ( !yyg->yy_init )
1631  {
1632  yyg->yy_init = 1;
1633 
1634 #ifdef YY_USER_INIT
1635  YY_USER_INIT;
1636 #endif
1637 
1638  if ( ! yyg->yy_start )
1639  yyg->yy_start = 1; /* first start state */
1640 
1641  if ( ! yyin )
1642  yyin = stdin;
1643 
1644  if ( ! yyout )
1645  yyout = stdout;
1646 
1647  if ( ! YY_CURRENT_BUFFER ) {
1648  yyensure_buffer_stack (yyscanner);
1650  yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1651  }
1652 
1653  yy_load_buffer_state( yyscanner );
1654  }
1655 
1656  {
1657 #line 384 "../libinterp/parse-tree/lex.ll"
1658 
1659 
1660 
1661 #line 388 "../libinterp/parse-tree/lex.ll"
1662 // Make script and function files start with an invalid token. This makes
1663 // the parser go down a special path.
1664 
1665 
1666 #line 1667 "libinterp/parse-tree/lex.cc"
1667 
1668  while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1669  {
1670  yy_cp = yyg->yy_c_buf_p;
1671 
1672  /* Support of yytext. */
1673  *yy_cp = yyg->yy_hold_char;
1674 
1675  /* yy_bp points to the position in yy_ch_buf of the start of
1676  * the current run.
1677  */
1678  yy_bp = yy_cp;
1679 
1680  yy_current_state = yyg->yy_start;
1681  yy_current_state += YY_AT_BOL();
1682 yy_match:
1683  do
1684  {
1685  YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1686  if ( yy_accept[yy_current_state] )
1687  {
1688  yyg->yy_last_accepting_state = yy_current_state;
1689  yyg->yy_last_accepting_cpos = yy_cp;
1690  }
1691  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1692  {
1693  yy_current_state = (int) yy_def[yy_current_state];
1694  if ( yy_current_state >= 290 )
1695  yy_c = yy_meta[yy_c];
1696  }
1697  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1698  ++yy_cp;
1699  }
1700  while ( yy_base[yy_current_state] != 1235 );
1701 
1702 yy_find_action:
1703  yy_act = yy_accept[yy_current_state];
1704  if ( yy_act == 0 )
1705  { /* have to back up */
1706  yy_cp = yyg->yy_last_accepting_cpos;
1707  yy_current_state = yyg->yy_last_accepting_state;
1708  yy_act = yy_accept[yy_current_state];
1709  }
1710 
1712 
1713 do_action: /* This label is used only to access EOF actions. */
1714 
1715  switch ( yy_act )
1716  { /* beginning of action switch */
1717  case 0: /* must back up */
1718  /* undo the effects of YY_DO_BEFORE_ACTION */
1719  *yy_cp = yyg->yy_hold_char;
1720  yy_cp = yyg->yy_last_accepting_cpos;
1721  yy_current_state = yyg->yy_last_accepting_state;
1722  goto yy_find_action;
1723 
1724 case 1:
1725 /* rule 1 can match eol */
1727 #line 392 "../libinterp/parse-tree/lex.ll"
1728 {
1729  curr_lexer->lexer_debug ("<INPUT_FILE_START>{ANY_INCLUDING_NL}");
1730 
1731  curr_lexer->xunput (yytext[0]);
1732 
1733  // May be reset later if we see "function" or "classdef" appears
1734  // as the first token.
1735  curr_lexer->m_reading_script_file = true;
1736 
1737  curr_lexer->pop_start_state ();
1738 
1739  return curr_lexer->show_token (INPUT_FILE);
1740  }
1741  YY_BREAK
1743 #line 406 "../libinterp/parse-tree/lex.ll"
1744 {
1745  curr_lexer->lexer_debug ("<INPUT_FILE_START><<EOF>>");
1746 
1747  // May be reset later if we see "function" or "classdef" appears
1748  // as the first token.
1749  curr_lexer->m_reading_script_file = true;
1750 
1751  curr_lexer->pop_start_state ();
1752 
1753  return curr_lexer->show_token (INPUT_FILE);
1754  }
1755  YY_BREAK
1756 
1757 // Help and other command-style functions.
1758 
1759 
1760 // Commands can be continued on a second line using the ellipsis.
1761 // If an argument is in construction, it is completed.
1762 
1763 case 2:
1764 /* rule 2 can match eol */
1766 #line 427 "../libinterp/parse-tree/lex.ll"
1767 {
1768  curr_lexer->lexer_debug ("<COMMAND_START>(\\.\\.\\.){ANY_EXCEPT_NL}*{NL}");
1769 
1770  if (! curr_lexer->m_string_text.empty ())
1771  {
1772  yyless (0);
1773  curr_lexer->m_tok_end = curr_lexer->m_filepos;
1774  return curr_lexer->finish_command_arg ();
1775  }
1776 
1778  }
1779  YY_BREAK
1780 
1781 // Commands normally end at the end of a line or a semicolon.
1782 
1783 case 3:
1784 /* rule 3 can match eol */
1786 #line 444 "../libinterp/parse-tree/lex.ll"
1787 {
1788  curr_lexer->lexer_debug ("<COMMAND_START>({CCHAR}{ANY_EXCEPT_NL}*)?{NL}");
1789 
1790  if (! curr_lexer->m_string_text.empty ())
1791  {
1792  yyless (0);
1793  curr_lexer->m_tok_end = curr_lexer->m_filepos;
1794  return curr_lexer->finish_command_arg ();
1795  }
1796 
1797  curr_lexer->update_token_positions (yyleng);
1798 
1799  curr_lexer->m_filepos.next_line ();
1800  curr_lexer->m_looking_for_object_index = false;
1801  curr_lexer->pop_start_state ();
1802  curr_lexer->m_comment_uses_hash_char = yytext[0] == '#';
1803  curr_lexer->finish_comment (octave::comment_elt::end_of_line);
1804 
1805  return curr_lexer->handle_token ('\n');
1806  }
1807  YY_BREAK
1808 case 4:
1810 #line 465 "../libinterp/parse-tree/lex.ll"
1811 {
1812  curr_lexer->lexer_debug ("<COMMAND_START>[\\,\\;]");
1813 
1814  if (yytext[0] != ',' || curr_lexer->m_command_arg_paren_count == 0)
1815  {
1816  if (! curr_lexer->m_string_text.empty ())
1817  {
1818  yyless (0);
1819  curr_lexer->m_tok_end = curr_lexer->m_filepos;
1820  return curr_lexer->finish_command_arg ();
1821  }
1822 
1823  curr_lexer->update_token_positions (yyleng);
1824 
1825  curr_lexer->m_looking_for_object_index = false;
1826  curr_lexer->m_at_beginning_of_statement = true;
1827  curr_lexer->pop_start_state ();
1828 
1829  return curr_lexer->handle_token (yytext[0]);
1830  }
1831  else
1832  {
1833  curr_lexer->m_string_text += yytext;
1834  curr_lexer->m_filepos.increment_column (yyleng);
1835  }
1836  }
1837  YY_BREAK
1838 
1839 // Unbalanced parentheses serve as pseudo-quotes: they are included in
1840 // the final argument string, but they cause parentheses and quotes to
1841 // be slurped into that argument as well.
1842 
1843 case 5:
1845 #line 498 "../libinterp/parse-tree/lex.ll"
1846 {
1847  curr_lexer->lexer_debug ("<COMMAND_START>[\\(\\[\\{]+");
1848 
1849  curr_lexer->m_command_arg_paren_count += yyleng;
1850  curr_lexer->m_string_text += yytext;
1851  curr_lexer->m_filepos.increment_column (yyleng);
1852  }
1853  YY_BREAK
1854 case 6:
1856 #line 506 "../libinterp/parse-tree/lex.ll"
1857 {
1858  curr_lexer->lexer_debug ("<COMMAND_START>[\\)\\]\\}]+");
1859 
1860  curr_lexer->m_command_arg_paren_count -= yyleng;
1861  curr_lexer->m_string_text += yytext;
1862  curr_lexer->m_filepos.increment_column (yyleng);
1863 }
1864  YY_BREAK
1865 
1866 // Handle quoted strings. Quoted strings that are not separated by
1867 // whitespace from other argument text are combined with that previous
1868 // text. For instance,
1869 //
1870 // command 'text1'"text2"
1871 //
1872 // has a single argument text1text2, not two separate arguments.
1873 // That's why we must test to see if we are in command argument mode
1874 // when processing the end of a string.
1875 
1876 case 7:
1878 #line 526 "../libinterp/parse-tree/lex.ll"
1879 {
1880  curr_lexer->lexer_debug ("<COMMAND_START>[\\\"\\']");
1881 
1882  if (curr_lexer->m_command_arg_paren_count == 0)
1883  curr_lexer->begin_string (yytext[0] == '"'
1885  else
1886  curr_lexer->m_string_text += yytext;
1887 
1888  curr_lexer->m_filepos.increment_column (yyleng);
1889  }
1890  YY_BREAK
1891 
1892 // In standard command argument processing, whitespace separates
1893 // arguments. In the presence of unbalanced parentheses, it is
1894 // incorporated into the argument.
1895 
1896 case 8:
1898 #line 544 "../libinterp/parse-tree/lex.ll"
1899 {
1900  curr_lexer->lexer_debug ("<COMMAND_START>{S}*");
1901 
1902  if (curr_lexer->m_command_arg_paren_count == 0)
1903  {
1904  if (! curr_lexer->m_string_text.empty ())
1905  {
1906  yyless (0);
1907  curr_lexer->m_tok_end = curr_lexer->m_filepos;
1908  return curr_lexer->finish_command_arg ();
1909  }
1910  }
1911  else
1912  curr_lexer->m_string_text += yytext;
1913 
1914  curr_lexer->m_filepos.increment_column (yyleng);
1915  }
1916  YY_BREAK
1917 
1918 // Everything else is slurped into the command arguments.
1919 
1920 case 9:
1922 #line 566 "../libinterp/parse-tree/lex.ll"
1923 {
1924  curr_lexer->lexer_debug ("<COMMAND_START>([\\.]|[^#% \\t\\r\\n\\.\\,\\;\\\"\\'\\(\\[\\{\\}\\]\\)]*");
1925 
1926  curr_lexer->m_string_text += yytext;
1927  curr_lexer->m_filepos.increment_column (yyleng);
1928  }
1929  YY_BREAK
1930 
1931 // Whitespace inside matrix lists.
1932 
1933 case 10:
1935 #line 577 "../libinterp/parse-tree/lex.ll"
1936 {
1937  curr_lexer->lexer_debug ("<MATRIX_START>{S}*");
1938 
1939  curr_lexer->m_filepos.increment_column (yyleng);
1940 
1941  curr_lexer->mark_previous_token_trailing_space ();
1942  }
1943  YY_BREAK
1944 case 11:
1945 /* rule 11 can match eol */
1947 #line 585 "../libinterp/parse-tree/lex.ll"
1948 {
1949  curr_lexer->lexer_debug ("<MATRIX_START>{NL}");
1950 
1951  curr_lexer->m_filepos.next_line ();
1952 
1953  if (curr_lexer->m_nesting_level.is_paren ())
1954  curr_lexer->warn_language_extension ("bare newline inside parentheses");
1955  else
1956  {
1957  int tok = curr_lexer->previous_token_value ();
1958 
1959  if (! (tok == ';' || tok == '[' || tok == '{'))
1960  curr_lexer->xunput (';');
1961  }
1962  }
1963  YY_BREAK
1964 
1965 // Continuation lines in matrix constants are handled as whitespace.
1966 // Allow arbitrary text after the continuation marker.
1967 
1968 case 12:
1969 /* rule 12 can match eol */
1971 #line 606 "../libinterp/parse-tree/lex.ll"
1972 {
1973  curr_lexer->lexer_debug ("<MATRIX_START>\\.\\.\\.{ANY_EXCEPT_NL}*{NL}");
1974 
1975  curr_lexer->handle_continuation ();
1976 
1977  // Even if there wasn't a space before or after the continuation
1978  // marker, treat the continuation as if it were. But since it will
1979  // be transformed to a separator later anyway, there's no need to
1980  // actually unput a space on the input stream.
1981 
1982  curr_lexer->mark_previous_token_trailing_space ();
1983  }
1984  YY_BREAK
1985 
1986 // For this and the next two rules, we're looking at ']', and we
1987 // need to know if the next token is '=' or '=='.
1988 //
1989 // It would have been so much easier if the delimiters were simply
1990 // different for the expression on the left hand side of the equals
1991 // operator.
1992 //
1993 // It's also a pain in the ass to decide whether to insert a comma
1994 // after seeing a ']' character...
1995 
1996 // FIXME: we need to handle block comments here.
1997 
1998 case 13:
2000 #line 633 "../libinterp/parse-tree/lex.ll"
2001 {
2002  curr_lexer->lexer_debug ("<MATRIX_START>\\]");
2003 
2004  curr_lexer->update_token_positions (yyleng);
2005  return curr_lexer->handle_close_bracket (']');
2006  }
2007  YY_BREAK
2008 
2009 // FIXME: we need to handle block comments here.
2010 
2011 case 14:
2013 #line 644 "../libinterp/parse-tree/lex.ll"
2014 {
2015  curr_lexer->lexer_debug ("<MATRIX_START>\\}*");
2016 
2017  curr_lexer->update_token_positions (yyleng);
2018  return curr_lexer->handle_close_bracket ('}');
2019  }
2020  YY_BREAK
2021 case 15:
2023 #line 651 "../libinterp/parse-tree/lex.ll"
2024 {
2025  curr_lexer->lexer_debug ("\\[");
2026 
2027  bool unput_comma = false;
2028 
2029  if (curr_lexer->whitespace_is_significant ()
2030  && curr_lexer->space_follows_previous_token ())
2031  {
2032  int tok = curr_lexer->previous_token_value ();
2033 
2034  if (! (tok == '[' || tok == '{'
2035  || curr_lexer->previous_token_is_binop ()))
2036  unput_comma = true;
2037  }
2038 
2039  if (unput_comma)
2040  {
2041  yyless (0);
2042  curr_lexer->xunput (',');
2043  }
2044  else
2045  {
2046  curr_lexer->update_token_positions (yyleng);
2047 
2048  curr_lexer->m_nesting_level.bracket ();
2049 
2050  curr_lexer->m_looking_at_object_index.push_front (false);
2051 
2052  curr_lexer->m_looking_for_object_index = false;
2053  curr_lexer->m_at_beginning_of_statement = false;
2054 
2055  if (curr_lexer->m_defining_fcn
2056  && ! curr_lexer->m_parsed_function_name.top ())
2057  curr_lexer->m_looking_at_return_list = true;
2058  else
2059  curr_lexer->m_looking_at_matrix_or_assign_lhs = true;
2060 
2061  curr_lexer->m_bracketflag++;
2062 
2063  curr_lexer->push_start_state (MATRIX_START);
2064 
2065  return curr_lexer->count_token ('[');
2066  }
2067  }
2068  YY_BREAK
2069 case 16:
2071 #line 696 "../libinterp/parse-tree/lex.ll"
2072 {
2073  curr_lexer->lexer_debug ("\\]");
2074 
2075  curr_lexer->update_token_positions (yyleng);
2076 
2077  curr_lexer->m_nesting_level.remove ();
2078 
2079  curr_lexer->m_looking_at_object_index.pop_front ();
2080 
2081  curr_lexer->m_looking_for_object_index = true;
2082  curr_lexer->m_at_beginning_of_statement = false;
2083 
2084  return curr_lexer->handle_token (']');
2085  }
2086  YY_BREAK
2087 
2088 // Gobble comments. Both BLOCK_COMMENT_START and LINE_COMMENT_START
2089 // are exclusive start states. We try to grab a continuous series of
2090 // line-oriented comments as a single collection of comments.
2091 
2092 
2093 // Start of a block comment. Since comment start states are exclusive,
2094 // this pattern will not match a block comment that immediately follows
2095 // a line-oriented comment. All we need to do is push the matched text
2096 // back on the input stream and push the new start state.
2097 
2098 case 17:
2099 /* rule 17 can match eol */
2101 #line 724 "../libinterp/parse-tree/lex.ll"
2102 {
2103  curr_lexer->lexer_debug ("^{S}*{CCHAR}\\{{S}*{NL}");
2104 
2105  yyless (0);
2106 
2107  curr_lexer->push_start_state (BLOCK_COMMENT_START);
2108  }
2109  YY_BREAK
2110 case 18:
2111 /* rule 18 can match eol */
2113 #line 732 "../libinterp/parse-tree/lex.ll"
2114 {
2115  curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>^{S}*{CCHAR}\\{{S}*{NL}");
2116 
2117  curr_lexer->m_filepos.next_line ();
2118 
2119  if (curr_lexer->m_block_comment_nesting_level)
2120  curr_lexer->m_comment_text = "\n";
2121  else
2122  curr_lexer->check_comment_for_hash_char (yytext, yyleng);
2123 
2124  curr_lexer->m_block_comment_nesting_level++;
2125 
2126  HANDLE_EOB_OR_EOF (-1);
2127  }
2128  YY_BREAK
2129 
2130 // End of a block comment. If this block comment is nested inside
2131 // another, wait for the outermost block comment to be closed before
2132 // storing the comment.
2133 
2134 // NOTE: This pattern must appear before the one below. Both may match
2135 // the same text and this one should take precedence over the one that
2136 // follows.
2137 
2138 case 19:
2139 /* rule 19 can match eol */
2141 #line 757 "../libinterp/parse-tree/lex.ll"
2142 {
2143  curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>^{S}*{CCHAR}\\}{S}*{NL}");
2144 
2145  curr_lexer->m_filepos.next_line ();
2146 
2147  if (curr_lexer->m_block_comment_nesting_level > 1)
2148  curr_lexer->m_comment_text = "\n";
2149  else
2150  {
2151  curr_lexer->check_comment_for_hash_char (yytext, yyleng);
2152  curr_lexer->finish_comment (octave::comment_elt::block);
2153  }
2154 
2155  curr_lexer->m_block_comment_nesting_level--;
2156 
2157  if (curr_lexer->m_block_comment_nesting_level == 0)
2158  {
2159  curr_lexer->pop_start_state ();
2160 
2161  if (curr_lexer->pending_token_count () > 0)
2162  HANDLE_EOB_OR_EOF (-1);
2163  else
2164  HANDLE_EOB_OR_EOF (-2);
2165  }
2166  else
2167  HANDLE_EOB_OR_EOF (-1);
2168  }
2169  YY_BREAK
2170 
2171 // Body of a block comment.
2172 
2173 case 20:
2174 /* rule 20 can match eol */
2176 #line 789 "../libinterp/parse-tree/lex.ll"
2177 {
2178  curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>{ANY_EXCEPT_NL}*{NL}");
2179 
2180  curr_lexer->m_filepos.next_line ();
2181  curr_lexer->m_comment_text += yytext;
2182 
2183  HANDLE_EOB_OR_EOF (-1);
2184  }
2185  YY_BREAK
2186 
2187 // Full-line or end-of-line comment.
2188 
2189 case 21:
2190 /* rule 21 can match eol */
2192 #line 802 "../libinterp/parse-tree/lex.ll"
2193 {
2194  curr_lexer->lexer_debug ("{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}");
2195 
2196  curr_lexer->push_start_state (LINE_COMMENT_START);
2197  yyless (0);
2198  }
2199  YY_BREAK
2200 
2201 // Beginning of a block comment while we are looking at a series of
2202 // line-oriented comments. Finish previous comment, push current
2203 // text back on input stream, and switch start states.
2204 
2205 // NOTE: This pattern must appear before the one below. Both may match
2206 // the same text and this one should take precedence over the one that
2207 // follows.
2208 
2209 case 22:
2210 /* rule 22 can match eol */
2212 #line 819 "../libinterp/parse-tree/lex.ll"
2213 {
2214  curr_lexer->lexer_debug ("<LINE_COMMENT_START>^{S}*{CCHAR}\\{{S}*{NL}");
2215 
2216  if (! curr_lexer->m_comment_text.empty ())
2217  curr_lexer->finish_comment (octave::comment_elt::full_line);
2218 
2219  curr_lexer->pop_start_state ();
2220  curr_lexer->push_start_state (BLOCK_COMMENT_START);
2221  yyless (0);
2222  }
2223  YY_BREAK
2224 
2225 // Line-oriented comment. If we are at the beginning of a line, this is
2226 // part of a series of full-line comments. Otherwise, this is an end of
2227 // line comment. We don't need to parse the matched text to determine
2228 // whether we are looking at the start of a block comment as that
2229 // pattern is handled above.
2230 
2231 // NOTE: This pattern must appear before the one below. Both may match
2232 // the same text and this one should take precedence over the one that
2233 // follows.
2234 
2235 case 23:
2236 /* rule 23 can match eol */
2238 #line 842 "../libinterp/parse-tree/lex.ll"
2239 {
2240  curr_lexer->lexer_debug ("<LINE_COMMENT_START>{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}");
2241 
2242  // Grab text of comment without leading space or comment
2243  // characters.
2244 
2245  std::size_t i = 0;
2246  while (i < yyleng && is_space_or_tab (yytext[i]))
2247  i++;
2248 
2249  bool have_space = (i > 0);
2250 
2251  bool first = true;
2252 
2253  while (i < yyleng)
2254  {
2255  char c = yytext[i];
2256 
2257  if (c == '#' || c == '%')
2258  {
2259  if (first && c == '#')
2260  {
2261  curr_lexer->m_comment_uses_hash_char = true;
2262  first = false;
2263  }
2264 
2265  i++;
2266  }
2267  else
2268  break;
2269  }
2270 
2271  curr_lexer->m_comment_text += &yytext[i];
2272 
2273  if (curr_lexer->m_filepos.column () == 1)
2274  {
2275  curr_lexer->m_filepos.next_line ();
2276  }
2277  else
2278  {
2279  // End of line comment.
2280 
2281  if (have_space)
2282  curr_lexer->mark_previous_token_trailing_space ();
2283 
2284  curr_lexer->finish_comment (octave::comment_elt::end_of_line);
2285 
2286  curr_lexer->pop_start_state ();
2287 
2288  // Push the newline character back on the input and skip
2289  // incrementing the line count so we don't have to duplicate
2290  // all the possible actions that happen with newlines here.
2291 
2292  curr_lexer->xunput ('\n');
2293 
2294  // The next action should recognize a newline character and set
2295  // the input column back to 1, but we should try to keep the
2296  // input column location accurate anyway, so update here.
2297  curr_lexer->m_filepos.increment_column (yyleng);
2298  }
2299  }
2300  YY_BREAK
2301 
2302 // End of a series of full-line because some other character was
2303 // found on the input stream.
2304 
2305 case 24:
2306 /* rule 24 can match eol */
2308 #line 909 "../libinterp/parse-tree/lex.ll"
2309 {
2310  curr_lexer->lexer_debug ("<LINE_COMMENT_START>{ANY_INCLUDING_NL}");
2311 
2312  if (yytext[0] == '\001')
2313  {
2314  // We are here because we are using the push parser/lexer
2315  // interface and we hit the end of the input buffer or file.
2316  // The special ASCII 1 marker is added to the input by
2317  // push_lexer::fill_flex_buffer.
2318 
2319  if (curr_lexer->pending_token_count () > 0)
2320  {
2321  // We are in the middle of parsing a command, expresison,
2322  // etc., so set the return status so that if we are at the
2323  // end of the buffer we'll continue looking for more input,
2324  // possibly buffering a series of line oriented comments as
2325  // a single block.
2326 
2327  HANDLE_EOB_OR_EOF (-1);
2328  }
2329  else
2330  {
2331  // We are not in the process of parsing a command,
2332  // expression, etc., so end any current sequence of comments
2333  // with this full line comment, pop the start state and
2334  // return as if we have just finished parsing a complete
2335  // statement.
2336 
2337  curr_lexer->finish_comment (octave::comment_elt::full_line);
2338 
2339  curr_lexer->pop_start_state ();
2340 
2341  HANDLE_EOB_OR_EOF (-2);
2342  }
2343  }
2344  else
2345  {
2346  // End any current sequence of comments, pop the start state,
2347  // and unput the pending input character that ended the series
2348  // of comments.
2349 
2350  curr_lexer->finish_comment (octave::comment_elt::full_line);
2351 
2352  curr_lexer->pop_start_state ();
2353 
2354  curr_lexer->xunput (yytext[0]);
2355  }
2356  }
2357  YY_BREAK
2358 
2359 // End of file will also end a series of full-line comments.
2360 
2362 #line 962 "../libinterp/parse-tree/lex.ll"
2363 {
2364  curr_lexer->lexer_debug ("<LINE_COMMENT_START><<EOF>>");
2365 
2366  curr_lexer->finish_comment (octave::comment_elt::full_line);
2367 
2368  curr_lexer->pop_start_state ();
2369  }
2370  YY_BREAK
2371 
2372 // Double-quoted character strings.
2373 
2374 case 25:
2376 #line 974 "../libinterp/parse-tree/lex.ll"
2377 {
2378  curr_lexer->lexer_debug ("<DQ_STRING_START>\\\"\\\"");
2379 
2380  curr_lexer->m_filepos.increment_column (yyleng);
2381  curr_lexer->m_string_text += '"';
2382  }
2383  YY_BREAK
2384 case 26:
2386 #line 981 "../libinterp/parse-tree/lex.ll"
2387 {
2388  curr_lexer->lexer_debug ("<DQ_STRING_START>\\\"");
2389 
2390  // m_tok_beg was set when we started parsing the string.
2391  curr_lexer->m_tok_end = curr_lexer->m_filepos;
2392  curr_lexer->m_filepos.increment_column ();
2393 
2394  curr_lexer->pop_start_state ();
2395 
2396  if (curr_lexer->start_state() != COMMAND_START)
2397  {
2398  curr_lexer->m_looking_for_object_index = true;
2399  curr_lexer->m_at_beginning_of_statement = false;
2400 
2401  curr_lexer->push_token (new octave::token (DQ_STRING,
2402  curr_lexer->m_string_text,
2403  curr_lexer->m_tok_beg,
2404  curr_lexer->m_tok_end));
2405 
2406  curr_lexer->m_string_text = "";
2407 
2408  return curr_lexer->count_token_internal (DQ_STRING);
2409  }
2410  }
2411  YY_BREAK
2412 case 27:
2414 #line 1006 "../libinterp/parse-tree/lex.ll"
2415 {
2416  curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\[0-7]{1,3}");
2417 
2418  curr_lexer->update_token_positions (yyleng);
2419 
2420  unsigned int result;
2421  sscanf (yytext+1, "%o", &result);
2422 
2423  if (result > 0xff)
2424  {
2425  // Use location of octal digits for error token.
2426  octave::token *tok
2427  = new octave::token (LEXICAL_ERROR,
2428  "invalid octal escape sequence in character string",
2429  curr_lexer->m_tok_beg, curr_lexer->m_tok_end);
2430 
2431  curr_lexer->push_token (tok);
2432 
2433  return curr_lexer->count_token_internal (LEXICAL_ERROR);
2434  }
2435  else
2436  curr_lexer->m_string_text += static_cast<unsigned char> (result);
2437  }
2438  YY_BREAK
2439 case 28:
2441 #line 1030 "../libinterp/parse-tree/lex.ll"
2442 {
2443  curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\x[0-9a-fA-F]+");
2444 
2445  curr_lexer->m_filepos.increment_column (yyleng);
2446 
2447  unsigned int result;
2448  sscanf (yytext+2, "%x", &result);
2449 
2450  // Truncate the value silently instead of checking the range like
2451  // we do for octal above. This is to match C/C++ where any number
2452  // of digits is allowed but the value is implementation-defined if
2453  // it exceeds the range of the character type.
2454  curr_lexer->m_string_text += static_cast<unsigned char> (result);
2455  }
2456  YY_BREAK
2457 case 29:
2459 #line 1045 "../libinterp/parse-tree/lex.ll"
2460 {
2461  curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\a\"");
2462 
2463  curr_lexer->m_filepos.increment_column (yyleng);
2464  curr_lexer->m_string_text += '\a';
2465  }
2466  YY_BREAK
2467 case 30:
2469 #line 1052 "../libinterp/parse-tree/lex.ll"
2470 {
2471  curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\b\"");
2472 
2473  curr_lexer->m_filepos.increment_column (yyleng);
2474  curr_lexer->m_string_text += '\b';
2475  }
2476  YY_BREAK
2477 case 31:
2479 #line 1059 "../libinterp/parse-tree/lex.ll"
2480 {
2481  curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\f\"");
2482 
2483  curr_lexer->m_filepos.increment_column (yyleng);
2484  curr_lexer->m_string_text += '\f';
2485  }
2486  YY_BREAK
2487 case 32:
2489 #line 1066 "../libinterp/parse-tree/lex.ll"
2490 {
2491  curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\n\"");
2492 
2493  curr_lexer->m_filepos.increment_column (yyleng);
2494  curr_lexer->m_string_text += '\n';
2495  }
2496  YY_BREAK
2497 case 33:
2499 #line 1073 "../libinterp/parse-tree/lex.ll"
2500 {
2501  curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\r\"");
2502 
2503  curr_lexer->m_filepos.increment_column (yyleng);
2504  curr_lexer->m_string_text += '\r';
2505  }
2506  YY_BREAK
2507 case 34:
2509 #line 1080 "../libinterp/parse-tree/lex.ll"
2510 {
2511  curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\t\"");
2512 
2513  curr_lexer->m_filepos.increment_column (yyleng);
2514  curr_lexer->m_string_text += '\t';
2515  }
2516  YY_BREAK
2517 case 35:
2519 #line 1087 "../libinterp/parse-tree/lex.ll"
2520 {
2521  curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\v\"");
2522 
2523  curr_lexer->m_filepos.increment_column (yyleng);
2524  curr_lexer->m_string_text += '\v';
2525  }
2526  YY_BREAK
2527 case 36:
2528 /* rule 36 can match eol */
2530 #line 1094 "../libinterp/parse-tree/lex.ll"
2531 {
2532  curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{NL}");
2533 
2535  }
2536  YY_BREAK
2537 case 37:
2539 #line 1100 "../libinterp/parse-tree/lex.ll"
2540 {
2541  curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\.");
2542 
2543  curr_lexer->m_filepos.increment_column (yyleng);
2544  curr_lexer->m_string_text += yytext[1];
2545  }
2546  YY_BREAK
2547 case 38:
2549 #line 1107 "../libinterp/parse-tree/lex.ll"
2550 {
2551  curr_lexer->lexer_debug ("<DQ_STRING_START>\\.");
2552 
2553  curr_lexer->m_filepos.increment_column ();
2554  curr_lexer->m_string_text += yytext[0];
2555  }
2556  YY_BREAK
2557 case 39:
2559 #line 1114 "../libinterp/parse-tree/lex.ll"
2560 {
2561  curr_lexer->lexer_debug ("<DQ_STRING_START>[^\\.\\\\\\r\\n\\\"]+");
2562 
2563  curr_lexer->m_filepos.increment_column (yyleng);
2564  curr_lexer->m_string_text += yytext;
2565  }
2566  YY_BREAK
2567 case 40:
2568 /* rule 40 can match eol */
2570 #line 1121 "../libinterp/parse-tree/lex.ll"
2571 {
2572  curr_lexer->lexer_debug ("<DQ_STRING_START>{NL}");
2573 
2574  // Use current file position for error token.
2575  octave::token *tok
2576  = new octave::token (LEXICAL_ERROR,
2577  "unterminated character string constant",
2578  curr_lexer->m_filepos, curr_lexer->m_filepos);
2579 
2580  curr_lexer->push_token (tok);
2581 
2582  curr_lexer->m_filepos.next_line ();
2583 
2584  return curr_lexer->count_token_internal (LEXICAL_ERROR);
2585  }
2586  YY_BREAK
2587 
2588 // Single-quoted character strings.
2589 
2590 case 41:
2592 #line 1141 "../libinterp/parse-tree/lex.ll"
2593 {
2594  curr_lexer->lexer_debug ("<SQ_STRING_START>\\'\\'");
2595 
2596  curr_lexer->m_filepos.increment_column (yyleng);
2597  curr_lexer->m_string_text += '\'';
2598  }
2599  YY_BREAK
2600 case 42:
2602 #line 1148 "../libinterp/parse-tree/lex.ll"
2603 {
2604  curr_lexer->lexer_debug ("<SQ_STRING_START>\\'");
2605 
2606  // m_tok_beg was set when we started parsing the string.
2607  curr_lexer->m_tok_end = curr_lexer->m_filepos;
2608  curr_lexer->m_filepos.increment_column ();
2609 
2610  curr_lexer->pop_start_state ();
2611 
2612  if (curr_lexer->start_state() != COMMAND_START)
2613  {
2614  curr_lexer->m_looking_for_object_index = true;
2615  curr_lexer->m_at_beginning_of_statement = false;
2616 
2617  curr_lexer->push_token (new octave::token (SQ_STRING,
2618  curr_lexer->m_string_text,
2619  curr_lexer->m_tok_beg,
2620  curr_lexer->m_tok_end));
2621 
2622  curr_lexer->m_string_text = "";
2623 
2624  return curr_lexer->count_token_internal (SQ_STRING);
2625  }
2626  }
2627  YY_BREAK
2628 case 43:
2630 #line 1173 "../libinterp/parse-tree/lex.ll"
2631 {
2632  curr_lexer->lexer_debug ("<SQ_STRING_START>[^\\'\\n\\r]+");
2633 
2634  curr_lexer->m_filepos.increment_column (yyleng);
2635  curr_lexer->m_string_text += yytext;
2636  }
2637  YY_BREAK
2638 case 44:
2639 /* rule 44 can match eol */
2641 #line 1180 "../libinterp/parse-tree/lex.ll"
2642 {
2643  curr_lexer->lexer_debug ("<SQ_STRING_START>{NL}");
2644 
2645  // Use current file position for error token.
2646  octave::token *tok
2647  = new octave::token (LEXICAL_ERROR,
2648  "unterminated character string constant",
2649  curr_lexer->m_filepos, curr_lexer->m_filepos);
2650 
2651  curr_lexer->push_token (tok);
2652 
2653  curr_lexer->m_filepos.next_line ();
2654 
2655  return curr_lexer->count_token_internal (LEXICAL_ERROR);
2656  }
2657  YY_BREAK
2658 
2659 // Fully-qualified identifiers (used for classdef).
2660 
2661 case 45:
2663 #line 1200 "../libinterp/parse-tree/lex.ll"
2664 {
2665  curr_lexer->lexer_debug ("<FQ_IDENT_START>{FQIDENT}{S}*");
2666 
2667  curr_lexer->pop_start_state ();
2668 
2669  curr_lexer->update_token_positions (yyleng);
2670 
2671  int id_tok = curr_lexer->handle_fq_identifier ();
2672 
2673  if (id_tok >= 0)
2674  {
2675  curr_lexer->m_looking_for_object_index = true;
2676 
2677  return curr_lexer->count_token_internal (id_tok);
2678  }
2679  }
2680  YY_BREAK
2681 case 46:
2683 #line 1217 "../libinterp/parse-tree/lex.ll"
2684 {
2685  curr_lexer->lexer_debug ("<FQ_IDENT_START>{S}+");
2686 
2687  curr_lexer->m_filepos.increment_column (yyleng);
2688 
2689  curr_lexer->mark_previous_token_trailing_space ();
2690  }
2691  YY_BREAK
2692 case 47:
2693 /* rule 47 can match eol */
2695 #line 1225 "../libinterp/parse-tree/lex.ll"
2696 {
2697  curr_lexer->lexer_debug ("<FQ_IDENT_START>(\\.\\.\\.){ANY_EXCEPT_NL}*{NL}");
2698 
2699  curr_lexer->m_filepos.next_line ();
2700  }
2701  YY_BREAK
2702 case 48:
2703 /* rule 48 can match eol */
2705 #line 1231 "../libinterp/parse-tree/lex.ll"
2706 {
2707  curr_lexer->lexer_debug ("<FQ_IDENT_START>{ANY_INCLUDING_NL}");
2708 
2709  // If input doesn't match FQIDENT, return char and go to previous
2710  // start state.
2711 
2712  yyless (0);
2713  curr_lexer->pop_start_state ();
2714  }
2715  YY_BREAK
2716 case 49:
2718 #line 1241 "../libinterp/parse-tree/lex.ll"
2719 {
2720  HANDLE_NUMBER ("{BINARY_NUMBER}", 2);
2721  }
2722  YY_BREAK
2723 
2724 // Decimal numbers. For expressions that are just digits followed
2725 // directly by an element-by-element operator, don't grab the '.'
2726 // part of the operator as part of the constant (for example, in an
2727 // expression like "13./x").
2728 
2729 case 50:
2730 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
2731 yyg->yy_c_buf_p = yy_cp -= 2;
2732 YY_DO_BEFORE_ACTION; /* set up yytext again */
2733 #line 1253 "../libinterp/parse-tree/lex.ll"
2734 case 51:
2736 #line 1253 "../libinterp/parse-tree/lex.ll"
2737 {
2738  HANDLE_NUMBER ("{DECIMAL_DIGITS}/\\.[\\*/\\\\^\\']|{DECIMAL_NUMBER}", 10);
2739  }
2740  YY_BREAK
2741 case 52:
2743 #line 1257 "../libinterp/parse-tree/lex.ll"
2744 {
2745  HANDLE_NUMBER ("{HEXADECIMAL_NUMBER}", 16);
2746  }
2747  YY_BREAK
2748 
2749 // Eat whitespace. Whitespace inside matrix constants is handled by
2750 // the <MATRIX_START> start state code above.
2751 
2752 case 53:
2754 #line 1266 "../libinterp/parse-tree/lex.ll"
2755 {
2756  curr_lexer->m_filepos.increment_column (yyleng);
2757 
2758  curr_lexer->mark_previous_token_trailing_space ();
2759  }
2760  YY_BREAK
2761 
2762 // Continuation lines. Allow arbitrary text after continuations.
2763 
2764 case 54:
2765 /* rule 54 can match eol */
2767 #line 1276 "../libinterp/parse-tree/lex.ll"
2768 {
2769  curr_lexer->lexer_debug ("\\.\\.\\.{ANY_EXCEPT_NL}*{NL}");
2770 
2771  curr_lexer->handle_continuation ();
2772  }
2773  YY_BREAK
2774 
2775 // Deprecated C preprocessor style continuation markers.
2776 
2777 
2778 // End of file.
2779 
2780 case YY_STATE_EOF(INITIAL):
2787 #line 1291 "../libinterp/parse-tree/lex.ll"
2788 {
2789  return curr_lexer->handle_end_of_input ();
2790  }
2791  YY_BREAK
2792 
2793 // Identifiers.
2794 
2795 // Don't allow get and set to be recognized as keywords if they are
2796 // followed by "(".
2797 
2798 case 55:
2800 #line 1302 "../libinterp/parse-tree/lex.ll"
2801 {
2802  HANDLE_IDENTIFIER ("(set|get){S}*\\(", true);
2803  }
2804  YY_BREAK
2805 case 56:
2807 #line 1306 "../libinterp/parse-tree/lex.ll"
2808 {
2809  HANDLE_IDENTIFIER ("{IDENT}", false);
2810  }
2811  YY_BREAK
2812 
2813 // Superclass method identifiers.
2814 
2815 case 57:
2817 #line 1314 "../libinterp/parse-tree/lex.ll"
2818 {
2819  curr_lexer->lexer_debug ("{FQIDENT}{S}*@{S}*{FQIDENT}");
2820 
2821  if (curr_lexer->previous_token_may_be_command ())
2822  {
2823  yyless (0);
2824  curr_lexer->push_start_state (COMMAND_START);
2825  }
2826  else
2827  {
2828  if (curr_lexer->m_at_beginning_of_statement)
2829  {
2830  std::string txt = yytext;
2831 
2832  std::size_t at_or_dot_pos = txt.find_first_of ("@.");
2833 
2834  if (at_or_dot_pos != std::string::npos)
2835  {
2836  std::size_t spc_pos = txt.find_first_of (" \t");
2837 
2838  if (spc_pos != std::string::npos && spc_pos < at_or_dot_pos)
2839  {
2840  yyless (spc_pos);
2841  curr_lexer->m_filepos.increment_column (spc_pos);
2842 
2843  return curr_lexer->handle_identifier ();
2844  }
2845  }
2846  }
2847 
2848  curr_lexer->m_looking_for_object_index = true;
2849  curr_lexer->m_at_beginning_of_statement = false;
2850 
2851  return curr_lexer->handle_superclass_identifier ();
2852  }
2853  }
2854  YY_BREAK
2855 
2856 // Metaclass query
2857 
2858 case 58:
2860 #line 1355 "../libinterp/parse-tree/lex.ll"
2861 {
2862  curr_lexer->lexer_debug ("\\?{S}*{FQIDENT}");
2863 
2864  if (curr_lexer->previous_token_may_be_command ()
2865  && curr_lexer->space_follows_previous_token ())
2866  {
2867  yyless (0);
2868  curr_lexer->push_start_state (COMMAND_START);
2869  }
2870  else
2871  {
2872  curr_lexer->update_token_positions (yyleng);
2873 
2874  int id_tok = curr_lexer->handle_meta_identifier ();
2875 
2876  if (id_tok >= 0)
2877  {
2878  curr_lexer->m_looking_for_object_index = true;
2879 
2880  return curr_lexer->count_token_internal (id_tok);
2881  }
2882  }
2883  }
2884  YY_BREAK
2885 case 59:
2886 #line 1380 "../libinterp/parse-tree/lex.ll"
2887 case 60:
2889 #line 1380 "../libinterp/parse-tree/lex.ll"
2890 {
2891  curr_lexer->lexer_debug ("\\@|\\@{S}*{FQIDENT}");
2892 
2893  if (curr_lexer->previous_token_may_be_command ()
2894  && curr_lexer->space_follows_previous_token ())
2895  {
2896  yyless (0);
2897  curr_lexer->push_start_state (COMMAND_START);
2898  }
2899  else
2900  {
2901  int tok_val = curr_lexer->previous_token_value ();
2902 
2903  if (curr_lexer->whitespace_is_significant ()
2904  && curr_lexer->space_follows_previous_token ()
2905  && ! (tok_val == '[' || tok_val == '{'
2906  || curr_lexer->previous_token_is_binop ()))
2907  {
2908  yyless (0);
2909  curr_lexer->xunput (',');
2910  }
2911  else
2912  {
2913  curr_lexer->update_token_positions (yyleng);
2914 
2915  curr_lexer->m_at_beginning_of_statement = false;
2916 
2917  std::string ident = yytext;
2918 
2919  if (ident == "@")
2920  {
2921  curr_lexer->m_looking_at_function_handle++;
2922  curr_lexer->m_looking_for_object_index = false;
2923 
2924  return curr_lexer->count_token ('@');
2925  }
2926  else
2927  {
2928  ident = ident.substr (1);
2929  ident.erase (std::remove_if (ident.begin (), ident.end (),
2930  is_space_or_tab), ident.end ());
2931 
2932  octave::token *tok;
2933 
2934  if (octave::iskeyword (ident))
2935  tok = new octave::token (LEXICAL_ERROR,
2936  "function handles may not refer to keywords",
2937  curr_lexer->m_tok_beg,
2938  curr_lexer->m_tok_end);
2939  else
2940  {
2941  curr_lexer->m_looking_for_object_index = true;
2942 
2943  tok = new octave::token (FCN_HANDLE, ident,
2944  curr_lexer->m_tok_beg,
2945  curr_lexer->m_tok_end);
2946  }
2947 
2948  curr_lexer->push_token (tok);
2949 
2950  return curr_lexer->count_token_internal (tok->token_value ());
2951  }
2952  }
2953  }
2954  }
2955  YY_BREAK
2956 
2957 // A new line character. New line characters inside matrix constants
2958 // are handled by the <MATRIX_START> start state code above. If closest
2959 // nesting is inside parentheses, don't return a row separator.
2960 
2961 case 61:
2962 /* rule 61 can match eol */
2964 #line 1452 "../libinterp/parse-tree/lex.ll"
2965 {
2966  curr_lexer->lexer_debug ("{NL}");
2967 
2968  if (curr_lexer->m_nesting_level.is_paren ())
2969  {
2970  curr_lexer->m_filepos.next_line ();
2971 
2972  curr_lexer->m_at_beginning_of_statement = false;
2973  curr_lexer->warn_language_extension
2974  ("bare newline inside parentheses");
2975  }
2976  else if (curr_lexer->m_nesting_level.none ()
2977  || curr_lexer->m_nesting_level.is_anon_fcn_body ())
2978  {
2979  curr_lexer->update_token_positions (yyleng);
2980  curr_lexer->m_filepos.next_line ();
2981 
2982  curr_lexer->m_at_beginning_of_statement = true;
2983 
2984  return curr_lexer->count_token ('\n');
2985  }
2986  else if (curr_lexer->m_nesting_level.is_bracket_or_brace ())
2987  {
2988  curr_lexer->update_token_positions (yyleng);
2989  curr_lexer->m_filepos.next_line ();
2990 
2991  // Use current file position for error token.
2992  octave::token *tok
2993  = new octave::token (LEXICAL_ERROR,
2994  "unexpected internal lexer error",
2995  curr_lexer->m_filepos, curr_lexer->m_filepos);
2996 
2997  curr_lexer->push_token (tok);
2998 
2999  return curr_lexer->count_token_internal (LEXICAL_ERROR);
3000  }
3001  }
3002  YY_BREAK
3003 
3004 // Single quote can either be the beginning of a string or a transpose
3005 // operator.
3006 
3007 case 62:
3009 #line 1495 "../libinterp/parse-tree/lex.ll"
3010 {
3011  curr_lexer->lexer_debug ("'");
3012 
3013  if (curr_lexer->previous_token_may_be_command ()
3014  && curr_lexer->space_follows_previous_token ())
3015  {
3016  curr_lexer->m_filepos.increment_column ();
3017  curr_lexer->push_start_state (COMMAND_START);
3018  curr_lexer->begin_string (SQ_STRING_START);
3019  }
3020  else if (curr_lexer->m_at_beginning_of_statement)
3021  {
3022  curr_lexer->m_filepos.increment_column ();
3023  curr_lexer->begin_string (SQ_STRING_START);
3024  }
3025  else
3026  {
3027  int tok = curr_lexer->previous_token_value ();
3028 
3029  if (curr_lexer->whitespace_is_significant ())
3030  {
3031  if (curr_lexer->space_follows_previous_token ())
3032  {
3033  if (tok == '[' || tok == '{'
3034  || curr_lexer->previous_token_is_binop ())
3035  {
3036  curr_lexer->m_filepos.increment_column ();
3037  curr_lexer->begin_string (SQ_STRING_START);
3038  }
3039  else
3040  {
3041  yyless (0);
3042  curr_lexer->xunput (',');
3043  }
3044  }
3045  else
3046  {
3047  if (tok == '[' || tok == '{'
3048  || curr_lexer->previous_token_is_binop ()
3049  || curr_lexer->previous_token_is_keyword ())
3050  {
3051  curr_lexer->m_filepos.increment_column ();
3052  curr_lexer->begin_string (SQ_STRING_START);
3053  }
3054  else
3055  {
3056  curr_lexer->m_filepos.increment_column ();
3057  return curr_lexer->count_token (HERMITIAN);
3058  }
3059  }
3060  }
3061  else
3062  {
3063  if (! tok || tok == '[' || tok == '{' || tok == '('
3064  || curr_lexer->previous_token_is_binop ()
3065  || curr_lexer->previous_token_is_keyword ())
3066  {
3067  curr_lexer->m_filepos.increment_column ();
3068  curr_lexer->begin_string (SQ_STRING_START);
3069  }
3070  else
3071  {
3072  curr_lexer->m_filepos.increment_column ();
3073  return curr_lexer->count_token (HERMITIAN);
3074  }
3075  }
3076  }
3077  }
3078  YY_BREAK
3079 
3080 // Double quotes always begin strings.
3081 
3082 case 63:
3084 #line 1568 "../libinterp/parse-tree/lex.ll"
3085 {
3086  curr_lexer->lexer_debug ("\\\"");
3087 
3088  if (curr_lexer->previous_token_may_be_command ()
3089  && curr_lexer->space_follows_previous_token ())
3090  {
3091  curr_lexer->m_filepos.increment_column ();
3092  curr_lexer->push_start_state (COMMAND_START);
3093  curr_lexer->begin_string (DQ_STRING_START);
3094  }
3095  else
3096  {
3097  int tok = curr_lexer->previous_token_value ();
3098 
3099  if (curr_lexer->whitespace_is_significant ())
3100  {
3101  if (curr_lexer->space_follows_previous_token ())
3102  {
3103  if (tok == '[' || tok == '{'
3104  || curr_lexer->previous_token_is_binop ())
3105  {
3106  curr_lexer->m_filepos.increment_column ();
3107  curr_lexer->begin_string (DQ_STRING_START);
3108  }
3109  else
3110  {
3111  yyless (0);
3112  curr_lexer->xunput (',');
3113  }
3114  }
3115  else
3116  {
3117  curr_lexer->m_filepos.increment_column ();
3118  curr_lexer->begin_string (DQ_STRING_START);
3119  }
3120  }
3121  else
3122  {
3123  curr_lexer->m_filepos.increment_column ();
3124  curr_lexer->begin_string (DQ_STRING_START);
3125  }
3126  }
3127  }
3128  YY_BREAK
3129 
3130 // Other operators.
3131 
3132 case 64:
3134 #line 1616 "../libinterp/parse-tree/lex.ll"
3135 { CMD_OR_OP (":", ':', true); }
3136  YY_BREAK
3137 case 65:
3139 #line 1617 "../libinterp/parse-tree/lex.ll"
3140 { CMD_OR_OP (".*", EMUL, true); }
3141  YY_BREAK
3142 case 66:
3144 #line 1618 "../libinterp/parse-tree/lex.ll"
3145 { CMD_OR_OP ("./", EDIV, true); }
3146  YY_BREAK
3147 case 67:
3149 #line 1619 "../libinterp/parse-tree/lex.ll"
3150 { CMD_OR_OP (".\\", ELEFTDIV, true); }
3151  YY_BREAK
3152 case 68:
3154 #line 1620 "../libinterp/parse-tree/lex.ll"
3155 { CMD_OR_OP (".^", EPOW, true); }
3156  YY_BREAK
3157 case 69:
3159 #line 1621 "../libinterp/parse-tree/lex.ll"
3160 { CMD_OR_OP ("<=", EXPR_LE, true); }
3161  YY_BREAK
3162 case 70:
3164 #line 1622 "../libinterp/parse-tree/lex.ll"
3165 { CMD_OR_OP ("==", EXPR_EQ, true); }
3166  YY_BREAK
3167 case 71:
3169 #line 1623 "../libinterp/parse-tree/lex.ll"
3170 { CMD_OR_OP ("!=", EXPR_NE, false); }
3171  YY_BREAK
3172 case 72:
3174 #line 1624 "../libinterp/parse-tree/lex.ll"
3175 { CMD_OR_OP ("~=", EXPR_NE, true); }
3176  YY_BREAK
3177 case 73:
3179 #line 1625 "../libinterp/parse-tree/lex.ll"
3180 { CMD_OR_OP (">=", EXPR_GE, true); }
3181  YY_BREAK
3182 case 74:
3184 #line 1626 "../libinterp/parse-tree/lex.ll"
3185 { CMD_OR_OP ("&", EXPR_AND, true); }
3186  YY_BREAK
3187 case 75:
3189 #line 1627 "../libinterp/parse-tree/lex.ll"
3190 { CMD_OR_OP ("|", EXPR_OR, true); }
3191  YY_BREAK
3192 case 76:
3194 #line 1628 "../libinterp/parse-tree/lex.ll"
3195 { CMD_OR_OP ("<", EXPR_LT, true); }
3196  YY_BREAK
3197 case 77:
3199 #line 1629 "../libinterp/parse-tree/lex.ll"
3200 { CMD_OR_OP (">", EXPR_GT, true); }
3201  YY_BREAK
3202 case 78:
3204 #line 1630 "../libinterp/parse-tree/lex.ll"
3205 { CMD_OR_OP ("*", '*', true); }
3206  YY_BREAK
3207 case 79:
3209 #line 1631 "../libinterp/parse-tree/lex.ll"
3210 { CMD_OR_OP ("/", '/', true); }
3211  YY_BREAK
3212 
3213 // In Matlab, '\' may also trigger command syntax.
3214 
3215 case 80:
3217 #line 1637 "../libinterp/parse-tree/lex.ll"
3218 {
3219  // FIXME: After backslash is no longer handled as a line
3220  // continuation marker outside of character strings, this
3221  // action may be replaced with
3222  //
3223  // CMD_OR_OP ("\\", LEFTDIV, true);
3224 
3225  curr_lexer->lexer_debug ("\\");
3226 
3227  return curr_lexer->handle_op (LEFTDIV);
3228  }
3229  YY_BREAK
3230 case 81:
3232 #line 1649 "../libinterp/parse-tree/lex.ll"
3233 { CMD_OR_OP ("^", POW, true); }
3234  YY_BREAK
3235 case 82:
3237 #line 1650 "../libinterp/parse-tree/lex.ll"
3238 { CMD_OR_OP ("&&", EXPR_AND_AND, true); }
3239  YY_BREAK
3240 case 83:
3242 #line 1651 "../libinterp/parse-tree/lex.ll"
3243 { CMD_OR_OP ("||", EXPR_OR_OR, true); }
3244  YY_BREAK
3245 case 84:
3247 #line 1653 "../libinterp/parse-tree/lex.ll"
3248 {
3249  curr_lexer->lexer_debug (";");
3250 
3251  bool at_beginning_of_statement
3252  = (! (curr_lexer->whitespace_is_significant ()
3253  || curr_lexer->m_looking_at_object_index.front ()));
3254 
3255  return curr_lexer->handle_op (';', at_beginning_of_statement);
3256  }
3257  YY_BREAK
3258 case 85:
3260 #line 1663 "../libinterp/parse-tree/lex.ll"
3261 { CMD_OR_UNARY_OP ("+", '+', true); }
3262  YY_BREAK
3263 case 86:
3265 #line 1664 "../libinterp/parse-tree/lex.ll"
3266 { CMD_OR_UNARY_OP ("-", '-', true); }
3267  YY_BREAK
3268 case 87:
3270 #line 1666 "../libinterp/parse-tree/lex.ll"
3271 { CMD_OR_UNARY_OP ("~", '~', true); }
3272  YY_BREAK
3273 case 88:
3275 #line 1667 "../libinterp/parse-tree/lex.ll"
3276 { CMD_OR_UNARY_OP ("!", '!', false); }
3277  YY_BREAK
3278 case 89:
3280 #line 1669 "../libinterp/parse-tree/lex.ll"
3281 {
3282  curr_lexer->lexer_debug (",");
3283 
3284  bool at_beginning_of_statement
3285  = (! (curr_lexer->whitespace_is_significant ()
3286  || curr_lexer->m_looking_at_object_index.front ()));
3287 
3288  return curr_lexer->handle_op (',', at_beginning_of_statement);
3289  }
3290  YY_BREAK
3291 case 90:
3293 #line 1679 "../libinterp/parse-tree/lex.ll"
3294 {
3295  curr_lexer->lexer_debug (".'");
3296 
3297  return curr_lexer->handle_op (TRANSPOSE);
3298  }
3299  YY_BREAK
3300 case 91:
3302 #line 1685 "../libinterp/parse-tree/lex.ll"
3303 { CMD_OR_UNARY_OP ("++", PLUS_PLUS, false); }
3304  YY_BREAK
3305 case 92:
3307 #line 1686 "../libinterp/parse-tree/lex.ll"
3308 { CMD_OR_UNARY_OP ("--", MINUS_MINUS, false); }
3309  YY_BREAK
3310 case 93:
3312 #line 1688 "../libinterp/parse-tree/lex.ll"
3313 {
3314  curr_lexer->lexer_debug ("(");
3315 
3316  bool unput_comma = false;
3317 
3318  if (curr_lexer->whitespace_is_significant ()
3319  && curr_lexer->space_follows_previous_token ())
3320  {
3321  int tok = curr_lexer->previous_token_value ();
3322 
3323  if (! (tok == '[' || tok == '{'
3324  || curr_lexer->previous_token_is_binop ()))
3325  unput_comma = true;
3326  }
3327 
3328  if (unput_comma)
3329  {
3330  yyless (0);
3331  curr_lexer->xunput (',');
3332  }
3333  else
3334  {
3335  curr_lexer->update_token_positions (yyleng);
3336 
3337  // If we are looking for an object index, then push TRUE for
3338  // m_looking_at_object_index. Otherwise, just push whatever state
3339  // is current (so that we can pop it off the stack when we find
3340  // the matching close paren).
3341 
3342  curr_lexer->m_looking_at_object_index.push_front
3343  (curr_lexer->m_looking_for_object_index);
3344 
3345  curr_lexer->m_looking_at_indirect_ref = false;
3346  curr_lexer->m_looking_for_object_index = false;
3347  curr_lexer->m_at_beginning_of_statement = false;
3348 
3349  curr_lexer->m_nesting_level.paren ();
3350 
3351  return curr_lexer->handle_token ('(');
3352  }
3353  }
3354  YY_BREAK
3355 case 94:
3357 #line 1730 "../libinterp/parse-tree/lex.ll"
3358 {
3359  curr_lexer->lexer_debug (")");
3360 
3361  curr_lexer->update_token_positions (yyleng);
3362 
3363  curr_lexer->m_nesting_level.remove ();
3364 
3365  curr_lexer->m_looking_at_object_index.pop_front ();
3366 
3367  curr_lexer->m_looking_for_object_index = true;
3368  curr_lexer->m_at_beginning_of_statement = false;
3369 
3370  if (curr_lexer->m_looking_at_anon_fcn_args)
3371  {
3372  curr_lexer->m_looking_at_anon_fcn_args = false;
3373  curr_lexer->m_nesting_level.anon_fcn_body ();
3374  }
3375 
3376  return curr_lexer->count_token (')');
3377  }
3378  YY_BREAK
3379 case 95:
3381 #line 1751 "../libinterp/parse-tree/lex.ll"
3382 {
3383  curr_lexer->lexer_debug (".");
3384 
3385  if (curr_lexer->previous_token_may_be_command ()
3386  && curr_lexer->space_follows_previous_token ())
3387  {
3388  yyless (0);
3389  curr_lexer->push_start_state (COMMAND_START);
3390  }
3391  else
3392  {
3393  curr_lexer->update_token_positions (yyleng);
3394 
3395  curr_lexer->m_looking_for_object_index = false;
3396  curr_lexer->m_at_beginning_of_statement = false;
3397 
3398  return curr_lexer->handle_token ('.');
3399  }
3400  }
3401  YY_BREAK
3402 
3403 // = and op= operators.
3404 
3405 case 96:
3407 #line 1775 "../libinterp/parse-tree/lex.ll"
3408 {
3409  curr_lexer->lexer_debug ("=");
3410 
3411  return curr_lexer->handle_op ('=');
3412  }
3413  YY_BREAK
3414 case 97:
3416 #line 1781 "../libinterp/parse-tree/lex.ll"
3417 { CMD_OR_OP ("+=", ADD_EQ, false); }
3418  YY_BREAK
3419 case 98:
3421 #line 1782 "../libinterp/parse-tree/lex.ll"
3422 { CMD_OR_OP ("-=", SUB_EQ, false); }
3423  YY_BREAK
3424 case 99:
3426 #line 1783 "../libinterp/parse-tree/lex.ll"
3427 { CMD_OR_OP ("*=", MUL_EQ, false); }
3428  YY_BREAK
3429 case 100:
3431 #line 1784 "../libinterp/parse-tree/lex.ll"
3432 { CMD_OR_OP ("/=", DIV_EQ, false); }
3433  YY_BREAK
3434 case 101:
3436 #line 1785 "../libinterp/parse-tree/lex.ll"
3437 { CMD_OR_OP ("\\=", LEFTDIV_EQ, false); }
3438  YY_BREAK
3439 case 102:
3441 #line 1786 "../libinterp/parse-tree/lex.ll"
3442 { CMD_OR_OP (".*=", EMUL_EQ, false); }
3443  YY_BREAK
3444 case 103:
3446 #line 1787 "../libinterp/parse-tree/lex.ll"
3447 { CMD_OR_OP ("./=", EDIV_EQ, false); }
3448  YY_BREAK
3449 case 104:
3451 #line 1788 "../libinterp/parse-tree/lex.ll"
3452 { CMD_OR_OP (".\\=", ELEFTDIV_EQ, false); }
3453  YY_BREAK
3454 case 105:
3456 #line 1789 "../libinterp/parse-tree/lex.ll"
3457 { CMD_OR_OP ("^=", POW_EQ, false); }
3458  YY_BREAK
3459 case 106:
3461 #line 1790 "../libinterp/parse-tree/lex.ll"
3462 { CMD_OR_OP (".^=", EPOW_EQ, false); }
3463  YY_BREAK
3464 case 107:
3466 #line 1791 "../libinterp/parse-tree/lex.ll"
3467 { CMD_OR_OP ("&=", AND_EQ, false); }
3468  YY_BREAK
3469 case 108:
3471 #line 1792 "../libinterp/parse-tree/lex.ll"
3472 { CMD_OR_OP ("|=", OR_EQ, false); }
3473  YY_BREAK
3474 
3475 // In Matlab, '{' may also trigger command syntax.
3476 
3477 case 109:
3479 #line 1798 "../libinterp/parse-tree/lex.ll"
3480 {
3481  curr_lexer->lexer_debug ("{");
3482 
3483  bool unput_comma = false;
3484 
3485  if (curr_lexer->whitespace_is_significant ()
3486  && curr_lexer->space_follows_previous_token ())
3487  {
3488  int tok = curr_lexer->previous_token_value ();
3489 
3490  if (! (tok == '[' || tok == '{'
3491  || curr_lexer->previous_token_is_binop ()))
3492  unput_comma = true;
3493  }
3494 
3495  if (unput_comma)
3496  {
3497  yyless (0);
3498  curr_lexer->xunput (',');
3499  }
3500  else
3501  {
3502  curr_lexer->m_nesting_level.brace ();
3503 
3504  curr_lexer->m_looking_at_object_index.push_front
3505  (curr_lexer->m_looking_for_object_index);
3506 
3507  curr_lexer->m_filepos.increment_column (yyleng);
3508  curr_lexer->m_looking_for_object_index = false;
3509  curr_lexer->m_at_beginning_of_statement = false;
3510 
3511  curr_lexer->m_braceflag++;
3512 
3513  curr_lexer->push_start_state (MATRIX_START);
3514 
3515  return curr_lexer->count_token ('{');
3516  }
3517  }
3518  YY_BREAK
3519 case 110:
3521 #line 1837 "../libinterp/parse-tree/lex.ll"
3522 {
3523  curr_lexer->lexer_debug ("}");
3524 
3525  curr_lexer->update_token_positions (yyleng);
3526 
3527  curr_lexer->m_looking_at_object_index.pop_front ();
3528 
3529  curr_lexer->m_looking_for_object_index = true;
3530  curr_lexer->m_at_beginning_of_statement = false;
3531 
3532  curr_lexer->m_nesting_level.remove ();
3533 
3534  return curr_lexer->handle_token ('}');
3535  }
3536  YY_BREAK
3537 
3538 // Unrecognized input. If the previous token may be a command and is
3539 // followed by a space, parse the remainder of this statement as a
3540 // command-style function call. Otherwise, unrecognized input is a
3541 // lexical error.
3542 
3543 case 111:
3545 #line 1859 "../libinterp/parse-tree/lex.ll"
3546 {
3547  curr_lexer->lexer_debug (".");
3548 
3549  curr_lexer->xunput (yytext[0]);
3550 
3551  int c = curr_lexer->text_yyinput ();
3552 
3553  if (c == 1)
3554  return -1;
3555  else if (c == EOF)
3556  return curr_lexer->handle_end_of_input ();
3557  else if (curr_lexer->previous_token_may_be_command ()
3558  && curr_lexer->space_follows_previous_token ())
3559  {
3560  yyless (0);
3561  curr_lexer->push_start_state (COMMAND_START);
3562  }
3563  else
3564  {
3565  std::ostringstream buf;
3566 
3567  buf << "invalid character '"
3568  << octave::undo_string_escape (static_cast<char> (c))
3569  << "' (ASCII " << c << ")";
3570 
3571  // Use current file position for error token.
3572  octave::token *tok
3573  = new octave::token (LEXICAL_ERROR, buf.str (),
3574  curr_lexer->m_filepos, curr_lexer->m_filepos);
3575 
3576  curr_lexer->push_token (tok);
3577 
3578  curr_lexer->m_filepos.increment_column ();
3579 
3580  return curr_lexer->count_token_internal (LEXICAL_ERROR);
3581  }
3582  }
3583  YY_BREAK
3584 
3585 #if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
3586  // Disable these warnings for flex code.
3587 # pragma GCC diagnostic ignored "-Wold-style-cast"
3588 # pragma GCC diagnostic ignored "-Wunused-parameter"
3589 #endif
3590 
3591 case 112:
3593 #line 1905 "../libinterp/parse-tree/lex.ll"
3594 ECHO;
3595  YY_BREAK
3596 #line 3597 "libinterp/parse-tree/lex.cc"
3597 
3598  case YY_END_OF_BUFFER:
3599  {
3600  /* Amount of text matched not including the EOB char. */
3601  int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
3602 
3603  /* Undo the effects of YY_DO_BEFORE_ACTION. */
3604  *yy_cp = yyg->yy_hold_char;
3606 
3607  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
3608  {
3609  /* We're scanning a new file or input source. It's
3610  * possible that this happened because the user
3611  * just pointed yyin at a new source and called
3612  * yylex(). If so, then we have to assure
3613  * consistency between YY_CURRENT_BUFFER and our
3614  * globals. Here is the right place to do so, because
3615  * this is the first action (other than possibly a
3616  * back-up) that will match for the new input source.
3617  */
3618  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3619  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
3620  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
3621  }
3622 
3623  /* Note that here we test for yy_c_buf_p "<=" to the position
3624  * of the first EOB in the buffer, since yy_c_buf_p will
3625  * already have been incremented past the NUL character
3626  * (since all states make transitions on EOB to the
3627  * end-of-buffer state). Contrast this with the test
3628  * in input().
3629  */
3630  if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
3631  { /* This was really a NUL. */
3632  yy_state_type yy_next_state;
3633 
3634  yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
3635 
3636  yy_current_state = yy_get_previous_state( yyscanner );
3637 
3638  /* Okay, we're now positioned to make the NUL
3639  * transition. We couldn't have
3640  * yy_get_previous_state() go ahead and do it
3641  * for us because it doesn't know how to deal
3642  * with the possibility of jamming (and we don't
3643  * want to build jamming into it because then it
3644  * will run more slowly).
3645  */
3646 
3647  yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
3648 
3649  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
3650 
3651  if ( yy_next_state )
3652  {
3653  /* Consume the NUL. */
3654  yy_cp = ++yyg->yy_c_buf_p;
3655  yy_current_state = yy_next_state;
3656  goto yy_match;
3657  }
3658 
3659  else
3660  {
3661  yy_cp = yyg->yy_c_buf_p;
3662  goto yy_find_action;
3663  }
3664  }
3665 
3666  else switch ( yy_get_next_buffer( yyscanner ) )
3667  {
3668  case EOB_ACT_END_OF_FILE:
3669  {
3670  yyg->yy_did_buffer_switch_on_eof = 0;
3671 
3672  if ( yywrap( yyscanner ) )
3673  {
3674  /* Note: because we've taken care in
3675  * yy_get_next_buffer() to have set up
3676  * yytext, we can now set up
3677  * yy_c_buf_p so that if some total
3678  * hoser (like flex itself) wants to
3679  * call the scanner after we return the
3680  * YY_NULL, it'll still work - another
3681  * YY_NULL will get returned.
3682  */
3683  yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
3684 
3685  yy_act = YY_STATE_EOF(YY_START);
3686  goto do_action;
3687  }
3688 
3689  else
3690  {
3691  if ( ! yyg->yy_did_buffer_switch_on_eof )
3692  YY_NEW_FILE;
3693  }
3694  break;
3695  }
3696 
3697  case EOB_ACT_CONTINUE_SCAN:
3698  yyg->yy_c_buf_p =
3699  yyg->yytext_ptr + yy_amount_of_matched_text;
3700 
3701  yy_current_state = yy_get_previous_state( yyscanner );
3702 
3703  yy_cp = yyg->yy_c_buf_p;
3704  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
3705  goto yy_match;
3706 
3707  case EOB_ACT_LAST_MATCH:
3708  yyg->yy_c_buf_p =
3709  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
3710 
3711  yy_current_state = yy_get_previous_state( yyscanner );
3712 
3713  yy_cp = yyg->yy_c_buf_p;
3714  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
3715  goto yy_find_action;
3716  }
3717  break;
3718  }
3719 
3720  default:
3722  "fatal flex scanner internal error--no action found" );
3723  } /* end of action switch */
3724  } /* end of scanning one token */
3725  } /* end of user's declarations */
3726 } /* end of yylex */
3727 
3728 /* yy_get_next_buffer - try to read in a new buffer
3729  *
3730  * Returns a code representing an action:
3731  * EOB_ACT_LAST_MATCH -
3732  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3733  * EOB_ACT_END_OF_FILE - end of file
3734  */
3735 static int yy_get_next_buffer (yyscan_t yyscanner)
3736 {
3737  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3738  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
3739  char *source = yyg->yytext_ptr;
3740  int number_to_move, i;
3741  int ret_val;
3742 
3743  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
3745  "fatal flex scanner internal error--end of buffer missed" );
3746 
3747  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
3748  { /* Don't try to fill the buffer, so this is an EOF. */
3749  if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
3750  {
3751  /* We matched a single character, the EOB, so
3752  * treat this as a final EOF.
3753  */
3754  return EOB_ACT_END_OF_FILE;
3755  }
3756 
3757  else
3758  {
3759  /* We matched some text prior to the EOB, first
3760  * process it.
3761  */
3762  return EOB_ACT_LAST_MATCH;
3763  }
3764  }
3765 
3766  /* Try to read more data. */
3767 
3768  /* First move last chars to start of buffer. */
3769  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
3770 
3771  for ( i = 0; i < number_to_move; ++i )
3772  *(dest++) = *(source++);
3773 
3774  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3775  /* don't do the read, it's not guaranteed to return an EOF,
3776  * just force an EOF
3777  */
3778  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
3779 
3780  else
3781  {
3782  int num_to_read =
3783  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
3784 
3785  while ( num_to_read <= 0 )
3786  { /* Not enough room in the buffer - grow it. */
3787 
3788  /* just a shorter name for the current buffer */
3790 
3791  int yy_c_buf_p_offset =
3792  (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
3793 
3794  if ( b->yy_is_our_buffer )
3795  {
3796  int new_size = b->yy_buf_size * 2;
3797 
3798  if ( new_size <= 0 )
3799  b->yy_buf_size += b->yy_buf_size / 8;
3800  else
3801  b->yy_buf_size *= 2;
3802 
3803  b->yy_ch_buf = (char *)
3804  /* Include room in for 2 EOB chars. */
3805  yyrealloc( (void *) b->yy_ch_buf,
3806  (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
3807  }
3808  else
3809  /* Can't grow it, we don't own it. */
3810  b->yy_ch_buf = NULL;
3811 
3812  if ( ! b->yy_ch_buf )
3814  "fatal error - scanner input buffer overflow" );
3815 
3816  yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
3817 
3818  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
3819  number_to_move - 1;
3820 
3821  }
3822 
3823  if ( num_to_read > YY_READ_BUF_SIZE )
3824  num_to_read = YY_READ_BUF_SIZE;
3825 
3826  /* Read in more data. */
3827  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
3828  yyg->yy_n_chars, num_to_read );
3829 
3830  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
3831  }
3832 
3833  if ( yyg->yy_n_chars == 0 )
3834  {
3835  if ( number_to_move == YY_MORE_ADJ )
3836  {
3837  ret_val = EOB_ACT_END_OF_FILE;
3838  yyrestart( yyin , yyscanner);
3839  }
3840 
3841  else
3842  {
3843  ret_val = EOB_ACT_LAST_MATCH;
3844  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
3846  }
3847  }
3848 
3849  else
3850  ret_val = EOB_ACT_CONTINUE_SCAN;
3851 
3852  if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
3853  /* Extend the array by 50%, plus the number we really need. */
3854  int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
3855  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
3856  (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
3857  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
3858  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
3859  /* "- 2" to take care of EOB's */
3860  YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
3861  }
3862 
3863  yyg->yy_n_chars += number_to_move;
3864  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
3865  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
3866 
3867  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
3868 
3869  return ret_val;
3870 }
3871 
3872 /* yy_get_previous_state - get the state just before the EOB char was reached */
3873 
3874  static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
3875 {
3876  yy_state_type yy_current_state;
3877  char *yy_cp;
3878  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3879 
3880  yy_current_state = yyg->yy_start;
3881  yy_current_state += YY_AT_BOL();
3882 
3883  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
3884  {
3885  YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3886  if ( yy_accept[yy_current_state] )
3887  {
3888  yyg->yy_last_accepting_state = yy_current_state;
3889  yyg->yy_last_accepting_cpos = yy_cp;
3890  }
3891  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3892  {
3893  yy_current_state = (int) yy_def[yy_current_state];
3894  if ( yy_current_state >= 290 )
3895  yy_c = yy_meta[yy_c];
3896  }
3897  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
3898  }
3899 
3900  return yy_current_state;
3901 }
3902 
3903 /* yy_try_NUL_trans - try to make a transition on the NUL character
3904  *
3905  * synopsis
3906  * next_state = yy_try_NUL_trans( current_state );
3907  */
3908  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
3909 {
3910  int yy_is_jam;
3911  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
3912  char *yy_cp = yyg->yy_c_buf_p;
3913 
3914  YY_CHAR yy_c = 1;
3915  if ( yy_accept[yy_current_state] )
3916  {
3917  yyg->yy_last_accepting_state = yy_current_state;
3918  yyg->yy_last_accepting_cpos = yy_cp;
3919  }
3920  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3921  {
3922  yy_current_state = (int) yy_def[yy_current_state];
3923  if ( yy_current_state >= 290 )
3924  yy_c = yy_meta[yy_c];
3925  }
3926  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
3927  yy_is_jam = (yy_current_state == 289);
3928 
3929  (void)yyg;
3930  return yy_is_jam ? 0 : yy_current_state;
3931 }
3932 
3933 #ifndef YY_NO_UNPUT
3934 
3935  static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
3936 {
3937  char *yy_cp;
3938  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3939 
3940  yy_cp = yyg->yy_c_buf_p;
3941 
3942  /* undo effects of setting up yytext */
3943  *yy_cp = yyg->yy_hold_char;
3944 
3945  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3946  { /* need to shift things up to make room */
3947  /* +2 for EOB chars. */
3948  int number_to_move = yyg->yy_n_chars + 2;
3949  char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
3950  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
3951  char *source =
3952  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
3953 
3954  while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
3955  *--dest = *--source;
3956 
3957  yy_cp += (int) (dest - source);
3958  yy_bp += (int) (dest - source);
3959  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
3960  yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
3961 
3962  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3963  YY_FATAL_ERROR( "flex scanner push-back overflow" );
3964  }
3965 
3966  *--yy_cp = (char) c;
3967 
3968  yyg->yytext_ptr = yy_bp;
3969  yyg->yy_hold_char = *yy_cp;
3970  yyg->yy_c_buf_p = yy_cp;
3971 }
3972 
3973 #endif
3974 
3975 #ifndef YY_NO_INPUT
3976 #ifdef __cplusplus
3977  static int yyinput (yyscan_t yyscanner)
3978 #else
3979  static int input (yyscan_t yyscanner)
3980 #endif
3981 
3982 {
3983  int c;
3984  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3985 
3986  *yyg->yy_c_buf_p = yyg->yy_hold_char;
3987 
3988  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
3989  {
3990  /* yy_c_buf_p now points to the character we want to return.
3991  * If this occurs *before* the EOB characters, then it's a
3992  * valid NUL; if not, then we've hit the end of the buffer.
3993  */
3994  if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
3995  /* This was really a NUL. */
3996  *yyg->yy_c_buf_p = '\0';
3997 
3998  else
3999  { /* need more input */
4000  int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
4001  ++yyg->yy_c_buf_p;
4002 
4003  switch ( yy_get_next_buffer( yyscanner ) )
4004  {
4005  case EOB_ACT_LAST_MATCH:
4006  /* This happens because yy_g_n_b()
4007  * sees that we've accumulated a
4008  * token and flags that we need to
4009  * try matching the token before
4010  * proceeding. But for input(),
4011  * there's no matching to consider.
4012  * So convert the EOB_ACT_LAST_MATCH
4013  * to EOB_ACT_END_OF_FILE.
4014  */
4015 
4016  /* Reset buffer status. */
4017  yyrestart( yyin , yyscanner);
4018 
4019  /*FALLTHROUGH*/
4020 
4021  case EOB_ACT_END_OF_FILE:
4022  {
4023  if ( yywrap( yyscanner ) )
4024  return 0;
4025 
4026  if ( ! yyg->yy_did_buffer_switch_on_eof )
4027  YY_NEW_FILE;
4028 #ifdef __cplusplus
4029  return yyinput(yyscanner);
4030 #else
4031  return input(yyscanner);
4032 #endif
4033  }
4034 
4035  case EOB_ACT_CONTINUE_SCAN:
4036  yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
4037  break;
4038  }
4039  }
4040  }
4041 
4042  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
4043  *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
4044  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
4045 
4046  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
4047 
4048  return c;
4049 }
4050 #endif /* ifndef YY_NO_INPUT */
4051 
4052 /** Immediately switch to a different input stream.
4053  * @param input_file A readable stream.
4054  * @param yyscanner The scanner object.
4055  * @note This function does not reset the start condition to @c INITIAL .
4056  */
4057  void yyrestart (FILE * input_file , yyscan_t yyscanner)
4058 {
4059  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4060 
4061  if ( ! YY_CURRENT_BUFFER ){
4062  yyensure_buffer_stack (yyscanner);
4064  yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
4065  }
4066 
4067  yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
4068  yy_load_buffer_state( yyscanner );
4069 }
4070 
4071 /** Switch to a different input buffer.
4072  * @param new_buffer The new input buffer.
4073  * @param yyscanner The scanner object.
4074  */
4075  void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
4076 {
4077  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4078 
4079  /* TODO. We should be able to replace this entire function body
4080  * with
4081  * yypop_buffer_state();
4082  * yypush_buffer_state(new_buffer);
4083  */
4084  yyensure_buffer_stack (yyscanner);
4085  if ( YY_CURRENT_BUFFER == new_buffer )
4086  return;
4087 
4088  if ( YY_CURRENT_BUFFER )
4089  {
4090  /* Flush out information for old buffer. */
4091  *yyg->yy_c_buf_p = yyg->yy_hold_char;
4092  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
4093  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
4094  }
4095 
4096  YY_CURRENT_BUFFER_LVALUE = new_buffer;
4097  yy_load_buffer_state( yyscanner );
4098 
4099  /* We don't actually know whether we did this switch during
4100  * EOF (yywrap()) processing, but the only time this flag
4101  * is looked at is after yywrap() is called, so it's safe
4102  * to go ahead and always set it.
4103  */
4104  yyg->yy_did_buffer_switch_on_eof = 1;
4105 }
4106 
4107 static void yy_load_buffer_state (yyscan_t yyscanner)
4108 {
4109  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4110  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
4111  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
4112  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
4113  yyg->yy_hold_char = *yyg->yy_c_buf_p;
4114 }
4115 
4116 /** Allocate and initialize an input buffer state.
4117  * @param file A readable stream.
4118  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
4119  * @param yyscanner The scanner object.
4120  * @return the allocated buffer state.
4121  */
4122  YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
4123 {
4124  YY_BUFFER_STATE b;
4125 
4126  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
4127  if ( ! b )
4128  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
4129 
4130  b->yy_buf_size = size;
4131 
4132  /* yy_ch_buf has to be 2 characters longer than the size given because
4133  * we need to put in 2 end-of-buffer characters.
4134  */
4135  b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
4136  if ( ! b->yy_ch_buf )
4137  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
4138 
4139  b->yy_is_our_buffer = 1;
4140 
4141  yy_init_buffer( b, file , yyscanner);
4142 
4143  return b;
4144 }
4145 
4146 /** Destroy the buffer.
4147  * @param b a buffer created with yy_create_buffer()
4148  * @param yyscanner The scanner object.
4149  */
4151 {
4152  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4153 
4154  if ( ! b )
4155  return;
4156 
4157  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
4159 
4160  if ( b->yy_is_our_buffer )
4161  yyfree( (void *) b->yy_ch_buf , yyscanner );
4162 
4163  yyfree( (void *) b , yyscanner );
4164 }
4165 
4166 /* Initializes or reinitializes a buffer.
4167  * This function is sometimes called more than once on the same buffer,
4168  * such as during a yyrestart() or at EOF.
4169  */
4170  static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
4171 
4172 {
4173  int oerrno = errno;
4174  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4175 
4176  yy_flush_buffer( b , yyscanner);
4177 
4178  b->yy_input_file = file;
4179  b->yy_fill_buffer = 1;
4180 
4181  /* If b is the current buffer, then yy_init_buffer was _probably_
4182  * called from yyrestart() or through yy_get_next_buffer.
4183  * In that case, we don't want to reset the lineno or column.
4184  */
4185  if (b != YY_CURRENT_BUFFER){
4186  b->yy_bs_lineno = 1;
4187  b->yy_bs_column = 0;
4188  }
4189 
4190  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
4191 
4192  errno = oerrno;
4193 }
4194 
4195 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
4196  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
4197  * @param yyscanner The scanner object.
4198  */
4200 {
4201  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4202  if ( ! b )
4203  return;
4204 
4205  b->yy_n_chars = 0;
4206 
4207  /* We always need two end-of-buffer characters. The first causes
4208  * a transition to the end-of-buffer state. The second causes
4209  * a jam in that state.
4210  */
4211  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
4212  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
4213 
4214  b->yy_buf_pos = &b->yy_ch_buf[0];
4215 
4216  b->yy_at_bol = 1;
4217  b->yy_buffer_status = YY_BUFFER_NEW;
4218 
4219  if ( b == YY_CURRENT_BUFFER )
4220  yy_load_buffer_state( yyscanner );
4221 }
4222 
4223 /** Pushes the new state onto the stack. The new state becomes
4224  * the current state. This function will allocate the stack
4225  * if necessary.
4226  * @param new_buffer The new state.
4227  * @param yyscanner The scanner object.
4228  */
4229 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
4230 {
4231  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4232  if (new_buffer == NULL)
4233  return;
4234 
4235  yyensure_buffer_stack(yyscanner);
4236 
4237  /* This block is copied from yy_switch_to_buffer. */
4238  if ( YY_CURRENT_BUFFER )
4239  {
4240  /* Flush out information for old buffer. */
4241  *yyg->yy_c_buf_p = yyg->yy_hold_char;
4242  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
4243  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
4244  }
4245 
4246  /* Only push if top exists. Otherwise, replace top. */
4247  if (YY_CURRENT_BUFFER)
4248  yyg->yy_buffer_stack_top++;
4249  YY_CURRENT_BUFFER_LVALUE = new_buffer;
4250 
4251  /* copied from yy_switch_to_buffer. */
4252  yy_load_buffer_state( yyscanner );
4253  yyg->yy_did_buffer_switch_on_eof = 1;
4254 }
4255 
4256 /** Removes and deletes the top of the stack, if present.
4257  * The next element becomes the new top.
4258  * @param yyscanner The scanner object.
4259  */
4261 {
4262  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4263  if (!YY_CURRENT_BUFFER)
4264  return;
4265 
4266  yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
4267  YY_CURRENT_BUFFER_LVALUE = NULL;
4268  if (yyg->yy_buffer_stack_top > 0)
4269  --yyg->yy_buffer_stack_top;
4270 
4271  if (YY_CURRENT_BUFFER) {
4272  yy_load_buffer_state( yyscanner );
4273  yyg->yy_did_buffer_switch_on_eof = 1;
4274  }
4275 }
4276 
4277 /* Allocates the stack if it does not exist.
4278  * Guarantees space for at least one push.
4279  */
4280 static void yyensure_buffer_stack (yyscan_t yyscanner)
4281 {
4282  yy_size_t num_to_alloc;
4283  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4284 
4285  if (!yyg->yy_buffer_stack) {
4286 
4287  /* First allocation is just for 2 elements, since we don't know if this
4288  * scanner will even need a stack. We use 2 instead of 1 to avoid an
4289  * immediate realloc on the next call.
4290  */
4291  num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
4292  yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
4293  (num_to_alloc * sizeof(struct yy_buffer_state*)
4294  , yyscanner);
4295  if ( ! yyg->yy_buffer_stack )
4296  YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
4297 
4298  memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
4299 
4300  yyg->yy_buffer_stack_max = num_to_alloc;
4301  yyg->yy_buffer_stack_top = 0;
4302  return;
4303  }
4304 
4305  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
4306 
4307  /* Increase the buffer to prepare for a possible push. */
4308  yy_size_t grow_size = 8 /* arbitrary grow size */;
4309 
4310  num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
4311  yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
4312  (yyg->yy_buffer_stack,
4313  num_to_alloc * sizeof(struct yy_buffer_state*)
4314  , yyscanner);
4315  if ( ! yyg->yy_buffer_stack )
4316  YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
4317 
4318  /* zero only the new slots.*/
4319  memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
4320  yyg->yy_buffer_stack_max = num_to_alloc;
4321  }
4322 }
4323 
4324 /** Setup the input buffer state to scan directly from a user-specified character buffer.
4325  * @param base the character buffer
4326  * @param size the size in bytes of the character buffer
4327  * @param yyscanner The scanner object.
4328  * @return the newly allocated buffer state object.
4329  */
4330 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
4331 {
4332  YY_BUFFER_STATE b;
4333 
4334  if ( size < 2 ||
4335  base[size-2] != YY_END_OF_BUFFER_CHAR ||
4336  base[size-1] != YY_END_OF_BUFFER_CHAR )
4337  /* They forgot to leave room for the EOB's. */
4338  return NULL;
4339 
4340  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
4341  if ( ! b )
4342  YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
4343 
4344  b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
4345  b->yy_buf_pos = b->yy_ch_buf = base;
4346  b->yy_is_our_buffer = 0;
4347  b->yy_input_file = NULL;
4348  b->yy_n_chars = b->yy_buf_size;
4349  b->yy_is_interactive = 0;
4350  b->yy_at_bol = 1;
4351  b->yy_fill_buffer = 0;
4352  b->yy_buffer_status = YY_BUFFER_NEW;
4353 
4354  yy_switch_to_buffer( b , yyscanner );
4355 
4356  return b;
4357 }
4358 
4359 /** Setup the input buffer state to scan a string. The next call to yylex() will
4360  * scan from a @e copy of @a str.
4361  * @param yystr a NUL-terminated string to scan
4362  * @param yyscanner The scanner object.
4363  * @return the newly allocated buffer state object.
4364  * @note If you want to scan bytes that may contain NUL values, then use
4365  * yy_scan_bytes() instead.
4366  */
4367 YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
4368 {
4369 
4370  return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
4371 }
4372 
4373 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
4374  * scan from a @e copy of @a bytes.
4375  * @param yybytes the byte buffer to scan
4376  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
4377  * @param yyscanner The scanner object.
4378  * @return the newly allocated buffer state object.
4379  */
4380 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
4381 {
4382  YY_BUFFER_STATE b;
4383  char *buf;
4384  yy_size_t n;
4385  int i;
4386 
4387  /* Get memory for full buffer, including space for trailing EOB's. */
4388  n = (yy_size_t) (_yybytes_len + 2);
4389  buf = (char *) yyalloc( n , yyscanner );
4390  if ( ! buf )
4391  YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
4392 
4393  for ( i = 0; i < _yybytes_len; ++i )
4394  buf[i] = yybytes[i];
4395 
4396  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
4397 
4398  b = yy_scan_buffer( buf, n , yyscanner);
4399  if ( ! b )
4400  YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
4401 
4402  /* It's okay to grow etc. this buffer, and we should throw it
4403  * away when we're done.
4404  */
4405  b->yy_is_our_buffer = 1;
4406 
4407  return b;
4408 }
4409 
4410 #ifndef YY_EXIT_FAILURE
4411 #define YY_EXIT_FAILURE 2
4412 #endif
4413 
4414 static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
4415 {
4416  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4417  (void)yyg;
4418  fprintf( stderr, "%s\n", msg );
4419  exit( YY_EXIT_FAILURE );
4420 }
4421 
4422 /* Redefine yyless() so it works in section 3 code. */
4423 
4424 #undef yyless
4425 #define yyless(n) \
4426  do \
4427  { \
4428  /* Undo effects of setting up yytext. */ \
4429  int yyless_macro_arg = (n); \
4430  YY_LESS_LINENO(yyless_macro_arg);\
4431  yytext[yyleng] = yyg->yy_hold_char; \
4432  yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
4433  yyg->yy_hold_char = *yyg->yy_c_buf_p; \
4434  *yyg->yy_c_buf_p = '\0'; \
4435  yyleng = yyless_macro_arg; \
4436  } \
4437  while ( 0 )
4438 
4439 /* Accessor methods (get/set functions) to struct members. */
4440 
4441 /** Get the user-defined data for this scanner.
4442  * @param yyscanner The scanner object.
4443  */
4445 {
4446  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4447  return yyextra;
4448 }
4449 
4450 /** Get the current line number.
4451  * @param yyscanner The scanner object.
4452  */
4453 int yyget_lineno (yyscan_t yyscanner)
4454 {
4455  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4456 
4457  if (! YY_CURRENT_BUFFER)
4458  return 0;
4459 
4460  return yylineno;
4461 }
4462 
4463 /** Get the current column number.
4464  * @param yyscanner The scanner object.
4465  */
4466 int yyget_column (yyscan_t yyscanner)
4467 {
4468  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4469 
4470  if (! YY_CURRENT_BUFFER)
4471  return 0;
4472 
4473  return yycolumn;
4474 }
4475 
4476 /** Get the input stream.
4477  * @param yyscanner The scanner object.
4478  */
4479 FILE *yyget_in (yyscan_t yyscanner)
4480 {
4481  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4482  return yyin;
4483 }
4484 
4485 /** Get the output stream.
4486  * @param yyscanner The scanner object.
4487  */
4488 FILE *yyget_out (yyscan_t yyscanner)
4489 {
4490  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4491  return yyout;
4492 }
4493 
4494 /** Get the length of the current token.
4495  * @param yyscanner The scanner object.
4496  */
4497 int yyget_leng (yyscan_t yyscanner)
4498 {
4499  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4500  return yyleng;
4501 }
4502 
4503 /** Get the current token.
4504  * @param yyscanner The scanner object.
4505  */
4506 
4507 char *yyget_text (yyscan_t yyscanner)
4508 {
4509  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4510  return yytext;
4511 }
4512 
4513 /** Set the user-defined data. This data is never touched by the scanner.
4514  * @param user_defined The data to be associated with this scanner.
4515  * @param yyscanner The scanner object.
4516  */
4517 void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
4518 {
4519  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4520  yyextra = user_defined ;
4521 }
4522 
4523 /** Set the current line number.
4524  * @param _line_number line number
4525  * @param yyscanner The scanner object.
4526  */
4527 void yyset_lineno (int _line_number , yyscan_t yyscanner)
4528 {
4529  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4530 
4531  /* lineno is only valid if an input buffer exists. */
4532  if (! YY_CURRENT_BUFFER )
4533  YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
4534 
4535  yylineno = _line_number;
4536 }
4537 
4538 /** Set the current column.
4539  * @param _column_no column number
4540  * @param yyscanner The scanner object.
4541  */
4542 void yyset_column (int _column_no , yyscan_t yyscanner)
4543 {
4544  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4545 
4546  /* column is only valid if an input buffer exists. */
4547  if (! YY_CURRENT_BUFFER )
4548  YY_FATAL_ERROR( "yyset_column called with no buffer" );
4549 
4550  yycolumn = _column_no;
4551 }
4552 
4553 /** Set the input stream. This does not discard the current
4554  * input buffer.
4555  * @param _in_str A readable stream.
4556  * @param yyscanner The scanner object.
4557  * @see yy_switch_to_buffer
4558  */
4559 void yyset_in (FILE * _in_str , yyscan_t yyscanner)
4560 {
4561  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4562  yyin = _in_str ;
4563 }
4564 
4565 void yyset_out (FILE * _out_str , yyscan_t yyscanner)
4566 {
4567  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4568  yyout = _out_str ;
4569 }
4570 
4571 int yyget_debug (yyscan_t yyscanner)
4572 {
4573  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4574  return yy_flex_debug;
4575 }
4576 
4577 void yyset_debug (int _bdebug , yyscan_t yyscanner)
4578 {
4579  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4580  yy_flex_debug = _bdebug ;
4581 }
4582 
4583 /* Accessor methods for yylval and yylloc */
4584 
4586 {
4587  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4588  return yylval;
4589 }
4590 
4591 void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
4592 {
4593  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4594  yylval = yylval_param;
4595 }
4596 
4597 /* User-visible API */
4598 
4599 /* yylex_init is special because it creates the scanner itself, so it is
4600  * the ONLY reentrant function that doesn't take the scanner as the last argument.
4601  * That's why we explicitly handle the declaration, instead of using our macros.
4602  */
4603 int yylex_init(yyscan_t* ptr_yy_globals)
4604 {
4605  if (ptr_yy_globals == NULL){
4606  errno = EINVAL;
4607  return 1;
4608  }
4609 
4610  *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
4611 
4612  if (*ptr_yy_globals == NULL){
4613  errno = ENOMEM;
4614  return 1;
4615  }
4616 
4617  /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
4618  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
4619 
4620  return yy_init_globals ( *ptr_yy_globals );
4621 }
4622 
4623 /* yylex_init_extra has the same functionality as yylex_init, but follows the
4624  * convention of taking the scanner as the last argument. Note however, that
4625  * this is a *pointer* to a scanner, as it will be allocated by this call (and
4626  * is the reason, too, why this function also must handle its own declaration).
4627  * The user defined value in the first argument will be available to yyalloc in
4628  * the yyextra field.
4629  */
4630 int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
4631 {
4632  struct yyguts_t dummy_yyguts;
4633 
4634  yyset_extra (yy_user_defined, &dummy_yyguts);
4635 
4636  if (ptr_yy_globals == NULL){
4637  errno = EINVAL;
4638  return 1;
4639  }
4640 
4641  *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
4642 
4643  if (*ptr_yy_globals == NULL){
4644  errno = ENOMEM;
4645  return 1;
4646  }
4647 
4648  /* By setting to 0xAA, we expose bugs in
4649  yy_init_globals. Leave at 0x00 for releases. */
4650  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
4651 
4652  yyset_extra (yy_user_defined, *ptr_yy_globals);
4653 
4654  return yy_init_globals ( *ptr_yy_globals );
4655 }
4656 
4657 static int yy_init_globals (yyscan_t yyscanner)
4658 {
4659  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4660  /* Initialization is the same as for the non-reentrant scanner.
4661  * This function is called from yylex_destroy(), so don't allocate here.
4662  */
4663 
4664  yyg->yy_buffer_stack = NULL;
4665  yyg->yy_buffer_stack_top = 0;
4666  yyg->yy_buffer_stack_max = 0;
4667  yyg->yy_c_buf_p = NULL;
4668  yyg->yy_init = 0;
4669  yyg->yy_start = 0;
4670 
4671  yyg->yy_start_stack_ptr = 0;
4672  yyg->yy_start_stack_depth = 0;
4673  yyg->yy_start_stack = NULL;
4674 
4675 /* Defined in main.c */
4676 #ifdef YY_STDINIT
4677  yyin = stdin;
4678  yyout = stdout;
4679 #else
4680  yyin = NULL;
4681  yyout = NULL;
4682 #endif
4683 
4684  /* For future reference: Set errno on error, since we are called by
4685  * yylex_init()
4686  */
4687  return 0;
4688 }
4689 
4690 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
4691 int yylex_destroy (yyscan_t yyscanner)
4692 {
4693  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4694 
4695  /* Pop the buffer stack, destroying each element. */
4696  while(YY_CURRENT_BUFFER){
4697  yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
4698  YY_CURRENT_BUFFER_LVALUE = NULL;
4699  yypop_buffer_state(yyscanner);
4700  }
4701 
4702  /* Destroy the stack itself. */
4703  yyfree(yyg->yy_buffer_stack , yyscanner);
4704  yyg->yy_buffer_stack = NULL;
4705 
4706  /* Destroy the start condition stack. */
4707  yyfree( yyg->yy_start_stack , yyscanner );
4708  yyg->yy_start_stack = NULL;
4709 
4710  /* Reset the globals. This is important in a non-reentrant scanner so the next time
4711  * yylex() is called, initialization will occur. */
4712  yy_init_globals( yyscanner);
4713 
4714  /* Destroy the main struct (reentrant only). */
4715  yyfree ( yyscanner , yyscanner );
4716  yyscanner = NULL;
4717  return 0;
4718 }
4719 
4720 /*
4721  * Internal utility routines.
4722  */
4723 
4724 #ifndef yytext_ptr
4725 static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
4726 {
4727  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4728  (void)yyg;
4729 
4730  int i;
4731  for ( i = 0; i < n; ++i )
4732  s1[i] = s2[i];
4733 }
4734 #endif
4735 
4736 #ifdef YY_NEED_STRLEN
4737 static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
4738 {
4739  int n;
4740  for ( n = 0; s[n]; ++n )
4741  ;
4742 
4743  return n;
4744 }
4745 #endif
4746 
4747 #define YYTABLES_NAME "yytables"
4748 
4749 #line 1905 "../libinterp/parse-tree/lex.ll"
4750 
4751 
4752 #if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
4753  // Restore prevailing warning state for remainder of the file.
4754 # pragma GCC diagnostic pop
4755 #endif
4756 
4757 void *
4759 {
4760  return std::malloc (size);
4761 }
4762 
4763 void *
4765 {
4766  return std::realloc (ptr, size);
4767 }
4768 
4769 void
4770 octave_free (void *ptr, yyscan_t)
4771 {
4772  std::free (ptr);
4773 }
4774 
4775 static void
4776 display_character (char c)
4777 {
4778  if (isgraph (c))
4779  std::cerr << c;
4780  else
4781  switch (c)
4782  {
4783  case 0:
4784  std::cerr << "NUL";
4785  break;
4786 
4787  case 1:
4788  std::cerr << "SOH";
4789  break;
4790 
4791  case 2:
4792  std::cerr << "STX";
4793  break;
4794 
4795  case 3:
4796  std::cerr << "ETX";
4797  break;
4798 
4799  case 4:
4800  std::cerr << "EOT";
4801  break;
4802 
4803  case 5:
4804  std::cerr << "ENQ";
4805  break;
4806 
4807  case 6:
4808  std::cerr << "ACK";
4809  break;
4810 
4811  case 7:
4812  std::cerr << "\\a";
4813  break;
4814 
4815  case 8:
4816  std::cerr << "\\b";
4817  break;
4818 
4819  case 9:
4820  std::cerr << "\\t";
4821  break;
4822 
4823  case 10:
4824  std::cerr << "\\n";
4825  break;
4826 
4827  case 11:
4828  std::cerr << "\\v";
4829  break;
4830 
4831  case 12:
4832  std::cerr << "\\f";
4833  break;
4834 
4835  case 13:
4836  std::cerr << "\\r";
4837  break;
4838 
4839  case 14:
4840  std::cerr << "SO";
4841  break;
4842 
4843  case 15:
4844  std::cerr << "SI";
4845  break;
4846 
4847  case 16:
4848  std::cerr << "DLE";
4849  break;
4850 
4851  case 17:
4852  std::cerr << "DC1";
4853  break;
4854 
4855  case 18:
4856  std::cerr << "DC2";
4857  break;
4858 
4859  case 19:
4860  std::cerr << "DC3";
4861  break;
4862 
4863  case 20:
4864  std::cerr << "DC4";
4865  break;
4866 
4867  case 21:
4868  std::cerr << "NAK";
4869  break;
4870 
4871  case 22:
4872  std::cerr << "SYN";
4873  break;
4874 
4875  case 23:
4876  std::cerr << "ETB";
4877  break;
4878 
4879  case 24:
4880  std::cerr << "CAN";
4881  break;
4882 
4883  case 25:
4884  std::cerr << "EM";
4885  break;
4886 
4887  case 26:
4888  std::cerr << "SUB";
4889  break;
4890 
4891  case 27:
4892  std::cerr << "ESC";
4893  break;
4894 
4895  case 28:
4896  std::cerr << "FS";
4897  break;
4898 
4899  case 29:
4900  std::cerr << "GS";
4901  break;
4902 
4903  case 30:
4904  std::cerr << "RS";
4905  break;
4906 
4907  case 31:
4908  std::cerr << "US";
4909  break;
4910 
4911  case 32:
4912  std::cerr << "SPACE";
4913  break;
4914 
4915  case 127:
4916  std::cerr << "DEL";
4917  break;
4918  }
4919 }
4920 
4922 
4923 DEFUN (iskeyword, args, ,
4924  doc: /* -*- texinfo -*-
4925 @deftypefn {} {} iskeyword ()
4926 @deftypefnx {} {} iskeyword (@var{name})
4927 Return true if @var{name} is an Octave keyword.
4928 
4929 If @var{name} is omitted, return a list of keywords.
4930 @seealso{isvarname, exist}
4931 @end deftypefn */)
4932 {
4933  octave_value retval;
4934 
4935  int nargin = args.length ();
4936 
4937  if (nargin > 1)
4938  print_usage ();
4939 
4940  if (nargin == 0)
4941  {
4942  // Neither set nor get are keywords. See the note in the
4943  // iskeyword function for additional details.
4944 
4946 
4947  int j = 0;
4948 
4949  for (int i = 0; i < TOTAL_KEYWORDS; i++)
4950  {
4951  std::string kword = wordlist[i].name;
4952 
4953  // FIXME: The following check is duplicated in iskeyword.
4954  if (! (kword == "set" || kword == "get" || kword == "arguments"
4955  || kword == "enumeration" || kword == "events"
4956  || kword == "methods" || kword == "properties"))
4957  lst[j++] = kword;
4958  }
4959 
4960  lst.resize (j);
4961 
4962  retval = Cell (lst.sort ());
4963  }
4964  else
4965  {
4966  std::string name = args(0).xstring_value ("iskeyword: NAME must be a string");
4967  retval = iskeyword (name);
4968  }
4969 
4970  return retval;
4971 }
4972 
4973 /*
4974 
4975 %!assert (iskeyword ("for"))
4976 %!assert (iskeyword ("fort"), false)
4977 %!assert (iskeyword ("fft"), false)
4978 %!assert (iskeyword ("get"), false)
4979 %!assert (iskeyword ("set"), false)
4980 
4981 %!error iskeyword ("A", "B")
4982 %!error <NAME must be a string> iskeyword (1)
4983 
4984 */
4985 
4986  void
4988  {
4989  while (! m_frame_stack.empty ())
4990  m_frame_stack.pop_front ();
4991  }
4992 
4993  void
4995  {
4996  if (empty ())
4997  panic_impossible ();
4998 
4999  m_frame_stack.pop_front ();
5000  }
5001 
5002  symbol_scope
5004  {
5005  if (empty ())
5006  return m_interpreter.get_current_scope ();
5007  else
5008  return m_frame_stack.front ();
5009  }
5010 
5011  symbol_scope
5013  {
5014  std::size_t sz = size ();
5015 
5016  return (sz > 1
5017  ? m_frame_stack[1]
5018  : (sz == 1 ? m_frame_stack[0] : symbol_scope::invalid ()));
5019  }
5020 
5022  {
5023  m_tokens.clear ();
5024  }
5025 
5026  void
5028  {
5029  // The closest paren, brace, or bracket nesting is not an object
5030  // index.
5031  m_looking_at_object_index.push_front (false);
5032  }
5033 
5034  void
5036  {
5037  m_end_of_input = false;
5038  m_allow_command_syntax = true;
5041  m_looking_at_return_list = false;
5043  m_looking_at_decl_list = false;
5046  m_looking_at_indirect_ref = false;
5047  m_arguments_is_keyword = false;
5049  m_parsing_anon_fcn_body = false;
5050  m_parsing_class_method = false;
5051  m_parsing_classdef = false;
5052  m_parsing_classdef_decl = false;
5057  m_quote_is_transpose = false;
5058  m_force_script = false;
5059  m_reading_fcn_file = false;
5060  m_reading_script_file = false;
5061  m_reading_classdef_file = false;
5062  m_buffer_function_text = false;
5063  m_comment_uses_hash_char = false;
5064  m_bracketflag = 0;
5065  m_braceflag = 0;
5066  m_looping = 0;
5067  m_defining_fcn = 0;
5071  m_token_count = 0;
5072  m_filepos = filepos (1, 1);
5073  m_tok_beg = filepos ();
5074  m_tok_end = filepos ();
5075  m_string_text = "";
5076  m_current_input_line = "";
5077  m_comment_text = "";
5078  m_function_text = "";
5079  m_fcn_file_name = "";
5080  m_fcn_file_full_name = "";
5081  m_dir_name = "";
5082  m_package_name = "";
5083  m_looking_at_object_index.clear ();
5084  m_looking_at_object_index.push_front (false);
5085 
5086  while (! m_parsed_function_name.empty ())
5087  m_parsed_function_name.pop ();
5088 
5091  m_tokens.clear ();
5092  }
5093 
5094  int
5096  {
5097  const token *tok = m_tokens.front ();
5098  return tok ? tok->token_value () : 0;
5099  }
5100 
5101  bool
5103  {
5104  const token *tok = m_tokens.front ();
5105  return tok ? tok->token_value_is (tok_val) : false;
5106  }
5107 
5108  void
5110  {
5111  token *tok = m_tokens.front ();
5112  if (tok && ! previous_token_value_is ('\n'))
5113  tok->mark_trailing_space ();
5114  }
5115 
5116  bool
5118  {
5119  const token *tok = m_tokens.front ();
5120  return tok ? tok->space_follows_token () : false;
5121  }
5122 
5123  bool
5125  {
5126  int tok = previous_token_value ();
5127 
5128  return (tok == '+' || tok == '-' || tok == '@' || tok == '~' || tok == '!'
5129  || tok == ',' || tok == ';' || tok == '*' || tok == '/'
5130  || tok == ':' || tok == '=' || tok == ADD_EQ
5131  || tok == AND_EQ || tok == DIV_EQ || tok == EDIV
5132  || tok == EDIV_EQ || tok == ELEFTDIV || tok == ELEFTDIV_EQ
5133  || tok == EMUL || tok == EMUL_EQ
5134  || tok == EPOW || tok == EPOW_EQ || tok == EXPR_AND
5135  || tok == EXPR_AND_AND || tok == EXPR_EQ || tok == EXPR_GE
5136  || tok == EXPR_GT || tok == EXPR_LE || tok == EXPR_LT
5137  || tok == EXPR_NE || tok == EXPR_OR
5138  || tok == EXPR_OR_OR || tok == LEFTDIV || tok == LEFTDIV_EQ
5139  || tok == MUL_EQ || tok == OR_EQ || tok == POW
5140  || tok == POW_EQ || tok == SUB_EQ);
5141  }
5142 
5143  bool
5145  {
5146  const token *tok = m_tokens.front ();
5147  return tok ? tok->iskeyword () : false;
5148  }
5149 
5150  void
5151  lexical_feedback::mark_as_variable (const std::string& nm)
5152  {
5154 
5155  if (scope)
5156  scope.mark_as_variable (nm);
5157  }
5158 
5159  void
5160  lexical_feedback::mark_as_variables (const std::list<std::string>& lst)
5161  {
5163 
5164  if (scope)
5165  scope.mark_as_variables (lst);
5166  }
5167 
5168  bool
5170  {
5171  if (! m_allow_command_syntax)
5172  return false;
5173 
5174  const token *tok = m_tokens.front ();
5175  return tok ? tok->may_be_command () : false;
5176  }
5177 
5178 static bool
5179 looks_like_copyright (const std::string& s)
5180 {
5181  if (s.empty ())
5182  return false;
5183 
5184  // Comment characters have been stripped but whitespace
5185  // (including newlines) remains.
5186 
5187  std::size_t offset = s.find_first_not_of (" \t\n\r");
5188 
5189  return (offset != std::string::npos
5190  && (s.substr (offset, 9) == "Copyright"
5191  || s.substr (offset, 6) == "Author"
5192  || s.substr (offset, 23) == "SPDX-License-Identifier"));
5193 }
5194 
5195 static bool
5196 looks_like_shebang (const std::string& s)
5197 {
5198  return ((! s.empty ()) && (s[0] == '!'));
5199 }
5200 
5201  void
5202  base_lexer::input_buffer::fill (const std::string& input, bool eof_arg)
5203  {
5204  m_buffer = input;
5205  m_chars_left = m_buffer.length ();
5206  m_offset = 0;
5207  m_eof = eof_arg;
5208  }
5209 
5210  // If BY_LINES is true, return chunks to the lexer line by line.
5211  int
5212  base_lexer::input_buffer::copy_chunk (char *buf, std::size_t max_size,
5213  bool by_lines)
5214  {
5215  static const char * const eol = "\n";
5216 
5217  std::size_t len = 0;
5218  if (by_lines)
5219  {
5220  std::size_t newline_pos = m_buffer.find ('\n', m_offset);
5221  len = (newline_pos != std::string::npos
5222  ? newline_pos - m_offset + 1
5223  : (max_size > m_chars_left ? m_chars_left : max_size));
5224  }
5225  else
5226  len = max_size > m_chars_left ? m_chars_left : max_size;
5227 
5228  assert (len > 0);
5229  memcpy (buf, m_buffer.c_str () + m_offset, len);
5230 
5231  m_chars_left -= len;
5232  m_offset += len;
5233 
5234  // Make sure the final input returned to the lexer ends with a new
5235  // line character.
5236 
5237  if (m_chars_left == 0 && buf[len-1] != '\n')
5238  {
5239  if (len < max_size)
5240  {
5241  // There is enough room to plug the newline character in
5242  // the buffer.
5243  buf[len++] = '\n';
5244  }
5245  else
5246  {
5247  // There isn't enough room to plug the newline character
5248  // in BUF so arrange to have it returned on the next call
5249  // to base_lexer::read.
5250 
5251  // At this point we've exhausted the original input
5252  // (m_chars_left is zero) so we can overwrite the initial
5253  // buffer with a single newline character to be returned on
5254  // the next call.
5255 
5256  m_buffer = eol;
5257  m_chars_left = 1;
5258  m_offset = 0;
5259  }
5260  }
5261 
5262  return len;
5263  }
5264 
5266  {
5268  }
5269 
5270  void
5272  {
5273  yylex_init (&m_scanner);
5274 
5275  // Make base_lexer object available through yyextra in
5276  // flex-generated lexer.
5277  yyset_extra (this, m_scanner);
5278 
5279  clear_start_state ();
5280  }
5281 
5282  // Inside Flex-generated functions, yyg is the scanner cast to its real
5283  // type. Some flex macros that we use in base_lexer member functions
5284  // (for example, BEGIN) use yyg. If we could perform the actions of
5285  // these macros with functions instead, we could eliminate the
5286  // OCTAVE_YYG macro.
5287 
5288 #define OCTAVE_YYG \
5289  struct yyguts_t *yyg = static_cast<struct yyguts_t*> (m_scanner)
5290 
5291  void
5293  {
5294  // Start off on the right foot.
5295  clear_start_state ();
5296 
5298 
5299  // Only ask for input from stdin if we are expecting interactive
5300  // input.
5301 
5302  if (m_interpreter.interactive ()
5303  && ! (m_reading_fcn_file
5306  || input_from_eval_string ()))
5307  yyrestart (stdin, m_scanner);
5308 
5310 
5311  m_comment_buf.reset ();
5312  }
5313 
5314  void
5316  {
5317  m_reading_script_file = true;
5318 
5319  push_start_state (INPUT_FILE_START);
5320  }
5321 
5322  void
5324  {
5325  m_tok_beg = m_filepos;
5326 
5327  push_start_state (state);
5328  }
5329 
5330  int
5332  {
5333  lexer_debug ("<<EOF>>");
5334 
5335  m_tok_beg = m_filepos;
5336  m_tok_end = m_filepos;
5337 
5339  {
5340  warning ("block comment unterminated at end of input");
5341 
5343  && ! m_fcn_file_name.empty ())
5344  warning ("near line %d of file '%s.m'",
5345  m_filepos.line (), m_fcn_file_name.c_str ());
5346  }
5347 
5348  token *tok_val = new token (END_OF_INPUT, m_tok_beg, m_tok_end);
5349 
5350  push_token (tok_val);
5351 
5352  return count_token_internal (END_OF_INPUT);
5353  }
5354 
5355  char *
5357  {
5358  return yyget_text (m_scanner);
5359  }
5360 
5361  int
5363  {
5364  return yyget_leng (m_scanner);
5365  }
5366 
5367  int
5369  {
5370  int c = yyinput (m_scanner);
5371 
5372  if (debug_flag ())
5373  {
5374  std::cerr << "I: ";
5375  display_character (c);
5376  std::cerr << std::endl;
5377  }
5378 
5379  // Convert CRLF into just LF and single CR into LF.
5380 
5381  if (c == '\r')
5382  {
5383  c = yyinput (m_scanner);
5384 
5385  if (debug_flag ())
5386  {
5387  std::cerr << "I: ";
5388  display_character (c);
5389  std::cerr << std::endl;
5390  }
5391 
5392  if (c != '\n')
5393  {
5394  xunput (c);
5395  c = '\n';
5396  }
5397  }
5398 
5399  return c;
5400  }
5401 
5402  void
5403  base_lexer::xunput (char c, char *buf)
5404  {
5405  if (c != EOF)
5406  {
5407  if (debug_flag ())
5408  {
5409  std::cerr << "U: ";
5410  display_character (c);
5411  std::cerr << std::endl;
5412  }
5413 
5414  yyunput (c, buf, m_scanner);
5415  }
5416  }
5417 
5418  void
5420  {
5421  char *yytxt = flex_yytext ();
5422 
5423  xunput (c, yytxt);
5424  }
5425 
5426  void
5428  {
5429  m_tok_beg = m_filepos;
5430  m_tok_end = m_filepos;
5431 
5432  if (tok_len > 1)
5433  m_tok_end.increment_column (tok_len - 1);
5434 
5435  m_filepos.increment_column (tok_len);
5436  }
5437 
5438  bool
5440  {
5441  int c = text_yyinput ();
5442  xunput (c);
5443  return is_space_or_tab (c);
5444  }
5445 
5446  bool
5448  {
5449  bool retval = false;
5450 
5451  for (const bool is_obj_idx : m_looking_at_object_index)
5452  {
5453  if (is_obj_idx)
5454  {
5455  retval = true;
5456  break;
5457  }
5458  }
5459 
5460  return retval;
5461  }
5462 
5463  int
5464  base_lexer::make_keyword_token (const std::string& s)
5465  {
5466  // Token positions should have already been updated before this
5467  // function is called.
5468 
5469  int slen = s.length ();
5470 
5471  const octave_kw *kw = octave_kw_hash::in_word_set (s.c_str (), slen);
5472 
5473  if (! kw)
5474  return 0;
5475 
5476  bool previous_at_bos = m_at_beginning_of_statement;
5477 
5478  // May be reset to true for some token types.
5480 
5481  token *tok_val = nullptr;
5482 
5483  switch (kw->kw_id)
5484  {
5485  case break_kw:
5486  case catch_kw:
5487  case continue_kw:
5488  case else_kw:
5489  case otherwise_kw:
5490  case return_kw:
5493  break;
5494 
5495  case persistent_kw:
5496  case global_kw:
5497  m_looking_at_decl_list = true;
5498  break;
5499 
5500  case case_kw:
5501  case elseif_kw:
5502  case until_kw:
5503  break;
5504 
5505  case end_kw:
5506  if (inside_any_object_index ()
5507  || (m_defining_fcn
5509  || m_parsed_function_name.top ())))
5510  {
5511  m_at_beginning_of_statement = previous_at_bos;
5512  return 0;
5513  }
5514 
5515  tok_val = new token (kw->tok, token::simple_end, m_tok_beg, m_tok_end);
5517  break;
5518 
5519  case end_try_catch_kw:
5520  tok_val = new token (kw->tok, token::try_catch_end, m_tok_beg,
5521  m_tok_end);
5523  break;
5524 
5525  case end_unwind_protect_kw:
5526  tok_val = new token (kw->tok, token::unwind_protect_end, m_tok_beg,
5527  m_tok_end);
5529  break;
5530 
5531  case endfor_kw:
5532  tok_val = new token (kw->tok, token::for_end, m_tok_beg, m_tok_end);
5534  break;
5535 
5536  case endfunction_kw:
5537  tok_val = new token (kw->tok, token::function_end, m_tok_beg,
5538  m_tok_end);
5540  break;
5541 
5542  case endif_kw:
5543  tok_val = new token (kw->tok, token::if_end, m_tok_beg, m_tok_end);
5545  break;
5546 
5547  case endparfor_kw:
5548  tok_val = new token (kw->tok, token::parfor_end, m_tok_beg, m_tok_end);
5550  break;
5551 
5552  case endswitch_kw:
5553  tok_val = new token (kw->tok, token::switch_end, m_tok_beg, m_tok_end);
5555  break;
5556 
5557  case endwhile_kw:
5558  tok_val = new token (kw->tok, token::while_end, m_tok_beg, m_tok_end);
5560  break;
5561 
5562  case endarguments_kw:
5563 #if defined (DISABLE_ARGUMENTS_VALIDATION_BLOCK)
5564  return 0;
5565 #else
5566  tok_val = new token (kw->tok, token::arguments_end, m_tok_beg,
5567  m_tok_end);
5569  break;
5570 #endif
5571 
5572  case endclassdef_kw:
5573  tok_val = new token (kw->tok, token::classdef_end, m_tok_beg,
5574  m_tok_end);
5576  break;
5577 
5578  case endenumeration_kw:
5579  tok_val = new token (kw->tok, token::enumeration_end, m_tok_beg,
5580  m_tok_end);
5582  break;
5583 
5584  case endevents_kw:
5585  tok_val = new token (kw->tok, token::events_end, m_tok_beg,
5586  m_tok_end);
5588  break;
5589 
5590  case endmethods_kw:
5591  tok_val = new token (kw->tok, token::methods_end, m_tok_beg,
5592  m_tok_end);
5594  break;
5595 
5596  case endproperties_kw:
5597  tok_val = new token (kw->tok, token::properties_end, m_tok_beg,
5598  m_tok_end);
5600  break;
5601 
5602  case for_kw:
5603  case parfor_kw:
5604  case while_kw:
5605  m_looping++;
5606  break;
5607 
5608  case do_kw:
5610  m_looping++;
5611  break;
5612 
5613  case try_kw:
5614  case unwind_protect_kw:
5616  break;
5617 
5618  case if_kw:
5619  case switch_kw:
5620  break;
5621 
5622  case get_kw:
5623  case set_kw:
5624  // 'get' and 'set' are keywords in classdef method
5625  // declarations.
5627  {
5628  m_at_beginning_of_statement = previous_at_bos;
5629  return 0;
5630  }
5631  break;
5632 
5633  case enumeration_kw:
5634  case events_kw:
5635  case methods_kw:
5636  case properties_kw:
5637  // 'properties', 'methods' and 'events' are keywords for
5638  // classdef blocks.
5640  {
5641  m_at_beginning_of_statement = previous_at_bos;
5642  return 0;
5643  }
5644  // fall through ...
5645 
5646  case classdef_kw:
5647  // 'classdef' is always a keyword.
5648  if (! m_force_script && m_token_count == 0 && input_from_file ())
5649  {
5650  m_reading_classdef_file = true;
5651  m_reading_script_file = false;
5652  }
5653  break;
5654 
5655  case function_kw:
5656  m_defining_fcn++;
5657  m_parsed_function_name.push (false);
5658 
5659  if (! m_force_script && m_token_count == 0 && input_from_file ())
5660  {
5661  m_reading_fcn_file = true;
5662  m_reading_script_file = false;
5663  }
5664 
5665  // FIXME: should we be asking directly whether input is coming
5666  // from an eval string instead of that it is not coming from a
5667  // file?
5668 
5671  {
5672  // Input must be coming from the terminal or stdin?
5673  m_buffer_function_text = true;
5675 
5676  // FIXME: do we need to save and restore the file position
5677  // or just reset the line number here? The goal is to
5678  // track line info for command-line functions relative
5679  // to the function keyword. Should we really be setting
5680  // the line and column info to (1, 1) here?
5681 
5682  m_filepos = filepos (1, 1);
5683  update_token_positions (slen);
5684  }
5685  break;
5686 
5687  case arguments_kw:
5688 #if defined (DISABLE_ARGUMENTS_VALIDATION_BLOCK)
5689  return 0;
5690 #else
5691  if (! m_arguments_is_keyword)
5692  return 0;
5693  break;
5694 #endif
5695 
5696  case spmd_kw:
5698  break;
5699 
5700  case endspmd_kw:
5701  tok_val = new token (kw->tok, token::spmd_end, m_tok_beg, m_tok_end);
5703  break;
5704 
5705  case magic_file_kw:
5706  {
5709  && ! m_fcn_file_full_name.empty ())
5710  tok_val = new token (kw->tok, m_fcn_file_full_name,
5711  m_tok_beg, m_tok_end);
5712  else
5713  tok_val = new token (kw->tok, "stdin", m_tok_beg, m_tok_end);
5714  }
5715  break;
5716 
5717  case magic_line_kw:
5718  {
5719  int l = m_tok_beg.line ();
5720  octave_value ov_value (static_cast<double> (l));
5721  tok_val = new token (kw->tok, ov_value, "", m_tok_beg, m_tok_end);
5722  }
5723  break;
5724 
5725  default:
5726  panic_impossible ();
5727  }
5728 
5729  if (! tok_val)
5730  tok_val = new token (kw->tok, true, m_tok_beg, m_tok_end);
5731 
5732  push_token (tok_val);
5733 
5734  return kw->tok;
5735  }
5736 
5737 /*
5738 
5739 ## check if magic file and line keywords are working
5740 %!assert <*62587> (ischar (__FILE__))
5741 %!assert <*62587> (isnumeric (__LINE__))
5742 
5743 */
5744 
5745  bool
5747  {
5748  std::size_t p1 = 0;
5749  std::size_t p2;
5750 
5751  std::string s_part;
5752 
5753  do
5754  {
5755  p2 = s.find ('.', p1);
5756 
5757  if (p2 != std::string::npos)
5758  {
5759  s_part = s.substr (p1, p2 - p1);
5760  p1 = p2 + 1;
5761  }
5762  else
5763  s_part = s.substr (p1);
5764 
5765  if (iskeyword (s_part))
5766  return true;
5767  }
5768  while (p2 != std::string::npos);
5769 
5770  return false;
5771  }
5772 
5773  bool
5775  {
5776  return (m_nesting_level.is_bracket ()
5777  || (m_nesting_level.is_brace ()
5778  && ! m_looking_at_object_index.front ()));
5779  }
5780 
5781 static inline bool
5782 looks_like_bin (const char *s, int len)
5783 {
5784  return (len > 2 && s[0] == '0' && (s[1] == 'b' || s[1] == 'B'));
5785 }
5786 
5787 static inline bool
5788 looks_like_hex (const char *s, int len)
5789 {
5790  return (len > 2 && s[0] == '0' && (s[1] == 'x' || s[1] == 'X'));
5791 }
5792 
5793 static inline octave_value
5794 make_integer_value (uintmax_t long_int_val, bool unsigned_val, int bytes)
5795 {
5796  if (unsigned_val)
5797  {
5798  switch (bytes)
5799  {
5800  case 1:
5801  return octave_value (octave_uint8 (long_int_val));
5802 
5803  case 2:
5804  return octave_value (octave_uint16 (long_int_val));
5805 
5806  case 4:
5807  return octave_value (octave_uint32 (long_int_val));
5808 
5809  case 8:
5810  return octave_value (octave_uint64 (long_int_val));
5811 
5812  default:
5813  panic_impossible ();
5814  };
5815  }
5816  else
5817  {
5818  // FIXME: Conversion to signed values is supposed to follow
5819  // twos-complement rules. Do we need to be more carefule here?
5820 
5821  switch (bytes)
5822  {
5823  case 1:
5824  return octave_value (octave_int8 (int8_t (long_int_val)));
5825 
5826  case 2:
5827  return octave_value (octave_int16 (int16_t (long_int_val)));
5828 
5829  case 4:
5830  return octave_value (octave_int32 (int32_t (long_int_val)));
5831 
5832  case 8:
5833  return octave_value (octave_int64 (int64_t (long_int_val)));
5834 
5835  default:
5836  panic_impossible ();
5837  };
5838  }
5839 
5840  return octave_value ();
5841 }
5842 
5843  template <>
5844  int
5845  base_lexer::handle_number<2> ()
5846  {
5847  // Skip 0[bB] prefix.
5848  std::string yytxt (flex_yytext () + 2);
5849 
5850  yytxt.erase (std::remove (yytxt.begin (), yytxt.end (), '_'),
5851  yytxt.end ());
5852 
5853  std::size_t pos = yytxt.find_first_of ("su");
5854 
5855  bool unsigned_val = true;
5856  int bytes = -1;
5857 
5858  if (pos == std::string::npos)
5859  {
5860  std::size_t num_digits = yytxt.length ();
5861 
5862  if (num_digits <= 8)
5863  bytes = 1;
5864  else if (num_digits <= 16)
5865  bytes = 2;
5866  else if (num_digits <= 32)
5867  bytes = 4;
5868  else if (num_digits <= 64)
5869  bytes = 8;
5870  }
5871  else
5872  {
5873  unsigned_val = (yytxt[pos] == 'u');
5874  std::string size_str = yytxt.substr (pos+1);
5875  yytxt = yytxt.substr (0, pos);
5876  std::size_t num_digits = yytxt.length ();
5877 
5878  if (size_str == "8" && num_digits <= 8)
5879  bytes = 1;
5880  else if (size_str == "16" && num_digits <= 16)
5881  bytes = 2;
5882  else if (size_str == "32" && num_digits <= 32)
5883  bytes = 4;
5884  else if (size_str == "64" && num_digits <= 64)
5885  bytes = 8;
5886  }
5887 
5888  if (bytes < 0)
5889  {
5890  token *tok
5891  = new token (LEXICAL_ERROR,
5892  "too many digits for binary constant",
5893  m_tok_beg, m_tok_end);
5894 
5895  push_token (tok);
5896 
5897  return count_token_internal (LEXICAL_ERROR);
5898  }
5899 
5900  // FIXME: is there a better way? Can uintmax_t be anything other
5901  // than long or long long? Should we just be using uint64_t instead
5902  // of uintmax_t?
5903 
5904  errno = 0;
5905  char *end;
5906  uintmax_t long_int_val;
5907  if (sizeof (uintmax_t) == sizeof (unsigned long long))
5908  long_int_val = strtoull (yytxt.c_str (), &end, 2);
5909  else if (sizeof (uintmax_t) == sizeof (unsigned long))
5910  long_int_val = strtoul (yytxt.c_str (), &end, 2);
5911  else
5912  panic_impossible ();
5913 
5914  if (errno == ERANGE)
5915  panic_impossible ();
5916 
5917  octave_value ov_value
5918  = make_integer_value (long_int_val, unsigned_val, bytes);
5919 
5922 
5923  update_token_positions (flex_yyleng ());
5924 
5925  push_token (new token (NUMBER, ov_value, yytxt, m_tok_beg, m_tok_end));
5926 
5927  return count_token_internal (NUMBER);
5928  }
5929 
5930  static uint64_t
5931  flintmax ()
5932  {
5933  return (static_cast<uint64_t> (1) << std::numeric_limits<double>::digits);
5934  }
5935 
5936  template <>
5937  int
5938  base_lexer::handle_number<10> ()
5939  {
5940  bool imag = false;
5941  bool digits_only = true;
5942 
5943  char *yytxt = flex_yytext ();
5944  std::size_t yylng = flex_yyleng ();
5945 
5946  OCTAVE_LOCAL_BUFFER (char, tmptxt, yylng + 1);
5947  char *rp = yytxt;
5948  char *p = &tmptxt[0];
5949 
5950  char ch;
5951  while ((ch = *rp++))
5952  {
5953  switch (ch)
5954  {
5955  case '_':
5956  break;
5957 
5958  case 'D':
5959  case 'd':
5960  *p++ = 'e';
5961  digits_only = false;
5962  break;
5963 
5964  case 'I':
5965  case 'J':
5966  case 'i':
5967  case 'j':
5968  // Octave does not provide imaginary integers.
5969  digits_only = false;
5970  imag = true;
5971  break;
5972 
5973  case '+':
5974  case '-':
5975  case '.':
5976  case 'E':
5977  case 'e':
5978  digits_only = false;
5979  *p++ = ch;
5980  break;
5981 
5982  default:
5983  *p++ = ch;
5984  break;
5985  }
5986  }
5987 
5988  *p = '\0';
5989 
5990  double value = 0.0;
5991  int nread = 0;
5992 
5993  nread = sscanf (tmptxt, "%lf", &value);
5994 
5995  // If yytext doesn't contain a valid number, we are in deep doo doo.
5996 
5997  assert (nread == 1);
5998 
5999  octave_value ov_value;
6000 
6001  // Use >= because > will not return true until value is greater than
6002  // flintmax + 2!
6003 
6004  if (digits_only && value >= flintmax ())
6005  {
6006  // Try reading as an unsigned 64-bit integer. If there is a
6007  // range error, then create a double value. Otherwise, create a
6008  // special uint64 object that will be automatically converted to
6009  // double unless it appears as the argument to one of the int64
6010  // or uint64 functions.
6011 
6012  errno = 0;
6013  char *end;
6014  uintmax_t long_int_val;
6015  if (sizeof (uintmax_t) == sizeof (unsigned long long))
6016  long_int_val = strtoull (tmptxt, &end, 10);
6017  else if (sizeof (uintmax_t) == sizeof (unsigned long))
6018  long_int_val = strtoul (tmptxt, &end, 10);
6019  else
6020  panic_impossible ();
6021 
6022  if (errno != ERANGE)
6023  {
6024  // If possible, store the value as a signed integer.
6025 
6026  octave_base_value *magic_int;
6027  if (long_int_val > std::numeric_limits<int64_t>::max ())
6028  magic_int = new octave_magic_uint (octave_uint64 (long_int_val));
6029  else
6030  magic_int = new octave_magic_int (octave_int64 (long_int_val));
6031 
6032  ov_value = octave_value (magic_int);
6033  }
6034  }
6035 
6038 
6039  update_token_positions (yylng);
6040 
6041  if (ov_value.is_undefined ())
6042  ov_value = (imag
6043  ? octave_value (Complex (0.0, value))
6044  : octave_value (value));
6045 
6046  push_token (new token (NUMBER, ov_value, yytxt, m_tok_beg, m_tok_end));
6047 
6048  return count_token_internal (NUMBER);
6049  }
6050 
6051  template <>
6052  int
6053  base_lexer::handle_number<16> ()
6054  {
6055  // Skip 0[xX] prefix.
6056  std::string yytxt (flex_yytext () + 2);
6057 
6058  yytxt.erase (std::remove (yytxt.begin (), yytxt.end (), '_'),
6059  yytxt.end ());
6060 
6061  std::size_t pos = yytxt.find_first_of ("su");
6062 
6063  bool unsigned_val = true;
6064  int bytes = -1;
6065 
6066  if (pos == std::string::npos)
6067  {
6068  std::size_t num_digits = yytxt.length ();
6069 
6070  if (num_digits <= 2)
6071  bytes = 1;
6072  else if (num_digits <= 4)
6073  bytes = 2;
6074  else if (num_digits <= 8)
6075  bytes = 4;
6076  else if (num_digits <= 16)
6077  bytes = 8;
6078  }
6079  else
6080  {
6081  unsigned_val = (yytxt[pos] == 'u');
6082  std::string size_str = yytxt.substr (pos+1);
6083  yytxt = yytxt.substr (0, pos);
6084  std::size_t num_digits = yytxt.length ();
6085 
6086  if (size_str == "8" && num_digits <= 2)
6087  bytes = 1;
6088  else if (size_str == "16" && num_digits <= 4)
6089  bytes = 2;
6090  else if (size_str == "32" && num_digits <= 8)
6091  bytes = 4;
6092  else if (size_str == "64" && num_digits <= 16)
6093  bytes = 8;
6094  }
6095 
6096  if (bytes < 0)
6097  {
6098  token *tok
6099  = new token (LEXICAL_ERROR,
6100  "too many digits for hexadecimal constant",
6101  m_tok_beg, m_tok_end);
6102 
6103  push_token (tok);
6104 
6105  return count_token_internal (LEXICAL_ERROR);
6106  }
6107 
6108  // Assert here because if yytext doesn't contain a valid number, we
6109  // are in deep doo doo.
6110 
6111  uintmax_t long_int_val;
6112  int status = sscanf (yytxt.c_str (), "%jx", &long_int_val);
6113  assert (status);
6114 
6115  octave_value ov_value
6116  = make_integer_value (long_int_val, unsigned_val, bytes);
6117 
6120 
6121  update_token_positions (flex_yyleng ());
6122 
6123  push_token (new token (NUMBER, ov_value, yytxt, m_tok_beg, m_tok_end));
6124 
6125  return count_token_internal (NUMBER);
6126  }
6127 
6128  void
6130  {
6131  char *yytxt = flex_yytext ();
6132  int yylng = flex_yyleng ();
6133 
6134  int offset = 1;
6135  if (yytxt[0] == '\\')
6136  warn_language_extension_continuation ();
6137  else
6138  offset = 3;
6139 
6140  bool have_space = false;
6141  while (offset < yylng)
6142  {
6143  char c = yytxt[offset];
6144  if (is_space_or_tab (c))
6145  {
6146  have_space = true;
6147  offset++;
6148  }
6149  else
6150  break;
6151  }
6152 
6153  if (have_space)
6155 
6156  bool have_comment = false;
6157  bool first = true;
6158  while (offset < yylng)
6159  {
6160  char c = yytxt[offset];
6161 
6162  if (c == '#' || c == '%')
6163  {
6164  if (first && c == '#')
6165  {
6166  m_comment_uses_hash_char = true;
6167  first = false;
6168  }
6169 
6170  have_comment = true;
6171  offset++;
6172  }
6173  else
6174  break;
6175  }
6176 
6177  if (have_comment)
6178  {
6179  m_comment_text = &yytxt[offset];
6180 
6181  // finish_comment sets m_at_beginning_of_statement to true but
6182  // that's not be correct if we are handling a continued
6183  // statement. Preserve the current state.
6184 
6185  bool saved_bos = m_at_beginning_of_statement;
6186 
6187  finish_comment (comment_elt::end_of_line);
6188 
6189  m_at_beginning_of_statement = saved_bos;
6190  }
6191 
6192  m_filepos.next_line ();
6193  }
6194 
6195  void
6197  {
6198  if (looks_like_copyright (m_comment_text))
6199  typ = comment_elt::copyright;
6200 
6201  m_comment_buf.append (m_comment_text, typ, m_comment_uses_hash_char);
6202 
6203  m_comment_text = "";
6204  m_comment_uses_hash_char = false;
6206  }
6207 
6208  int
6210  {
6211  m_looking_at_object_index.pop_front ();
6212 
6215 
6216  if (! m_nesting_level.none ())
6217  {
6219 
6220  if (bracket_type == ']')
6221  m_bracketflag--;
6222  else if (bracket_type == '}')
6223  m_braceflag--;
6224  else
6225  panic_impossible ();
6226  }
6227 
6228  pop_start_state ();
6229 
6230  return count_token (bracket_type);
6231  }
6232 
6233  bool
6235  {
6236  if (! m_allow_command_syntax)
6237  return false;
6238 
6239  bool space_before = space_follows_previous_token ();
6240  bool space_after = looking_at_space ();
6241 
6242  return (space_before && ! space_after
6244  }
6245 
6246  int
6248  {
6249  update_token_positions (flex_yyleng ());
6250 
6251  std::string txt = flex_yytext ();
6252 
6253  txt.erase (std::remove_if (txt.begin (), txt.end (), is_space_or_tab),
6254  txt.end ());
6255 
6256  std::size_t pos = txt.find ("@");
6257 
6258  std::string meth = txt.substr (0, pos);
6259  std::string cls = txt.substr (pos + 1);
6260 
6261  if (iskeyword (meth) || fq_identifier_contains_keyword (cls))
6262  {
6263  token *tok
6264  = new token (LEXICAL_ERROR,
6265  "method, class, and package names may not be keywords",
6266  m_tok_beg, m_tok_end);
6267 
6268  push_token (tok);
6269 
6270  return count_token_internal (LEXICAL_ERROR);
6271  }
6272 
6273  push_token (new token (SUPERCLASSREF, meth, cls, m_tok_beg, m_tok_end));
6274 
6275  m_filepos.increment_column (flex_yyleng ());
6276 
6277  return count_token_internal (SUPERCLASSREF);
6278  }
6279 
6280  int
6282  {
6283  std::string txt = flex_yytext ();
6284 
6285  txt.erase (std::remove_if (txt.begin (), txt.end (), is_space_or_tab),
6286  txt.end ());
6287 
6288  // Eliminate leading '?'
6289  std::string cls = txt.substr (1);
6290 
6291  // Token positions should have already been updated before this
6292  // function is called.
6293 
6294  if (fq_identifier_contains_keyword (cls))
6295  {
6296  token *tok = new token (LEXICAL_ERROR,
6297  "class and package names may not be keywords",
6298  m_tok_beg, m_tok_end);
6299  push_token (tok);
6300 
6301  return count_token_internal (LEXICAL_ERROR);
6302  }
6303 
6304  push_token (new token (METAQUERY, cls, m_tok_beg, m_tok_end));
6305 
6306  m_filepos.increment_column (flex_yyleng ());
6307 
6308  return METAQUERY;
6309  }
6310 
6311  int
6313  {
6314  std::string txt = flex_yytext ();
6315 
6316  txt.erase (std::remove_if (txt.begin (), txt.end (), is_space_or_tab),
6317  txt.end ());
6318 
6319  // Token positions should have already been updated before this
6320  // function is called.
6321 
6322  if (fq_identifier_contains_keyword (txt))
6323  {
6324  token *tok
6325  = new token (LEXICAL_ERROR,
6326  "function, method, class, and package names may not be keywords",
6327  m_tok_beg, m_tok_end);
6328 
6329  push_token (tok);
6330 
6331  return count_token_internal (LEXICAL_ERROR);
6332  }
6333 
6334  push_token (new token (FQ_IDENT, txt, m_tok_beg, m_tok_end));
6335 
6336  m_filepos.increment_column (flex_yyleng ());
6337 
6338  return FQ_IDENT;
6339  }
6340 
6341  // Figure out exactly what kind of token to return when we have seen
6342  // an identifier. Handles keywords. Return -1 if the identifier
6343  // should be ignored.
6344 
6345  int
6347  {
6348  update_token_positions (flex_yyleng ());
6349 
6350  std::string ident = flex_yytext ();
6351 
6352  // If we are expecting a structure element, avoid recognizing
6353  // keywords and other special names and return STRUCT_ELT, which is
6354  // a string that is also a valid identifier.
6355 
6357  {
6358  push_token (new token (STRUCT_ELT, ident, m_tok_beg, m_tok_end));
6359 
6361 
6362  return STRUCT_ELT;
6363  }
6364 
6365  // If ident is a keyword token, then make_keyword_token will set
6366  // m_at_beginning_of_statement. For example, if tok is an IF
6367  // token, then m_at_beginning_of_statement will be false.
6368 
6369  int kw_token = make_keyword_token (ident);
6370 
6371  // If we have a regular keyword, return it.
6372  // Keywords can be followed by identifiers.
6373 
6374  if (kw_token)
6375  {
6377 
6378  // The call to make_keyword_token set m_at_beginning_of_statement.
6379 
6380  return count_token_internal (kw_token);
6381  }
6382 
6383  token *tok = new token (NAME, ident, m_tok_beg, m_tok_end);
6384 
6385  // For compatibility with Matlab, the following symbols are
6386  // handled specially so that things like
6387  //
6388  // pi +1
6389  //
6390  // are parsed as an addition expression instead of as a command-style
6391  // function call with the argument "+1".
6392 
6395  || ident == "e" || ident == "pi"
6396  || ident == "I" || ident == "i"
6397  || ident == "J" || ident == "j"
6398  || ident == "Inf" || ident == "inf"
6399  || ident == "NaN" || ident == "nan"))
6400  tok->mark_may_be_command ();
6401 
6402  push_token (tok);
6403 
6404  // The magic end index can't be indexed.
6405 
6406  if (ident != "end")
6408 
6410 
6411  return count_token_internal (NAME);
6412  }
6413 
6414  void
6415  base_lexer::check_comment_for_hash_char (const char *txt, std::size_t len)
6416  {
6418  return;
6419 
6420  std::size_t i = 0;
6421  while (i < len && is_space_or_tab (txt[i]))
6422  i++;
6423 
6424  m_comment_uses_hash_char = txt[i] == '#';
6425  }
6426 
6427  void
6429  {
6430  std::string nm = m_fcn_file_full_name;
6431 
6432  if (nm.empty ())
6433  warning_with_id ("Octave:separator-insert",
6434  "potential auto-insertion of '%c' near line %d",
6435  sep, m_filepos.line ());
6436  else
6437  warning_with_id ("Octave:separator-insert",
6438  "potential auto-insertion of '%c' near line %d of file %s",
6439  sep, m_filepos.line (), nm.c_str ());
6440  }
6441 
6442  void
6443  base_lexer::warn_language_extension (const std::string& msg)
6444  {
6445  std::string nm = m_fcn_file_full_name;
6446 
6447  if (nm.empty ())
6448  warning_with_id ("Octave:language-extension",
6449  "Octave language extension used: %s",
6450  msg.c_str ());
6451  else
6452  warning_with_id ("Octave:language-extension",
6453  "Octave language extension used: %s near line %d offile %s",
6454  msg.c_str (), m_filepos.line (), nm.c_str ());
6455  }
6456 
6457  void
6459  {
6460  if (c == '#')
6461  warn_language_extension ("# used as comment character");
6462  }
6463 
6464  void
6466  {
6467  warn_language_extension ("\\ used as line continuation marker");
6468  }
6469 
6470  void
6472  {
6473  std::string t = op;
6474  int n = t.length ();
6475  if (t[n-1] == '\n')
6476  t.resize (n-1);
6477  warn_language_extension (t + " used as operator");
6478  }
6479 
6480  void
6481  base_lexer::warn_deprecated_syntax (const std::string& msg)
6482  {
6483  if (m_fcn_file_full_name.empty ())
6484  warning_with_id ("Octave:deprecated-syntax", "%s", msg.c_str ());
6485  else
6486  warning_with_id ("Octave:deprecated-syntax",
6487  "%s; near line %d of file '%s'", msg.c_str (),
6488  m_filepos.line (), m_fcn_file_full_name.c_str ());
6489  }
6490 
6491  void
6493  {
6494  YYSTYPE *lval = yyget_lval (m_scanner);
6495  lval->tok_val = tok;
6496  m_tokens.push (tok);
6497  }
6498 
6499  token *
6501  {
6502  YYSTYPE *lval = yyget_lval (m_scanner);
6503  return lval->tok_val;
6504  }
6505 
6506  std::size_t
6508  {
6509  return m_tokens.size ();
6510  }
6511 
6512  void
6514  {
6515  switch (tok)
6516  {
6517  case '=': std::cerr << "'='\n"; break;
6518  case ':': std::cerr << "':'\n"; break;
6519  case '-': std::cerr << "'-'\n"; break;
6520  case '+': std::cerr << "'+'\n"; break;
6521  case '*': std::cerr << "'*'\n"; break;
6522  case '/': std::cerr << "'/'\n"; break;
6523  case '~': std::cerr << "'~'\n"; break;
6524  case '!': std::cerr << "'!'\n"; break;
6525  case ADD_EQ: std::cerr << "ADD_EQ\n"; break;
6526  case SUB_EQ: std::cerr << "SUB_EQ\n"; break;
6527  case MUL_EQ: std::cerr << "MUL_EQ\n"; break;
6528  case DIV_EQ: std::cerr << "DIV_EQ\n"; break;
6529  case LEFTDIV_EQ: std::cerr << "LEFTDIV_EQ\n"; break;
6530  case POW_EQ: std::cerr << "POW_EQ\n"; break;
6531  case EMUL_EQ: std::cerr << "EMUL_EQ\n"; break;
6532  case EDIV_EQ: std::cerr << "EDIV_EQ\n"; break;
6533  case ELEFTDIV_EQ: std::cerr << "ELEFTDIV_EQ\n"; break;
6534  case EPOW_EQ: std::cerr << "EPOW_EQ\n"; break;
6535  case AND_EQ: std::cerr << "AND_EQ\n"; break;
6536  case OR_EQ: std::cerr << "OR_EQ\n"; break;
6537  case EXPR_AND_AND: std::cerr << "EXPR_AND_AND\n"; break;
6538  case EXPR_OR_OR: std::cerr << "EXPR_OR_OR\n"; break;
6539  case EXPR_AND: std::cerr << "EXPR_AND\n"; break;
6540  case EXPR_OR: std::cerr << "EXPR_OR\n"; break;
6541  case EXPR_LT: std::cerr << "EXPR_LT\n"; break;
6542  case EXPR_LE: std::cerr << "EXPR_LE\n"; break;
6543  case EXPR_EQ: std::cerr << "EXPR_EQ\n"; break;
6544  case EXPR_NE: std::cerr << "EXPR_NE\n"; break;
6545  case EXPR_GE: std::cerr << "EXPR_GE\n"; break;
6546  case EXPR_GT: std::cerr << "EXPR_GT\n"; break;
6547  case LEFTDIV: std::cerr << "LEFTDIV\n"; break;
6548  case EMUL: std::cerr << "EMUL\n"; break;
6549  case EDIV: std::cerr << "EDIV\n"; break;
6550  case ELEFTDIV: std::cerr << "ELEFTDIV\n"; break;
6551  case HERMITIAN: std::cerr << "HERMITIAN\n"; break;
6552  case TRANSPOSE: std::cerr << "TRANSPOSE\n"; break;
6553  case PLUS_PLUS: std::cerr << "PLUS_PLUS\n"; break;
6554  case MINUS_MINUS: std::cerr << "MINUS_MINUS\n"; break;
6555  case POW: std::cerr << "POW\n"; break;
6556  case EPOW: std::cerr << "EPOW\n"; break;
6557 
6558  case NUMBER:
6559  {
6560  token *tok_val = current_token ();
6561  std::cerr << "NUMBER [";
6562  octave_value num = tok_val->number ();
6563  num.print_raw (std::cerr);
6564  std::cerr << "]\n";
6565  }
6566  break;
6567 
6568  case STRUCT_ELT:
6569  {
6570  token *tok_val = current_token ();
6571  std::cerr << "STRUCT_ELT [" << tok_val->text () << "]\n";
6572  }
6573  break;
6574 
6575  case NAME:
6576  {
6577  token *tok_val = current_token ();
6578  std::cerr << "NAME [" << tok_val->text () << "]\n";
6579  }
6580  break;
6581 
6582  case END: std::cerr << "END\n"; break;
6583 
6584  case DQ_STRING:
6585  case SQ_STRING:
6586  {
6587  token *tok_val = current_token ();
6588 
6589  std::cerr << (tok == DQ_STRING ? "DQ_STRING" : "SQ_STRING")
6590  << " [" << tok_val->text () << "]\n";
6591  }
6592  break;
6593 
6594  case FOR: std::cerr << "FOR\n"; break;
6595  case WHILE: std::cerr << "WHILE\n"; break;
6596  case DO: std::cerr << "DO\n"; break;
6597  case UNTIL: std::cerr << "UNTIL\n"; break;
6598  case IF: std::cerr << "IF\n"; break;
6599  case ELSEIF: std::cerr << "ELSEIF\n"; break;
6600  case ELSE: std::cerr << "ELSE\n"; break;
6601  case SWITCH: std::cerr << "SWITCH\n"; break;
6602  case CASE: std::cerr << "CASE\n"; break;
6603  case OTHERWISE: std::cerr << "OTHERWISE\n"; break;
6604  case BREAK: std::cerr << "BREAK\n"; break;
6605  case CONTINUE: std::cerr << "CONTINUE\n"; break;
6606  case FUNC_RET: std::cerr << "FUNC_RET\n"; break;
6607  case UNWIND: std::cerr << "UNWIND\n"; break;
6608  case CLEANUP: std::cerr << "CLEANUP\n"; break;
6609  case TRY: std::cerr << "TRY\n"; break;
6610  case CATCH: std::cerr << "CATCH\n"; break;
6611  case GLOBAL: std::cerr << "GLOBAL\n"; break;
6612  case PERSISTENT: std::cerr << "PERSISTENT\n"; break;
6613  case FCN_HANDLE: std::cerr << "FCN_HANDLE\n"; break;
6614  case END_OF_INPUT: std::cerr << "END_OF_INPUT\n\n"; break;
6615  case LEXICAL_ERROR: std::cerr << "LEXICAL_ERROR\n\n"; break;
6616  case FCN: std::cerr << "FCN\n"; break;
6617  case INPUT_FILE: std::cerr << "INPUT_FILE\n"; break;
6618  case SUPERCLASSREF: std::cerr << "SUPERCLASSREF\n"; break;
6619  case METAQUERY: std::cerr << "METAQUERY\n"; break;
6620  case GET: std::cerr << "GET\n"; break;
6621  case SET: std::cerr << "SET\n"; break;
6622  case PROPERTIES: std::cerr << "PROPERTIES\n"; break;
6623  case METHODS: std::cerr << "METHODS\n"; break;
6624  case EVENTS: std::cerr << "EVENTS\n"; break;
6625  case CLASSDEF: std::cerr << "CLASSDEF\n"; break;
6626  case '\n': std::cerr << "\\n\n"; break;
6627  case '\r': std::cerr << "\\r\n"; break;
6628  case '\t': std::cerr << "TAB\n"; break;
6629  default:
6630  {
6631  if (tok < 256 && tok > 31)
6632  std::cerr << static_cast<char> (tok) << "\n";
6633  else
6634  std::cerr << "UNKNOWN(" << tok << ")\n";
6635  }
6636  break;
6637  }
6638  }
6639 
6640  void
6641  base_lexer::fatal_error (const char *msg)
6642  {
6643  error ("fatal lexer error: %s", msg);
6644  }
6645 
6646  bool
6648  {
6649  settings& stgs = m_interpreter.get_settings ();
6650  return stgs.lexer_debug_flag ();
6651  }
6652 
6653  bool
6655  {
6656  settings& stgs = m_interpreter.get_settings ();
6657  return stgs.display_tokens ();
6658  }
6659 
6660  void
6662  {
6663  settings& stgs = m_interpreter.get_settings ();
6664  stgs.increment_token_count ();
6665 
6666  m_token_count++;
6667  }
6668 
6669  void
6670  base_lexer::lexer_debug (const char *pattern)
6671  {
6672  if (debug_flag ())
6673  {
6674  std::cerr << std::endl;
6675 
6676  display_start_state ();
6677 
6678  std::cerr << "P: " << pattern << std::endl;
6679  std::cerr << "T: " << flex_yytext () << std::endl;
6680  }
6681  }
6682 
6683  bool
6685  {
6687 
6688  return history_sys.input_from_tmp_file ();
6689  }
6690 
6691  void
6693  {
6694  OCTAVE_YYG;
6695 
6696  start_state_stack.push (state);
6697 
6698  BEGIN (start_state ());
6699  }
6700 
6701  void
6703  {
6704  OCTAVE_YYG;
6705 
6706  start_state_stack.pop ();
6707 
6708  BEGIN (start_state ());
6709  }
6710 
6711  void
6713  {
6714  while (! start_state_stack.empty ())
6715  start_state_stack.pop ();
6716 
6717  push_start_state (INITIAL);
6718  }
6719 
6720  void
6722  {
6723  std::cerr << "S: ";
6724 
6725  switch (start_state ())
6726  {
6727  case INITIAL:
6728  std::cerr << "INITIAL" << std::endl;
6729  break;
6730 
6731  case COMMAND_START:
6732  std::cerr << "COMMAND_START" << std::endl;
6733  break;
6734 
6735  case MATRIX_START:
6736  std::cerr << "MATRIX_START" << std::endl;
6737  break;
6738 
6739  case INPUT_FILE_START:
6740  std::cerr << "INPUT_FILE_START" << std::endl;
6741  break;
6742 
6743  case BLOCK_COMMENT_START:
6744  std::cerr << "BLOCK_COMMENT_START" << std::endl;
6745  break;
6746 
6747  case LINE_COMMENT_START:
6748  std::cerr << "LINE_COMMENT_START" << std::endl;
6749  break;
6750 
6751  case DQ_STRING_START:
6752  std::cerr << "DQ_STRING_START" << std::endl;
6753  break;
6754 
6755  case SQ_STRING_START:
6756  std::cerr << "SQ_STRING_START" << std::endl;
6757  break;
6758 
6759  case FQ_IDENT_START:
6760  std::cerr << "FQ_IDENT_START" << std::endl;
6761  break;
6762 
6763  default:
6764  std::cerr << "UNKNOWN START STATE!" << std::endl;
6765  break;
6766  }
6767  }
6768 
6769  bool
6771  {
6772  int prev_tok = previous_token_value ();
6773 
6774  bool unput_comma = false;
6775 
6776  if (whitespace_is_significant () && space_follows_previous_token ())
6777  {
6778  int c = text_yyinput ();
6779  xunput (c);
6780 
6781  bool space_after = is_space_or_tab (c);
6782 
6783  if (! (prev_tok == '[' || prev_tok == '{'
6785  || ((tok == '+' || tok == '-') && space_after)))
6786  unput_comma = true;
6787  }
6788 
6789  return unput_comma;
6790  }
6791 
6792  int
6793  base_lexer::handle_op (int tok, bool bos, bool compat)
6794  {
6795  if (! compat)
6796  warn_language_extension_operator (flex_yytext ());
6797 
6798  update_token_positions (flex_yyleng ());
6799 
6800  push_token (new token (tok, m_tok_beg, m_tok_end));
6801 
6804 
6805  switch (tok)
6806  {
6807  case EXPR_LT:
6809  {
6811  push_start_state (FQ_IDENT_START);
6812  }
6813  break;
6814 
6815  case EXPR_AND:
6817  push_start_state (FQ_IDENT_START);
6818  break;
6819 
6820  default:
6821  break;
6822  }
6823 
6824  return count_token_internal (tok);
6825  }
6826 
6827  // When a command argument boundary is detected, push out the current
6828  // argument being built. This one seems like a good candidate for a
6829  // function call.
6830 
6831  int
6833  {
6834  int tok = SQ_STRING;
6835 
6836  token *tok_val = new token (tok, m_string_text, m_tok_beg, m_tok_end);
6837 
6838  m_string_text = "";
6840 
6841  return handle_token (tok, tok_val);
6842  }
6843 
6844  int
6845  base_lexer::handle_token (int tok, token *tok_val)
6846  {
6847  if (! tok_val)
6848  tok_val = new token (tok, m_tok_beg, m_tok_end);
6849 
6850  push_token (tok_val);
6851 
6852  return count_token_internal (tok);
6853  }
6854 
6855  int
6857  {
6858  token *tok_val = new token (tok, m_tok_beg, m_tok_end);
6859 
6860  push_token (tok_val);
6861 
6862  return count_token_internal (tok);
6863  }
6864 
6865  int
6867  {
6868  if (tok != '\n')
6869  increment_token_count ();
6870 
6871  return show_token (tok);
6872  }
6873 
6874  int
6876  {
6877 
6878  if (display_tokens ())
6879  display_token (tok);
6880 
6881  if (debug_flag ())
6882  {
6883  std::cerr << "R: ";
6884  display_token (tok);
6885  std::cerr << std::endl;
6886  }
6887 
6888  return tok;
6889  }
6890 
6891  int
6892  lexer::fill_flex_buffer (char *buf, unsigned max_size)
6893  {
6894  int status = 0;
6895 
6896  if (m_input_buf.empty ())
6897  {
6898  std::string ps
6899  = m_initial_input ? m_interpreter.PS1 () : m_interpreter.PS2 ();
6900 
6901  std::string prompt = command_editor::decode_prompt_string (ps);
6902 
6903  bool eof = false;
6904  m_current_input_line = m_reader.get_input (prompt, eof);
6905 
6906  m_input_buf.fill (m_current_input_line, eof);
6907 
6908  // Attempt to capture text for functions defined on the
6909  // command line.
6910  //
6911  // FIXME: the handling of newline here seems a bit clumsy.
6912  //
6913  // See also comments in push_lexer::append_input.
6914 
6916  {
6917  if (! m_current_input_line.empty ())
6918  {
6920  if (m_current_input_line.back () != '\n')
6921  m_function_text += '\n';
6922  }
6923  }
6924  }
6925 
6926  if (! m_input_buf.empty ())
6927  status = m_input_buf.copy_chunk (buf, max_size);
6928  else
6929  status = YY_NULL;
6930 
6931  m_initial_input = false;
6932 
6933  return status;
6934  }
6935 
6936  void
6937  push_lexer::append_input (const std::string& input, bool eof)
6938  {
6939  // FIXME: input may contain more than one line, so how can we
6940  // properly start buffering input for command-line functions?
6941  //
6942  // Currently, base_lexer::make_keyword_token starts buffering text
6943  // for command-line functions by setting the initial value of
6944  // m_function_text to m_current_input_line when function_kw is
6945  // recognized. To make that work, we need to do something like
6946  // maintain a queue of input strings and pass them to the flex
6947  // buffer one line at a time, while also setting
6948  // m_current_input_line. Some care will be needed if a single line
6949  // of input arrives in multiple calls to append_input.
6950  //
6951  // OR, should we require that the input string to append_input
6952  // IS a single line of input? That seems to be what we are doing
6953  // here by setting m_current_input_line to input.
6954 
6955  m_input_buf.fill (input, eof);
6956  m_current_input_line = input;
6957  }
6958 
6959  int
6960  push_lexer::fill_flex_buffer (char *buf, unsigned max_size)
6961  {
6962  int status = 0;
6963 
6964  if (m_input_buf.empty () && ! m_input_buf.at_eof ())
6965  {
6966  // If the input buffer is empty or we are at the end of the
6967  // buffer, insert ASCII 1 as a marker for subsequent rules.
6968  // Don't insert a newline character in this case. Instead of
6969  // calling input_buffer::fill followed immediately by
6970  // input_buffer::copy_chunk, simply insert the marker directly
6971  // in BUF.
6972 
6973  assert (max_size > 0);
6974 
6975  buf[0] = static_cast<char> (1);
6976  status = 1;
6977  }
6978  else
6979  {
6980  // Note that the copy_chunk function may append a newline
6981  // character to the input.
6982 
6983  if (! m_input_buf.empty ())
6984  status = m_input_buf.copy_chunk (buf, max_size, true);
6985  else
6986  status = YY_NULL;
6987  }
6988 
6989  return status;
6990  }
6991 
6992 OCTAVE_END_NAMESPACE(octave)
6993 
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:230
Definition: Cell.h:43
int copy_chunk(char *buf, std::size_t max_size, bool by_lines=false)
Definition: lex.cc:5212
void fill(const std::string &input, bool eof_arg)
Definition: lex.cc:5202
int make_keyword_token(const std::string &s)
Definition: lex.cc:5464
void maybe_warn_separator_insert(char sep)
Definition: lex.cc:6428
void warn_language_extension_operator(const std::string &op)
Definition: lex.cc:6471
int handle_superclass_identifier()
Definition: lex.cc:6247
int handle_op(int tok, bool bos=false, bool compat=true)
Definition: lex.cc:6793
void push_start_state(int state)
Definition: lex.cc:6692
int handle_close_bracket(int bracket_type)
Definition: lex.cc:6209
bool looking_at_space()
Definition: lex.cc:5439
bool inside_any_object_index()
Definition: lex.cc:5447
int count_token_internal(int tok)
Definition: lex.cc:6866
void begin_string(int state)
Definition: lex.cc:5323
bool input_from_tmp_history_file()
Definition: lex.cc:6684
int show_token(int tok)
Definition: lex.cc:6875
void update_token_positions(int tok_len)
Definition: lex.cc:5427
int handle_end_of_input()
Definition: lex.cc:5331
void maybe_warn_language_extension_comment(char c)
Definition: lex.cc:6458
bool looks_like_command_arg()
Definition: lex.cc:6234
bool fq_identifier_contains_keyword(const std::string &s)
Definition: lex.cc:5746
void warn_deprecated_syntax(const std::string &msg)
Definition: lex.cc:6481
void push_token(token *)
Definition: lex.cc:6492
void warn_language_extension(const std::string &msg)
Definition: lex.cc:6443
void finish_comment(comment_elt::comment_type typ)
Definition: lex.cc:6196
void display_start_state() const
Definition: lex.cc:6721
void prep_for_file()
Definition: lex.cc:5315
void init()
Definition: lex.cc:5271
void warn_language_extension_continuation()
Definition: lex.cc:6465
void display_token(int tok)
Definition: lex.cc:6513
int handle_identifier()
Definition: lex.cc:6346
int text_yyinput()
Definition: lex.cc:5368
void fatal_error(const char *msg)
Definition: lex.cc:6641
void clear_start_state()
Definition: lex.cc:6712
void handle_continuation()
Definition: lex.cc:6129
bool debug_flag() const
Definition: lex.cc:6647
void xunput(char c, char *buf)
Definition: lex.cc:5403
std::size_t pending_token_count() const
Definition: lex.cc:6507
int handle_meta_identifier()
Definition: lex.cc:6281
virtual void reset()
Definition: lex.cc:5292
void check_comment_for_hash_char(const char *txt, std::size_t len)
Definition: lex.cc:6415
int handle_token(int tok, token *tok_val=nullptr)
Definition: lex.cc:6845
virtual ~base_lexer()
Definition: lex.cc:5265
bool whitespace_is_significant()
Definition: lex.cc:5774
bool display_tokens() const
Definition: lex.cc:6654
char * flex_yytext()
Definition: lex.cc:5356
int count_token(int tok)
Definition: lex.cc:6856
int flex_yyleng()
Definition: lex.cc:5362
void lexer_debug(const char *pattern)
Definition: lex.cc:6670
int finish_command_arg()
Definition: lex.cc:6832
void pop_start_state()
Definition: lex.cc:6702
bool maybe_unput_comma_before_unary_op(int tok)
Definition: lex.cc:6770
int handle_fq_identifier()
Definition: lex.cc:6312
void increment_token_count()
Definition: lex.cc:6661
token * current_token()
Definition: lex.cc:6500
static std::string decode_prompt_string(const std::string &s)
Definition: cmd-edit.cc:1275
void next_line()
Definition: filepos.h:61
void increment_column(int val=1)
Definition: filepos.h:56
void line(int l)
Definition: filepos.h:49
octave_value input_from_tmp_file(const octave_value_list &args, int nargout)
Definition: oct-hist.cc:299
symbol_scope get_current_scope() const
settings & get_settings()
Definition: interpreter.h:246
octave_value PS1(const octave_value_list &args, int nargout)
history_system & get_history_system()
Definition: interpreter.h:273
bool interactive() const
Definition: interpreter.h:165
octave_value PS2(const octave_value_list &args, int nargout)
int fill_flex_buffer(char *buf, unsigned int max_size)
Definition: lex.cc:6892
symbol_scope curr_scope() const
Definition: lex.cc:5003
symbol_scope parent_scope() const
Definition: lex.cc:5012
std::size_t size() const
Definition: lex.h:249
void push(token *tok)
Definition: lex.h:202
bool m_looking_at_parameter_list
Definition: lex.h:365
bool m_reading_classdef_file
Definition: lex.h:432
bool previous_token_is_binop() const
Definition: lex.cc:5124
bool space_follows_previous_token() const
Definition: lex.cc:5117
bool m_looking_at_anon_fcn_args
Definition: lex.h:359
std::string m_package_name
Definition: lex.h:500
void mark_as_variables(const std::list< std::string > &lst)
Definition: lex.cc:5160
bool previous_token_is_keyword() const
Definition: lex.cc:5144
filepos m_filepos
Definition: lex.h:468
bool m_arguments_is_keyword
Definition: lex.h:383
std::string m_current_input_line
Definition: lex.h:481
bool m_end_of_input
Definition: lex.h:349
bool m_allow_command_syntax
Definition: lex.h:352
int m_looping
Definition: lex.h:449
bool m_parsing_classdef_set_method
Definition: lex.h:416
int m_bracketflag
Definition: lex.h:443
bool m_parsing_anon_fcn_body
Definition: lex.h:390
~lexical_feedback()
Definition: lex.cc:5021
std::string m_comment_text
Definition: lex.h:485
token_cache m_tokens
Definition: lex.h:519
std::stack< bool > m_parsed_function_name
Definition: lex.h:509
bool m_at_beginning_of_statement
Definition: lex.h:356
int m_block_comment_nesting_level
Definition: lex.h:458
bool previous_token_may_be_command() const
Definition: lex.cc:5169
int m_command_arg_paren_count
Definition: lex.h:461
std::string m_fcn_file_full_name
Definition: lex.h:494
bool m_looking_at_return_list
Definition: lex.h:362
bool m_parsing_classdef_get_method
Definition: lex.h:413
std::string m_string_text
Definition: lex.h:478
std::list< bool > m_looking_at_object_index
Definition: lex.h:504
int m_braceflag
Definition: lex.h:446
bool m_parsing_classdef_decl
Definition: lex.h:401
bool m_looking_at_matrix_or_assign_lhs
Definition: lex.h:373
bool previous_token_value_is(int tok_val) const
Definition: lex.cc:5102
bool m_parsing_classdef_superclass
Definition: lex.h:405
bool m_looking_for_object_index
Definition: lex.h:376
interpreter & m_interpreter
Definition: lex.h:346
bbp_nesting_level m_nesting_level
Definition: lex.h:516
bool m_parsing_classdef
Definition: lex.h:396
bool m_reading_script_file
Definition: lex.h:429
bool m_classdef_element_names_are_keywords
Definition: lex.h:387
bool m_reading_fcn_file
Definition: lex.h:426
std::size_t m_token_count
Definition: lex.h:465
std::string m_function_text
Definition: lex.h:488
bool m_comment_uses_hash_char
Definition: lex.h:440
filepos m_tok_end
Definition: lex.h:475
std::string m_fcn_file_name
Definition: lex.h:491
bool m_looking_at_decl_list
Definition: lex.h:369
symbol_table_context m_symtab_context
Definition: lex.h:512
bool m_quote_is_transpose
Definition: lex.h:419
filepos m_tok_beg
Definition: lex.h:474
bool m_parsing_class_method
Definition: lex.h:393
void mark_previous_token_trailing_space()
Definition: lex.cc:5109
bool m_buffer_function_text
Definition: lex.h:436
bool m_force_script
Definition: lex.h:423
void reset()
Definition: lex.cc:5035
int previous_token_value() const
Definition: lex.cc:5095
void mark_as_variable(const std::string &nm)
Definition: lex.cc:5151
std::string m_dir_name
Definition: lex.h:497
bool m_maybe_classdef_get_set_method
Definition: lex.h:410
bool m_looking_at_indirect_ref
Definition: lex.h:380
int m_looking_at_function_handle
Definition: lex.h:455
int m_defining_fcn
Definition: lex.h:452
void init()
Definition: lex.cc:5027
static const struct octave_kw * in_word_set(const char *str, size_t len)
Definition: oct-gperf.h:294
bool is_undefined() const
Definition: ov.h:595
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Definition: ov.h:1324
octave_idx_type length() const
int fill_flex_buffer(char *buf, unsigned int max_size)
Definition: lex.cc:6960
void append_input(const std::string &input, bool eof)
Definition: lex.cc:6937
octave_value lexer_debug_flag(const octave_value_list &args, int nargout)
Definition: settings.cc:53
octave_value display_tokens(const octave_value_list &args, int nargout)
Definition: settings.cc:45
void increment_token_count()
Definition: settings.h:68
string_vector & sort(bool make_uniq=false)
Definition: str-vec.cc:77
void resize(octave_idx_type n, const std::string &rfv="")
Definition: str-vec.h:95
void mark_as_variable(const std::string &nm)
Definition: symscope.h:674
static symbol_scope invalid()
Definition: symscope.h:400
void mark_as_variables(const std::list< std::string > &lst)
Definition: symscope.h:680
Definition: token.h:39
int token_value() const
Definition: token.h:102
void mark_trailing_space()
Definition: token.h:99
bool token_value_is(int tv) const
Definition: token.h:103
@ events_end
Definition: token.h:58
@ methods_end
Definition: token.h:62
@ enumeration_end
Definition: token.h:57
@ unwind_protect_end
Definition: token.h:67
@ try_catch_end
Definition: token.h:66
@ properties_end
Definition: token.h:64
@ switch_end
Definition: token.h:65
@ simple_end
Definition: token.h:54
@ classdef_end
Definition: token.h:56
@ arguments_end
Definition: token.h:55
@ if_end
Definition: token.h:61
@ parfor_end
Definition: token.h:63
@ for_end
Definition: token.h:59
@ function_end
Definition: token.h:60
@ while_end
Definition: token.h:69
@ spmd_end
Definition: token.h:68
void mark_may_be_command()
Definition: token.h:96
std::string text() const
Definition: token.cc:97
bool may_be_command() const
Definition: token.h:97
octave_value number() const
Definition: token.cc:104
bool space_follows_token() const
Definition: token.h:100
bool iskeyword() const
Definition: token.h:115
ColumnVector imag(const ComplexColumnVector &a)
Definition: dColVector.cc:143
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void print_usage(void)
Definition: defun-int.h:72
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
Definition: defun.h:56
void warning(const char *fmt,...)
Definition: error.cc:1063
void warning_with_id(const char *id, const char *fmt,...)
Definition: error.cc:1078
void() error(const char *fmt,...)
Definition: error.cc:988
#define panic_impossible()
Definition: error.h:503
#define INPUT_FILE_START
Definition: lex.cc:1377
#define yy_load_buffer_state
Definition: lex.cc:111
#define YY_NEW_FILE
Definition: lex.cc:416
#define yyset_extra
Definition: lex.cc:189
#define yytext
Definition: lex.cc:397
#define yyget_lval
Definition: lex.cc:261
#define yyget_column
Definition: lex.cc:243
unsigned char flex_uint8_t
Definition: lex.cc:325
#define yyset_lineno
Definition: lex.cc:237
#define yyset_lval
Definition: lex.cc:267
void * yyscan_t
Definition: lex.cc:388
#define OCTAVE_YYG
Definition: lex.cc:5288
#define yylex_init
Definition: lex.cc:153
#define yyrestart
Definition: lex.cc:147
#define yyset_debug
Definition: lex.cc:177
#define YY_EXTRA_TYPE
Definition: lex.cc:1166
#define YYSTYPE
Definition: lex.cc:1154
short int flex_int16_t
Definition: lex.cc:323
#define yy_flex_debug
Definition: lex.cc:400
#define yyget_out
Definition: lex.cc:207
unsigned int flex_uint32_t
Definition: lex.cc:327
void * octave_alloc(yy_size_t, yyscan_t yyscanner)
Definition: lex.cc:4758
#define yy_scan_bytes
Definition: lex.cc:93
#define YY_BREAK
Definition: lex.cc:1610
#define yylex_init_extra
Definition: lex.cc:159
bool iskeyword(const std::string &s)
Definition: lex.cc:1335
#define yynoreturn
Definition: lex.cc:374
#define yyget_debug
Definition: lex.cc:171
#define yypush_buffer_state
Definition: lex.cc:123
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lex.cc:438
#define yyfree
Definition: lex.cc:285
#define yyout
Definition: lex.cc:394
#define YY_BUFFER_NEW
Definition: lex.cc:516
#define CMD_OR_UNARY_OP(PATTERN, TOK, COMPAT)
Definition: lex.cc:1200
#define yyget_lineno
Definition: lex.cc:231
#define yylex
Definition: lex.cc:141
#define YY_RESTORE_YY_MORE_OFFSET
Definition: lex.cc:1081
#define yywrap
Definition: lex.cc:255
#define HANDLE_EOB_OR_EOF(STATUS)
Definition: lex.cc:1228
#define yyget_text
Definition: lex.cc:225
#define YY_BUFFER_NORMAL
Definition: lex.cc:517
#define yyensure_buffer_stack
Definition: lex.cc:135
#define COMMAND_START
Definition: lex.cc:1375
#define yy_scan_buffer
Definition: lex.cc:81
#define YY_MORE_ADJ
Definition: lex.cc:1080
#define YY_RULE_SETUP
Definition: lex.cc:1613
void octave_free(void *, yyscan_t yyscanner)
Definition: lex.cc:4770
#define yy_scan_string
Definition: lex.cc:87
#define yyextra
Definition: lex.cc:395
#define HANDLE_NUMBER(PATTERN, BASE)
Definition: lex.cc:1254
#define YY_AT_BOL()
Definition: lex.cc:587
#define yylval
Definition: lex.cc:1436
signed char flex_int8_t
Definition: lex.cc:322
#define yyget_leng
Definition: lex.cc:219
#define EOB_ACT_END_OF_FILE
Definition: lex.cc:447
#define yyalloc
Definition: lex.cc:273
#define yypop_buffer_state
Definition: lex.cc:129
#define YY_CURRENT_BUFFER_LVALUE
Definition: lex.cc:545
int flex_int32_t
Definition: lex.cc:324
#define yylex_destroy
Definition: lex.cc:165
#define curr_lexer
Definition: lex.cc:1167
#define YY_NULL
Definition: lex.cc:378
#define YY_START
Definition: lex.cc:411
#define yyset_column
Definition: lex.cc:249
#define HANDLE_IDENTIFIER(pattern, get_set)
Definition: lex.cc:1283
#define yy_switch_to_buffer
Definition: lex.cc:117
int yy_state_type
Definition: lex.cc:595
#define YY_CURRENT_BUFFER
Definition: lex.cc:539
#define yy_init_buffer
Definition: lex.cc:99
#define INITIAL
Definition: lex.cc:1374
#define MATRIX_START
Definition: lex.cc:1376
#define yyget_extra
Definition: lex.cc:183
#define DQ_STRING_START
Definition: lex.cc:1380
#define yyin
Definition: lex.cc:393
#define LINE_COMMENT_START
Definition: lex.cc:1379
#define YY_READ_BUF_SIZE
Definition: lex.cc:1520
#define YY_INPUT(buf, result, max_size)
Definition: lex.cc:1174
#define ECHO
Definition: lex.cc:1529
#define yy_flush_buffer
Definition: lex.cc:105
#define yyrealloc
Definition: lex.cc:279
#define YY_END_OF_BUFFER
Definition: lex.cc:614
#define YY_STATE_EOF(state)
Definition: lex.cc:414
#define BEGIN
Definition: lex.cc:406
#define YY_END_OF_BUFFER_CHAR
Definition: lex.cc:417
#define YY_FATAL_ERROR(msg)
Definition: lex.cc:1182
unsigned short int flex_uint16_t
Definition: lex.cc:326
#define yy_create_buffer
Definition: lex.cc:69
flex_uint8_t YY_CHAR
Definition: lex.cc:593
#define YY_DO_BEFORE_ACTION
Definition: lex.cc:607
#define yy_delete_buffer
Definition: lex.cc:75
#define EOB_ACT_LAST_MATCH
Definition: lex.cc:448
#define yyget_in
Definition: lex.cc:195
size_t yy_size_t
Definition: lex.cc:443
#define YY_BUFFER_EOF_PENDING
Definition: lex.cc:528
#define yylineno
Definition: lex.cc:398
#define yycolumn
Definition: lex.cc:399
#define yyset_out
Definition: lex.cc:213
#define EOB_ACT_CONTINUE_SCAN
Definition: lex.cc:446
#define HANDLE_STRING_CONTINUATION
Definition: lex.cc:1245
#define YY_DECL
Definition: lex.cc:1597
#define yyless(n)
Definition: lex.cc:4425
#define YY_BUF_SIZE
Definition: lex.cc:428
#define CMD_OR_OP(PATTERN, TOK, COMPAT)
Definition: lex.cc:1185
#define YY_EXIT_FAILURE
Definition: lex.cc:4411
void * octave_realloc(void *, yy_size_t, yyscan_t yyscanner)
Definition: lex.cc:4764
#define isatty
Definition: lex.cc:1158
#define YY_SC_TO_UI(c)
Definition: lex.cc:383
#define SQ_STRING_START
Definition: lex.cc:1381
#define yyleng
Definition: lex.cc:396
#define BLOCK_COMMENT_START
Definition: lex.cc:1378
#define yyset_in
Definition: lex.cc:201
#define FQ_IDENT_START
Definition: lex.cc:1382
octave_idx_type n
Definition: mx-inlines.cc:761
const char * undo_string_escape(char c)
Definition: utils.cc:991
std::complex< double > Complex
Definition: oct-cmplx.h:33
@ endspmd_kw
Definition: oct-gperf.h:88
@ endif_kw
Definition: oct-gperf.h:84
@ global_kw
Definition: oct-gperf.h:96
@ return_kw
Definition: oct-gperf.h:105
@ classdef_kw
Definition: oct-gperf.h:70
@ endswitch_kw
Definition: oct-gperf.h:89
@ methods_kw
Definition: oct-gperf.h:100
@ try_kw
Definition: oct-gperf.h:109
@ magic_file_kw
Definition: oct-gperf.h:98
@ end_try_catch_kw
Definition: oct-gperf.h:76
@ endenumeration_kw
Definition: oct-gperf.h:80
@ function_kw
Definition: oct-gperf.h:94
@ endfunction_kw
Definition: oct-gperf.h:83
@ endevents_kw
Definition: oct-gperf.h:81
@ else_kw
Definition: oct-gperf.h:73
@ do_kw
Definition: oct-gperf.h:72
@ while_kw
Definition: oct-gperf.h:113
@ arguments_kw
Definition: oct-gperf.h:66
@ unwind_protect_kw
Definition: oct-gperf.h:111
@ case_kw
Definition: oct-gperf.h:68
@ continue_kw
Definition: oct-gperf.h:71
@ properties_kw
Definition: oct-gperf.h:104
@ set_kw
Definition: oct-gperf.h:106
@ endparfor_kw
Definition: oct-gperf.h:86
@ endmethods_kw
Definition: oct-gperf.h:85
@ magic_line_kw
Definition: oct-gperf.h:99
@ spmd_kw
Definition: oct-gperf.h:107
@ persistent_kw
Definition: oct-gperf.h:103
@ otherwise_kw
Definition: oct-gperf.h:101
@ end_unwind_protect_kw
Definition: oct-gperf.h:77
@ until_kw
Definition: oct-gperf.h:110
@ endarguments_kw
Definition: oct-gperf.h:78
@ endwhile_kw
Definition: oct-gperf.h:90
@ get_kw
Definition: oct-gperf.h:95
@ elseif_kw
Definition: oct-gperf.h:74
@ catch_kw
Definition: oct-gperf.h:69
@ endproperties_kw
Definition: oct-gperf.h:87
@ end_kw
Definition: oct-gperf.h:75
@ endfor_kw
Definition: oct-gperf.h:82
@ endclassdef_kw
Definition: oct-gperf.h:79
@ unwind_protect_cleanup_kw
Definition: oct-gperf.h:112
@ if_kw
Definition: oct-gperf.h:97
@ events_kw
Definition: oct-gperf.h:92
@ switch_kw
Definition: oct-gperf.h:108
@ break_kw
Definition: oct-gperf.h:67
@ parfor_kw
Definition: oct-gperf.h:102
@ for_kw
Definition: oct-gperf.h:93
@ enumeration_kw
Definition: oct-gperf.h:91
#define TOTAL_KEYWORDS
Definition: oct-gperf.h:119
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Definition: oct-locbuf.h:44
#define scanner
Definition: oct-parse.cc:147
@ LEFTDIV
Definition: oct-parse.h:87
@ EDIV
Definition: oct-parse.h:89
@ PROPERTIES
Definition: oct-parse.h:126
@ FCN_HANDLE
Definition: oct-parse.h:124
@ FUNC_RET
Definition: oct-parse.h:117
@ PLUS_PLUS
Definition: oct-parse.h:93
@ END_OF_INPUT
Definition: oct-parse.h:138
@ DIV_EQ
Definition: oct-parse.h:68
@ GET
Definition: oct-parse.h:133
@ NUMBER
Definition: oct-parse.h:97
@ SUPERCLASSREF
Definition: oct-parse.h:131
@ ELEFTDIV
Definition: oct-parse.h:90
@ EXPR_LT
Definition: oct-parse.h:81
@ DQ_STRING
Definition: oct-parse.h:101
@ IF
Definition: oct-parse.h:109
@ MINUS_MINUS
Definition: oct-parse.h:94
@ POW
Definition: oct-parse.h:95
@ WHILE
Definition: oct-parse.h:105
@ TRANSPOSE
Definition: oct-parse.h:92
@ OR_EQ
Definition: oct-parse.h:76
@ EXPR_AND_AND
Definition: oct-parse.h:77
@ EXPR_NE
Definition: oct-parse.h:84
@ EXPR_OR_OR
Definition: oct-parse.h:78
@ CONTINUE
Definition: oct-parse.h:116
@ EPOW_EQ
Definition: oct-parse.h:74
@ EVENTS
Definition: oct-parse.h:128
@ SWITCH
Definition: oct-parse.h:112
@ TRY
Definition: oct-parse.h:120
@ EPOW
Definition: oct-parse.h:96
@ SQ_STRING
Definition: oct-parse.h:102
@ MUL_EQ
Definition: oct-parse.h:67
@ AND_EQ
Definition: oct-parse.h:75
@ NAME
Definition: oct-parse.h:99
@ EMUL_EQ
Definition: oct-parse.h:71
@ INPUT_FILE
Definition: oct-parse.h:139
@ ELSEIF
Definition: oct-parse.h:110
@ POW_EQ
Definition: oct-parse.h:70
@ CATCH
Definition: oct-parse.h:121
@ ADD_EQ
Definition: oct-parse.h:65
@ ELSE
Definition: oct-parse.h:111
@ BREAK
Definition: oct-parse.h:115
@ SUB_EQ
Definition: oct-parse.h:66
@ CASE
Definition: oct-parse.h:113
@ PERSISTENT
Definition: oct-parse.h:123
@ UNTIL
Definition: oct-parse.h:107
@ FOR
Definition: oct-parse.h:103
@ EXPR_LE
Definition: oct-parse.h:82
@ SET
Definition: oct-parse.h:134
@ DO
Definition: oct-parse.h:106
@ STRUCT_ELT
Definition: oct-parse.h:98
@ EXPR_GE
Definition: oct-parse.h:85
@ LEXICAL_ERROR
Definition: oct-parse.h:137
@ METHODS
Definition: oct-parse.h:127
@ FCN
Definition: oct-parse.h:135
@ OTHERWISE
Definition: oct-parse.h:114
@ EXPR_OR
Definition: oct-parse.h:80
@ CLEANUP
Definition: oct-parse.h:119
@ FQ_IDENT
Definition: oct-parse.h:132
@ METAQUERY
Definition: oct-parse.h:130
@ EMUL
Definition: oct-parse.h:88
@ LEFTDIV_EQ
Definition: oct-parse.h:69
@ CLASSDEF
Definition: oct-parse.h:125
@ HERMITIAN
Definition: oct-parse.h:91
@ EDIV_EQ
Definition: oct-parse.h:72
@ ELEFTDIV_EQ
Definition: oct-parse.h:73
@ EXPR_GT
Definition: oct-parse.h:86
@ UNWIND
Definition: oct-parse.h:118
@ EXPR_EQ
Definition: oct-parse.h:83
@ GLOBAL
Definition: oct-parse.h:122
@ EXPR_AND
Definition: oct-parse.h:79
T::size_type strlen(const typename T::value_type *str)
Definition: oct-string.cc:88
unsigned char flex_uint8_t
void * yyscan_t
short int flex_int16_t
struct yy_buffer_state * YY_BUFFER_STATE
int flex_int32_t
int yy_state_type
flex_uint8_t YY_CHAR
size_t yy_size_t
#define yyguts_t
void * malloc(unsigned)
#define m_scanner
void free(void *)
@ END
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_kw_id kw_id
Definition: oct-gperf.h:117
F77_RET_T len
Definition: xerbla.cc:61