29#if defined (HAVE_CONFIG_H)
33#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
35# pragma GCC diagnostic ignored "-Wunused-function"
40# pragma GCC diagnostic push
41# pragma GCC diagnostic ignored "-Wold-style-cast"
42# pragma GCC diagnostic ignored "-Wsign-compare"
43# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
44# if defined (HAVE_WARN_IMPLICIT_FALLTHROUGH)
45# pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
51#if ! defined (register)
55#line 56 "libinterp/parse-tree/lex.cc"
57#define YY_INT_ALIGNED short int
62#define YY_FLEX_MAJOR_VERSION 2
63#define YY_FLEX_MINOR_VERSION 6
64#define YY_FLEX_SUBMINOR_VERSION 4
65#if YY_FLEX_SUBMINOR_VERSION > 0
69#ifdef yy_create_buffer
70#define octave__create_buffer_ALREADY_DEFINED
72#define yy_create_buffer octave__create_buffer
75#ifdef yy_delete_buffer
76#define octave__delete_buffer_ALREADY_DEFINED
78#define yy_delete_buffer octave__delete_buffer
82#define octave__scan_buffer_ALREADY_DEFINED
84#define yy_scan_buffer octave__scan_buffer
88#define octave__scan_string_ALREADY_DEFINED
90#define yy_scan_string octave__scan_string
94#define octave__scan_bytes_ALREADY_DEFINED
96#define yy_scan_bytes octave__scan_bytes
100#define octave__init_buffer_ALREADY_DEFINED
102#define yy_init_buffer octave__init_buffer
105#ifdef yy_flush_buffer
106#define octave__flush_buffer_ALREADY_DEFINED
108#define yy_flush_buffer octave__flush_buffer
111#ifdef yy_load_buffer_state
112#define octave__load_buffer_state_ALREADY_DEFINED
114#define yy_load_buffer_state octave__load_buffer_state
117#ifdef yy_switch_to_buffer
118#define octave__switch_to_buffer_ALREADY_DEFINED
120#define yy_switch_to_buffer octave__switch_to_buffer
123#ifdef yypush_buffer_state
124#define octave_push_buffer_state_ALREADY_DEFINED
126#define yypush_buffer_state octave_push_buffer_state
129#ifdef yypop_buffer_state
130#define octave_pop_buffer_state_ALREADY_DEFINED
132#define yypop_buffer_state octave_pop_buffer_state
135#ifdef yyensure_buffer_stack
136#define octave_ensure_buffer_stack_ALREADY_DEFINED
138#define yyensure_buffer_stack octave_ensure_buffer_stack
142#define octave_lex_ALREADY_DEFINED
144#define yylex octave_lex
148#define octave_restart_ALREADY_DEFINED
150#define yyrestart octave_restart
154#define octave_lex_init_ALREADY_DEFINED
156#define yylex_init octave_lex_init
159#ifdef yylex_init_extra
160#define octave_lex_init_extra_ALREADY_DEFINED
162#define yylex_init_extra octave_lex_init_extra
166#define octave_lex_destroy_ALREADY_DEFINED
168#define yylex_destroy octave_lex_destroy
172#define octave_get_debug_ALREADY_DEFINED
174#define yyget_debug octave_get_debug
178#define octave_set_debug_ALREADY_DEFINED
180#define yyset_debug octave_set_debug
184#define octave_get_extra_ALREADY_DEFINED
186#define yyget_extra octave_get_extra
190#define octave_set_extra_ALREADY_DEFINED
192#define yyset_extra octave_set_extra
196#define octave_get_in_ALREADY_DEFINED
198#define yyget_in octave_get_in
202#define octave_set_in_ALREADY_DEFINED
204#define yyset_in octave_set_in
208#define octave_get_out_ALREADY_DEFINED
210#define yyget_out octave_get_out
214#define octave_set_out_ALREADY_DEFINED
216#define yyset_out octave_set_out
220#define octave_get_leng_ALREADY_DEFINED
222#define yyget_leng octave_get_leng
226#define octave_get_text_ALREADY_DEFINED
228#define yyget_text octave_get_text
232#define octave_get_lineno_ALREADY_DEFINED
234#define yyget_lineno octave_get_lineno
238#define octave_set_lineno_ALREADY_DEFINED
240#define yyset_lineno octave_set_lineno
244#define octave_get_column_ALREADY_DEFINED
246#define yyget_column octave_get_column
250#define octave_set_column_ALREADY_DEFINED
252#define yyset_column octave_set_column
256#define octave_wrap_ALREADY_DEFINED
258#define yywrap octave_wrap
262#define octave_get_lval_ALREADY_DEFINED
264#define yyget_lval octave_get_lval
268#define octave_set_lval_ALREADY_DEFINED
270#define yyset_lval octave_set_lval
274#define octave_alloc_ALREADY_DEFINED
276#define yyalloc octave_alloc
280#define octave_realloc_ALREADY_DEFINED
282#define yyrealloc octave_realloc
286#define octave_free_ALREADY_DEFINED
288#define yyfree octave_free
308#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
313#ifndef __STDC_LIMIT_MACROS
314#define __STDC_LIMIT_MACROS 1
334#define INT8_MIN (-128)
337#define INT16_MIN (-32767-1)
340#define INT32_MIN (-2147483647-1)
343#define INT8_MAX (127)
346#define INT16_MAX (32767)
349#define INT32_MAX (2147483647)
352#define UINT8_MAX (255U)
355#define UINT16_MAX (65535U)
358#define UINT32_MAX (4294967295U)
362#define SIZE_MAX (~(size_t)0)
374#if defined(__GNUC__) && __GNUC__ >= 3
375#define yynoreturn __attribute__((__noreturn__))
386#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
389#ifndef YY_TYPEDEF_YY_SCANNER_T
390#define YY_TYPEDEF_YY_SCANNER_T
396#define yyin yyg->yyin_r
397#define yyout yyg->yyout_r
398#define yyextra yyg->yyextra_r
399#define yyleng yyg->yyleng_r
400#define yytext yyg->yytext_r
401#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
402#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
403#define yy_flex_debug yyg->yy_flex_debug_r
409#define BEGIN yyg->yy_start = 1 + 2 *
414#define YY_START ((yyg->yy_start - 1) / 2)
415#define YYSTATE YY_START
417#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
419#define YY_NEW_FILE yyrestart( yyin , yyscanner )
420#define YY_END_OF_BUFFER_CHAR 0
429#define YY_BUF_SIZE 32768
431#define YY_BUF_SIZE 16384
437#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
439#ifndef YY_TYPEDEF_YY_BUFFER_STATE
440#define YY_TYPEDEF_YY_BUFFER_STATE
444#ifndef YY_TYPEDEF_YY_SIZE_T
445#define YY_TYPEDEF_YY_SIZE_T
449#define EOB_ACT_CONTINUE_SCAN 0
450#define EOB_ACT_END_OF_FILE 1
451#define EOB_ACT_LAST_MATCH 2
453 #define YY_LESS_LINENO(n)
454 #define YY_LINENO_REWIND_TO(ptr)
461 int yyless_macro_arg = (n); \
462 YY_LESS_LINENO(yyless_macro_arg);\
463 *yy_cp = yyg->yy_hold_char; \
464 YY_RESTORE_YY_MORE_OFFSET \
465 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
466 YY_DO_BEFORE_ACTION; \
469#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
471#ifndef YY_STRUCT_YY_BUFFER_STATE
472#define YY_STRUCT_YY_BUFFER_STATE
473struct yy_buffer_state
494 int yy_is_our_buffer;
501 int yy_is_interactive;
517 int yy_buffer_status;
519#define YY_BUFFER_NEW 0
520#define YY_BUFFER_NORMAL 1
531#define YY_BUFFER_EOF_PENDING 2
542#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
543 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
548#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
561#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
571#define yy_new_buffer yy_create_buffer
572#define yy_set_interactive(is_interactive) \
574 if ( ! YY_CURRENT_BUFFER ){ \
575 yyensure_buffer_stack (yyscanner); \
576 YY_CURRENT_BUFFER_LVALUE = \
577 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
579 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
581#define yy_set_bol(at_bol) \
583 if ( ! YY_CURRENT_BUFFER ){\
584 yyensure_buffer_stack (yyscanner); \
585 YY_CURRENT_BUFFER_LVALUE = \
586 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
588 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
590#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
594#define octave_wrap(yyscanner) (1)
595#define YY_SKIP_YYWRAP
600#define yytext_ptr yytext_r
604static int yy_get_next_buffer (
yyscan_t yyscanner );
610#define YY_DO_BEFORE_ACTION \
611 yyg->yytext_ptr = yy_bp; \
612 yyleng = (int) (yy_cp - yy_bp); \
613 yyg->yy_hold_char = *yy_cp; \
615 yyg->yy_c_buf_p = yy_cp;
616#define YY_NUM_RULES 112
617#define YY_END_OF_BUFFER 113
627 0, 0, 5, 5, 10, 10, 0, 0, 0, 0,
628 0, 0, 0, 0, 0, 0, 0, 0, 113, 111,
629 53, 61, 61, 88, 63, 111, 74, 62, 93, 94,
630 78, 85, 89, 86, 95, 79, 51, 51, 64, 84,
631 76, 96, 77, 111, 59, 56, 15, 80, 16, 81,
632 56, 56, 109, 75, 110, 87, 53, 111, 9, 8,
633 3, 3, 7, 112, 5, 6, 4, 9, 10, 11,
634 11, 95, 13, 14, 10, 1, 1, 112, 20, 20,
635 112, 112, 24, 24, 24, 24, 24, 24, 39, 40,
636 40, 26, 38, 112, 43, 44, 44, 42, 48, 46,
638 48, 48, 45, 53, 0, 61, 71, 0, 21, 21,
639 82, 107, 99, 91, 97, 92, 98, 90, 65, 0,
640 66, 51, 67, 68, 100, 51, 51, 0, 0, 51,
641 0, 69, 70, 73, 0, 58, 0, 60, 0, 0,
642 56, 0, 101, 105, 56, 56, 108, 83, 72, 53,
643 0, 0, 9, 8, 3, 0, 3, 5, 6, 0,
644 10, 11, 0, 10, 1, 0, 20, 20, 0, 0,
645 0, 0, 0, 0, 24, 0, 23, 23, 0, 0,
646 0, 39, 40, 25, 37, 36, 36, 27, 29, 30,
647 31, 32, 33, 34, 35, 37, 43, 44, 41, 46,
649 48, 0, 0, 0, 45, 102, 0, 103, 51, 104,
650 106, 50, 49, 0, 51, 52, 0, 0, 58, 0,
651 0, 60, 0, 0, 0, 57, 56, 0, 17, 17,
652 0, 0, 0, 18, 18, 0, 19, 19, 0, 22,
653 22, 27, 28, 0, 0, 45, 0, 54, 54, 49,
654 0, 51, 52, 0, 0, 58, 0, 60, 0, 0,
655 0, 57, 0, 55, 0, 2, 2, 0, 12, 12,
656 27, 0, 47, 47, 45, 0, 0, 0, 49, 0,
657 0, 0, 52, 58, 60, 0, 57, 57, 0
660static const YY_CHAR yy_ec[256] =
662 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
663 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
664 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
665 1, 2, 5, 6, 7, 1, 7, 8, 9, 10,
666 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
667 21, 22, 23, 24, 23, 25, 26, 27, 28, 29,
668 30, 31, 32, 33, 34, 35, 34, 36, 36, 34,
669 37, 37, 38, 38, 37, 37, 37, 37, 37, 37,
670 37, 37, 37, 37, 37, 37, 37, 39, 37, 37,
671 40, 41, 42, 43, 44, 1, 45, 46, 34, 36,
673 47, 48, 49, 37, 38, 38, 37, 37, 37, 50,
674 37, 37, 37, 51, 52, 53, 54, 55, 37, 56,
675 37, 37, 57, 58, 59, 60, 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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
681 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
682 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, 1, 1, 1, 1, 1,
687 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
688 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
692static const YY_CHAR yy_meta[61] =
694 1, 2, 3, 3, 1, 4, 5, 1, 6, 5,
695 5, 7, 8, 5, 8, 9, 7, 10, 10, 10,
696 10, 10, 10, 10, 10, 10, 1, 5, 1, 1,
697 1, 1, 11, 12, 12, 13, 14, 15, 14, 5,
698 16, 5, 7, 17, 12, 12, 13, 12, 14, 14,
699 14, 18, 14, 18, 14, 14, 5, 1, 5, 1
704 0, 59, 65, 123, 61, 81, 750, 749, 83, 87,
705 94, 102, 112, 132, 108, 110, 181, 236, 752, 1235,
706 71, 1235, 748, 720, 1235, 96, 62, 1235, 1235, 1235,
707 716, 128, 1235, 65, 133, 708, 277, 108, 1235, 1235,
708 707, 706, 705, 732, 731, 144, 1235, 699, 1235, 694,
709 153, 154, 1235, 52, 1235, 693, 150, 164, 0, 720,
710 1235, 718, 1235, 158, 149, 133, 1235, 704, 164, 1235,
711 716, 302, 1235, 1235, 177, 1235, 715, 187, 1235, 714,
712 191, 199, 1235, 197, 713, 204, 203, 208, 0, 1235,
713 709, 701, 1235, 343, 0, 1235, 703, 696, 1235, 702,
715 700, 686, 207, 237, 210, 1235, 1235, 238, 1235, 698,
716 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 670, 683,
717 666, 207, 665, 664, 1235, 391, 0, 228, 209, 1235,
718 0, 1235, 1235, 1235, 691, 246, 690, 247, 292, 687,
719 304, 539, 1235, 1235, 315, 320, 1235, 1235, 1235, 248,
720 273, 257, 0, 536, 1235, 263, 533, 269, 293, 519,
721 262, 1235, 518, 303, 1235, 324, 1235, 530, 337, 347,
722 352, 355, 327, 366, 1235, 368, 1235, 529, 372, 373,
723 378, 0, 1235, 1235, 1235, 1235, 528, 400, 1235, 1235,
724 1235, 1235, 1235, 1235, 1235, 0, 0, 1235, 1235, 528,
726 1235, 513, 376, 521, 381, 1235, 381, 1235, 390, 1235,
727 1235, 1235, 417, 238, 459, 353, 385, 400, 423, 429,
728 393, 431, 388, 439, 384, 438, 440, 449, 1235, 372,
729 440, 445, 455, 1235, 357, 460, 1235, 346, 463, 1235,
730 339, 456, 0, 478, 336, 444, 480, 1235, 329, 467,
731 468, 269, 416, 475, 276, 486, 266, 488, 489, 493,
732 255, 496, 504, 1235, 504, 1235, 193, 512, 1235, 185,
733 1235, 514, 1235, 178, 508, 154, 152, 109, 1235, 97,
734 88, 80, 1235, 511, 523, 60, 524, 526, 1235, 542,
735 560, 578, 596, 614, 632, 650, 668, 681, 696, 713,
737 730, 748, 766, 784, 802, 820, 838, 856, 873, 882,
738 493, 890, 902, 919, 936, 953, 962, 974, 992, 1001,
739 1009, 1026, 1043, 1060, 1077, 1095, 1113, 1131, 1148, 1165,
745 289, 1, 290, 290, 1, 1, 291, 291, 292, 292,
746 293, 293, 294, 294, 295, 295, 296, 296, 289, 289,
747 289, 289, 289, 289, 289, 297, 289, 289, 289, 289,
748 289, 289, 289, 289, 298, 289, 289, 37, 289, 289,
749 289, 289, 289, 299, 300, 301, 289, 289, 289, 289,
750 301, 301, 289, 289, 289, 289, 289, 297, 302, 289,
751 289, 289, 289, 303, 289, 289, 289, 289, 289, 289,
752 289, 298, 289, 289, 289, 289, 289, 304, 289, 289,
753 304, 304, 289, 289, 289, 305, 289, 305, 306, 289,
754 289, 289, 289, 307, 308, 289, 289, 289, 289, 289,
756 289, 289, 309, 289, 297, 289, 289, 297, 289, 289,
757 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
758 289, 310, 289, 289, 289, 289, 38, 289, 311, 289,
759 312, 289, 289, 289, 299, 313, 300, 314, 289, 315,
760 301, 316, 289, 289, 301, 301, 289, 289, 289, 289,
761 297, 297, 302, 289, 289, 303, 289, 289, 289, 289,
762 289, 289, 289, 289, 289, 304, 289, 289, 304, 304,
763 304, 304, 289, 305, 289, 305, 289, 289, 289, 305,
764 305, 306, 289, 289, 289, 289, 289, 289, 289, 289,
765 289, 289, 289, 289, 289, 317, 308, 289, 289, 289,
767 289, 289, 289, 318, 309, 289, 319, 289, 310, 289,
768 289, 289, 289, 311, 320, 321, 289, 322, 313, 289,
769 323, 314, 315, 324, 316, 325, 301, 297, 289, 289,
770 326, 327, 304, 289, 289, 304, 289, 289, 305, 289,
771 289, 289, 317, 328, 318, 329, 319, 289, 289, 289,
772 289, 320, 321, 289, 322, 330, 323, 331, 324, 289,
773 332, 325, 289, 289, 326, 289, 289, 327, 289, 289,
774 289, 328, 289, 289, 329, 289, 289, 289, 289, 289,
775 289, 289, 289, 330, 331, 332, 333, 333, 0, 289,
776 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
778 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
779 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
780 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
786 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
787 30, 31, 32, 33, 34, 35, 36, 37, 38, 38,
788 38, 38, 38, 38, 38, 38, 39, 40, 41, 42,
789 43, 44, 45, 46, 46, 46, 46, 46, 46, 47,
790 48, 49, 50, 46, 46, 46, 46, 46, 51, 46,
791 46, 52, 46, 46, 46, 46, 53, 54, 55, 56,
792 57, 286, 69, 70, 71, 58, 60, 61, 62, 111,
793 63, 64, 104, 63, 65, 66, 72, 105, 67, 116,
794 68, 147, 75, 70, 71, 79, 80, 58, 81, 79,
795 80, 112, 67, 82, 117, 84, 72, 85, 109, 110,
797 86, 283, 73, 87, 65, 85, 66, 283, 88, 148,
798 96, 97, 96, 97, 90, 91, 98, 92, 98, 74,
799 283, 65, 73, 66, 60, 61, 62, 93, 63, 64,
800 279, 63, 65, 66, 90, 91, 67, 92, 68, 74,
801 114, 118, 289, 159, 119, 139, 289, 93, 120, 121,
802 67, 150, 94, 289, 139, 139, 151, 115, 158, 140,
803 155, 157, 65, 289, 66, 161, 109, 110, 140, 140,
804 105, 279, 94, 123, 159, 124, 142, 279, 164, 65,
805 273, 66, 100, 151, 101, 142, 142, 269, 158, 167,
806 168, 159, 169, 167, 168, 266, 102, 170, 173, 145,
808 146, 167, 168, 174, 179, 158, 177, 178, 203, 180,
809 177, 178, 109, 110, 103, 103, 103, 103, 103, 103,
810 152, 214, 204, 214, 103, 103, 103, 103, 103, 103,
811 103, 103, 103, 103, 103, 103, 103, 100, 104, 101,
812 109, 110, 129, 105, 130, 213, 213, 217, 220, 150,
813 289, 102, 289, 129, 151, 171, 286, 172, 228, 229,
814 230, 218, 221, 161, 181, 155, 157, 257, 105, 103,
815 103, 103, 103, 103, 103, 109, 110, 255, 158, 103,
816 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
817 103, 103, 126, 139, 127, 127, 127, 127, 127, 127,
819 127, 127, 127, 159, 164, 139, 130, 140, 158, 151,
820 118, 128, 129, 119, 130, 131, 139, 163, 121, 140,
821 127, 139, 128, 129, 142, 158, 167, 168, 173, 152,
822 140, 248, 131, 174, 159, 140, 142, 245, 169, 167,
823 168, 240, 123, 170, 124, 186, 187, 142, 237, 167,
824 168, 159, 142, 233, 234, 235, 236, 237, 238, 234,
825 188, 188, 188, 188, 188, 188, 188, 227, 177, 178,
826 177, 178, 227, 179, 229, 177, 178, 203, 180, 239,
827 240, 241, 203, 248, 249, 225, 217, 189, 190, 223,
828 191, 204, 192, 193, 257, 194, 204, 195, 196, 212,
830 218, 255, 212, 171, 254, 172, 254, 212, 122, 122,
831 122, 122, 122, 122, 122, 122, 122, 242, 242, 242,
832 242, 242, 242, 242, 217, 129, 129, 130, 130, 181,
833 220, 212, 220, 212, 250, 250, 129, 129, 218, 260,
834 139, 263, 266, 267, 221, 203, 221, 269, 270, 264,
835 228, 229, 230, 261, 140, 140, 233, 234, 235, 204,
836 250, 236, 237, 238, 239, 240, 241, 254, 251, 254,
837 251, 142, 142, 271, 271, 271, 271, 271, 271, 271,
838 273, 274, 248, 249, 250, 250, 276, 217, 277, 220,
839 139, 278, 279, 280, 260, 281, 130, 260, 282, 283,
841 215, 218, 215, 221, 140, 263, 266, 267, 261, 203,
842 250, 261, 217, 264, 269, 270, 273, 274, 251, 140,
843 251, 142, 245, 204, 220, 260, 218, 260, 244, 200,
844 186, 177, 167, 232, 231, 155, 142, 154, 221, 261,
845 225, 261, 59, 59, 59, 59, 59, 59, 59, 59,
846 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
847 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
848 76, 76, 76, 76, 76, 76, 76, 76, 78, 78,
849 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
850 78, 78, 78, 78, 78, 78, 83, 83, 83, 83,
852 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
853 83, 83, 83, 83, 89, 89, 89, 89, 89, 89,
854 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
855 89, 89, 95, 95, 95, 95, 95, 95, 95, 95,
856 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
857 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
858 99, 99, 99, 99, 99, 99, 99, 99, 108, 108,
859 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
860 108, 108, 108, 108, 108, 108, 122, 122, 223, 122,
861 122, 137, 135, 211, 210, 208, 122, 136, 207, 206,
863 109, 202, 201, 200, 199, 198, 184, 136, 136, 136,
864 136, 183, 136, 136, 138, 175, 167, 165, 162, 160,
865 155, 154, 149, 144, 138, 138, 138, 138, 143, 138,
866 138, 141, 137, 135, 134, 133, 132, 125, 141, 141,
867 141, 141, 141, 141, 141, 113, 141, 141, 153, 107,
868 106, 289, 77, 77, 153, 153, 289, 153, 153, 153,
869 153, 153, 153, 153, 153, 153, 156, 156, 156, 156,
870 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
871 156, 156, 156, 156, 166, 166, 166, 166, 166, 166,
872 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
874 166, 166, 176, 176, 176, 176, 176, 176, 176, 176,
875 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
876 182, 182, 289, 289, 182, 182, 182, 182, 289, 182,
877 182, 182, 182, 182, 182, 289, 182, 182, 185, 185,
878 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
879 185, 185, 185, 185, 185, 185, 197, 197, 289, 197,
880 197, 289, 197, 197, 197, 197, 197, 197, 197, 197,
881 197, 197, 197, 197, 205, 289, 289, 289, 289, 289,
882 289, 205, 205, 289, 205, 205, 205, 205, 289, 205,
883 205, 209, 289, 289, 209, 289, 209, 289, 209, 216,
885 289, 216, 216, 219, 289, 289, 289, 289, 289, 289,
886 219, 219, 289, 219, 219, 219, 219, 289, 219, 219,
887 222, 289, 289, 289, 289, 289, 289, 222, 222, 289,
888 222, 222, 222, 222, 289, 222, 222, 224, 289, 289,
889 289, 289, 289, 289, 289, 289, 289, 224, 224, 224,
890 224, 289, 224, 224, 226, 289, 289, 289, 289, 289,
891 289, 289, 289, 289, 226, 226, 226, 226, 289, 226,
892 226, 243, 289, 243, 243, 246, 289, 289, 289, 289,
893 289, 289, 289, 289, 289, 246, 246, 246, 246, 289,
894 246, 246, 247, 247, 247, 247, 247, 247, 247, 247,
896 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
897 252, 289, 289, 289, 289, 252, 289, 252, 253, 289,
898 253, 253, 289, 289, 289, 253, 253, 256, 289, 289,
899 289, 289, 289, 289, 289, 289, 289, 256, 256, 256,
900 256, 289, 256, 256, 258, 289, 289, 289, 289, 289,
901 289, 289, 289, 289, 258, 258, 258, 258, 289, 258,
902 258, 259, 289, 289, 289, 289, 289, 289, 259, 259,
903 259, 259, 259, 259, 259, 289, 259, 259, 262, 289,
904 289, 289, 289, 289, 289, 262, 262, 289, 262, 262,
905 262, 262, 289, 262, 262, 265, 265, 265, 265, 265,
907 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
908 265, 265, 265, 268, 268, 268, 268, 268, 268, 268,
909 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
910 268, 272, 272, 272, 272, 272, 272, 272, 272, 272,
911 272, 272, 272, 272, 272, 272, 272, 272, 272, 275,
912 289, 289, 289, 289, 289, 289, 275, 275, 289, 275,
913 275, 275, 275, 289, 275, 275, 284, 289, 289, 289,
914 289, 289, 289, 284, 284, 289, 284, 284, 284, 284,
915 289, 284, 284, 285, 289, 289, 289, 289, 289, 289,
916 285, 285, 289, 285, 285, 285, 285, 289, 285, 285,
918 287, 289, 289, 289, 289, 289, 289, 289, 289, 289,
919 287, 287, 287, 287, 289, 287, 287, 288, 289, 289,
920 289, 289, 289, 289, 288, 288, 289, 288, 288, 288,
921 288, 289, 288, 288, 19, 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, 289, 289, 289, 289, 289,
925 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
926 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
927 289, 289, 289, 289, 289
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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
937 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
938 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
939 2, 286, 5, 5, 5, 2, 3, 3, 3, 27,
940 3, 3, 21, 3, 3, 3, 5, 21, 3, 34,
941 3, 54, 6, 6, 6, 9, 9, 6, 10, 10,
942 10, 27, 3, 10, 34, 11, 6, 11, 26, 26,
944 11, 282, 5, 12, 3, 12, 3, 281, 12, 54,
945 15, 15, 16, 16, 13, 13, 15, 13, 16, 5,
946 280, 3, 6, 3, 4, 4, 4, 13, 4, 4,
947 278, 4, 4, 4, 14, 14, 4, 14, 4, 6,
948 32, 35, 38, 66, 35, 46, 38, 14, 35, 35,
949 4, 57, 13, 38, 51, 52, 57, 32, 65, 46,
950 64, 64, 4, 38, 4, 69, 58, 58, 51, 52,
951 69, 277, 14, 35, 66, 35, 46, 276, 75, 4,
952 274, 4, 17, 75, 17, 51, 52, 270, 65, 78,
953 78, 66, 81, 81, 81, 267, 17, 81, 84, 51,
955 52, 82, 82, 84, 87, 65, 86, 86, 103, 87,
956 88, 88, 105, 105, 17, 17, 17, 17, 17, 17,
957 58, 129, 103, 129, 17, 17, 17, 17, 17, 17,
958 17, 17, 17, 17, 17, 17, 17, 18, 104, 18,
959 108, 108, 122, 104, 122, 128, 128, 136, 138, 150,
960 214, 18, 214, 122, 150, 82, 261, 82, 152, 152,
961 152, 136, 138, 161, 88, 156, 156, 257, 161, 18,
962 18, 18, 18, 18, 18, 151, 151, 255, 158, 18,
963 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
964 18, 18, 37, 139, 37, 37, 37, 37, 37, 37,
966 37, 37, 37, 159, 164, 141, 252, 139, 158, 164,
967 72, 37, 37, 72, 37, 37, 145, 72, 72, 141,
968 37, 146, 37, 37, 139, 158, 166, 166, 173, 151,
969 145, 249, 37, 173, 159, 146, 141, 245, 169, 169,
970 169, 241, 72, 169, 72, 94, 94, 145, 238, 170,
971 170, 159, 146, 171, 171, 171, 172, 172, 172, 235,
972 94, 94, 94, 94, 94, 94, 94, 145, 174, 174,
973 176, 176, 146, 179, 230, 180, 180, 203, 179, 181,
974 181, 181, 205, 207, 207, 225, 217, 94, 94, 223,
975 94, 203, 94, 94, 221, 94, 205, 94, 94, 126,
977 217, 218, 126, 170, 216, 170, 216, 126, 126, 126,
978 126, 126, 126, 126, 126, 126, 126, 188, 188, 188,
979 188, 188, 188, 188, 219, 209, 126, 209, 126, 180,
980 220, 126, 222, 126, 213, 213, 209, 126, 219, 226,
981 224, 227, 231, 231, 220, 246, 222, 232, 232, 227,
982 228, 228, 228, 226, 224, 227, 233, 233, 233, 246,
983 213, 236, 236, 236, 239, 239, 239, 253, 213, 253,
984 213, 224, 227, 242, 242, 242, 242, 242, 242, 242,
985 244, 244, 247, 247, 250, 250, 251, 256, 251, 258,
986 259, 251, 251, 254, 260, 254, 215, 262, 254, 254,
988 311, 256, 311, 258, 259, 263, 265, 265, 260, 275,
989 250, 262, 284, 263, 268, 268, 272, 272, 250, 263,
990 250, 259, 204, 275, 285, 287, 284, 288, 202, 200,
991 187, 178, 168, 163, 160, 157, 263, 154, 285, 287,
992 142, 288, 290, 290, 290, 290, 290, 290, 290, 290,
993 290, 290, 290, 290, 290, 290, 290, 290, 290, 290,
994 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
995 291, 291, 291, 291, 291, 291, 291, 291, 292, 292,
996 292, 292, 292, 292, 292, 292, 292, 292, 292, 292,
997 292, 292, 292, 292, 292, 292, 293, 293, 293, 293,
999 293, 293, 293, 293, 293, 293, 293, 293, 293, 293,
1000 293, 293, 293, 293, 294, 294, 294, 294, 294, 294,
1001 294, 294, 294, 294, 294, 294, 294, 294, 294, 294,
1002 294, 294, 295, 295, 295, 295, 295, 295, 295, 295,
1003 295, 295, 295, 295, 295, 295, 295, 295, 295, 295,
1004 296, 296, 296, 296, 296, 296, 296, 296, 296, 296,
1005 296, 296, 296, 296, 296, 296, 296, 296, 297, 297,
1006 297, 297, 297, 297, 297, 297, 297, 297, 297, 297,
1007 297, 297, 297, 297, 297, 297, 298, 298, 140, 298,
1008 298, 137, 135, 124, 123, 121, 298, 299, 120, 119,
1010 110, 102, 101, 100, 98, 97, 92, 299, 299, 299,
1011 299, 91, 299, 299, 300, 85, 80, 77, 71, 68,
1012 62, 60, 56, 50, 300, 300, 300, 300, 48, 300,
1013 300, 301, 45, 44, 43, 42, 41, 36, 301, 301,
1014 301, 301, 301, 301, 301, 31, 301, 301, 302, 24,
1015 23, 19, 8, 7, 302, 302, 0, 302, 302, 302,
1016 302, 302, 302, 302, 302, 302, 303, 303, 303, 303,
1017 303, 303, 303, 303, 303, 303, 303, 303, 303, 303,
1018 303, 303, 303, 303, 304, 304, 304, 304, 304, 304,
1019 304, 304, 304, 304, 304, 304, 304, 304, 304, 304,
1021 304, 304, 305, 305, 305, 305, 305, 305, 305, 305,
1022 305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
1023 306, 306, 0, 0, 306, 306, 306, 306, 0, 306,
1024 306, 306, 306, 306, 306, 0, 306, 306, 307, 307,
1025 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
1026 307, 307, 307, 307, 307, 307, 308, 308, 0, 308,
1027 308, 0, 308, 308, 308, 308, 308, 308, 308, 308,
1028 308, 308, 308, 308, 309, 0, 0, 0, 0, 0,
1029 0, 309, 309, 0, 309, 309, 309, 309, 0, 309,
1030 309, 310, 0, 0, 310, 0, 310, 0, 310, 312,
1032 0, 312, 312, 313, 0, 0, 0, 0, 0, 0,
1033 313, 313, 0, 313, 313, 313, 313, 0, 313, 313,
1034 314, 0, 0, 0, 0, 0, 0, 314, 314, 0,
1035 314, 314, 314, 314, 0, 314, 314, 315, 0, 0,
1036 0, 0, 0, 0, 0, 0, 0, 315, 315, 315,
1037 315, 0, 315, 315, 316, 0, 0, 0, 0, 0,
1038 0, 0, 0, 0, 316, 316, 316, 316, 0, 316,
1039 316, 317, 0, 317, 317, 318, 0, 0, 0, 0,
1040 0, 0, 0, 0, 0, 318, 318, 318, 318, 0,
1041 318, 318, 319, 319, 319, 319, 319, 319, 319, 319,
1043 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
1044 320, 0, 0, 0, 0, 320, 0, 320, 321, 0,
1045 321, 321, 0, 0, 0, 321, 321, 322, 0, 0,
1046 0, 0, 0, 0, 0, 0, 0, 322, 322, 322,
1047 322, 0, 322, 322, 323, 0, 0, 0, 0, 0,
1048 0, 0, 0, 0, 323, 323, 323, 323, 0, 323,
1049 323, 324, 0, 0, 0, 0, 0, 0, 324, 324,
1050 324, 324, 324, 324, 324, 0, 324, 324, 325, 0,
1051 0, 0, 0, 0, 0, 325, 325, 0, 325, 325,
1052 325, 325, 0, 325, 325, 326, 326, 326, 326, 326,
1054 326, 326, 326, 326, 326, 326, 326, 326, 326, 326,
1055 326, 326, 326, 327, 327, 327, 327, 327, 327, 327,
1056 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
1057 327, 328, 328, 328, 328, 328, 328, 328, 328, 328,
1058 328, 328, 328, 328, 328, 328, 328, 328, 328, 329,
1059 0, 0, 0, 0, 0, 0, 329, 329, 0, 329,
1060 329, 329, 329, 0, 329, 329, 330, 0, 0, 0,
1061 0, 0, 0, 330, 330, 0, 330, 330, 330, 330,
1062 0, 330, 330, 331, 0, 0, 0, 0, 0, 0,
1063 331, 331, 0, 331, 331, 331, 331, 0, 331, 331,
1065 332, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1066 332, 332, 332, 332, 0, 332, 332, 333, 0, 0,
1067 0, 0, 0, 0, 333, 333, 0, 333, 333, 333,
1068 333, 0, 333, 333, 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, 289, 289, 289, 289, 289,
1072 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
1073 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
1074 289, 289, 289, 289, 289
1081#define REJECT reject_used_but_not_detected
1082#define yymore() yymore_used_but_not_detected
1083#define YY_MORE_ADJ 0
1084#define YY_RESTORE_YY_MORE_OFFSET
1085#line 1 "../libinterp/parse-tree/lex.ll"
1107#line 94 "../libinterp/parse-tree/lex.ll"
1120#if defined (OCTAVE_HAVE_FAST_FLOAT)
1121# include <fast_float/fast_float.h>
1161#if defined (OCTAVE_STYPE_IS_DECLARED) && ! defined YYSTYPE
1162# define YYSTYPE OCTAVE_STYPE
1165#define YY_NO_UNISTD_H 1
1166#define isatty octave_isatty_wrapper
1168#if ! (defined (FLEX_SCANNER) \
1169 && defined (YY_FLEX_MAJOR_VERSION) && YY_FLEX_MAJOR_VERSION >= 2 \
1170 && defined (YY_FLEX_MINOR_VERSION) && YY_FLEX_MINOR_VERSION >= 5)
1171#error lex.l requires flex version 2.5.4 or later
1174#define YY_EXTRA_TYPE octave::base_lexer *
1175#define curr_lexer yyextra
1179#if defined (YY_INPUT)
1182#define YY_INPUT(buf, result, max_size) \
1183 result = curr_lexer->fill_flex_buffer (buf, max_size)
1187#if defined (YY_FATAL_ERROR)
1188# undef YY_FATAL_ERROR
1190#define YY_FATAL_ERROR(msg) \
1191 (yyget_extra (yyscanner))->fatal_error (msg)
1193#define CMD_OR_OP(PATTERN, TOK_ID, COMPAT) \
1196 curr_lexer->lexer_debug (PATTERN); \
1200 std::string tok_txt (yytext); \
1201 int tok_len = yyleng; \
1203 if (curr_lexer->looks_like_command_arg ()) \
1206 curr_lexer->push_start_state (COMMAND_START); \
1209 return curr_lexer->handle_op (TOK_ID, tok_txt, tok_len, false, COMPAT); \
1213#define CMD_OR_UNARY_OP(PATTERN, TOK_ID, COMPAT) \
1216 curr_lexer->lexer_debug (PATTERN); \
1220 std::string tok_txt (yytext); \
1221 int tok_len = yyleng; \
1223 if (curr_lexer->previous_token_may_be_command ()) \
1225 if (curr_lexer->looks_like_command_arg ()) \
1228 curr_lexer->push_start_state (COMMAND_START); \
1231 return curr_lexer->handle_op (TOK_ID, tok_txt, tok_len, false, COMPAT); \
1235 if (curr_lexer->maybe_unput_comma_before_unary_op (TOK_ID)) \
1238 curr_lexer->xunput (','); \
1241 return curr_lexer->handle_op (TOK_ID, tok_txt, tok_len, false, COMPAT); \
1246#define HANDLE_EOB_OR_EOF(STATUS) \
1249 if (curr_lexer->is_push_lexer ()) \
1251 if (curr_lexer->at_end_of_buffer ()) \
1254 if (curr_lexer->at_end_of_file ()) \
1255 return curr_lexer->handle_end_of_input (); \
1263#define HANDLE_STRING_CONTINUATION \
1266 curr_lexer->m_filepos.next_line (); \
1268 HANDLE_EOB_OR_EOF (-1); \
1272#define HANDLE_NUMBER(PATTERN, BASE) \
1275 curr_lexer->lexer_debug (PATTERN); \
1277 if (curr_lexer->previous_token_may_be_command () \
1278 && curr_lexer->space_follows_previous_token ()) \
1281 curr_lexer->push_start_state (COMMAND_START); \
1285 int tok_id = curr_lexer->previous_token_id (); \
1287 if (curr_lexer->whitespace_is_significant () \
1288 && curr_lexer->space_follows_previous_token () \
1289 && ! (tok_id == '[' || tok_id == '{' \
1290 || curr_lexer->previous_token_is_binop ())) \
1293 curr_lexer->xunput (','); \
1296 return curr_lexer->handle_number<BASE> (); \
1301#define HANDLE_IDENTIFIER(pattern, get_set) \
1304 curr_lexer->lexer_debug (pattern); \
1306 int tok_id = curr_lexer->previous_token_id (); \
1308 if (curr_lexer->whitespace_is_significant () \
1309 && curr_lexer->space_follows_previous_token () \
1310 && ! (tok_id == '[' || tok_id == '{' \
1311 || curr_lexer->previous_token_is_binop ())) \
1314 curr_lexer->xunput (','); \
1318 if (! curr_lexer->m_looking_at_decl_list \
1319 && curr_lexer->previous_token_may_be_command ()) \
1322 curr_lexer->push_start_state (COMMAND_START); \
1329 curr_lexer->m_filepos.increment_column (3); \
1330 curr_lexer->m_maybe_classdef_get_set_method = false; \
1333 return curr_lexer->handle_identifier (); \
1340is_space_or_tab (
char c)
1342 return c ==
' ' || c ==
'\t';
1346is_space_or_tab_or_eol (
char c)
1348 return c ==
' ' || c ==
'\t' || c ==
'\n' || c ==
'\r';
1365 && ! (s ==
"set" || s ==
"get" || s ==
"arguments"
1366 || s ==
"enumeration" || s ==
"events"
1367 || s ==
"methods" || s ==
"properties"));
1370OCTAVE_END_NAMESPACE(octave)
1372#line 1373 "libinterp/parse-tree/lex.cc"
1373#line 369 "../libinterp/parse-tree/lex.ll"
1378#line 1379 "libinterp/parse-tree/lex.cc"
1379#line 382 "../libinterp/parse-tree/lex.ll"
1389#line 1390 "libinterp/parse-tree/lex.cc"
1390#line 1391 "libinterp/parse-tree/lex.cc"
1393#define COMMAND_START 1
1394#define MATRIX_START 2
1395#define INPUT_FILE_START 3
1396#define BLOCK_COMMENT_START 4
1397#define LINE_COMMENT_START 5
1398#define DQ_STRING_START 6
1399#define SQ_STRING_START 7
1400#define FQ_IDENT_START 8
1402#ifndef YY_NO_UNISTD_H
1410#ifndef YY_EXTRA_TYPE
1411#define YY_EXTRA_TYPE void *
1422 FILE *yyin_r, *yyout_r;
1423 size_t yy_buffer_stack_top;
1424 size_t yy_buffer_stack_max;
1432 int yy_did_buffer_switch_on_eof;
1433 int yy_start_stack_ptr;
1434 int yy_start_stack_depth;
1435 int *yy_start_stack;
1437 char* yy_last_accepting_cpos;
1440 int yy_flex_debug_r;
1450static int yy_init_globals (
yyscan_t yyscanner );
1454 # define yylval yyg->yylval_r
1501#ifndef YY_SKIP_YYWRAP
1511 static void yyunput (
int c,
char *buf_ptr ,
yyscan_t yyscanner);
1516static void yy_flex_strncpy (
char *,
const char *,
int ,
yyscan_t yyscanner);
1519#ifdef YY_NEED_STRLEN
1520static int yy_flex_strlen (
const char * ,
yyscan_t yyscanner);
1525static int yyinput (
yyscan_t yyscanner );
1527static int input (
yyscan_t yyscanner );
1533#ifndef YY_READ_BUF_SIZE
1536#define YY_READ_BUF_SIZE 16384
1538#define YY_READ_BUF_SIZE 8192
1547#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1554#define YY_INPUT(buf,result,max_size) \
1555 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1559 for ( n = 0; n < max_size && \
1560 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1561 buf[n] = (char) c; \
1563 buf[n++] = (char) c; \
1564 if ( c == EOF && ferror( yyin ) ) \
1565 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1571 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1573 if( errno != EINTR) \
1575 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1591#define yyterminate() return YY_NULL
1595#ifndef YY_START_STACK_INCR
1596#define YY_START_STACK_INCR 25
1600#ifndef YY_FATAL_ERROR
1601#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1610#define YY_DECL_IS_OURS 1
1615#define YY_DECL int yylex \
1616 (YYSTYPE * yylval_param , yyscan_t yyscanner)
1622#ifndef YY_USER_ACTION
1623#define YY_USER_ACTION
1628#define YY_BREAK break;
1631#define YY_RULE_SETUP \
1633 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1634 (yytext[yyleng - 1] == '\n'); \
1642 char *yy_cp, *yy_bp;
1648 if ( !yyg->yy_init )
1656 if ( ! yyg->yy_start )
1675#line 402 "../libinterp/parse-tree/lex.ll"
1679#line 406 "../libinterp/parse-tree/lex.ll"
1684#line 1685 "libinterp/parse-tree/lex.cc"
1688 yy_cp = yyg->yy_c_buf_p;
1691 *yy_cp = yyg->yy_hold_char;
1698 yy_current_state = yyg->yy_start;
1704 if ( yy_accept[yy_current_state] )
1706 yyg->yy_last_accepting_state = yy_current_state;
1707 yyg->yy_last_accepting_cpos = yy_cp;
1709 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1711 yy_current_state = (
int) yy_def[yy_current_state];
1712 if ( yy_current_state >= 290 )
1713 yy_c = yy_meta[yy_c];
1715 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1718 while ( yy_base[yy_current_state] != 1235 );
1721 yy_act = yy_accept[yy_current_state];
1724 yy_cp = yyg->yy_last_accepting_cpos;
1725 yy_current_state = yyg->yy_last_accepting_state;
1726 yy_act = yy_accept[yy_current_state];
1737 *yy_cp = yyg->yy_hold_char;
1738 yy_cp = yyg->yy_last_accepting_cpos;
1739 yy_current_state = yyg->yy_last_accepting_state;
1740 goto yy_find_action;
1745#line 410 "../libinterp/parse-tree/lex.ll"
1747 curr_lexer->lexer_debug (
"<INPUT_FILE_START>{ANY_INCLUDING_NL}");
1761#line 424 "../libinterp/parse-tree/lex.ll"
1763 curr_lexer->lexer_debug (
"<INPUT_FILE_START><<EOF>>");
1784#line 445 "../libinterp/parse-tree/lex.ll"
1786 curr_lexer->lexer_debug (
"<COMMAND_START>(\\.\\.\\.){ANY_EXCEPT_NL}*{NL}");
1804#line 462 "../libinterp/parse-tree/lex.ll"
1806 curr_lexer->lexer_debug (
"<COMMAND_START>({CCHAR}{ANY_EXCEPT_NL}*)?{NL}");
1818 curr_lexer->m_looking_for_object_index =
false;
1821 curr_lexer->finish_comment (octave::comment_elt::end_of_line);
1828#line 483 "../libinterp/parse-tree/lex.ll"
1830 curr_lexer->lexer_debug (
"<COMMAND_START>[\\,\\;]");
1843 curr_lexer->m_looking_for_object_index =
false;
1844 curr_lexer->m_at_beginning_of_statement =
true;
1863#line 516 "../libinterp/parse-tree/lex.ll"
1865 curr_lexer->lexer_debug (
"<COMMAND_START>[\\(\\[\\{]+");
1874#line 524 "../libinterp/parse-tree/lex.ll"
1876 curr_lexer->lexer_debug (
"<COMMAND_START>[\\)\\]\\}]+");
1896#line 544 "../libinterp/parse-tree/lex.ll"
1898 curr_lexer->lexer_debug (
"<COMMAND_START>[\\\"\\']");
1900 if (
curr_lexer->m_command_arg_paren_count == 0)
1916#line 562 "../libinterp/parse-tree/lex.ll"
1918 curr_lexer->lexer_debug (
"<COMMAND_START>{S}*");
1920 if (
curr_lexer->m_command_arg_paren_count == 0)
1940#line 584 "../libinterp/parse-tree/lex.ll"
1942 curr_lexer->lexer_debug (
"<COMMAND_START>([\\.]|[^#% \\t\\r\\n\\.\\,\\;\\\"\\'\\(\\[\\{\\}\\]\\)]*");
1953#line 595 "../libinterp/parse-tree/lex.ll"
1955 curr_lexer->lexer_debug (
"<MATRIX_START>{S}*");
1959 curr_lexer->mark_previous_token_trailing_space ();
1965#line 603 "../libinterp/parse-tree/lex.ll"
1967 curr_lexer->lexer_debug (
"<MATRIX_START>{NL}");
1972 curr_lexer->warn_language_extension (
"bare newline inside parentheses");
1975 int tok_id =
curr_lexer->previous_token_id ();
1977 if (! (tok_id ==
';' || tok_id ==
'[' || tok_id ==
'{'))
1989#line 624 "../libinterp/parse-tree/lex.ll"
1991 curr_lexer->lexer_debug (
"<MATRIX_START>\\.\\.\\.{ANY_EXCEPT_NL}*{NL}");
2000 curr_lexer->mark_previous_token_trailing_space ();
2018#line 651 "../libinterp/parse-tree/lex.ll"
2020 curr_lexer->lexer_debug (
"<MATRIX_START>\\]");
2023 return curr_lexer->handle_close_bracket (
']');
2031#line 662 "../libinterp/parse-tree/lex.ll"
2033 curr_lexer->lexer_debug (
"<MATRIX_START>\\}*");
2036 return curr_lexer->handle_close_bracket (
'}');
2041#line 669 "../libinterp/parse-tree/lex.ll"
2045 bool unput_comma =
false;
2048 &&
curr_lexer->space_follows_previous_token ())
2050 int tok_id =
curr_lexer->previous_token_id ();
2052 if (! (tok_id ==
'[' || tok_id ==
'{'
2068 curr_lexer->m_looking_at_object_index.push_front (
false);
2070 curr_lexer->m_looking_for_object_index =
false;
2071 curr_lexer->m_at_beginning_of_statement =
false;
2074 && !
curr_lexer->m_parsed_function_name.top ())
2077 curr_lexer->m_looking_at_matrix_or_assign_lhs =
true;
2089#line 714 "../libinterp/parse-tree/lex.ll"
2097 curr_lexer->m_looking_at_object_index.pop_front ();
2099 curr_lexer->m_looking_for_object_index =
true;
2100 curr_lexer->m_at_beginning_of_statement =
false;
2119#line 742 "../libinterp/parse-tree/lex.ll"
2121 curr_lexer->lexer_debug (
"^{S}*{CCHAR}\\{{S}*{NL}");
2131#line 750 "../libinterp/parse-tree/lex.ll"
2133 curr_lexer->lexer_debug (
"<BLOCK_COMMENT_START>^{S}*{CCHAR}\\{{S}*{NL}");
2137 if (
curr_lexer->m_block_comment_nesting_level)
2159#line 775 "../libinterp/parse-tree/lex.ll"
2161 curr_lexer->lexer_debug (
"<BLOCK_COMMENT_START>^{S}*{CCHAR}\\}{S}*{NL}");
2165 if (
curr_lexer->m_block_comment_nesting_level > 1)
2170 curr_lexer->finish_comment (octave::comment_elt::block);
2175 if (
curr_lexer->m_block_comment_nesting_level == 0)
2194#line 807 "../libinterp/parse-tree/lex.ll"
2196 curr_lexer->lexer_debug (
"<BLOCK_COMMENT_START>{ANY_EXCEPT_NL}*{NL}");
2210#line 820 "../libinterp/parse-tree/lex.ll"
2212 curr_lexer->lexer_debug (
"{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}");
2230#line 837 "../libinterp/parse-tree/lex.ll"
2232 curr_lexer->lexer_debug (
"<LINE_COMMENT_START>^{S}*{CCHAR}\\{{S}*{NL}");
2235 curr_lexer->finish_comment (octave::comment_elt::full_line);
2256#line 860 "../libinterp/parse-tree/lex.ll"
2258 curr_lexer->lexer_debug (
"<LINE_COMMENT_START>{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}");
2267 bool have_space = (i > 0);
2275 if (c ==
'#' || c ==
'%')
2277 if (first && c ==
'#')
2300 curr_lexer->mark_previous_token_trailing_space ();
2302 curr_lexer->finish_comment (octave::comment_elt::end_of_line);
2326#line 927 "../libinterp/parse-tree/lex.ll"
2328 curr_lexer->lexer_debug (
"<LINE_COMMENT_START>{ANY_INCLUDING_NL}");
2355 curr_lexer->finish_comment (octave::comment_elt::full_line);
2368 curr_lexer->finish_comment (octave::comment_elt::full_line);
2380#line 980 "../libinterp/parse-tree/lex.ll"
2382 curr_lexer->lexer_debug (
"<LINE_COMMENT_START><<EOF>>");
2384 curr_lexer->finish_comment (octave::comment_elt::full_line);
2394#line 992 "../libinterp/parse-tree/lex.ll"
2396 curr_lexer->lexer_debug (
"<DQ_STRING_START>\\\"\\\"");
2404#line 999 "../libinterp/parse-tree/lex.ll"
2406 curr_lexer->lexer_debug (
"<DQ_STRING_START>\\\"");
2416 curr_lexer->m_looking_for_object_index =
true;
2417 curr_lexer->m_at_beginning_of_statement =
false;
2429#line 1021 "../libinterp/parse-tree/lex.ll"
2431 curr_lexer->lexer_debug (
"<DQ_STRING_START>\\\\[0-7]{1,3}");
2435 unsigned int result = 0;
2436 const char *chars_start =
yytext + 1;
2438 auto [ptr, ec] = std::from_chars (chars_start, chars_end, result, 8);
2439 if (ec != std::errc{})
2443 case std::errc::invalid_argument:
2444 curr_lexer->fatal_error (
"invalid octal digits in lexer rule <DQ_STRING_START>\\\\[0-7]{1,3} - please report this bug");
2446 case std::errc::result_out_of_range:
2447 curr_lexer->fatal_error (
"octal value out of range in lexer rule <DQ_STRING_START>\\\\[0-7]{1,3} - please report this bug");
2450 curr_lexer->fatal_error (
"from_chars failed in lexer rule <DQ_STRING_START>\\\\[0-7]{1,3} - please report this bug");
2459 std::string msg {
"invalid octal escape sequence in character string"};
2463 curr_lexer->m_string_text +=
static_cast<unsigned char> (result);
2468#line 1057 "../libinterp/parse-tree/lex.ll"
2470 curr_lexer->lexer_debug (
"<DQ_STRING_START>\\\\x[0-9a-fA-F]+");
2474 unsigned int result = 0;
2475 const char *chars_start =
yytext + 2;
2477 auto [ptr, ec] = std::from_chars (chars_start, chars_end, result, 16);
2478 if (ec != std::errc{})
2482 case std::errc::invalid_argument:
2483 curr_lexer->fatal_error (
"invalid hexadecimal digits in lexer rule <DQ_STRING_START>\\\\x[0-9a-fA-F]+ - please report this bug");
2485 case std::errc::result_out_of_range:
2486 curr_lexer->fatal_error (
"hexadecimal value out of range in lexer rule <DQ_STRING_START>\\\\x[0-9a-fA-F]+ - please report this bug");
2489 curr_lexer->fatal_error (
"from_chars failed in lexer rule <DQ_STRING_START>\\\\x[0-9a-fA-F]+ - please report this bug");
2499 curr_lexer->m_string_text +=
static_cast<unsigned char> (result);
2504#line 1090 "../libinterp/parse-tree/lex.ll"
2506 curr_lexer->lexer_debug (
"<DQ_STRING_START>\"\\\\a\"");
2514#line 1097 "../libinterp/parse-tree/lex.ll"
2516 curr_lexer->lexer_debug (
"<DQ_STRING_START>\"\\\\b\"");
2524#line 1104 "../libinterp/parse-tree/lex.ll"
2526 curr_lexer->lexer_debug (
"<DQ_STRING_START>\"\\\\f\"");
2534#line 1111 "../libinterp/parse-tree/lex.ll"
2536 curr_lexer->lexer_debug (
"<DQ_STRING_START>\"\\\\n\"");
2544#line 1118 "../libinterp/parse-tree/lex.ll"
2546 curr_lexer->lexer_debug (
"<DQ_STRING_START>\"\\\\r\"");
2554#line 1125 "../libinterp/parse-tree/lex.ll"
2556 curr_lexer->lexer_debug (
"<DQ_STRING_START>\"\\\\t\"");
2564#line 1132 "../libinterp/parse-tree/lex.ll"
2566 curr_lexer->lexer_debug (
"<DQ_STRING_START>\"\\\\v\"");
2575#line 1139 "../libinterp/parse-tree/lex.ll"
2577 curr_lexer->lexer_debug (
"<DQ_STRING_START>\\\\{NL}");
2584#line 1145 "../libinterp/parse-tree/lex.ll"
2586 curr_lexer->lexer_debug (
"<DQ_STRING_START>\\\\.");
2594#line 1152 "../libinterp/parse-tree/lex.ll"
2596 curr_lexer->lexer_debug (
"<DQ_STRING_START>\\.");
2604#line 1159 "../libinterp/parse-tree/lex.ll"
2606 curr_lexer->lexer_debug (
"<DQ_STRING_START>[^\\.\\\\\\r\\n\\\"]+");
2615#line 1166 "../libinterp/parse-tree/lex.ll"
2617 curr_lexer->lexer_debug (
"<DQ_STRING_START>{NL}");
2620 std::string msg {
"unterminated character string constant"};
2629#line 1178 "../libinterp/parse-tree/lex.ll"
2631 curr_lexer->lexer_debug (
"<SQ_STRING_START>\\'\\'");
2639#line 1185 "../libinterp/parse-tree/lex.ll"
2641 curr_lexer->lexer_debug (
"<SQ_STRING_START>\\'");
2651 curr_lexer->m_looking_for_object_index =
true;
2652 curr_lexer->m_at_beginning_of_statement =
false;
2664#line 1207 "../libinterp/parse-tree/lex.ll"
2666 curr_lexer->lexer_debug (
"<SQ_STRING_START>[^\\'\\n\\r]+");
2675#line 1214 "../libinterp/parse-tree/lex.ll"
2677 curr_lexer->lexer_debug (
"<SQ_STRING_START>{NL}");
2680 std::string msg {
"unterminated character string constant"};
2689#line 1226 "../libinterp/parse-tree/lex.ll"
2691 curr_lexer->lexer_debug (
"<FQ_IDENT_START>{FQIDENT}{S}*");
2697 std::string ident =
yytext;
2699 ident.erase (std::remove_if (ident.begin (), ident.end (), is_space_or_tab), ident.end ());
2701 if (
curr_lexer->fq_identifier_contains_keyword (ident))
2702 return curr_lexer->syntax_error (
"function, method, class, and package names may not be keywords");
2704 octave::token *tok =
curr_lexer->make_fq_identifier_token (ident);
2711#line 1245 "../libinterp/parse-tree/lex.ll"
2713 curr_lexer->lexer_debug (
"<FQ_IDENT_START>{S}+");
2717 curr_lexer->mark_previous_token_trailing_space ();
2723#line 1253 "../libinterp/parse-tree/lex.ll"
2725 curr_lexer->lexer_debug (
"<FQ_IDENT_START>(\\.\\.\\.){ANY_EXCEPT_NL}*{NL}");
2733#line 1259 "../libinterp/parse-tree/lex.ll"
2735 curr_lexer->lexer_debug (
"<FQ_IDENT_START>{ANY_INCLUDING_NL}");
2746#line 1269 "../libinterp/parse-tree/lex.ll"
2758*yy_cp = yyg->yy_hold_char;
2759yyg->yy_c_buf_p = yy_cp -= 2;
2761#line 1281 "../libinterp/parse-tree/lex.ll"
2764#line 1281 "../libinterp/parse-tree/lex.ll"
2766 HANDLE_NUMBER (
"{DECIMAL_DIGITS}/\\.[\\*/\\\\^\\']|{DECIMAL_NUMBER}", 10);
2771#line 1285 "../libinterp/parse-tree/lex.ll"
2782#line 1294 "../libinterp/parse-tree/lex.ll"
2786 curr_lexer->mark_previous_token_trailing_space ();
2795#line 1304 "../libinterp/parse-tree/lex.ll"
2797 curr_lexer->lexer_debug (
"\\.\\.\\.{ANY_EXCEPT_NL}*{NL}");
2815#line 1319 "../libinterp/parse-tree/lex.ll"
2828#line 1330 "../libinterp/parse-tree/lex.ll"
2835#line 1334 "../libinterp/parse-tree/lex.ll"
2845#line 1342 "../libinterp/parse-tree/lex.ll"
2847 curr_lexer->lexer_debug (
"{FQIDENT}{S}*@{S}*{FQIDENT}");
2849 if (
curr_lexer->previous_token_may_be_command ())
2858 std::string txt =
yytext;
2860 std::size_t at_or_dot_pos = txt.find_first_of (
"@.");
2862 if (at_or_dot_pos != std::string::npos)
2864 std::size_t spc_pos = txt.find_first_of (
" \t");
2866 if (spc_pos != std::string::npos && spc_pos < at_or_dot_pos)
2869 curr_lexer->m_filepos.increment_column (spc_pos);
2876 curr_lexer->m_looking_for_object_index =
true;
2877 curr_lexer->m_at_beginning_of_statement =
false;
2879 return curr_lexer->handle_superclass_identifier ();
2888#line 1383 "../libinterp/parse-tree/lex.ll"
2890 curr_lexer->lexer_debug (
"\\?{S}*{FQIDENT}");
2892 if (
curr_lexer->previous_token_may_be_command ()
2893 &&
curr_lexer->space_follows_previous_token ())
2902 std::string txt =
yytext;
2904 txt.erase (std::remove_if (txt.begin (), txt.end (), is_space_or_tab), txt.end ());
2907 std::string cls = txt.substr (1);
2909 if (
curr_lexer->fq_identifier_contains_keyword (cls))
2910 return curr_lexer->syntax_error (
"class and package names may not be keywords");
2912 octave::token *tok =
curr_lexer->make_meta_identifier_token (cls);
2919#line 1413 "../libinterp/parse-tree/lex.ll"
2922#line 1413 "../libinterp/parse-tree/lex.ll"
2924 curr_lexer->lexer_debug (
"\\@|\\@{S}*{FQIDENT}");
2926 if (
curr_lexer->previous_token_may_be_command ()
2927 &&
curr_lexer->space_follows_previous_token ())
2934 int tok_id =
curr_lexer->previous_token_id ();
2937 &&
curr_lexer->space_follows_previous_token ()
2938 && ! (tok_id ==
'[' || tok_id ==
'{'
2948 curr_lexer->m_at_beginning_of_statement =
false;
2950 std::string ident =
yytext;
2955 curr_lexer->m_looking_for_object_index =
false;
2961 ident = ident.substr (1);
2962 ident.erase (std::remove_if (ident.begin (), ident.end (),
2963 is_space_or_tab), ident.end ());
2967 if (octave::iskeyword (ident))
2969 std::string msg {
"function handles may not refer to keywords"};
2973 curr_lexer->m_looking_for_object_index =
true;
2991#line 1479 "../libinterp/parse-tree/lex.ll"
2999 curr_lexer->m_at_beginning_of_statement =
false;
3001 (
"bare newline inside parentheses");
3004 ||
curr_lexer->m_nesting_level.is_anon_fcn_body ())
3009 curr_lexer->m_at_beginning_of_statement =
true;
3013 else if (
curr_lexer->m_nesting_level.is_bracket_or_brace ())
3019 std::string msg {
"unexpected internal lexer error"};
3030#line 1516 "../libinterp/parse-tree/lex.ll"
3034 if (
curr_lexer->previous_token_may_be_command ()
3035 &&
curr_lexer->space_follows_previous_token ())
3041 else if (
curr_lexer->m_at_beginning_of_statement)
3048 int tok_id =
curr_lexer->previous_token_id ();
3050 if (
curr_lexer->whitespace_is_significant ())
3052 if (
curr_lexer->space_follows_previous_token ())
3054 if (tok_id ==
'[' || tok_id ==
'{'
3068 if (tok_id ==
'[' || tok_id ==
'{'
3084 if (! tok_id || tok_id ==
'[' || tok_id ==
'{' || tok_id ==
'('
3105#line 1589 "../libinterp/parse-tree/lex.ll"
3109 if (
curr_lexer->previous_token_may_be_command ()
3110 &&
curr_lexer->space_follows_previous_token ())
3118 int tok_id =
curr_lexer->previous_token_id ();
3120 if (
curr_lexer->whitespace_is_significant ())
3122 if (
curr_lexer->space_follows_previous_token ())
3124 if (tok_id ==
'[' || tok_id ==
'{'
3155#line 1637 "../libinterp/parse-tree/lex.ll"
3160#line 1638 "../libinterp/parse-tree/lex.ll"
3165#line 1639 "../libinterp/parse-tree/lex.ll"
3170#line 1640 "../libinterp/parse-tree/lex.ll"
3175#line 1641 "../libinterp/parse-tree/lex.ll"
3180#line 1642 "../libinterp/parse-tree/lex.ll"
3185#line 1643 "../libinterp/parse-tree/lex.ll"
3190#line 1644 "../libinterp/parse-tree/lex.ll"
3195#line 1645 "../libinterp/parse-tree/lex.ll"
3200#line 1646 "../libinterp/parse-tree/lex.ll"
3205#line 1647 "../libinterp/parse-tree/lex.ll"
3210#line 1648 "../libinterp/parse-tree/lex.ll"
3215#line 1649 "../libinterp/parse-tree/lex.ll"
3220#line 1650 "../libinterp/parse-tree/lex.ll"
3225#line 1651 "../libinterp/parse-tree/lex.ll"
3230#line 1652 "../libinterp/parse-tree/lex.ll"
3238#line 1658 "../libinterp/parse-tree/lex.ll"
3253#line 1670 "../libinterp/parse-tree/lex.ll"
3258#line 1671 "../libinterp/parse-tree/lex.ll"
3263#line 1672 "../libinterp/parse-tree/lex.ll"
3268#line 1674 "../libinterp/parse-tree/lex.ll"
3272 bool at_beginning_of_statement
3273 = (! (
curr_lexer->whitespace_is_significant ()
3274 ||
curr_lexer->m_looking_at_object_index.front ()));
3281#line 1684 "../libinterp/parse-tree/lex.ll"
3286#line 1685 "../libinterp/parse-tree/lex.ll"
3291#line 1687 "../libinterp/parse-tree/lex.ll"
3296#line 1688 "../libinterp/parse-tree/lex.ll"
3301#line 1690 "../libinterp/parse-tree/lex.ll"
3305 bool at_beginning_of_statement
3306 = (! (
curr_lexer->whitespace_is_significant ()
3307 ||
curr_lexer->m_looking_at_object_index.front ()));
3314#line 1700 "../libinterp/parse-tree/lex.ll"
3323#line 1706 "../libinterp/parse-tree/lex.ll"
3328#line 1707 "../libinterp/parse-tree/lex.ll"
3333#line 1709 "../libinterp/parse-tree/lex.ll"
3337 bool unput_comma =
false;
3340 &&
curr_lexer->space_follows_previous_token ())
3342 int tok_id =
curr_lexer->previous_token_id ();
3344 if (! (tok_id ==
'[' || tok_id ==
'{'
3363 curr_lexer->m_looking_at_object_index.push_front
3366 curr_lexer->m_looking_at_indirect_ref =
false;
3367 curr_lexer->m_looking_for_object_index =
false;
3368 curr_lexer->m_at_beginning_of_statement =
false;
3378#line 1751 "../libinterp/parse-tree/lex.ll"
3386 curr_lexer->m_looking_at_object_index.pop_front ();
3388 curr_lexer->m_looking_for_object_index =
true;
3389 curr_lexer->m_at_beginning_of_statement =
false;
3393 curr_lexer->m_looking_at_anon_fcn_args =
false;
3394 curr_lexer->m_nesting_level.anon_fcn_body ();
3402#line 1772 "../libinterp/parse-tree/lex.ll"
3406 if (
curr_lexer->previous_token_may_be_command ()
3407 &&
curr_lexer->space_follows_previous_token ())
3416 curr_lexer->m_looking_for_object_index =
false;
3417 curr_lexer->m_at_beginning_of_statement =
false;
3428#line 1796 "../libinterp/parse-tree/lex.ll"
3437#line 1802 "../libinterp/parse-tree/lex.ll"
3442#line 1803 "../libinterp/parse-tree/lex.ll"
3447#line 1804 "../libinterp/parse-tree/lex.ll"
3452#line 1805 "../libinterp/parse-tree/lex.ll"
3457#line 1806 "../libinterp/parse-tree/lex.ll"
3462#line 1807 "../libinterp/parse-tree/lex.ll"
3467#line 1808 "../libinterp/parse-tree/lex.ll"
3472#line 1809 "../libinterp/parse-tree/lex.ll"
3477#line 1810 "../libinterp/parse-tree/lex.ll"
3482#line 1811 "../libinterp/parse-tree/lex.ll"
3487#line 1812 "../libinterp/parse-tree/lex.ll"
3492#line 1813 "../libinterp/parse-tree/lex.ll"
3500#line 1819 "../libinterp/parse-tree/lex.ll"
3504 bool unput_comma =
false;
3507 &&
curr_lexer->space_follows_previous_token ())
3509 int tok_id =
curr_lexer->previous_token_id ();
3511 if (! (tok_id ==
'[' || tok_id ==
'{'
3525 curr_lexer->m_looking_at_object_index.push_front
3529 curr_lexer->m_looking_for_object_index =
false;
3530 curr_lexer->m_at_beginning_of_statement =
false;
3542#line 1858 "../libinterp/parse-tree/lex.ll"
3548 curr_lexer->m_looking_at_object_index.pop_front ();
3550 curr_lexer->m_looking_for_object_index =
true;
3551 curr_lexer->m_at_beginning_of_statement =
false;
3566#line 1880 "../libinterp/parse-tree/lex.ll"
3573 if (
curr_lexer->previous_token_may_be_command ()
3574 &&
curr_lexer->space_follows_previous_token ())
3591 std::ostringstream buf;
3593 buf <<
"invalid character '"
3594 << octave::undo_string_escape (
static_cast<char> (c))
3595 <<
"' (ASCII " << c <<
")";
3599 return curr_lexer->syntax_error (buf.str ());
3605#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
3607# pragma GCC diagnostic ignored "-Wold-style-cast"
3608# pragma GCC diagnostic ignored "-Wunused-parameter"
3613#line 1925 "../libinterp/parse-tree/lex.ll"
3616#line 3617 "libinterp/parse-tree/lex.cc"
3621 int yy_amount_of_matched_text = (
int) (yy_cp - yyg->yytext_ptr) - 1;
3624 *yy_cp = yyg->yy_hold_char;
3654 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
3656 yy_current_state = yy_get_previous_state( yyscanner );
3667 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
3671 if ( yy_next_state )
3674 yy_cp = ++yyg->yy_c_buf_p;
3675 yy_current_state = yy_next_state;
3681 yy_cp = yyg->yy_c_buf_p;
3682 goto yy_find_action;
3686 else switch ( yy_get_next_buffer( yyscanner ) )
3690 yyg->yy_did_buffer_switch_on_eof = 0;
3692 if (
yywrap( yyscanner ) )
3711 if ( ! yyg->yy_did_buffer_switch_on_eof )
3719 yyg->yytext_ptr + yy_amount_of_matched_text;
3721 yy_current_state = yy_get_previous_state( yyscanner );
3723 yy_cp = yyg->yy_c_buf_p;
3731 yy_current_state = yy_get_previous_state( yyscanner );
3733 yy_cp = yyg->yy_c_buf_p;
3735 goto yy_find_action;
3742 "fatal flex scanner internal error--no action found" );
3755static int yy_get_next_buffer (
yyscan_t yyscanner)
3759 char *source = yyg->yytext_ptr;
3760 int number_to_move, i;
3765 "fatal flex scanner internal error--end of buffer missed" );
3769 if ( yyg->yy_c_buf_p - yyg->yytext_ptr -
YY_MORE_ADJ == 1 )
3789 number_to_move = (
int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
3791 for ( i = 0; i < number_to_move; ++i )
3792 *(dest++) = *(source++);
3805 while ( num_to_read <= 0 )
3811 int yy_c_buf_p_offset =
3812 (
int) (yyg->yy_c_buf_p - b->yy_ch_buf);
3814 if ( b->yy_is_our_buffer )
3816 int new_size = b->yy_buf_size * 2;
3818 if ( new_size <= 0 )
3819 b->yy_buf_size += b->yy_buf_size / 8;
3821 b->yy_buf_size *= 2;
3823 b->yy_ch_buf = (
char *)
3826 (
yy_size_t) (b->yy_buf_size + 2) , yyscanner );
3830 b->yy_ch_buf = NULL;
3832 if ( ! b->yy_ch_buf )
3834 "fatal error - scanner input buffer overflow" );
3836 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
3848 yyg->yy_n_chars, num_to_read );
3853 if ( yyg->yy_n_chars == 0 )
3874 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
3878 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
3883 yyg->yy_n_chars += number_to_move;
3900 yy_current_state = yyg->yy_start;
3903 for ( yy_cp = yyg->yytext_ptr +
YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
3906 if ( yy_accept[yy_current_state] )
3908 yyg->yy_last_accepting_state = yy_current_state;
3909 yyg->yy_last_accepting_cpos = yy_cp;
3911 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3913 yy_current_state = (
int) yy_def[yy_current_state];
3914 if ( yy_current_state >= 290 )
3915 yy_c = yy_meta[yy_c];
3917 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
3920 return yy_current_state;
3932 char *yy_cp = yyg->yy_c_buf_p;
3935 if ( yy_accept[yy_current_state] )
3937 yyg->yy_last_accepting_state = yy_current_state;
3938 yyg->yy_last_accepting_cpos = yy_cp;
3940 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3942 yy_current_state = (
int) yy_def[yy_current_state];
3943 if ( yy_current_state >= 290 )
3944 yy_c = yy_meta[yy_c];
3946 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
3947 yy_is_jam = (yy_current_state == 289);
3950 return yy_is_jam ? 0 : yy_current_state;
3955 static void yyunput (
int c,
char * yy_bp ,
yyscan_t yyscanner)
3960 yy_cp = yyg->yy_c_buf_p;
3963 *yy_cp = yyg->yy_hold_char;
3965 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3968 int number_to_move = yyg->yy_n_chars + 2;
3975 *--dest = *--source;
3977 yy_cp += (
int) (dest - source);
3978 yy_bp += (
int) (dest - source);
3982 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3986 *--yy_cp = (char) c;
3988 yyg->yytext_ptr = yy_bp;
3989 yyg->yy_hold_char = *yy_cp;
3990 yyg->yy_c_buf_p = yy_cp;
3997 static int yyinput (
yyscan_t yyscanner)
3999 static int input (
yyscan_t yyscanner)
4006 *yyg->yy_c_buf_p = yyg->yy_hold_char;
4016 *yyg->yy_c_buf_p =
'\0';
4020 int offset = (
int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
4023 switch ( yy_get_next_buffer( yyscanner ) )
4043 if (
yywrap( yyscanner ) )
4046 if ( ! yyg->yy_did_buffer_switch_on_eof )
4049 return yyinput(yyscanner);
4051 return input(yyscanner);
4056 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
4062 c = *(
unsigned char *) yyg->yy_c_buf_p;
4063 *yyg->yy_c_buf_p =
'\0';
4064 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
4111 *yyg->yy_c_buf_p = yyg->yy_hold_char;
4124 yyg->yy_did_buffer_switch_on_eof = 1;
4133 yyg->yy_hold_char = *yyg->yy_c_buf_p;
4150 b->yy_buf_size = size;
4155 b->yy_ch_buf = (
char *)
yyalloc( (
yy_size_t) (b->yy_buf_size + 2) , yyscanner );
4156 if ( ! b->yy_ch_buf )
4159 b->yy_is_our_buffer = 1;
4180 if ( b->yy_is_our_buffer )
4181 yyfree( (
void *) b->yy_ch_buf , yyscanner );
4183 yyfree( (
void *) b , yyscanner );
4198 b->yy_input_file = file;
4199 b->yy_fill_buffer = 1;
4206 b->yy_bs_lineno = 1;
4207 b->yy_bs_column = 0;
4210 b->yy_is_interactive = file ? (
isatty( fileno(file) ) > 0) : 0;
4234 b->yy_buf_pos = &b->yy_ch_buf[0];
4252 if (new_buffer == NULL)
4261 *yyg->yy_c_buf_p = yyg->yy_hold_char;
4268 yyg->yy_buffer_stack_top++;
4273 yyg->yy_did_buffer_switch_on_eof = 1;
4288 if (yyg->yy_buffer_stack_top > 0)
4289 --yyg->yy_buffer_stack_top;
4293 yyg->yy_did_buffer_switch_on_eof = 1;
4305 if (!yyg->yy_buffer_stack) {
4312 yyg->yy_buffer_stack = (
struct yy_buffer_state**)
yyalloc
4313 (num_to_alloc *
sizeof(
struct yy_buffer_state*)
4315 if ( ! yyg->yy_buffer_stack )
4316 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
4318 memset(yyg->yy_buffer_stack, 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
4320 yyg->yy_buffer_stack_max = num_to_alloc;
4321 yyg->yy_buffer_stack_top = 0;
4325 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
4330 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
4331 yyg->yy_buffer_stack = (
struct yy_buffer_state**)
yyrealloc
4332 (yyg->yy_buffer_stack,
4333 num_to_alloc *
sizeof(
struct yy_buffer_state*)
4335 if ( ! yyg->yy_buffer_stack )
4336 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
4339 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size *
sizeof(
struct yy_buffer_state*));
4340 yyg->yy_buffer_stack_max = num_to_alloc;
4364 b->yy_buf_size = (
int) (size - 2);
4365 b->yy_buf_pos = b->yy_ch_buf = base;
4366 b->yy_is_our_buffer = 0;
4367 b->yy_input_file = NULL;
4368 b->yy_n_chars = b->yy_buf_size;
4369 b->yy_is_interactive = 0;
4371 b->yy_fill_buffer = 0;
4409 buf = (
char *)
yyalloc( n , yyscanner );
4413 for ( i = 0; i < _yybytes_len; ++i )
4414 buf[i] = yybytes[i];
4425 b->yy_is_our_buffer = 1;
4430#ifndef YY_EXIT_FAILURE
4431#define YY_EXIT_FAILURE 2
4438 fprintf( stderr,
"%s\n", msg );
4449 int yyless_macro_arg = (n); \
4450 YY_LESS_LINENO(yyless_macro_arg);\
4451 yytext[yyleng] = yyg->yy_hold_char; \
4452 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
4453 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
4454 *yyg->yy_c_buf_p = '\0'; \
4455 yyleng = yyless_macro_arg; \
4625 if (ptr_yy_globals == NULL){
4632 if (*ptr_yy_globals == NULL){
4638 memset(*ptr_yy_globals,0x00,
sizeof(
struct yyguts_t));
4640 return yy_init_globals ( *ptr_yy_globals );
4656 if (ptr_yy_globals == NULL){
4663 if (*ptr_yy_globals == NULL){
4670 memset(*ptr_yy_globals,0x00,
sizeof(
struct yyguts_t));
4674 return yy_init_globals ( *ptr_yy_globals );
4677static int yy_init_globals (
yyscan_t yyscanner)
4684 yyg->yy_buffer_stack = NULL;
4685 yyg->yy_buffer_stack_top = 0;
4686 yyg->yy_buffer_stack_max = 0;
4687 yyg->yy_c_buf_p = NULL;
4691 yyg->yy_start_stack_ptr = 0;
4692 yyg->yy_start_stack_depth = 0;
4693 yyg->yy_start_stack = NULL;
4723 yyfree(yyg->yy_buffer_stack , yyscanner);
4724 yyg->yy_buffer_stack = NULL;
4727 yyfree( yyg->yy_start_stack , yyscanner );
4728 yyg->yy_start_stack = NULL;
4732 yy_init_globals( yyscanner);
4735 yyfree ( yyscanner , yyscanner );
4745static void yy_flex_strncpy (
char* s1,
const char * s2,
int n ,
yyscan_t yyscanner)
4751 for ( i = 0; i < n; ++i )
4756#ifdef YY_NEED_STRLEN
4757static int yy_flex_strlen (
const char * s ,
yyscan_t yyscanner)
4760 for ( n = 0; s[n]; ++n )
4767#define YYTABLES_NAME "yytables"
4769#line 1925 "../libinterp/parse-tree/lex.ll"
4772#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
4774# pragma GCC diagnostic pop
4780 return std::malloc (size);
4786 return std::realloc (ptr, size);
4795#if defined (OCTAVE_PARSER_DEBUG)
4797display_character (
char c)
4933 std::cerr <<
"SPACE";
4945#if defined (OCTAVE_PARSER_DEBUG)
4946static bool V__lexer_debug_flag__ =
false;
4947static bool V__display_tokens__ =
false;
4948static std::size_t V__token_count__ = 0;
4963 int nargin = args.
length ();
4979 std::string kword = wordlist[i].name;
4982 if (! (kword ==
"set" || kword ==
"get" || kword ==
"arguments"
4983 || kword ==
"enumeration" || kword ==
"events"
4984 || kword ==
"methods" || kword ==
"properties"))
4994 std::string name = args(0).xstring_value (
"iskeyword: NAME must be a string");
5014DEFUN (__lexer_debug_flag__, args, nargout,
5028#if defined (OCTAVE_PARSER_DEBUG)
5030 "__lexer_debug_flag__");
5032 octave_unused_parameter (args);
5033 octave_unused_parameter (nargout);
5035 error (
"__lexer_debug_flag__: support for debugging the lexer was disabled when Octave was built");
5039DEFUN (__display_tokens__, args, nargout,
5053#if defined (OCTAVE_PARSER_DEBUG)
5055 "__display_tokens__");
5057 octave_unused_parameter (args);
5058 octave_unused_parameter (nargout);
5060 error (
"__display_tokens__: support for debugging the lexer was disabled when Octave was built");
5064DEFUN (__token_count__, , ,
5071#if defined (OCTAVE_PARSER_DEBUG)
5074 error (
"__token_count__: support for debugging the lexer was disabled when Octave was built");
5081 while (! m_frame_stack.empty ())
5082 m_frame_stack.pop_front ();
5089 error (
"unexpected: empty stack in lexical_feedback::symbol_table_context::pop - please report this bug");
5091 m_frame_stack.pop_front ();
5100 return m_frame_stack.front ();
5106 std::size_t sz = size ();
5201 return prev_tok ? prev_tok->
token_id () : 0;
5208 return prev_tok ? prev_tok->
token_is (tok_id) :
false;
5215 return prev_tok ? prev_tok->
token_is (tok) :
false;
5238 return (tok_id ==
'+' || tok_id ==
'-' || tok_id ==
'@' || tok_id ==
'~' || tok_id ==
'!'
5239 || tok_id ==
',' || tok_id ==
';' || tok_id ==
'*' || tok_id ==
'/'
5240 || tok_id ==
':' || tok_id ==
'=' || tok_id ==
ADD_EQ
5257 return prev_tok ? prev_tok->
iskeyword () :
false;
5289looks_like_copyright (
const std::string& s)
5297 std::size_t offset = s.find_first_not_of (
" \t\n\r");
5299 return (offset != std::string::npos
5300 && (s.substr (offset, 9) ==
"Copyright"
5301 || s.substr (offset, 6) ==
"Author"
5302 || s.substr (offset, 23) ==
"SPDX-License-Identifier"));
5307looks_like_shebang (
const std::string& s)
5309 return ((! s.empty ()) && (s[0] ==
'!'));
5316 m_chars_left = m_buffer.length ();
5326 static const char *
const eol =
"\n";
5328 std::size_t
len = 0;
5331 std::size_t newline_pos = m_buffer.find (
'\n', m_offset);
5332 len = (newline_pos != std::string::npos
5333 ? newline_pos - m_offset + 1
5334 : (max_size > m_chars_left ? m_chars_left : max_size));
5337 len = max_size > m_chars_left ? m_chars_left : max_size;
5340 error (
"unexpected: buffer underflow in base_lexer::input_buffer::copy_chunk - please report this bug");
5342 memcpy (buf, m_buffer.c_str () + m_offset,
len);
5344 m_chars_left -=
len;
5350 if (m_chars_left == 0 && buf[
len-1] !=
'\n')
5392 clear_start_state ();
5402 struct yyguts_t *yyg = static_cast<struct yyguts_t*> (m_scanner)
5408 clear_start_state ();
5419 || input_from_eval_string ()))
5424 m_comment_list.clear ();
5440 push_start_state (state);
5446 lexer_debug (
"<<EOF>>");
5453 std::string msg {
"block comment unterminated at end of input"};
5464 return handle_token (tok);
5484#if defined (OCTAVE_PARSER_DEBUG)
5485 if (V__lexer_debug_flag__)
5488 display_character (c);
5489 std::cerr << std::endl;
5498#if defined (OCTAVE_PARSER_DEBUG)
5499 if (V__lexer_debug_flag__)
5502 display_character (c);
5503 std::cerr << std::endl;
5522#if defined (OCTAVE_PARSER_DEBUG)
5523 if (V__lexer_debug_flag__)
5526 display_character (c);
5527 std::cerr << std::endl;
5537 char *yytxt = flex_yytext ();
5557 int c = text_yyinput ();
5559 return is_space_or_tab (c);
5565 bool retval =
false;
5585 int slen = s.length ();
5597 token *tok =
nullptr;
5622 if (inside_any_object_index ()
5676#if defined (DISABLE_ARGUMENTS_VALIDATION_BLOCK)
5787 update_token_positions (slen);
5792#if defined (DISABLE_ARGUMENTS_VALIDATION_BLOCK)
5857 p2 = s.find (
'.', p1);
5859 if (p2 != std::string::npos)
5861 s_part = s.substr (p1, p2 - p1);
5865 s_part = s.substr (p1);
5870 while (p2 != std::string::npos);
5884looks_like_bin (
const char *s,
int len)
5886 return (
len > 2 && s[0] ==
'0' && (s[1] ==
'b' || s[1] ==
'B'));
5890looks_like_hex (
const char *s,
int len)
5892 return (
len > 2 && s[0] ==
'0' && (s[1] ==
'x' || s[1] ==
'X'));
5895OCTAVE_NORETURN
static void
5896error_unexpected_bytes (
int bytes)
5898 error (
"unexpected: bytes (= %d) not 1, 2, 4, or 8 in make_integer_value - please report this bug", bytes);
5902make_integer_value (uintmax_t long_int_val,
bool unsigned_val,
int bytes)
5921 error_unexpected_bytes (bytes);
5944 error_unexpected_bytes (bytes);
5953base_lexer::handle_number<2> ()
5956 std::string yytxt (flex_yytext () + 2);
5958 yytxt.erase (std::remove (yytxt.begin (), yytxt.end (),
'_'), yytxt.end ());
5960 std::size_t pos = yytxt.find_first_of (
"su");
5962 bool unsigned_val =
true;
5965 if (pos == std::string::npos)
5967 std::size_t num_digits = yytxt.length ();
5969 if (num_digits <= 8)
5971 else if (num_digits <= 16)
5973 else if (num_digits <= 32)
5975 else if (num_digits <= 64)
5980 unsigned_val = (yytxt[pos] ==
'u');
5981 std::string size_str = yytxt.substr (pos+1);
5982 yytxt = yytxt.substr (0, pos);
5983 std::size_t num_digits = yytxt.length ();
5985 if (size_str ==
"8" && num_digits <= 8)
5987 else if (size_str ==
"16" && num_digits <= 16)
5989 else if (size_str ==
"32" && num_digits <= 32)
5991 else if (size_str ==
"64" && num_digits <= 64)
5997 std::string msg {
"too many digits for binary constant"};
5998 return syntax_error (msg);
6006 uintmax_t long_int_val;
6007 if (
sizeof (uintmax_t) ==
sizeof (
unsigned long long))
6008 long_int_val = strtoull (yytxt.c_str (), &end, 2);
6009 else if (
sizeof (uintmax_t) ==
sizeof (
unsigned long))
6010 long_int_val = strtoul (yytxt.c_str (), &end, 2);
6012 error (
"unexpected: size mismatch: uintmax_t vs unsigned long or unsigned long long in base_lexer::handle_number<2> - please report this bug");
6014 if (errno == ERANGE)
6015 error (
"unexpected: ERANGE error in base_lexer::handle_number<2> - please report this bug");
6017 octave_value ov = make_integer_value (long_int_val, unsigned_val, bytes);
6022 update_token_positions (flex_yyleng ());
6026 return handle_token (tok);
6032 return (
static_cast<uint64_t
> (1) << std::numeric_limits<double>::digits);
6037base_lexer::handle_number<10> ()
6040 bool digits_only =
true;
6042 char *yytxt = flex_yytext ();
6043 std::size_t yylng = flex_yyleng ();
6047 char *p = &tmptxt[0];
6050 while ((ch = *rp++))
6060 digits_only =
false;
6068 digits_only =
false;
6077 digits_only =
false;
6090 const char *chars_start = tmptxt;
6091 const char *chars_end = tmptxt + std::strlen (tmptxt);
6093#if defined (OCTAVE_HAVE_STD_FROM_CHARS_DOUBLE)
6094 auto [ptr, ec] = std::from_chars (chars_start, chars_end, value);
6095#elif defined (OCTAVE_HAVE_FAST_FLOAT)
6096 auto [ptr, ec] = fast_float::from_chars (chars_start, chars_end, value);
6098# error "Cannot convert string to floating-point number. This should be unreachable."
6101 if (ec != std::errc{})
6105 case std::errc::invalid_argument:
6106 fatal_error (
"invalid floating point format in base_lexer::handle_number<10> - please report this bug");
6108 case std::errc::result_out_of_range:
6111 if (tmptxt[0] ==
'-')
6112 value = -std::numeric_limits<double>::infinity ();
6114 value = std::numeric_limits<double>::infinity ();
6117 fatal_error (
"from_chars failed in base_lexer::handle_number<10> - please report this bug");
6127 if (digits_only && value >= flintmax ())
6136 uintmax_t long_int_val;
6137 if (
sizeof (uintmax_t) ==
sizeof (
unsigned long long))
6138 long_int_val = strtoull (tmptxt, &end, 10);
6139 else if (
sizeof (uintmax_t) ==
sizeof (
unsigned long))
6140 long_int_val = strtoul (tmptxt, &end, 10);
6142 error (
"unexpected: size mismatch: uintmax_t vs unsigned long or unsigned long long in base_lexer::handle_number<10> - please report this bug");
6144 if (errno != ERANGE)
6149 if (long_int_val > std::numeric_limits<int64_t>::max ())
6161 update_token_positions (yylng);
6169 return handle_token (tok);
6179base_lexer::handle_number<16> ()
6182 std::string yytxt (flex_yytext () + 2);
6184 yytxt.erase (std::remove (yytxt.begin (), yytxt.end (),
'_'), yytxt.end ());
6186 std::size_t pos = yytxt.find_first_of (
"su");
6188 bool unsigned_val =
true;
6191 if (pos == std::string::npos)
6193 std::size_t num_digits = yytxt.length ();
6195 if (num_digits <= 2)
6197 else if (num_digits <= 4)
6199 else if (num_digits <= 8)
6201 else if (num_digits <= 16)
6206 unsigned_val = (yytxt[pos] ==
'u');
6207 std::string size_str = yytxt.substr (pos+1);
6208 yytxt = yytxt.substr (0, pos);
6209 std::size_t num_digits = yytxt.length ();
6211 if (size_str ==
"8" && num_digits <= 2)
6213 else if (size_str ==
"16" && num_digits <= 4)
6215 else if (size_str ==
"32" && num_digits <= 8)
6217 else if (size_str ==
"64" && num_digits <= 16)
6223 std::string msg {
"too many digits for hexadecimal constant"};
6224 return syntax_error (msg);
6227 uintmax_t long_int_val = 0;
6228 const char *chars_start = yytxt.c_str ();
6229 const char *chars_end = chars_start + yytxt.length ();
6230 auto [ptr, ec] = std::from_chars (chars_start, chars_end, long_int_val, 16);
6231 if (ec != std::errc{})
6235 case std::errc::invalid_argument:
6236 fatal_error (
"invalid hexadecimal format in base_lexer::handle_number<16> - please report this bug");
6238 case std::errc::result_out_of_range:
6239 fatal_error (
"hexadecimal value out of range in base_lexer::handle_number<16> - please report this bug");
6242 fatal_error (
"from_chars failed in base_lexer::handle_number<16> - please report this bug");
6248 octave_value ov = make_integer_value (long_int_val, unsigned_val, bytes);
6253 update_token_positions (flex_yyleng ());
6257 return handle_token (tok);
6263 char *yytxt = flex_yytext ();
6264 int yylng = flex_yyleng ();
6267 if (yytxt[0] ==
'\\')
6268 warn_language_extension_continuation ();
6272 bool have_space =
false;
6273 while (offset < yylng)
6275 char c = yytxt[offset];
6276 if (is_space_or_tab (c))
6288 bool have_comment =
false;
6290 while (offset < yylng)
6292 char c = yytxt[offset];
6294 if (c ==
'#' || c ==
'%')
6296 if (first && c ==
'#')
6302 have_comment =
true;
6352 if (bracket_type ==
']')
6354 else if (bracket_type ==
'}')
6357 error (
"unexpected: bracket_type not ']' or '}' in base_lexer::handle_close_bracket - please report this bug");
6362 return handle_token (bracket_type);
6372 bool space_after = looking_at_space ();
6380 update_token_positions (flex_yyleng ());
6382 std::string txt = flex_yytext ();
6384 txt.erase (std::remove_if (txt.begin (), txt.end (), is_space_or_tab),
6387 std::size_t pos = txt.find (
"@");
6389 std::string meth = txt.substr (0, pos);
6390 std::string cls = txt.substr (pos + 1);
6392 if (
iskeyword (meth) || fq_identifier_contains_keyword (cls))
6394 std::string msg {
"method, class, and package names may not be keywords"};
6395 return syntax_error (msg);
6402 return handle_token (tok);
6442 update_token_positions (flex_yyleng ());
6444 std::string ident = flex_yytext ();
6456 return handle_token (tok);
6463 token *tok = make_keyword_token (ident);
6473 return handle_token (tok);
6488 || ident ==
"e" || ident ==
"pi"
6489 || ident ==
"I" || ident ==
"i"
6490 || ident ==
"J" || ident ==
"j"
6491 || ident ==
"Inf" || ident ==
"inf"
6492 || ident ==
"NaN" || ident ==
"nan"))
6501 return handle_token (tok);
6511 while (i <
len && is_space_or_tab (txt[i]))
6524 "potential auto-insertion of '%c' near line %d",
6528 "potential auto-insertion of '%c' near line %d of file %s",
6539 "Octave language extension used: %s",
6543 "Octave language extension used: %s near line %d of file %s",
6551 warn_language_extension (
"# used as comment character");
6557 warn_language_extension (
"\\ used as line continuation marker");
6564 int n = t.length ();
6567 warn_language_extension (t +
" used as operator");
6577 "%s; near line %d of file '%s'", msg.c_str (),
6590 return syntax_error (msg, pos, pos);
6601 return count_token_internal (tok->
token_id ());
6625#if defined (OCTAVE_PARSER_DEBUG)
6631 case '=': std::cerr <<
"'='\n";
break;
6632 case ':': std::cerr <<
"':'\n";
break;
6633 case '-': std::cerr <<
"'-'\n";
break;
6634 case '+': std::cerr <<
"'+'\n";
break;
6635 case '*': std::cerr <<
"'*'\n";
break;
6636 case '/': std::cerr <<
"'/'\n";
break;
6637 case '~': std::cerr <<
"'~'\n";
break;
6638 case '!': std::cerr <<
"'!'\n";
break;
6639 case ADD_EQ: std::cerr <<
"ADD_EQ\n";
break;
6640 case SUB_EQ: std::cerr <<
"SUB_EQ\n";
break;
6641 case MUL_EQ: std::cerr <<
"MUL_EQ\n";
break;
6642 case DIV_EQ: std::cerr <<
"DIV_EQ\n";
break;
6643 case LEFTDIV_EQ: std::cerr <<
"LEFTDIV_EQ\n";
break;
6644 case POW_EQ: std::cerr <<
"POW_EQ\n";
break;
6645 case EMUL_EQ: std::cerr <<
"EMUL_EQ\n";
break;
6646 case EDIV_EQ: std::cerr <<
"EDIV_EQ\n";
break;
6647 case ELEFTDIV_EQ: std::cerr <<
"ELEFTDIV_EQ\n";
break;
6648 case EPOW_EQ: std::cerr <<
"EPOW_EQ\n";
break;
6649 case AND_EQ: std::cerr <<
"AND_EQ\n";
break;
6650 case OR_EQ: std::cerr <<
"OR_EQ\n";
break;
6651 case EXPR_AND_AND: std::cerr <<
"EXPR_AND_AND\n";
break;
6652 case EXPR_OR_OR: std::cerr <<
"EXPR_OR_OR\n";
break;
6653 case EXPR_AND: std::cerr <<
"EXPR_AND\n";
break;
6654 case EXPR_OR: std::cerr <<
"EXPR_OR\n";
break;
6655 case EXPR_LT: std::cerr <<
"EXPR_LT\n";
break;
6656 case EXPR_LE: std::cerr <<
"EXPR_LE\n";
break;
6657 case EXPR_EQ: std::cerr <<
"EXPR_EQ\n";
break;
6658 case EXPR_NE: std::cerr <<
"EXPR_NE\n";
break;
6659 case EXPR_GE: std::cerr <<
"EXPR_GE\n";
break;
6660 case EXPR_GT: std::cerr <<
"EXPR_GT\n";
break;
6661 case LEFTDIV: std::cerr <<
"LEFTDIV\n";
break;
6662 case EMUL: std::cerr <<
"EMUL\n";
break;
6663 case EDIV: std::cerr <<
"EDIV\n";
break;
6664 case ELEFTDIV: std::cerr <<
"ELEFTDIV\n";
break;
6665 case HERMITIAN: std::cerr <<
"HERMITIAN\n";
break;
6666 case TRANSPOSE: std::cerr <<
"TRANSPOSE\n";
break;
6667 case PLUS_PLUS: std::cerr <<
"PLUS_PLUS\n";
break;
6668 case MINUS_MINUS: std::cerr <<
"MINUS_MINUS\n";
break;
6669 case POW: std::cerr <<
"POW\n";
break;
6670 case EPOW: std::cerr <<
"EPOW\n";
break;
6674 token *tok = current_token ();
6675 std::cerr <<
"NUMBER [";
6684 token *tok = current_token ();
6685 std::cerr <<
"STRUCT_ELT [" << tok->
text () <<
"]\n";
6691 token *tok = current_token ();
6692 std::cerr <<
"NAME [" << tok->
text () <<
"]\n";
6696 case END: std::cerr <<
"END\n";
break;
6701 token *tok = current_token ();
6703 std::cerr << (tok_id ==
DQ_STRING ?
"DQ_STRING" :
"SQ_STRING")
6704 <<
" [" << tok->
text () <<
"]\n";
6708 case FOR: std::cerr <<
"FOR\n";
break;
6709 case WHILE: std::cerr <<
"WHILE\n";
break;
6710 case DO: std::cerr <<
"DO\n";
break;
6711 case UNTIL: std::cerr <<
"UNTIL\n";
break;
6712 case IF: std::cerr <<
"IF\n";
break;
6713 case ELSEIF: std::cerr <<
"ELSEIF\n";
break;
6714 case ELSE: std::cerr <<
"ELSE\n";
break;
6715 case SWITCH: std::cerr <<
"SWITCH\n";
break;
6716 case CASE: std::cerr <<
"CASE\n";
break;
6717 case OTHERWISE: std::cerr <<
"OTHERWISE\n";
break;
6718 case BREAK: std::cerr <<
"BREAK\n";
break;
6719 case CONTINUE: std::cerr <<
"CONTINUE\n";
break;
6720 case RETURN: std::cerr <<
"RETURN\n";
break;
6721 case UNWIND: std::cerr <<
"UNWIND\n";
break;
6722 case CLEANUP: std::cerr <<
"CLEANUP\n";
break;
6723 case TRY: std::cerr <<
"TRY\n";
break;
6724 case CATCH: std::cerr <<
"CATCH\n";
break;
6725 case GLOBAL: std::cerr <<
"GLOBAL\n";
break;
6726 case PERSISTENT: std::cerr <<
"PERSISTENT\n";
break;
6727 case FCN_HANDLE: std::cerr <<
"FCN_HANDLE\n";
break;
6728 case END_OF_INPUT: std::cerr <<
"END_OF_INPUT\n\n";
break;
6729 case LEXICAL_ERROR: std::cerr <<
"LEXICAL_ERROR\n\n";
break;
6730 case FUNCTION: std::cerr <<
"FUNCTION\n";
break;
6731 case INPUT_FILE: std::cerr <<
"INPUT_FILE\n";
break;
6733 case METAQUERY: std::cerr <<
"METAQUERY\n";
break;
6734 case GET: std::cerr <<
"GET\n";
break;
6735 case SET: std::cerr <<
"SET\n";
break;
6736 case PROPERTIES: std::cerr <<
"PROPERTIES\n";
break;
6737 case METHODS: std::cerr <<
"METHODS\n";
break;
6738 case EVENTS: std::cerr <<
"EVENTS\n";
break;
6739 case CLASSDEF: std::cerr <<
"CLASSDEF\n";
break;
6740 case '\n': std::cerr <<
"\\n\n";
break;
6741 case '\r': std::cerr <<
"\\r\n";
break;
6742 case '\t': std::cerr <<
"TAB\n";
break;
6745 if (tok_id < 256 && tok_id > 31)
6746 std::cerr << static_cast<char> (tok_id) <<
"\n";
6748 std::cerr <<
"UNKNOWN(" << tok_id <<
")\n";
6758 ::error (
"fatal lexer error: %s", msg);
6766#if defined (OCTAVE_PARSER_DEBUG)
6774#if defined (OCTAVE_PARSER_DEBUG)
6775 if (V__lexer_debug_flag__)
6777 std::cerr << std::endl;
6779 display_start_state ();
6781 std::cerr <<
"P: " << pattern << std::endl;
6782 std::cerr <<
"T: " << flex_yytext () << std::endl;
6786 octave_unused_parameter (pattern);
6803 start_state_stack.push (state);
6805 BEGIN (start_state ());
6813 start_state_stack.pop ();
6815 BEGIN (start_state ());
6821 while (! start_state_stack.empty ())
6822 start_state_stack.pop ();
6828#if defined (OCTAVE_PARSER_DEBUG)
6834 switch (start_state ())
6837 std::cerr <<
"INITIAL" << std::endl;
6841 std::cerr <<
"COMMAND_START" << std::endl;
6845 std::cerr <<
"MATRIX_START" << std::endl;
6849 std::cerr <<
"INPUT_FILE_START" << std::endl;
6853 std::cerr <<
"BLOCK_COMMENT_START" << std::endl;
6857 std::cerr <<
"LINE_COMMENT_START" << std::endl;
6861 std::cerr <<
"DQ_STRING_START" << std::endl;
6865 std::cerr <<
"SQ_STRING_START" << std::endl;
6869 std::cerr <<
"FQ_IDENT_START" << std::endl;
6873 std::cerr <<
"UNKNOWN START STATE!" << std::endl;
6884 bool unput_comma =
false;
6888 int c = text_yyinput ();
6891 bool space_after = is_space_or_tab (c);
6893 if (! (prev_tok_id ==
'[' || prev_tok_id ==
'{'
6895 || ((tok_id ==
'+' || tok_id ==
'-') && space_after)))
6904 bool bos,
bool compat)
6907 warn_language_extension_operator (tok_txt);
6909 update_token_positions (tok_len);
6935 return handle_token (tok);
6949 return handle_token (tok);
6966 && ! (tok_id ==
';' || tok_id ==
',' || tok_id ==
'\n'))
6969 return count_token_internal (tok_id);
6976 increment_token_count ();
6978 return show_token (tok_id);
6984#if defined (OCTAVE_PARSER_DEBUG)
6985 if (V__display_tokens__)
6986 display_token (tok_id);
6988 if (V__lexer_debug_flag__)
6991 display_token (tok_id);
6992 std::cerr << std::endl;
7004 if (m_input_buf.empty ())
7033 if (! m_input_buf.empty ())
7034 status = m_input_buf.copy_chunk (buf, max_size);
7038 m_initial_input =
false;
7061 m_input_buf.fill (input, eof);
7070 if (m_input_buf.empty () && ! m_input_buf.at_eof ())
7079 error (
"unexpected: max_size <= 0 in push_lexer::fill_flex_buffer - please report this bug");
7081 buf[0] =
static_cast<char> (1);
7089 if (! m_input_buf.empty ())
7090 status = m_input_buf.copy_chunk (buf, max_size,
true);
7098OCTAVE_END_NAMESPACE(octave)
void maybe_warn_separator_insert(char sep)
void warn_language_extension_operator(const std::string &op)
int handle_superclass_identifier()
void push_start_state(int state)
int handle_close_bracket(int bracket_type)
bool inside_any_object_index()
void begin_string(int state)
bool input_from_tmp_history_file()
void update_token_positions(int tok_len)
int handle_end_of_input()
void maybe_warn_language_extension_comment(char c)
bool looks_like_command_arg()
bool fq_identifier_contains_keyword(const std::string &s)
void warn_deprecated_syntax(const std::string &msg)
void warn_language_extension(const std::string &msg)
void finish_comment(comment_elt::comment_type typ)
void display_start_state() const
token * make_meta_identifier_token(const std::string &cls)
void warn_language_extension_continuation()
int handle_op(int tok_id, const std::string &tok_txt, int tok_len, bool bos=false, bool compat=true)
token * make_keyword_token(const std::string &s)
token * make_fq_identifier_token(const std::string &ident)
void fatal_error(const char *msg)
int syntax_error(const std::string &msg)
int show_token(int tok_id)
int handle_token(int tok_id)
void handle_continuation()
bool maybe_unput_comma_before_unary_op(int tok_id)
void xunput(char c, char *buf)
void display_token(int tok_id)
std::size_t pending_token_count() const
void check_comment_for_hash_char(const char *txt, std::size_t len)
int count_token_internal(int tok_id)
bool whitespace_is_significant()
void lexer_debug(const char *pattern)
void increment_token_count()
static std::string decode_prompt_string(const std::string &s)
void increment_column(int val=1)
octave_value input_from_tmp_file(const octave_value_list &args, int nargout)
symbol_scope get_current_scope() const
history_system & get_history_system()
octave_value PS1(const octave_value_list &args, int nargout)
octave_value PS2(const octave_value_list &args, int nargout)
int fill_flex_buffer(char *buf, unsigned int max_size)
symbol_scope curr_scope() const
symbol_scope parent_scope() const
bool m_looking_at_parameter_list
bool m_reading_classdef_file
bool previous_token_is_binop() const
bool space_follows_previous_token() const
bool m_looking_at_anon_fcn_args
std::string m_package_name
void mark_as_variables(const std::list< std::string > &lst)
bool previous_token_is_keyword() const
bool previous_token_is(int tok_id) const
bool m_arguments_is_keyword
std::string m_current_input_line
bool m_allow_command_syntax
bool m_parsing_classdef_set_method
bool m_parsing_anon_fcn_body
std::string m_comment_text
std::stack< bool > m_parsed_function_name
bool m_at_beginning_of_statement
int m_block_comment_nesting_level
bool previous_token_may_be_command() const
int m_command_arg_paren_count
std::string m_fcn_file_full_name
bool m_looking_at_return_list
bool m_parsing_classdef_get_method
std::string m_string_text
std::list< bool > m_looking_at_object_index
bool m_parsing_classdef_decl
bool m_looking_at_matrix_or_assign_lhs
bool m_parsing_classdef_superclass
bool m_looking_for_object_index
interpreter & m_interpreter
bbp_nesting_level m_nesting_level
int previous_token_id() const
bool m_reading_script_file
bool m_classdef_element_names_are_keywords
std::size_t m_token_count
std::string m_function_text
bool m_comment_uses_hash_char
std::string m_fcn_file_name
bool m_looking_at_decl_list
symbol_table_context m_symtab_context
bool m_quote_is_transpose
bool m_parsing_class_method
void mark_previous_token_trailing_space()
bool m_buffer_function_text
void mark_as_variable(const std::string &nm)
bool m_maybe_classdef_get_set_method
bool m_looking_at_indirect_ref
int m_looking_at_function_handle
static const struct octave_kw * in_word_set(const char *str, size_t len)
bool is_undefined() const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
octave_idx_type length() const
int fill_flex_buffer(char *buf, unsigned int max_size)
void append_input(const std::string &input, bool eof)
string_vector & sort(bool make_uniq=false)
void resize(octave_idx_type n, const std::string &rfv="")
void mark_as_variable(const std::string &nm)
static symbol_scope invalid()
void mark_as_variables(const std::list< std::string > &lst)
void mark_trailing_space()
void mark_may_be_command()
bool token_is(int id) const
bool may_be_command() const
octave_value number() const
bool space_follows_token() const
ColumnVector imag(const ComplexColumnVector &a)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void warning_with_id(const char *id, const char *fmt,...)
void error(const char *fmt,...)
#define yy_load_buffer_state
unsigned char flex_uint8_t
unsigned int flex_uint32_t
void * octave_alloc(yy_size_t, yyscan_t yyscanner)
bool iskeyword(const std::string &s)
#define yypush_buffer_state
struct yy_buffer_state * YY_BUFFER_STATE
#define YY_RESTORE_YY_MORE_OFFSET
#define HANDLE_EOB_OR_EOF(STATUS)
#define CMD_OR_UNARY_OP(PATTERN, TOK_ID, COMPAT)
#define yyensure_buffer_stack
void octave_free(void *, yyscan_t yyscanner)
#define HANDLE_NUMBER(PATTERN, BASE)
#define EOB_ACT_END_OF_FILE
#define yypop_buffer_state
#define YY_CURRENT_BUFFER_LVALUE
#define HANDLE_IDENTIFIER(pattern, get_set)
#define yy_switch_to_buffer
#define YY_CURRENT_BUFFER
#define LINE_COMMENT_START
#define YY_INPUT(buf, result, max_size)
#define YY_STATE_EOF(state)
#define YY_END_OF_BUFFER_CHAR
#define YY_FATAL_ERROR(msg)
unsigned short int flex_uint16_t
#define YY_DO_BEFORE_ACTION
#define EOB_ACT_LAST_MATCH
#define YY_BUFFER_EOF_PENDING
#define CMD_OR_OP(PATTERN, TOK_ID, COMPAT)
#define EOB_ACT_CONTINUE_SCAN
#define HANDLE_STRING_CONTINUATION
void * octave_realloc(void *, yy_size_t, yyscan_t yyscanner)
#define BLOCK_COMMENT_START
bool iskeyword(const std::string &s)
std::complex< double > Complex
@ unwind_protect_cleanup_kw
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
T::size_type strlen(const typename T::value_type *str)
unsigned char flex_uint8_t
struct yy_buffer_state * YY_BUFFER_STATE
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)