lexer.c
This file
Path
src/lexer.c
2,705 lines · 71.9 KiB · C
Last changed by
Parse `?//` as `?` and `//` outside destructuring patterns (#3593)A4-Tacksbefore adoptiona19efdd
History of this fileTake it
1#line 1 "src/lexer.c"23#line 3 "src/lexer.c"45#define YY_INT_ALIGNED short int67/* A lexical scanner generated by flex */89#define FLEX_SCANNER10#define YY_FLEX_MAJOR_VERSION 211#define YY_FLEX_MINOR_VERSION 612#define YY_FLEX_SUBMINOR_VERSION 413#if YY_FLEX_SUBMINOR_VERSION > 014#define FLEX_BETA15#endif1617#ifdef yy_create_buffer18#define jq_yy_create_buffer_ALREADY_DEFINED19#else20#define yy_create_buffer jq_yy_create_buffer21#endif2223#ifdef yy_delete_buffer24#define jq_yy_delete_buffer_ALREADY_DEFINED25#else26#define yy_delete_buffer jq_yy_delete_buffer27#endif2829#ifdef yy_scan_buffer30#define jq_yy_scan_buffer_ALREADY_DEFINED31#else32#define yy_scan_buffer jq_yy_scan_buffer33#endif3435#ifdef yy_scan_string36#define jq_yy_scan_string_ALREADY_DEFINED37#else38#define yy_scan_string jq_yy_scan_string39#endif4041#ifdef yy_scan_bytes42#define jq_yy_scan_bytes_ALREADY_DEFINED43#else44#define yy_scan_bytes jq_yy_scan_bytes45#endif4647#ifdef yy_init_buffer48#define jq_yy_init_buffer_ALREADY_DEFINED49#else50#define yy_init_buffer jq_yy_init_buffer51#endif5253#ifdef yy_flush_buffer54#define jq_yy_flush_buffer_ALREADY_DEFINED55#else56#define yy_flush_buffer jq_yy_flush_buffer57#endif5859#ifdef yy_load_buffer_state60#define jq_yy_load_buffer_state_ALREADY_DEFINED61#else62#define yy_load_buffer_state jq_yy_load_buffer_state63#endif6465#ifdef yy_switch_to_buffer66#define jq_yy_switch_to_buffer_ALREADY_DEFINED67#else68#define yy_switch_to_buffer jq_yy_switch_to_buffer69#endif7071#ifdef yypush_buffer_state72#define jq_yypush_buffer_state_ALREADY_DEFINED73#else74#define yypush_buffer_state jq_yypush_buffer_state75#endif7677#ifdef yypop_buffer_state78#define jq_yypop_buffer_state_ALREADY_DEFINED79#else80#define yypop_buffer_state jq_yypop_buffer_state81#endif8283#ifdef yyensure_buffer_stack84#define jq_yyensure_buffer_stack_ALREADY_DEFINED85#else86#define yyensure_buffer_stack jq_yyensure_buffer_stack87#endif8889#ifdef yylex90#define jq_yylex_ALREADY_DEFINED91#else92#define yylex jq_yylex93#endif9495#ifdef yyrestart96#define jq_yyrestart_ALREADY_DEFINED97#else98#define yyrestart jq_yyrestart99#endif100101#ifdef yylex_init102#define jq_yylex_init_ALREADY_DEFINED103#else104#define yylex_init jq_yylex_init105#endif106107#ifdef yylex_init_extra108#define jq_yylex_init_extra_ALREADY_DEFINED109#else110#define yylex_init_extra jq_yylex_init_extra111#endif112113#ifdef yylex_destroy114#define jq_yylex_destroy_ALREADY_DEFINED115#else116#define yylex_destroy jq_yylex_destroy117#endif118119#ifdef yyget_debug120#define jq_yyget_debug_ALREADY_DEFINED121#else122#define yyget_debug jq_yyget_debug123#endif124125#ifdef yyset_debug126#define jq_yyset_debug_ALREADY_DEFINED127#else128#define yyset_debug jq_yyset_debug129#endif130131#ifdef yyget_extra132#define jq_yyget_extra_ALREADY_DEFINED133#else134#define yyget_extra jq_yyget_extra135#endif136137#ifdef yyset_extra138#define jq_yyset_extra_ALREADY_DEFINED139#else140#define yyset_extra jq_yyset_extra141#endif142143#ifdef yyget_in144#define jq_yyget_in_ALREADY_DEFINED145#else146#define yyget_in jq_yyget_in147#endif148149#ifdef yyset_in150#define jq_yyset_in_ALREADY_DEFINED151#else152#define yyset_in jq_yyset_in153#endif154155#ifdef yyget_out156#define jq_yyget_out_ALREADY_DEFINED157#else158#define yyget_out jq_yyget_out159#endif160161#ifdef yyset_out162#define jq_yyset_out_ALREADY_DEFINED163#else164#define yyset_out jq_yyset_out165#endif166167#ifdef yyget_leng168#define jq_yyget_leng_ALREADY_DEFINED169#else170#define yyget_leng jq_yyget_leng171#endif172173#ifdef yyget_text174#define jq_yyget_text_ALREADY_DEFINED175#else176#define yyget_text jq_yyget_text177#endif178179#ifdef yyget_lineno180#define jq_yyget_lineno_ALREADY_DEFINED181#else182#define yyget_lineno jq_yyget_lineno183#endif184185#ifdef yyset_lineno186#define jq_yyset_lineno_ALREADY_DEFINED187#else188#define yyset_lineno jq_yyset_lineno189#endif190191#ifdef yyget_column192#define jq_yyget_column_ALREADY_DEFINED193#else194#define yyget_column jq_yyget_column195#endif196197#ifdef yyset_column198#define jq_yyset_column_ALREADY_DEFINED199#else200#define yyset_column jq_yyset_column201#endif202203#ifdef yywrap204#define jq_yywrap_ALREADY_DEFINED205#else206#define yywrap jq_yywrap207#endif208209#ifdef yyget_lval210#define jq_yyget_lval_ALREADY_DEFINED211#else212#define yyget_lval jq_yyget_lval213#endif214215#ifdef yyset_lval216#define jq_yyset_lval_ALREADY_DEFINED217#else218#define yyset_lval jq_yyset_lval219#endif220221#ifdef yyget_lloc222#define jq_yyget_lloc_ALREADY_DEFINED223#else224#define yyget_lloc jq_yyget_lloc225#endif226227#ifdef yyset_lloc228#define jq_yyset_lloc_ALREADY_DEFINED229#else230#define yyset_lloc jq_yyset_lloc231#endif232233#ifdef yyalloc234#define jq_yyalloc_ALREADY_DEFINED235#else236#define yyalloc jq_yyalloc237#endif238239#ifdef yyrealloc240#define jq_yyrealloc_ALREADY_DEFINED241#else242#define yyrealloc jq_yyrealloc243#endif244245#ifdef yyfree246#define jq_yyfree_ALREADY_DEFINED247#else248#define yyfree jq_yyfree249#endif250251/* First, we deal with platform-specific or compiler-specific issues. */252253/* begin standard C headers. */254#include <stdio.h>255#include <string.h>256#include <errno.h>257#include <stdlib.h>258259/* end standard C headers. */260261/* flex integer type definitions */262263#ifndef FLEXINT_H264#define FLEXINT_H265266/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */267268#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L269270/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,271 * if you want the limit (max/min) macros for int types. 272 */273#ifndef __STDC_LIMIT_MACROS274#define __STDC_LIMIT_MACROS 1275#endif276277#include <inttypes.h>278typedef int8_t flex_int8_t;279typedef uint8_t flex_uint8_t;280typedef int16_t flex_int16_t;281typedef uint16_t flex_uint16_t;282typedef int32_t flex_int32_t;283typedef uint32_t flex_uint32_t;284#else285typedef signed char flex_int8_t;286typedef short int flex_int16_t;287typedef int flex_int32_t;288typedef unsigned char flex_uint8_t; 289typedef unsigned short int flex_uint16_t;290typedef unsigned int flex_uint32_t;291292/* Limits of integral types. */293#ifndef INT8_MIN294#define INT8_MIN (-128)295#endif296#ifndef INT16_MIN297#define INT16_MIN (-32767-1)298#endif299#ifndef INT32_MIN300#define INT32_MIN (-2147483647-1)301#endif302#ifndef INT8_MAX303#define INT8_MAX (127)304#endif305#ifndef INT16_MAX306#define INT16_MAX (32767)307#endif308#ifndef INT32_MAX309#define INT32_MAX (2147483647)310#endif311#ifndef UINT8_MAX312#define UINT8_MAX (255U)313#endif314#ifndef UINT16_MAX315#define UINT16_MAX (65535U)316#endif317#ifndef UINT32_MAX318#define UINT32_MAX (4294967295U)319#endif320321#ifndef SIZE_MAX322#define SIZE_MAX (~(size_t)0)323#endif324325#endif /* ! C99 */326327#endif /* ! FLEXINT_H */328329/* begin standard C++ headers. */330331/* TODO: this is always defined, so inline it */332#define yyconst const333334#if defined(__GNUC__) && __GNUC__ >= 3335#define yynoreturn __attribute__((__noreturn__))336#else337#define yynoreturn338#endif339340/* Returned upon end-of-file. */341#define YY_NULL 0342343/* Promotes a possibly negative, possibly signed char to an344 * integer in range [0..255] for use as an array index.345 */346#define YY_SC_TO_UI(c) ((YY_CHAR) (c))347348/* An opaque pointer. */349#ifndef YY_TYPEDEF_YY_SCANNER_T350#define YY_TYPEDEF_YY_SCANNER_T351typedef void* yyscan_t;352#endif353354/* For convenience, these vars (plus the bison vars far below)355 are macros in the reentrant scanner. */356#define yyin yyg->yyin_r357#define yyout yyg->yyout_r358#define yyextra yyg->yyextra_r359#define yyleng yyg->yyleng_r360#define yytext yyg->yytext_r361#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)362#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)363#define yy_flex_debug yyg->yy_flex_debug_r364365/* Enter a start condition. This macro really ought to take a parameter,366 * but we do it the disgusting crufty way forced on us by the ()-less367 * definition of BEGIN.368 */369#define BEGIN yyg->yy_start = 1 + 2 *370/* Translate the current start state into a value that can be later handed371 * to BEGIN to return to the state. The YYSTATE alias is for lex372 * compatibility.373 */374#define YY_START ((yyg->yy_start - 1) / 2)375#define YYSTATE YY_START376/* Action number for EOF rule of a given start state. */377#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)378/* Special action meaning "start processing a new file". */379#define YY_NEW_FILE yyrestart( yyin , yyscanner )380#define YY_END_OF_BUFFER_CHAR 0381382/* Size of default input buffer. */383#ifndef YY_BUF_SIZE384#ifdef __ia64__385/* On IA-64, the buffer size is 16k, not 8k.386 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.387 * Ditto for the __ia64__ case accordingly.388 */389#define YY_BUF_SIZE 32768390#else391#define YY_BUF_SIZE 16384392#endif /* __ia64__ */393#endif394395/* The state buf must be large enough to hold one state per character in the main buffer.396 */397#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))398399#ifndef YY_TYPEDEF_YY_BUFFER_STATE400#define YY_TYPEDEF_YY_BUFFER_STATE401typedef struct yy_buffer_state *YY_BUFFER_STATE;402#endif403404#ifndef YY_TYPEDEF_YY_SIZE_T405#define YY_TYPEDEF_YY_SIZE_T406typedef size_t yy_size_t;407#endif408409#define EOB_ACT_CONTINUE_SCAN 0410#define EOB_ACT_END_OF_FILE 1411#define EOB_ACT_LAST_MATCH 2412 413 #define YY_LESS_LINENO(n)414 #define YY_LINENO_REWIND_TO(ptr)415 416/* Return all but the first "n" matched characters back to the input stream. */417#define yyless(n) \418 do \419 { \420 /* Undo effects of setting up yytext. */ \421 int yyless_macro_arg = (n); \422 YY_LESS_LINENO(yyless_macro_arg);\423 *yy_cp = yyg->yy_hold_char; \424 YY_RESTORE_YY_MORE_OFFSET \425 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \426 YY_DO_BEFORE_ACTION; /* set up yytext again */ \427 } \428 while ( 0 )429#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )430431#ifndef YY_STRUCT_YY_BUFFER_STATE432#define YY_STRUCT_YY_BUFFER_STATE433struct yy_buffer_state434 {435 FILE *yy_input_file;436437 char *yy_ch_buf; /* input buffer */438 char *yy_buf_pos; /* current position in input buffer */439440 /* Size of input buffer in bytes, not including room for EOB441 * characters.442 */443 int yy_buf_size;444445 /* Number of characters read into yy_ch_buf, not including EOB446 * characters.447 */448 int yy_n_chars;449450 /* Whether we "own" the buffer - i.e., we know we created it,451 * and can realloc() it to grow it, and should free() it to452 * delete it.453 */454 int yy_is_our_buffer;455456 /* Whether this is an "interactive" input source; if so, and457 * if we're using stdio for input, then we want to use getc()458 * instead of fread(), to make sure we stop fetching input after459 * each newline.460 */461 int yy_is_interactive;462463 /* Whether we're considered to be at the beginning of a line.464 * If so, '^' rules will be active on the next match, otherwise465 * not.466 */467 int yy_at_bol;468469 int yy_bs_lineno; /**< The line count. */470 int yy_bs_column; /**< The column count. */471472 /* Whether to try to fill the input buffer when we reach the473 * end of it.474 */475 int yy_fill_buffer;476477 int yy_buffer_status;478479#define YY_BUFFER_NEW 0480#define YY_BUFFER_NORMAL 1481 /* When an EOF's been seen but there's still some text to process482 * then we mark the buffer as YY_EOF_PENDING, to indicate that we483 * shouldn't try reading from the input source any more. We might484 * still have a bunch of tokens to match, though, because of485 * possible backing-up.486 *487 * When we actually see the EOF, we change the status to "new"488 * (via yyrestart()), so that the user can continue scanning by489 * just pointing yyin at a new input file.490 */491#define YY_BUFFER_EOF_PENDING 2492493 };494#endif /* !YY_STRUCT_YY_BUFFER_STATE */495496/* We provide macros for accessing buffer states in case in the497 * future we want to put the buffer states in a more general498 * "scanner state".499 *500 * Returns the top of the stack, or NULL.501 */502#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \503 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \504 : NULL)505/* Same as previous macro, but useful when we know that the buffer stack is not506 * NULL or when we need an lvalue. For internal use only.507 */508#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]509510void yyrestart ( FILE *input_file , yyscan_t yyscanner );511void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );512YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );513void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );514void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );515void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );516void yypop_buffer_state ( yyscan_t yyscanner );517518static void yyensure_buffer_stack ( yyscan_t yyscanner );519static void yy_load_buffer_state ( yyscan_t yyscanner );520static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );521#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)522523YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );524YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );525YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );526527void *yyalloc ( yy_size_t , yyscan_t yyscanner );528void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );529void yyfree ( void * , yyscan_t yyscanner );530531#define yy_new_buffer yy_create_buffer532#define yy_set_interactive(is_interactive) \533 { \534 if ( ! YY_CURRENT_BUFFER ){ \535 yyensure_buffer_stack (yyscanner); \536 YY_CURRENT_BUFFER_LVALUE = \537 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \538 } \539 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \540 }541#define yy_set_bol(at_bol) \542 { \543 if ( ! YY_CURRENT_BUFFER ){\544 yyensure_buffer_stack (yyscanner); \545 YY_CURRENT_BUFFER_LVALUE = \546 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \547 } \548 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \549 }550#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)551552/* Begin user sect3 */553554#define jq_yywrap(yyscanner) (/*CONSTCOND*/1)555#define YY_SKIP_YYWRAP556typedef flex_uint8_t YY_CHAR;557558typedef int yy_state_type;559560#define yytext_ptr yytext_r561562static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );563static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);564static int yy_get_next_buffer ( yyscan_t yyscanner );565static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );566567/* Done after the current pattern has been matched and before the568 * corresponding action - sets up yytext.569 */570#define YY_DO_BEFORE_ACTION \571 yyg->yytext_ptr = yy_bp; \572 yyleng = (int) (yy_cp - yy_bp); \573 yyg->yy_hold_char = *yy_cp; \574 *yy_cp = '\0'; \575 yyg->yy_c_buf_p = yy_cp;576#define YY_NUM_RULES 52577#define YY_END_OF_BUFFER 53578/* This struct is not used in this scanner,579 but its presence is necessary. */580struct yy_trans_info581 {582 flex_int32_t yy_verify;583 flex_int32_t yy_nxt;584 };585static const flex_int16_t yy_accept[168] =586 { 0,587 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,588 0, 0, 0, 0, 53, 51, 50, 50, 51, 41,589 1, 36, 36, 37, 38, 36, 36, 36, 36, 36,590 36, 40, 36, 36, 36, 51, 47, 47, 47, 47,591 47, 47, 47, 47, 47, 47, 47, 47, 47, 36,592 45, 45, 43, 46, 2, 3, 2, 2, 50, 4,593 49, 49, 31, 29, 27, 28, 35, 40, 48, 20,594 30, 40, 40, 0, 33, 5, 34, 39, 47, 0,595 47, 6, 47, 47, 47, 47, 47, 47, 11, 47,596 47, 47, 47, 16, 47, 47, 47, 26, 45, 44,597598 42, 44, 3, 2, 0, 49, 0, 49, 48, 32,599 40, 0, 40, 0, 15, 47, 47, 10, 47, 47,600 17, 47, 47, 47, 47, 47, 47, 47, 21, 0,601 44, 0, 49, 47, 47, 47, 14, 13, 47, 47,602 47, 47, 47, 47, 12, 44, 49, 24, 22, 47,603 47, 47, 23, 47, 47, 44, 49, 47, 7, 47,604 9, 18, 49, 19, 8, 25, 0605 } ;606607static const YY_CHAR yy_ec[256] =608 { 0,609 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,610 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,611 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,612 1, 2, 5, 6, 7, 8, 9, 1, 1, 10,613 11, 12, 13, 14, 15, 16, 17, 18, 18, 18,614 18, 18, 18, 18, 18, 18, 18, 19, 20, 21,615 22, 23, 24, 25, 26, 26, 26, 26, 27, 26,616 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,617 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,618 28, 29, 30, 1, 31, 1, 32, 33, 34, 35,619620 36, 37, 26, 38, 39, 26, 40, 41, 42, 43,621 44, 45, 26, 46, 47, 48, 49, 26, 26, 26,622 50, 26, 51, 52, 53, 1, 1, 1, 1, 1,623 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,624 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,625 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,626 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,627 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,628 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,629 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,630631 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,632 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,633 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,634 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,635 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,636 1, 1, 1, 1, 1637 } ;638639static const YY_CHAR yy_meta[54] =640 { 0,641 1, 1, 1, 1, 1, 2, 1, 1, 1, 1,642 1, 1, 1, 1, 1, 3, 1, 4, 5, 1,643 1, 1, 1, 1, 1, 6, 6, 1, 7, 1,644 8, 6, 6, 6, 6, 6, 6, 6, 6, 6,645 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,646 1, 1, 1647 } ;648649static const flex_int16_t yy_base[183] =650 { 0,651 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,652 51, 52, 56, 58, 338, 339, 61, 64, 315, 339,653 339, 305, 313, 339, 339, 312, 311, 339, 310, 53,654 53, 56, 309, 308, 307, 0, 309, 54, 57, 58,655 59, 63, 65, 70, 67, 72, 69, 60, 79, 305,656 0, 0, 339, 83, 339, 339, 323, 107, 116, 339,657 306, 83, 339, 339, 339, 339, 339, 103, 0, 302,658 339, 104, 108, 128, 339, 339, 339, 0, 304, 301,659 110, 297, 114, 75, 115, 108, 118, 119, 293, 109,660 123, 129, 132, 290, 137, 130, 139, 339, 0, 276,661662 339, 273, 339, 339, 297, 278, 265, 140, 0, 339,663 142, 261, 258, 0, 252, 142, 145, 250, 149, 144,664 247, 151, 152, 154, 156, 157, 158, 165, 245, 172,665 231, 0, 166, 222, 164, 171, 221, 220, 169, 172,666 174, 175, 178, 179, 218, 206, 180, 215, 214, 181,667 183, 192, 213, 184, 186, 201, 193, 198, 210, 206,668 209, 89, 207, 86, 81, 37, 339, 242, 250, 253,669 259, 264, 269, 277, 285, 290, 295, 300, 302, 307,670 311, 315671 } ;672673static const flex_int16_t yy_def[183] =674 { 0,675 167, 1, 1, 1, 1, 1, 1, 1, 1, 1,676 168, 168, 169, 169, 167, 167, 167, 167, 167, 167,677 167, 170, 167, 167, 167, 167, 167, 167, 167, 171,678 167, 167, 167, 167, 167, 172, 173, 173, 173, 173,679 173, 173, 173, 173, 173, 173, 173, 173, 173, 167,680 174, 174, 167, 175, 167, 167, 167, 167, 167, 167,681 176, 176, 167, 167, 167, 167, 167, 167, 177, 167,682 167, 167, 167, 167, 167, 167, 167, 172, 173, 167,683 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,684 173, 173, 173, 173, 173, 173, 173, 167, 174, 167,685686 167, 178, 167, 167, 167, 176, 167, 176, 177, 167,687 167, 167, 167, 179, 173, 173, 173, 173, 173, 173,688 173, 173, 173, 173, 173, 173, 173, 173, 173, 175,689 180, 170, 176, 173, 173, 173, 173, 173, 173, 173,690 173, 173, 173, 173, 173, 181, 176, 173, 173, 173,691 173, 173, 173, 173, 173, 182, 176, 173, 173, 173,692 173, 173, 176, 173, 173, 176, 0, 167, 167, 167,693 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,694 167, 167695 } ;696697static const flex_int16_t yy_nxt[393] =698 { 0,699 16, 17, 18, 17, 19, 20, 21, 22, 23, 24,700 25, 26, 27, 28, 29, 30, 31, 32, 28, 28,701 33, 34, 35, 28, 36, 37, 37, 24, 16, 25,702 37, 38, 39, 40, 41, 42, 43, 37, 44, 37,703 45, 46, 37, 47, 37, 48, 37, 49, 37, 37,704 24, 50, 25, 52, 52, 107, 53, 53, 56, 57,705 56, 57, 59, 59, 59, 59, 59, 59, 67, 70,706 68, 72, 80, 73, 71, 80, 80, 80, 80, 54,707 54, 80, 74, 80, 58, 80, 58, 80, 80, 84,708 80, 74, 101, 80, 85, 95, 81, 80, 92, 80,709710 82, 107, 83, 86, 80, 87, 89, 80, 88, 104,711 105, 90, 91, 108, 94, 93, 96, 59, 59, 59,712 68, 111, 117, 72, 97, 73, 80, 80, 80, 74,713 74, 102, 80, 80, 74, 104, 80, 80, 74, 74,714 112, 80, 112, 74, 115, 113, 119, 80, 80, 116,715 80, 118, 121, 123, 120, 80, 124, 80, 107, 111,716 80, 125, 80, 80, 122, 128, 126, 80, 74, 80,717 80, 127, 80, 135, 80, 80, 80, 74, 136, 138,718 133, 167, 80, 80, 107, 137, 139, 80, 129, 80,719 80, 142, 80, 80, 141, 140, 80, 80, 107, 80,720721 150, 80, 80, 148, 80, 143, 144, 145, 149, 147,722 80, 107, 155, 157, 158, 153, 80, 151, 154, 161,723 102, 162, 152, 163, 80, 107, 160, 80, 80, 130,724 159, 80, 80, 80, 130, 164, 80, 166, 80, 80,725 80, 165, 51, 51, 51, 51, 51, 51, 51, 51,726 55, 55, 55, 55, 55, 55, 55, 55, 61, 130,727 61, 69, 69, 80, 69, 80, 69, 78, 80, 78,728 80, 78, 79, 79, 79, 113, 79, 99, 113, 99,729 99, 99, 99, 132, 99, 100, 100, 100, 100, 100,730 100, 100, 100, 106, 106, 106, 107, 106, 109, 104,731732 109, 130, 109, 131, 130, 131, 131, 134, 80, 134,733 146, 80, 146, 146, 156, 80, 156, 156, 100, 114,734 100, 100, 80, 110, 107, 103, 98, 80, 77, 76,735 75, 66, 65, 64, 63, 62, 60, 167, 15, 167,736 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,737 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,738 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,739 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,740 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,741 167, 167742743 } ;744745static const flex_int16_t yy_chk[393] =746 { 0,747 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,748 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,749 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,750 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,751 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,752 1, 1, 1, 11, 12, 166, 11, 12, 13, 13,753 14, 14, 17, 17, 17, 18, 18, 18, 30, 31,754 30, 32, 38, 32, 31, 39, 40, 41, 48, 11,755 12, 42, 32, 43, 13, 45, 14, 47, 44, 40,756 46, 32, 54, 84, 41, 48, 38, 49, 45, 165,757758 38, 62, 39, 42, 164, 42, 44, 162, 43, 58,759 58, 44, 44, 62, 47, 46, 49, 59, 59, 59,760 68, 72, 84, 73, 49, 73, 86, 90, 81, 68,761 72, 54, 83, 85, 73, 58, 87, 88, 68, 72,762 74, 91, 74, 73, 81, 74, 86, 92, 96, 83,763 93, 85, 87, 90, 86, 95, 91, 97, 108, 111,764 116, 92, 120, 117, 88, 96, 93, 119, 111, 122,765 123, 95, 124, 116, 125, 126, 127, 111, 117, 120,766 108, 130, 135, 128, 133, 119, 122, 139, 97, 136,767 140, 125, 141, 142, 124, 123, 143, 144, 147, 150,768769 139, 151, 154, 135, 155, 126, 127, 128, 136, 133,770 152, 157, 144, 147, 150, 142, 158, 140, 143, 154,771 130, 155, 141, 157, 160, 163, 152, 161, 159, 156,772 151, 153, 149, 148, 146, 158, 145, 163, 138, 137,773 134, 160, 168, 168, 168, 168, 168, 168, 168, 168,774 169, 169, 169, 169, 169, 169, 169, 169, 170, 131,775 170, 171, 171, 129, 171, 121, 171, 172, 118, 172,776 115, 172, 173, 173, 173, 113, 173, 174, 112, 174,777 174, 174, 174, 107, 174, 175, 175, 175, 175, 175,778 175, 175, 175, 176, 176, 176, 106, 176, 177, 105,779780 177, 102, 177, 178, 100, 178, 178, 179, 94, 179,781 180, 89, 180, 180, 181, 82, 181, 181, 182, 80,782 182, 182, 79, 70, 61, 57, 50, 37, 35, 34,783 33, 29, 27, 26, 23, 22, 19, 15, 167, 167,784 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,785 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,786 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,787 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,788 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,789 167, 167790791 } ;792793/* The intent behind this definition is that it'll catch794 * any uses of REJECT which flex missed.795 */796#define REJECT reject_used_but_not_detected797#define yymore() yymore_used_but_not_detected798#define YY_MORE_ADJ 0799#define YY_RESTORE_YY_MORE_OFFSET800#line 1 "src/lexer.l"801#line 2 "src/lexer.l"802#include <assert.h>803#include "jv_alloc.h"804#include "compile.h"805806struct lexer_param;807808#include "parser.h" /* Generated by bison. */809810#define YY_USER_ACTION \811 do { \812 yylloc->start = yyget_extra(yyscanner); \813 yylloc->end = yylloc->start + yyleng; \814 yyset_extra(yylloc->end, yyscanner); \815 } while (0);816817#line 817 "src/lexer.c"818819#line 26 "src/lexer.l"820 static int enter(int opening, int state, yyscan_t yyscanner);821 static int try_exit(int closing, int state, yyscan_t yyscanner);822#line 822 "src/lexer.c"823#define YY_NO_INPUT 1824#line 824 "src/lexer.c"825826#define INITIAL 0827#define IN_PAREN 1828#define IN_BRACKET 2829#define IN_BRACE 3830#define IN_QQINTERP 4831#define IN_QQSTRING 5832#define IN_COMMENT 6833834#ifndef YY_NO_UNISTD_H835/* Special case for "unistd.h", since it is non-ANSI. We include it way836 * down here because we want the user's section 1 to have been scanned first.837 * The user has a chance to override it with an option.838 */839#include <unistd.h>840#endif841842#define YY_EXTRA_TYPE int843844/* Holds the entire state of the reentrant scanner. */845struct yyguts_t846 {847848 /* User-defined. Not touched by flex. */849 YY_EXTRA_TYPE yyextra_r;850851 /* The rest are the same as the globals declared in the non-reentrant scanner. */852 FILE *yyin_r, *yyout_r;853 size_t yy_buffer_stack_top; /**< index of top of stack. */854 size_t yy_buffer_stack_max; /**< capacity of stack. */855 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */856 char yy_hold_char;857 int yy_n_chars;858 int yyleng_r;859 char *yy_c_buf_p;860 int yy_init;861 int yy_start;862 int yy_did_buffer_switch_on_eof;863 int yy_start_stack_ptr;864 int yy_start_stack_depth;865 int *yy_start_stack;866 yy_state_type yy_last_accepting_state;867 char* yy_last_accepting_cpos;868869 int yylineno_r;870 int yy_flex_debug_r;871872 char *yytext_r;873 int yy_more_flag;874 int yy_more_len;875876 YYSTYPE * yylval_r;877878 YYLTYPE * yylloc_r;879880 }; /* end struct yyguts_t */881882static int yy_init_globals ( yyscan_t yyscanner );883884 /* This must go here because YYSTYPE and YYLTYPE are included885 * from bison output in section 1.*/886 # define yylval yyg->yylval_r887 888 # define yylloc yyg->yylloc_r889 890int yylex_init (yyscan_t* scanner);891892int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);893894/* Accessor methods to globals.895 These are made visible to non-reentrant scanners for convenience. */896897int yylex_destroy ( yyscan_t yyscanner );898899int yyget_debug ( yyscan_t yyscanner );900901void yyset_debug ( int debug_flag , yyscan_t yyscanner );902903YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );904905void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );906907FILE *yyget_in ( yyscan_t yyscanner );908909void yyset_in ( FILE * _in_str , yyscan_t yyscanner );910911FILE *yyget_out ( yyscan_t yyscanner );912913void yyset_out ( FILE * _out_str , yyscan_t yyscanner );914915 int yyget_leng ( yyscan_t yyscanner );916917char *yyget_text ( yyscan_t yyscanner );918919int yyget_lineno ( yyscan_t yyscanner );920921void yyset_lineno ( int _line_number , yyscan_t yyscanner );922923int yyget_column ( yyscan_t yyscanner );924925void yyset_column ( int _column_no , yyscan_t yyscanner );926927YYSTYPE * yyget_lval ( yyscan_t yyscanner );928929void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );930931 YYLTYPE *yyget_lloc ( yyscan_t yyscanner );932 933 void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );934 935/* Macros after this point can all be overridden by user definitions in936 * section 1.937 */938939#ifndef YY_SKIP_YYWRAP940#ifdef __cplusplus941extern "C" int yywrap ( yyscan_t yyscanner );942#else943extern int yywrap ( yyscan_t yyscanner );944#endif945#endif946947#ifndef YY_NO_UNPUT948 949#endif950951#ifndef yytext_ptr952static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);953#endif954955#ifdef YY_NEED_STRLEN956static int yy_flex_strlen ( const char * , yyscan_t yyscanner);957#endif958959#ifndef YY_NO_INPUT960#ifdef __cplusplus961static int yyinput ( yyscan_t yyscanner );962#else963static int input ( yyscan_t yyscanner );964#endif965966#endif967968 static void yy_push_state ( int _new_state , yyscan_t yyscanner);969 970 static void yy_pop_state ( yyscan_t yyscanner );971 972 static int yy_top_state ( yyscan_t yyscanner );973 974/* Amount of stuff to slurp up with each read. */975#ifndef YY_READ_BUF_SIZE976#ifdef __ia64__977/* On IA-64, the buffer size is 16k, not 8k */978#define YY_READ_BUF_SIZE 16384979#else980#define YY_READ_BUF_SIZE 8192981#endif /* __ia64__ */982#endif983984/* Copy whatever the last rule matched to the standard output. */985#ifndef ECHO986/* This used to be an fputs(), but since the string might contain NUL's,987 * we now use fwrite().988 */989#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)990#endif991992/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,993 * is returned in "result".994 */995#ifndef YY_INPUT996#define YY_INPUT(buf,result,max_size) \997 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \998 { \999 int c = '*'; \1000 int n; \1001 for ( n = 0; n < max_size && \1002 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \1003 buf[n] = (char) c; \1004 if ( c == '\n' ) \1005 buf[n++] = (char) c; \1006 if ( c == EOF && ferror( yyin ) ) \1007 YY_FATAL_ERROR( "input in flex scanner failed" ); \1008 result = n; \1009 } \1010 else \1011 { \1012 errno=0; \1013 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \1014 { \1015 if( errno != EINTR) \1016 { \1017 YY_FATAL_ERROR( "input in flex scanner failed" ); \1018 break; \1019 } \1020 errno=0; \1021 clearerr(yyin); \1022 } \1023 }\1024\10251026#endif10271028/* No semi-colon after return; correct usage is to write "yyterminate();" -1029 * we don't want an extra ';' after the "return" because that will cause1030 * some compilers to complain about unreachable statements.1031 */1032#ifndef yyterminate1033#define yyterminate() return YY_NULL1034#endif10351036/* Number of entries by which start-condition stack grows. */1037#ifndef YY_START_STACK_INCR1038#define YY_START_STACK_INCR 251039#endif10401041/* Report a fatal error. */1042#ifndef YY_FATAL_ERROR1043#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)1044#endif10451046/* end tables serialization structures and prototypes */10471048/* Default declaration of generated scanner - a define so the user can1049 * easily add parameters.1050 */1051#ifndef YY_DECL1052#define YY_DECL_IS_OURS 110531054extern int yylex \1055 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);10561057#define YY_DECL int yylex \1058 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)1059#endif /* !YY_DECL */10601061/* Code executed at the beginning of each rule, after yytext and yyleng1062 * have been set up.1063 */1064#ifndef YY_USER_ACTION1065#define YY_USER_ACTION1066#endif10671068/* Code executed at the end of each rule. */1069#ifndef YY_BREAK1070#define YY_BREAK /*LINTED*/break;1071#endif10721073#define YY_RULE_SETUP \1074 YY_USER_ACTION10751076/** The main scanner function which does all the work.1077 */1078YY_DECL1079{1080 yy_state_type yy_current_state;1081 char *yy_cp, *yy_bp;1082 int yy_act;1083 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;10841085 yylval = yylval_param;10861087 yylloc = yylloc_param;10881089 if ( !yyg->yy_init )1090 {1091 yyg->yy_init = 1;10921093#ifdef YY_USER_INIT1094 YY_USER_INIT;1095#endif10961097 if ( ! yyg->yy_start )1098 yyg->yy_start = 1; /* first start state */10991100 if ( ! yyin )1101 yyin = stdin;11021103 if ( ! yyout )1104 yyout = stdout;11051106 if ( ! YY_CURRENT_BUFFER ) {1107 yyensure_buffer_stack (yyscanner);1108 YY_CURRENT_BUFFER_LVALUE =1109 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);1110 }11111112 yy_load_buffer_state( yyscanner );1113 }11141115 {1116#line 39 "src/lexer.l"111711181119#line 1119 "src/lexer.c"11201121 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */1122 {1123 yy_cp = yyg->yy_c_buf_p;11241125 /* Support of yytext. */1126 *yy_cp = yyg->yy_hold_char;11271128 /* yy_bp points to the position in yy_ch_buf of the start of1129 * the current run.1130 */1131 yy_bp = yy_cp;11321133 yy_current_state = yyg->yy_start;1134yy_match:1135 do1136 {1137 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;1138 if ( yy_accept[yy_current_state] )1139 {1140 yyg->yy_last_accepting_state = yy_current_state;1141 yyg->yy_last_accepting_cpos = yy_cp;1142 }1143 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )1144 {1145 yy_current_state = (int) yy_def[yy_current_state];1146 if ( yy_current_state >= 168 )1147 yy_c = yy_meta[yy_c];1148 }1149 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];1150 ++yy_cp;1151 }1152 while ( yy_base[yy_current_state] != 339 );11531154yy_find_action:1155 yy_act = yy_accept[yy_current_state];1156 if ( yy_act == 0 )1157 { /* have to back up */1158 yy_cp = yyg->yy_last_accepting_cpos;1159 yy_current_state = yyg->yy_last_accepting_state;1160 yy_act = yy_accept[yy_current_state];1161 }11621163 YY_DO_BEFORE_ACTION;11641165do_action: /* This label is used only to access EOF actions. */11661167 switch ( yy_act )1168 { /* beginning of action switch */1169 case 0: /* must back up */1170 /* undo the effects of YY_DO_BEFORE_ACTION */1171 *yy_cp = yyg->yy_hold_char;1172 yy_cp = yyg->yy_last_accepting_cpos;1173 yy_current_state = yyg->yy_last_accepting_state;1174 goto yy_find_action;11751176case 1:1177YY_RULE_SETUP1178#line 41 "src/lexer.l"1179{ yy_push_state(IN_COMMENT, yyscanner); }1180 YY_BREAK11811182case 2:1183/* rule 2 can match eol */1184YY_RULE_SETUP1185#line 43 "src/lexer.l"1186{ }1187 YY_BREAK1188case 3:1189/* rule 3 can match eol */1190YY_RULE_SETUP1191#line 44 "src/lexer.l"1192{ yy_pop_state(yyscanner); }1193 YY_BREAK11941195case YY_STATE_EOF(IN_COMMENT):1196#line 46 "src/lexer.l"1197{ yy_pop_state(yyscanner); }1198 YY_BREAK1199case 4:1200YY_RULE_SETUP1201#line 48 "src/lexer.l"1202{ return NEQ; }1203 YY_BREAK1204case 5:1205YY_RULE_SETUP1206#line 49 "src/lexer.l"1207{ return EQ; }1208 YY_BREAK1209case 6:1210YY_RULE_SETUP1211#line 50 "src/lexer.l"1212{ return AS; }1213 YY_BREAK1214case 7:1215YY_RULE_SETUP1216#line 51 "src/lexer.l"1217{ return IMPORT; }1218 YY_BREAK1219case 8:1220YY_RULE_SETUP1221#line 52 "src/lexer.l"1222{ return INCLUDE; }1223 YY_BREAK1224case 9:1225YY_RULE_SETUP1226#line 53 "src/lexer.l"1227{ return MODULE; }1228 YY_BREAK1229case 10:1230YY_RULE_SETUP1231#line 54 "src/lexer.l"1232{ return DEF; }1233 YY_BREAK1234case 11:1235YY_RULE_SETUP1236#line 55 "src/lexer.l"1237{ return IF; }1238 YY_BREAK1239case 12:1240YY_RULE_SETUP1241#line 56 "src/lexer.l"1242{ return THEN; }1243 YY_BREAK1244case 13:1245YY_RULE_SETUP1246#line 57 "src/lexer.l"1247{ return ELSE; }1248 YY_BREAK1249case 14:1250YY_RULE_SETUP1251#line 58 "src/lexer.l"1252{ return ELSE_IF; }1253 YY_BREAK1254case 15:1255YY_RULE_SETUP1256#line 59 "src/lexer.l"1257{ return AND; }1258 YY_BREAK1259case 16:1260YY_RULE_SETUP1261#line 60 "src/lexer.l"1262{ return OR; }1263 YY_BREAK1264case 17:1265YY_RULE_SETUP1266#line 61 "src/lexer.l"1267{ return END; }1268 YY_BREAK1269case 18:1270YY_RULE_SETUP1271#line 62 "src/lexer.l"1272{ return REDUCE; }1273 YY_BREAK1274case 19:1275YY_RULE_SETUP1276#line 63 "src/lexer.l"1277{ return FOREACH; }1278 YY_BREAK1279case 20:1280YY_RULE_SETUP1281#line 64 "src/lexer.l"1282{ return DEFINEDOR; }1283 YY_BREAK1284case 21:1285YY_RULE_SETUP1286#line 65 "src/lexer.l"1287{ return TRY; }1288 YY_BREAK1289case 22:1290YY_RULE_SETUP1291#line 66 "src/lexer.l"1292{ return CATCH; }1293 YY_BREAK1294case 23:1295YY_RULE_SETUP1296#line 67 "src/lexer.l"1297{ return LABEL; }1298 YY_BREAK1299case 24:1300YY_RULE_SETUP1301#line 68 "src/lexer.l"1302{ return BREAK; }1303 YY_BREAK1304case 25:1305YY_RULE_SETUP1306#line 69 "src/lexer.l"1307{ return LOC; }1308 YY_BREAK1309case 26:1310YY_RULE_SETUP1311#line 70 "src/lexer.l"1312{ return SETPIPE; }1313 YY_BREAK1314case 27:1315YY_RULE_SETUP1316#line 71 "src/lexer.l"1317{ return SETPLUS; }1318 YY_BREAK1319case 28:1320YY_RULE_SETUP1321#line 72 "src/lexer.l"1322{ return SETMINUS; }1323 YY_BREAK1324case 29:1325YY_RULE_SETUP1326#line 73 "src/lexer.l"1327{ return SETMULT; }1328 YY_BREAK1329case 30:1330YY_RULE_SETUP1331#line 74 "src/lexer.l"1332{ return SETDIV; }1333 YY_BREAK1334case 31:1335YY_RULE_SETUP1336#line 75 "src/lexer.l"1337{ return SETMOD; }1338 YY_BREAK1339case 32:1340YY_RULE_SETUP1341#line 76 "src/lexer.l"1342{ return SETDEFINEDOR; }1343 YY_BREAK1344case 33:1345YY_RULE_SETUP1346#line 77 "src/lexer.l"1347{ return LESSEQ; }1348 YY_BREAK1349case 34:1350YY_RULE_SETUP1351#line 78 "src/lexer.l"1352{ return GREATEREQ; }1353 YY_BREAK1354case 35:1355YY_RULE_SETUP1356#line 79 "src/lexer.l"1357{ return REC; }1358 YY_BREAK1359case 36:1360YY_RULE_SETUP1361#line 80 "src/lexer.l"1362{ return yytext[0];}1363 YY_BREAK1364case 37:1365YY_RULE_SETUP1366#line 82 "src/lexer.l"1367{1368 return enter(yytext[0], YY_START, yyscanner);1369}1370 YY_BREAK1371case 38:1372YY_RULE_SETUP1373#line 86 "src/lexer.l"1374{1375 return try_exit(yytext[0], YY_START, yyscanner);1376}1377 YY_BREAK1378case 39:1379YY_RULE_SETUP1380#line 90 "src/lexer.l"1381{1382 yylval->literal = jv_string_sized(yytext + 1, yyleng - 1); return FORMAT;1383}1384 YY_BREAK1385case 40:1386YY_RULE_SETUP1387#line 94 "src/lexer.l"1388{1389 yylval->literal = jv_parse_sized(yytext, yyleng); return LITERAL;1390}1391 YY_BREAK1392case 41:1393YY_RULE_SETUP1394#line 98 "src/lexer.l"1395{1396 yy_push_state(IN_QQSTRING, yyscanner);1397 return QQSTRING_START;1398}1399 YY_BREAK14001401case 42:1402YY_RULE_SETUP1403#line 104 "src/lexer.l"1404{1405 return enter(QQSTRING_INTERP_START, YY_START, yyscanner);1406 }1407 YY_BREAK1408case 43:1409YY_RULE_SETUP1410#line 107 "src/lexer.l"1411{1412 yy_pop_state(yyscanner);1413 return QQSTRING_END;1414 }1415 YY_BREAK1416case 44:1417/* rule 44 can match eol */1418YY_RULE_SETUP1419#line 111 "src/lexer.l"1420{1421 /* pass escapes to the json parser */1422 jv escapes = jv_string_fmt("\"%.*s\"", (int)yyleng, yytext);1423 yylval->literal = jv_parse_sized(jv_string_value(escapes), jv_string_length_bytes(jv_copy(escapes)));1424 jv_free(escapes);1425 return QQSTRING_TEXT;1426 }1427 YY_BREAK1428case 45:1429/* rule 45 can match eol */1430YY_RULE_SETUP1431#line 118 "src/lexer.l"1432{1433 yylval->literal = jv_string_sized(yytext, yyleng);1434 return QQSTRING_TEXT;1435 }1436 YY_BREAK1437case 46:1438YY_RULE_SETUP1439#line 122 "src/lexer.l"1440{1441 return INVALID_CHARACTER;1442 }1443 YY_BREAK14441445case 47:1446YY_RULE_SETUP1447#line 128 "src/lexer.l"1448{ yylval->literal = jv_string(yytext); return IDENT;}1449 YY_BREAK1450case 48:1451YY_RULE_SETUP1452#line 129 "src/lexer.l"1453{ yylval->literal = jv_string(yytext+1); return FIELD;}1454 YY_BREAK1455case 49:1456YY_RULE_SETUP1457#line 130 "src/lexer.l"1458{ yylval->literal = jv_string(yytext+1); return BINDING;}1459 YY_BREAK1460case 50:1461/* rule 50 can match eol */1462YY_RULE_SETUP1463#line 132 "src/lexer.l"1464{}1465 YY_BREAK1466case 51:1467YY_RULE_SETUP1468#line 134 "src/lexer.l"1469{ return INVALID_CHARACTER; }1470 YY_BREAK1471case 52:1472YY_RULE_SETUP1473#line 136 "src/lexer.l"1474YY_FATAL_ERROR( "flex scanner jammed" );1475 YY_BREAK1476#line 1476 "src/lexer.c"1477case YY_STATE_EOF(INITIAL):1478case YY_STATE_EOF(IN_PAREN):1479case YY_STATE_EOF(IN_BRACKET):1480case YY_STATE_EOF(IN_BRACE):1481case YY_STATE_EOF(IN_QQINTERP):1482case YY_STATE_EOF(IN_QQSTRING):1483 yyterminate();14841485 case YY_END_OF_BUFFER:1486 {1487 /* Amount of text matched not including the EOB char. */1488 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;14891490 /* Undo the effects of YY_DO_BEFORE_ACTION. */1491 *yy_cp = yyg->yy_hold_char;1492 YY_RESTORE_YY_MORE_OFFSET14931494 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )1495 {1496 /* We're scanning a new file or input source. It's1497 * possible that this happened because the user1498 * just pointed yyin at a new source and called1499 * yylex(). If so, then we have to assure1500 * consistency between YY_CURRENT_BUFFER and our1501 * globals. Here is the right place to do so, because1502 * this is the first action (other than possibly a1503 * back-up) that will match for the new input source.1504 */1505 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;1506 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;1507 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;1508 }15091510 /* Note that here we test for yy_c_buf_p "<=" to the position1511 * of the first EOB in the buffer, since yy_c_buf_p will1512 * already have been incremented past the NUL character1513 * (since all states make transitions on EOB to the1514 * end-of-buffer state). Contrast this with the test1515 * in input().1516 */1517 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )1518 { /* This was really a NUL. */1519 yy_state_type yy_next_state;15201521 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;15221523 yy_current_state = yy_get_previous_state( yyscanner );15241525 /* Okay, we're now positioned to make the NUL1526 * transition. We couldn't have1527 * yy_get_previous_state() go ahead and do it1528 * for us because it doesn't know how to deal1529 * with the possibility of jamming (and we don't1530 * want to build jamming into it because then it1531 * will run more slowly).1532 */15331534 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);15351536 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;15371538 if ( yy_next_state )1539 {1540 /* Consume the NUL. */1541 yy_cp = ++yyg->yy_c_buf_p;1542 yy_current_state = yy_next_state;1543 goto yy_match;1544 }15451546 else1547 {1548 yy_cp = yyg->yy_c_buf_p;1549 goto yy_find_action;1550 }1551 }15521553 else switch ( yy_get_next_buffer( yyscanner ) )1554 {1555 case EOB_ACT_END_OF_FILE:1556 {1557 yyg->yy_did_buffer_switch_on_eof = 0;15581559 if ( yywrap( yyscanner ) )1560 {1561 /* Note: because we've taken care in1562 * yy_get_next_buffer() to have set up1563 * yytext, we can now set up1564 * yy_c_buf_p so that if some total1565 * hoser (like flex itself) wants to1566 * call the scanner after we return the1567 * YY_NULL, it'll still work - another1568 * YY_NULL will get returned.1569 */1570 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;15711572 yy_act = YY_STATE_EOF(YY_START);1573 goto do_action;1574 }15751576 else1577 {1578 if ( ! yyg->yy_did_buffer_switch_on_eof )1579 YY_NEW_FILE;1580 }1581 break;1582 }15831584 case EOB_ACT_CONTINUE_SCAN:1585 yyg->yy_c_buf_p =1586 yyg->yytext_ptr + yy_amount_of_matched_text;15871588 yy_current_state = yy_get_previous_state( yyscanner );15891590 yy_cp = yyg->yy_c_buf_p;1591 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;1592 goto yy_match;15931594 case EOB_ACT_LAST_MATCH:1595 yyg->yy_c_buf_p =1596 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];15971598 yy_current_state = yy_get_previous_state( yyscanner );15991600 yy_cp = yyg->yy_c_buf_p;1601 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;1602 goto yy_find_action;1603 }1604 break;1605 }16061607 default:1608 YY_FATAL_ERROR(1609 "fatal flex scanner internal error--no action found" );1610 } /* end of action switch */1611 } /* end of scanning one token */1612 } /* end of user's declarations */1613} /* end of yylex */16141615/* yy_get_next_buffer - try to read in a new buffer1616 *1617 * Returns a code representing an action:1618 * EOB_ACT_LAST_MATCH -1619 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position1620 * EOB_ACT_END_OF_FILE - end of file1621 */1622static int yy_get_next_buffer (yyscan_t yyscanner)1623{1624 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;1625 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;1626 char *source = yyg->yytext_ptr;1627 int number_to_move, i;1628 int ret_val;16291630 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )1631 YY_FATAL_ERROR(1632 "fatal flex scanner internal error--end of buffer missed" );16331634 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )1635 { /* Don't try to fill the buffer, so this is an EOF. */1636 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )1637 {1638 /* We matched a single character, the EOB, so1639 * treat this as a final EOF.1640 */1641 return EOB_ACT_END_OF_FILE;1642 }16431644 else1645 {1646 /* We matched some text prior to the EOB, first1647 * process it.1648 */1649 return EOB_ACT_LAST_MATCH;1650 }1651 }16521653 /* Try to read more data. */16541655 /* First move last chars to start of buffer. */1656 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);16571658 for ( i = 0; i < number_to_move; ++i )1659 *(dest++) = *(source++);16601661 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )1662 /* don't do the read, it's not guaranteed to return an EOF,1663 * just force an EOF1664 */1665 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;16661667 else1668 {1669 int num_to_read =1670 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;16711672 while ( num_to_read <= 0 )1673 { /* Not enough room in the buffer - grow it. */16741675 /* just a shorter name for the current buffer */1676 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;16771678 int yy_c_buf_p_offset =1679 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);16801681 if ( b->yy_is_our_buffer )1682 {1683 int new_size = b->yy_buf_size * 2;16841685 if ( new_size <= 0 )1686 b->yy_buf_size += b->yy_buf_size / 8;1687 else1688 b->yy_buf_size *= 2;16891690 b->yy_ch_buf = (char *)1691 /* Include room in for 2 EOB chars. */1692 yyrealloc( (void *) b->yy_ch_buf,1693 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );1694 }1695 else1696 /* Can't grow it, we don't own it. */1697 b->yy_ch_buf = NULL;16981699 if ( ! b->yy_ch_buf )1700 YY_FATAL_ERROR(1701 "fatal error - scanner input buffer overflow" );17021703 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];17041705 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -1706 number_to_move - 1;17071708 }17091710 if ( num_to_read > YY_READ_BUF_SIZE )1711 num_to_read = YY_READ_BUF_SIZE;17121713 /* Read in more data. */1714 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),1715 yyg->yy_n_chars, num_to_read );17161717 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;1718 }17191720 if ( yyg->yy_n_chars == 0 )1721 {1722 if ( number_to_move == YY_MORE_ADJ )1723 {1724 ret_val = EOB_ACT_END_OF_FILE;1725 yyrestart( yyin , yyscanner);1726 }17271728 else1729 {1730 ret_val = EOB_ACT_LAST_MATCH;1731 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =1732 YY_BUFFER_EOF_PENDING;1733 }1734 }17351736 else1737 ret_val = EOB_ACT_CONTINUE_SCAN;17381739 if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {1740 /* Extend the array by 50%, plus the number we really need. */1741 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);1742 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(1743 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );1744 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )1745 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );1746 /* "- 2" to take care of EOB's */1747 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);1748 }17491750 yyg->yy_n_chars += number_to_move;1751 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;1752 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;17531754 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];17551756 return ret_val;1757}17581759/* yy_get_previous_state - get the state just before the EOB char was reached */17601761 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)1762{1763 yy_state_type yy_current_state;1764 char *yy_cp;1765 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;17661767 yy_current_state = yyg->yy_start;17681769 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )1770 {1771 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);1772 if ( yy_accept[yy_current_state] )1773 {1774 yyg->yy_last_accepting_state = yy_current_state;1775 yyg->yy_last_accepting_cpos = yy_cp;1776 }1777 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )1778 {1779 yy_current_state = (int) yy_def[yy_current_state];1780 if ( yy_current_state >= 168 )1781 yy_c = yy_meta[yy_c];1782 }1783 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];1784 }17851786 return yy_current_state;1787}17881789/* yy_try_NUL_trans - try to make a transition on the NUL character1790 *1791 * synopsis1792 * next_state = yy_try_NUL_trans( current_state );1793 */1794 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)1795{1796 int yy_is_jam;1797 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */1798 char *yy_cp = yyg->yy_c_buf_p;17991800 YY_CHAR yy_c = 1;1801 if ( yy_accept[yy_current_state] )1802 {1803 yyg->yy_last_accepting_state = yy_current_state;1804 yyg->yy_last_accepting_cpos = yy_cp;1805 }1806 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )1807 {1808 yy_current_state = (int) yy_def[yy_current_state];1809 if ( yy_current_state >= 168 )1810 yy_c = yy_meta[yy_c];1811 }1812 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];1813 yy_is_jam = (yy_current_state == 167);18141815 (void)yyg;1816 return yy_is_jam ? 0 : yy_current_state;1817}18181819#ifndef YY_NO_UNPUT18201821#endif18221823#ifndef YY_NO_INPUT1824#ifdef __cplusplus1825 static int yyinput (yyscan_t yyscanner)1826#else1827 static int input (yyscan_t yyscanner)1828#endif18291830{1831 int c;1832 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;18331834 *yyg->yy_c_buf_p = yyg->yy_hold_char;18351836 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )1837 {1838 /* yy_c_buf_p now points to the character we want to return.1839 * If this occurs *before* the EOB characters, then it's a1840 * valid NUL; if not, then we've hit the end of the buffer.1841 */1842 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )1843 /* This was really a NUL. */1844 *yyg->yy_c_buf_p = '\0';18451846 else1847 { /* need more input */1848 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);1849 ++yyg->yy_c_buf_p;18501851 switch ( yy_get_next_buffer( yyscanner ) )1852 {1853 case EOB_ACT_LAST_MATCH:1854 /* This happens because yy_g_n_b()1855 * sees that we've accumulated a1856 * token and flags that we need to1857 * try matching the token before1858 * proceeding. But for input(),1859 * there's no matching to consider.1860 * So convert the EOB_ACT_LAST_MATCH1861 * to EOB_ACT_END_OF_FILE.1862 */18631864 /* Reset buffer status. */1865 yyrestart( yyin , yyscanner);18661867 /*FALLTHROUGH*/18681869 case EOB_ACT_END_OF_FILE:1870 {1871 if ( yywrap( yyscanner ) )1872 return 0;18731874 if ( ! yyg->yy_did_buffer_switch_on_eof )1875 YY_NEW_FILE;1876#ifdef __cplusplus1877 return yyinput(yyscanner);1878#else1879 return input(yyscanner);1880#endif1881 }18821883 case EOB_ACT_CONTINUE_SCAN:1884 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;1885 break;1886 }1887 }1888 }18891890 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */1891 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */1892 yyg->yy_hold_char = *++yyg->yy_c_buf_p;18931894 return c;1895}1896#endif /* ifndef YY_NO_INPUT */18971898/** Immediately switch to a different input stream.1899 * @param input_file A readable stream.1900 * @param yyscanner The scanner object.1901 * @note This function does not reset the start condition to @c INITIAL .1902 */1903 void yyrestart (FILE * input_file , yyscan_t yyscanner)1904{1905 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;19061907 if ( ! YY_CURRENT_BUFFER ){1908 yyensure_buffer_stack (yyscanner);1909 YY_CURRENT_BUFFER_LVALUE =1910 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);1911 }19121913 yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);1914 yy_load_buffer_state( yyscanner );1915}19161917/** Switch to a different input buffer.1918 * @param new_buffer The new input buffer.1919 * @param yyscanner The scanner object.1920 */1921 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)1922{1923 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;19241925 /* TODO. We should be able to replace this entire function body1926 * with1927 * yypop_buffer_state();1928 * yypush_buffer_state(new_buffer);1929 */1930 yyensure_buffer_stack (yyscanner);1931 if ( YY_CURRENT_BUFFER == new_buffer )1932 return;19331934 if ( YY_CURRENT_BUFFER )1935 {1936 /* Flush out information for old buffer. */1937 *yyg->yy_c_buf_p = yyg->yy_hold_char;1938 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;1939 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;1940 }19411942 YY_CURRENT_BUFFER_LVALUE = new_buffer;1943 yy_load_buffer_state( yyscanner );19441945 /* We don't actually know whether we did this switch during1946 * EOF (yywrap()) processing, but the only time this flag1947 * is looked at is after yywrap() is called, so it's safe1948 * to go ahead and always set it.1949 */1950 yyg->yy_did_buffer_switch_on_eof = 1;1951}19521953static void yy_load_buffer_state (yyscan_t yyscanner)1954{1955 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;1956 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;1957 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;1958 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;1959 yyg->yy_hold_char = *yyg->yy_c_buf_p;1960}19611962/** Allocate and initialize an input buffer state.1963 * @param file A readable stream.1964 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.1965 * @param yyscanner The scanner object.1966 * @return the allocated buffer state.1967 */1968 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)1969{1970 YY_BUFFER_STATE b;1971 1972 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );1973 if ( ! b )1974 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );19751976 b->yy_buf_size = size;19771978 /* yy_ch_buf has to be 2 characters longer than the size given because1979 * we need to put in 2 end-of-buffer characters.1980 */1981 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );1982 if ( ! b->yy_ch_buf )1983 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );19841985 b->yy_is_our_buffer = 1;19861987 yy_init_buffer( b, file , yyscanner);19881989 return b;1990}19911992/** Destroy the buffer.1993 * @param b a buffer created with yy_create_buffer()1994 * @param yyscanner The scanner object.1995 */1996 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)1997{1998 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;19992000 if ( ! b )The first 2,000 of 2,705 lines.