@port-labs/jq-node-bindings 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/.editorconfig +5 -0
  2. package/.jshintignore +1 -0
  3. package/.jshintrc +23 -0
  4. package/binding.gyp +56 -0
  5. package/configure +26 -0
  6. package/deps/jq/.gitattributes +2 -0
  7. package/deps/jq/.travis.yml +53 -0
  8. package/deps/jq/AUTHORS +73 -0
  9. package/deps/jq/COPYING +70 -0
  10. package/deps/jq/ChangeLog +1349 -0
  11. package/deps/jq/Makefile.am +198 -0
  12. package/deps/jq/NEWS +88 -0
  13. package/deps/jq/README.md +64 -0
  14. package/deps/jq/builtin.c +1684 -0
  15. package/deps/jq/builtin.h +10 -0
  16. package/deps/jq/bytecode.c +161 -0
  17. package/deps/jq/bytecode.h +92 -0
  18. package/deps/jq/compile-ios.sh +102 -0
  19. package/deps/jq/compile.c +1210 -0
  20. package/deps/jq/compile.h +101 -0
  21. package/deps/jq/config/m4/check-math-func.m4 +4 -0
  22. package/deps/jq/config/m4/find-func-no-libs.m4 +8 -0
  23. package/deps/jq/config/m4/find-func-no-libs2.m4 +62 -0
  24. package/deps/jq/config/m4/find-func.m4 +9 -0
  25. package/deps/jq/config/m4/misc.m4 +3 -0
  26. package/deps/jq/configure.ac +221 -0
  27. package/deps/jq/docs/Gemfile +7 -0
  28. package/deps/jq/docs/Gemfile.lock +63 -0
  29. package/deps/jq/docs/README.md +25 -0
  30. package/deps/jq/docs/Rakefile +145 -0
  31. package/deps/jq/docs/content/1.tutorial/default.yml +327 -0
  32. package/deps/jq/docs/content/2.download/default.yml +117 -0
  33. package/deps/jq/docs/content/3.manual/manual.yml +2878 -0
  34. package/deps/jq/docs/content/3.manual/v1.3/manual.yml +1270 -0
  35. package/deps/jq/docs/content/3.manual/v1.4/manual.yml +1672 -0
  36. package/deps/jq/docs/content/index/index.yml +51 -0
  37. package/deps/jq/docs/default_manpage.md +22 -0
  38. package/deps/jq/docs/public/.htaccess +28 -0
  39. package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.css +1058 -0
  40. package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.min.css +9 -0
  41. package/deps/jq/docs/public/bootstrap/css/bootstrap.css +5224 -0
  42. package/deps/jq/docs/public/bootstrap/css/bootstrap.min.css +9 -0
  43. package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings-white.png +0 -0
  44. package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings.png +0 -0
  45. package/deps/jq/docs/public/bootstrap/js/bootstrap.js +2027 -0
  46. package/deps/jq/docs/public/bootstrap/js/bootstrap.min.js +6 -0
  47. package/deps/jq/docs/public/css/base.scss +99 -0
  48. package/deps/jq/docs/public/jq.png +0 -0
  49. package/deps/jq/docs/public/robots.txt +2 -0
  50. package/deps/jq/docs/site.yml +18 -0
  51. package/deps/jq/docs/templates/default.liquid +34 -0
  52. package/deps/jq/docs/templates/index.liquid +60 -0
  53. package/deps/jq/docs/templates/manual.liquid +122 -0
  54. package/deps/jq/docs/templates/shared/_footer.liquid +5 -0
  55. package/deps/jq/docs/templates/shared/_head.liquid +12 -0
  56. package/deps/jq/docs/templates/shared/_header.liquid +26 -0
  57. package/deps/jq/exec_stack.h +112 -0
  58. package/deps/jq/execute.c +1155 -0
  59. package/deps/jq/inject_errors.c +112 -0
  60. package/deps/jq/jq.1.default +39 -0
  61. package/deps/jq/jq.1.prebuilt +3075 -0
  62. package/deps/jq/jq.h +60 -0
  63. package/deps/jq/jq.spec +70 -0
  64. package/deps/jq/jq_parser.h +9 -0
  65. package/deps/jq/jq_test.c +346 -0
  66. package/deps/jq/jv.c +1333 -0
  67. package/deps/jq/jv.h +240 -0
  68. package/deps/jq/jv_alloc.c +179 -0
  69. package/deps/jq/jv_alloc.h +27 -0
  70. package/deps/jq/jv_aux.c +619 -0
  71. package/deps/jq/jv_dtoa.c +4275 -0
  72. package/deps/jq/jv_dtoa.h +22 -0
  73. package/deps/jq/jv_file.c +49 -0
  74. package/deps/jq/jv_parse.c +852 -0
  75. package/deps/jq/jv_print.c +348 -0
  76. package/deps/jq/jv_unicode.c +96 -0
  77. package/deps/jq/jv_unicode.h +11 -0
  78. package/deps/jq/jv_utf8_tables.h +37 -0
  79. package/deps/jq/lexer.c +2442 -0
  80. package/deps/jq/lexer.h +362 -0
  81. package/deps/jq/lexer.l +184 -0
  82. package/deps/jq/libm.h +160 -0
  83. package/deps/jq/linker.c +393 -0
  84. package/deps/jq/linker.h +7 -0
  85. package/deps/jq/locfile.c +91 -0
  86. package/deps/jq/locfile.h +29 -0
  87. package/deps/jq/m4/ax_compare_version.m4 +177 -0
  88. package/deps/jq/m4/ax_prog_bison_version.m4 +68 -0
  89. package/deps/jq/main.c +566 -0
  90. package/deps/jq/opcode_list.h +44 -0
  91. package/deps/jq/parser.c +3914 -0
  92. package/deps/jq/parser.h +193 -0
  93. package/deps/jq/parser.y +923 -0
  94. package/deps/jq/scripts/crosscompile +42 -0
  95. package/deps/jq/scripts/gen_utf8_tables.py +32 -0
  96. package/deps/jq/scripts/version +5 -0
  97. package/deps/jq/setup.sh +33 -0
  98. package/deps/jq/tests/jq.test +1235 -0
  99. package/deps/jq/tests/jqtest +5 -0
  100. package/deps/jq/tests/mantest +7 -0
  101. package/deps/jq/tests/modules/.jq +5 -0
  102. package/deps/jq/tests/modules/a.jq +2 -0
  103. package/deps/jq/tests/modules/b/b.jq +2 -0
  104. package/deps/jq/tests/modules/c/c.jq +16 -0
  105. package/deps/jq/tests/modules/c/d.jq +1 -0
  106. package/deps/jq/tests/modules/data.json +4 -0
  107. package/deps/jq/tests/modules/lib/jq/e/e.jq +1 -0
  108. package/deps/jq/tests/modules/lib/jq/f.jq +1 -0
  109. package/deps/jq/tests/modules/syntaxerror/syntaxerror.jq +1 -0
  110. package/deps/jq/tests/modules/test_bind_order.jq +4 -0
  111. package/deps/jq/tests/modules/test_bind_order0.jq +1 -0
  112. package/deps/jq/tests/modules/test_bind_order1.jq +2 -0
  113. package/deps/jq/tests/modules/test_bind_order2.jq +2 -0
  114. package/deps/jq/tests/onig.supp +21 -0
  115. package/deps/jq/tests/onig.test +85 -0
  116. package/deps/jq/tests/onigtest +5 -0
  117. package/deps/jq/tests/setup +36 -0
  118. package/deps/jq/tests/shtest +205 -0
  119. package/deps/jq/tests/torture/input0.json +7 -0
  120. package/deps/jq/util.c +462 -0
  121. package/deps/jq/util.h +64 -0
  122. package/deps/jq.gyp +35 -0
  123. package/index.d.ts +3 -0
  124. package/jest.config.js +10 -0
  125. package/lib/index.js +14 -0
  126. package/package.json +48 -0
  127. package/reports/jest-port-api.xml +35 -0
  128. package/src/binding.cc +177 -0
  129. package/src/binding.h +13 -0
  130. package/test/santiy.test.js +122 -0
  131. package/util/configure.js +27 -0
@@ -0,0 +1,2442 @@
1
+ #line 2 "lexer.c"
2
+
3
+ #line 4 "lexer.c"
4
+
5
+ #define YY_INT_ALIGNED short int
6
+
7
+ /* A lexical scanner generated by flex */
8
+
9
+ #define FLEX_SCANNER
10
+ #define YY_FLEX_MAJOR_VERSION 2
11
+ #define YY_FLEX_MINOR_VERSION 5
12
+ #define YY_FLEX_SUBMINOR_VERSION 35
13
+ #if YY_FLEX_SUBMINOR_VERSION > 0
14
+ #define FLEX_BETA
15
+ #endif
16
+
17
+ /* First, we deal with platform-specific or compiler-specific issues. */
18
+
19
+ /* begin standard C headers. */
20
+ #include <stdio.h>
21
+ #include <string.h>
22
+ #include <errno.h>
23
+ #include <stdlib.h>
24
+
25
+ /* end standard C headers. */
26
+
27
+ /* flex integer type definitions */
28
+
29
+ #ifndef FLEXINT_H
30
+ #define FLEXINT_H
31
+
32
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
+
34
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
+
36
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37
+ * if you want the limit (max/min) macros for int types.
38
+ */
39
+ #ifndef __STDC_LIMIT_MACROS
40
+ #define __STDC_LIMIT_MACROS 1
41
+ #endif
42
+
43
+ #include <inttypes.h>
44
+ typedef int8_t flex_int8_t;
45
+ typedef uint8_t flex_uint8_t;
46
+ typedef int16_t flex_int16_t;
47
+ typedef uint16_t flex_uint16_t;
48
+ typedef int32_t flex_int32_t;
49
+ typedef uint32_t flex_uint32_t;
50
+ #else
51
+ typedef signed char flex_int8_t;
52
+ typedef short int flex_int16_t;
53
+ typedef int flex_int32_t;
54
+ typedef unsigned char flex_uint8_t;
55
+ typedef unsigned short int flex_uint16_t;
56
+ typedef unsigned int flex_uint32_t;
57
+
58
+ /* Limits of integral types. */
59
+ #ifndef INT8_MIN
60
+ #define INT8_MIN (-128)
61
+ #endif
62
+ #ifndef INT16_MIN
63
+ #define INT16_MIN (-32767-1)
64
+ #endif
65
+ #ifndef INT32_MIN
66
+ #define INT32_MIN (-2147483647-1)
67
+ #endif
68
+ #ifndef INT8_MAX
69
+ #define INT8_MAX (127)
70
+ #endif
71
+ #ifndef INT16_MAX
72
+ #define INT16_MAX (32767)
73
+ #endif
74
+ #ifndef INT32_MAX
75
+ #define INT32_MAX (2147483647)
76
+ #endif
77
+ #ifndef UINT8_MAX
78
+ #define UINT8_MAX (255U)
79
+ #endif
80
+ #ifndef UINT16_MAX
81
+ #define UINT16_MAX (65535U)
82
+ #endif
83
+ #ifndef UINT32_MAX
84
+ #define UINT32_MAX (4294967295U)
85
+ #endif
86
+
87
+ #endif /* ! C99 */
88
+
89
+ #endif /* ! FLEXINT_H */
90
+
91
+ #ifdef __cplusplus
92
+
93
+ /* The "const" storage-class-modifier is valid. */
94
+ #define YY_USE_CONST
95
+
96
+ #else /* ! __cplusplus */
97
+
98
+ /* C99 requires __STDC__ to be defined as 1. */
99
+ #if defined (__STDC__)
100
+
101
+ #define YY_USE_CONST
102
+
103
+ #endif /* defined (__STDC__) */
104
+ #endif /* ! __cplusplus */
105
+
106
+ #ifdef YY_USE_CONST
107
+ #define yyconst const
108
+ #else
109
+ #define yyconst
110
+ #endif
111
+
112
+ /* Returned upon end-of-file. */
113
+ #define YY_NULL 0
114
+
115
+ /* Promotes a possibly negative, possibly signed char to an unsigned
116
+ * integer for use as an array index. If the signed char is negative,
117
+ * we want to instead treat it as an 8-bit unsigned char, hence the
118
+ * double cast.
119
+ */
120
+ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121
+
122
+ /* An opaque pointer. */
123
+ #ifndef YY_TYPEDEF_YY_SCANNER_T
124
+ #define YY_TYPEDEF_YY_SCANNER_T
125
+ typedef void* yyscan_t;
126
+ #endif
127
+
128
+ /* For convenience, these vars (plus the bison vars far below)
129
+ are macros in the reentrant scanner. */
130
+ #define yyin yyg->yyin_r
131
+ #define yyout yyg->yyout_r
132
+ #define yyextra yyg->yyextra_r
133
+ #define yyleng yyg->yyleng_r
134
+ #define yytext yyg->yytext_r
135
+ #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
136
+ #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
137
+ #define yy_flex_debug yyg->yy_flex_debug_r
138
+
139
+ /* Enter a start condition. This macro really ought to take a parameter,
140
+ * but we do it the disgusting crufty way forced on us by the ()-less
141
+ * definition of BEGIN.
142
+ */
143
+ #define BEGIN yyg->yy_start = 1 + 2 *
144
+
145
+ /* Translate the current start state into a value that can be later handed
146
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
147
+ * compatibility.
148
+ */
149
+ #define YY_START ((yyg->yy_start - 1) / 2)
150
+ #define YYSTATE YY_START
151
+
152
+ /* Action number for EOF rule of a given start state. */
153
+ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154
+
155
+ /* Special action meaning "start processing a new file". */
156
+ #define YY_NEW_FILE jq_yyrestart(yyin ,yyscanner )
157
+
158
+ #define YY_END_OF_BUFFER_CHAR 0
159
+
160
+ /* Size of default input buffer. */
161
+ #ifndef YY_BUF_SIZE
162
+ #ifdef __ia64__
163
+ /* On IA-64, the buffer size is 16k, not 8k.
164
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
165
+ * Ditto for the __ia64__ case accordingly.
166
+ */
167
+ #define YY_BUF_SIZE 32768
168
+ #else
169
+ #define YY_BUF_SIZE 16384
170
+ #endif /* __ia64__ */
171
+ #endif
172
+
173
+ /* The state buf must be large enough to hold one state per character in the main buffer.
174
+ */
175
+ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
176
+
177
+ #ifndef YY_TYPEDEF_YY_BUFFER_STATE
178
+ #define YY_TYPEDEF_YY_BUFFER_STATE
179
+ typedef struct yy_buffer_state *YY_BUFFER_STATE;
180
+ #endif
181
+
182
+ #define EOB_ACT_CONTINUE_SCAN 0
183
+ #define EOB_ACT_END_OF_FILE 1
184
+ #define EOB_ACT_LAST_MATCH 2
185
+
186
+ #define YY_LESS_LINENO(n)
187
+
188
+ /* Return all but the first "n" matched characters back to the input stream. */
189
+ #define yyless(n) \
190
+ do \
191
+ { \
192
+ /* Undo effects of setting up yytext. */ \
193
+ int yyless_macro_arg = (n); \
194
+ YY_LESS_LINENO(yyless_macro_arg);\
195
+ *yy_cp = yyg->yy_hold_char; \
196
+ YY_RESTORE_YY_MORE_OFFSET \
197
+ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
199
+ } \
200
+ while ( 0 )
201
+
202
+ #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
203
+
204
+ #ifndef YY_TYPEDEF_YY_SIZE_T
205
+ #define YY_TYPEDEF_YY_SIZE_T
206
+ typedef size_t yy_size_t;
207
+ #endif
208
+
209
+ #ifndef YY_STRUCT_YY_BUFFER_STATE
210
+ #define YY_STRUCT_YY_BUFFER_STATE
211
+ struct yy_buffer_state
212
+ {
213
+ FILE *yy_input_file;
214
+
215
+ char *yy_ch_buf; /* input buffer */
216
+ char *yy_buf_pos; /* current position in input buffer */
217
+
218
+ /* Size of input buffer in bytes, not including room for EOB
219
+ * characters.
220
+ */
221
+ yy_size_t yy_buf_size;
222
+
223
+ /* Number of characters read into yy_ch_buf, not including EOB
224
+ * characters.
225
+ */
226
+ int yy_n_chars;
227
+
228
+ /* Whether we "own" the buffer - i.e., we know we created it,
229
+ * and can realloc() it to grow it, and should free() it to
230
+ * delete it.
231
+ */
232
+ int yy_is_our_buffer;
233
+
234
+ /* Whether this is an "interactive" input source; if so, and
235
+ * if we're using stdio for input, then we want to use getc()
236
+ * instead of fread(), to make sure we stop fetching input after
237
+ * each newline.
238
+ */
239
+ int yy_is_interactive;
240
+
241
+ /* Whether we're considered to be at the beginning of a line.
242
+ * If so, '^' rules will be active on the next match, otherwise
243
+ * not.
244
+ */
245
+ int yy_at_bol;
246
+
247
+ int yy_bs_lineno; /**< The line count. */
248
+ int yy_bs_column; /**< The column count. */
249
+
250
+ /* Whether to try to fill the input buffer when we reach the
251
+ * end of it.
252
+ */
253
+ int yy_fill_buffer;
254
+
255
+ int yy_buffer_status;
256
+
257
+ #define YY_BUFFER_NEW 0
258
+ #define YY_BUFFER_NORMAL 1
259
+ /* When an EOF's been seen but there's still some text to process
260
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261
+ * shouldn't try reading from the input source any more. We might
262
+ * still have a bunch of tokens to match, though, because of
263
+ * possible backing-up.
264
+ *
265
+ * When we actually see the EOF, we change the status to "new"
266
+ * (via jq_yyrestart()), so that the user can continue scanning by
267
+ * just pointing yyin at a new input file.
268
+ */
269
+ #define YY_BUFFER_EOF_PENDING 2
270
+
271
+ };
272
+ #endif /* !YY_STRUCT_YY_BUFFER_STATE */
273
+
274
+ /* We provide macros for accessing buffer states in case in the
275
+ * future we want to put the buffer states in a more general
276
+ * "scanner state".
277
+ *
278
+ * Returns the top of the stack, or NULL.
279
+ */
280
+ #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
281
+ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
282
+ : NULL)
283
+
284
+ /* Same as previous macro, but useful when we know that the buffer stack is not
285
+ * NULL or when we need an lvalue. For internal use only.
286
+ */
287
+ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
288
+
289
+ void jq_yyrestart (FILE *input_file ,yyscan_t yyscanner );
290
+ void jq_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
291
+ YY_BUFFER_STATE jq_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
292
+ void jq_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
293
+ void jq_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
294
+ void jq_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
295
+ void jq_yypop_buffer_state (yyscan_t yyscanner );
296
+
297
+ static void jq_yyensure_buffer_stack (yyscan_t yyscanner );
298
+ static void jq_yy_load_buffer_state (yyscan_t yyscanner );
299
+ static void jq_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
300
+
301
+ #define YY_FLUSH_BUFFER jq_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
302
+
303
+ YY_BUFFER_STATE jq_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
304
+ YY_BUFFER_STATE jq_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
305
+ YY_BUFFER_STATE jq_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
306
+
307
+ void *jq_yyalloc (yy_size_t ,yyscan_t yyscanner );
308
+ void *jq_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
309
+ void jq_yyfree (void * ,yyscan_t yyscanner );
310
+
311
+ #define yy_new_buffer jq_yy_create_buffer
312
+
313
+ #define yy_set_interactive(is_interactive) \
314
+ { \
315
+ if ( ! YY_CURRENT_BUFFER ){ \
316
+ jq_yyensure_buffer_stack (yyscanner); \
317
+ YY_CURRENT_BUFFER_LVALUE = \
318
+ jq_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
319
+ } \
320
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321
+ }
322
+
323
+ #define yy_set_bol(at_bol) \
324
+ { \
325
+ if ( ! YY_CURRENT_BUFFER ){\
326
+ jq_yyensure_buffer_stack (yyscanner); \
327
+ YY_CURRENT_BUFFER_LVALUE = \
328
+ jq_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
329
+ } \
330
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331
+ }
332
+
333
+ #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
334
+
335
+ /* Begin user sect3 */
336
+
337
+ #define jq_yywrap(n) 1
338
+ #define YY_SKIP_YYWRAP
339
+
340
+ typedef unsigned char YY_CHAR;
341
+
342
+ typedef int yy_state_type;
343
+
344
+ #define yytext_ptr yytext_r
345
+
346
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
347
+ static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
348
+ static int yy_get_next_buffer (yyscan_t yyscanner );
349
+ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
350
+
351
+ /* Done after the current pattern has been matched and before the
352
+ * corresponding action - sets up yytext.
353
+ */
354
+ #define YY_DO_BEFORE_ACTION \
355
+ yyg->yytext_ptr = yy_bp; \
356
+ yyleng = (size_t) (yy_cp - yy_bp); \
357
+ yyg->yy_hold_char = *yy_cp; \
358
+ *yy_cp = '\0'; \
359
+ yyg->yy_c_buf_p = yy_cp;
360
+
361
+ #define YY_NUM_RULES 49
362
+ #define YY_END_OF_BUFFER 50
363
+ /* This struct is not used in this scanner,
364
+ but its presence is necessary. */
365
+ struct yy_trans_info
366
+ {
367
+ flex_int32_t yy_verify;
368
+ flex_int32_t yy_nxt;
369
+ };
370
+ static yyconst flex_int16_t yy_accept[154] =
371
+ { 0,
372
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
373
+ 0, 0, 50, 48, 47, 47, 48, 39, 1, 34,
374
+ 34, 35, 36, 34, 34, 34, 34, 34, 38, 34,
375
+ 34, 34, 48, 45, 45, 45, 45, 45, 45, 45,
376
+ 45, 45, 45, 45, 45, 45, 45, 34, 43, 43,
377
+ 41, 44, 47, 2, 1, 29, 27, 25, 26, 33,
378
+ 38, 46, 46, 18, 28, 0, 31, 3, 32, 37,
379
+ 45, 0, 45, 45, 4, 45, 45, 45, 45, 45,
380
+ 45, 9, 45, 45, 45, 45, 14, 45, 45, 45,
381
+ 24, 43, 42, 40, 42, 46, 0, 38, 30, 38,
382
+
383
+ 0, 45, 13, 45, 45, 8, 45, 45, 15, 45,
384
+ 45, 45, 45, 45, 45, 45, 19, 0, 42, 45,
385
+ 45, 45, 45, 12, 11, 45, 45, 45, 45, 45,
386
+ 45, 10, 42, 45, 22, 20, 45, 45, 45, 21,
387
+ 45, 45, 42, 45, 45, 5, 45, 7, 16, 23,
388
+ 17, 6, 0
389
+ } ;
390
+
391
+ static yyconst flex_int32_t yy_ec[256] =
392
+ { 0,
393
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
394
+ 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
395
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396
+ 1, 2, 5, 6, 7, 8, 9, 1, 1, 10,
397
+ 11, 12, 13, 14, 15, 16, 17, 18, 18, 18,
398
+ 18, 18, 18, 18, 18, 18, 18, 19, 20, 21,
399
+ 22, 23, 24, 25, 26, 26, 26, 26, 27, 26,
400
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
401
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
402
+ 28, 29, 30, 1, 31, 1, 32, 33, 34, 35,
403
+
404
+ 36, 37, 26, 38, 39, 26, 40, 41, 42, 43,
405
+ 44, 45, 26, 46, 47, 48, 49, 26, 26, 26,
406
+ 50, 26, 51, 52, 53, 1, 1, 1, 1, 1,
407
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414
+
415
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420
+ 1, 1, 1, 1, 1
421
+ } ;
422
+
423
+ static yyconst flex_int32_t yy_meta[54] =
424
+ { 0,
425
+ 1, 1, 2, 2, 1, 3, 1, 1, 1, 1,
426
+ 1, 1, 1, 1, 1, 4, 1, 5, 6, 1,
427
+ 1, 1, 1, 1, 1, 7, 7, 1, 8, 1,
428
+ 9, 7, 7, 7, 7, 7, 7, 7, 7, 7,
429
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
430
+ 1, 1, 1
431
+ } ;
432
+
433
+ static yyconst flex_int16_t yy_base[167] =
434
+ { 0,
435
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
436
+ 51, 52, 318, 319, 57, 59, 295, 319, 0, 319,
437
+ 294, 319, 319, 293, 292, 291, 47, 47, 50, 290,
438
+ 289, 288, 0, 290, 48, 51, 53, 52, 37, 59,
439
+ 57, 66, 56, 63, 68, 70, 72, 286, 0, 0,
440
+ 319, 80, 90, 319, 0, 319, 319, 319, 319, 95,
441
+ 99, 0, 106, 285, 319, 110, 319, 319, 319, 0,
442
+ 285, 281, 86, 77, 277, 97, 101, 111, 113, 115,
443
+ 117, 274, 119, 120, 118, 121, 270, 122, 123, 124,
444
+ 319, 0, 257, 319, 255, 0, 254, 249, 319, 245,
445
+
446
+ 0, 125, 239, 126, 127, 237, 128, 134, 234, 136,
447
+ 143, 147, 148, 149, 152, 154, 232, 165, 212, 210,
448
+ 157, 159, 158, 209, 208, 160, 161, 162, 163, 164,
449
+ 166, 207, 196, 171, 205, 204, 174, 167, 175, 201,
450
+ 170, 176, 190, 190, 184, 199, 194, 198, 197, 85,
451
+ 78, 76, 319, 230, 239, 245, 250, 255, 264, 273,
452
+ 278, 283, 285, 290, 294, 298
453
+ } ;
454
+
455
+ static yyconst flex_int16_t yy_def[167] =
456
+ { 0,
457
+ 153, 1, 1, 1, 1, 1, 1, 1, 1, 1,
458
+ 154, 154, 153, 153, 153, 153, 153, 153, 155, 153,
459
+ 153, 153, 153, 153, 153, 153, 156, 153, 153, 153,
460
+ 153, 153, 157, 158, 158, 158, 158, 158, 158, 158,
461
+ 158, 158, 158, 158, 158, 158, 158, 153, 159, 159,
462
+ 153, 160, 153, 153, 155, 153, 153, 153, 153, 153,
463
+ 153, 161, 161, 153, 153, 153, 153, 153, 153, 157,
464
+ 158, 153, 158, 158, 158, 158, 158, 158, 158, 158,
465
+ 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
466
+ 153, 159, 153, 153, 162, 161, 153, 161, 153, 153,
467
+
468
+ 163, 158, 158, 158, 158, 158, 158, 158, 158, 158,
469
+ 158, 158, 158, 158, 158, 158, 158, 160, 164, 158,
470
+ 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
471
+ 158, 158, 165, 158, 158, 158, 158, 158, 158, 158,
472
+ 158, 158, 166, 158, 158, 158, 158, 158, 158, 158,
473
+ 158, 158, 0, 153, 153, 153, 153, 153, 153, 153,
474
+ 153, 153, 153, 153, 153, 153
475
+ } ;
476
+
477
+ static yyconst flex_int16_t yy_nxt[373] =
478
+ { 0,
479
+ 14, 15, 16, 14, 17, 18, 19, 20, 21, 22,
480
+ 23, 24, 25, 20, 26, 27, 28, 29, 20, 20,
481
+ 30, 31, 32, 20, 33, 34, 34, 22, 14, 23,
482
+ 35, 36, 37, 38, 39, 40, 41, 34, 42, 34,
483
+ 43, 44, 34, 45, 34, 46, 34, 47, 34, 34,
484
+ 22, 48, 23, 50, 50, 72, 51, 51, 53, 53,
485
+ 53, 53, 60, 64, 61, 61, 72, 61, 65, 72,
486
+ 72, 72, 78, 63, 72, 72, 66, 72, 73, 52,
487
+ 52, 72, 63, 77, 72, 66, 72, 85, 72, 94,
488
+ 72, 53, 53, 74, 72, 72, 72, 75, 76, 79,
489
+
490
+ 81, 80, 82, 72, 72, 88, 86, 83, 84, 89,
491
+ 61, 103, 61, 87, 61, 72, 61, 90, 97, 72,
492
+ 97, 66, 97, 98, 97, 66, 102, 100, 95, 72,
493
+ 66, 72, 104, 72, 66, 72, 72, 72, 72, 72,
494
+ 72, 72, 72, 72, 72, 72, 72, 106, 105, 109,
495
+ 113, 107, 72, 112, 72, 114, 115, 122, 116, 108,
496
+ 123, 72, 110, 111, 124, 72, 72, 72, 121, 125,
497
+ 72, 126, 72, 117, 153, 72, 72, 72, 72, 72,
498
+ 72, 72, 72, 129, 72, 72, 127, 128, 72, 72,
499
+ 134, 137, 72, 72, 72, 136, 132, 130, 135, 142,
500
+
501
+ 131, 144, 72, 140, 141, 148, 138, 145, 72, 147,
502
+ 139, 149, 72, 95, 146, 72, 72, 72, 118, 72,
503
+ 150, 151, 72, 72, 118, 72, 72, 72, 72, 152,
504
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 55,
505
+ 118, 55, 55, 55, 55, 55, 55, 55, 62, 62,
506
+ 72, 62, 72, 62, 70, 72, 70, 72, 70, 71,
507
+ 71, 71, 100, 71, 92, 92, 98, 92, 92, 92,
508
+ 92, 100, 92, 93, 93, 93, 93, 93, 93, 93,
509
+ 93, 93, 96, 118, 96, 118, 96, 119, 72, 119,
510
+ 119, 120, 72, 120, 133, 72, 133, 133, 143, 101,
511
+
512
+ 143, 143, 93, 72, 93, 93, 99, 91, 72, 69,
513
+ 68, 67, 59, 58, 57, 56, 54, 153, 13, 153,
514
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
515
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
516
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
517
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
518
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
519
+ 153, 153
520
+ } ;
521
+
522
+ static yyconst flex_int16_t yy_chk[373] =
523
+ { 0,
524
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
525
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
526
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
527
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
528
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
529
+ 1, 1, 1, 11, 12, 39, 11, 12, 15, 15,
530
+ 16, 16, 27, 28, 27, 29, 35, 29, 28, 36,
531
+ 38, 37, 39, 27, 43, 41, 29, 40, 35, 11,
532
+ 12, 44, 27, 38, 42, 29, 45, 43, 46, 52,
533
+ 47, 53, 53, 36, 152, 74, 151, 36, 37, 40,
534
+
535
+ 41, 40, 42, 150, 73, 46, 44, 42, 42, 47,
536
+ 60, 74, 60, 45, 61, 76, 61, 47, 63, 77,
537
+ 63, 60, 66, 63, 66, 61, 73, 66, 52, 78,
538
+ 60, 79, 76, 80, 61, 81, 85, 83, 84, 86,
539
+ 88, 89, 90, 102, 104, 105, 107, 78, 77, 80,
540
+ 85, 79, 108, 84, 110, 86, 88, 104, 89, 79,
541
+ 105, 111, 81, 83, 107, 112, 113, 114, 102, 108,
542
+ 115, 110, 116, 90, 118, 121, 123, 122, 126, 127,
543
+ 128, 129, 130, 113, 131, 138, 111, 112, 141, 134,
544
+ 121, 126, 137, 139, 142, 123, 116, 114, 122, 131,
545
+
546
+ 115, 134, 145, 129, 130, 141, 127, 137, 144, 139,
547
+ 128, 142, 147, 118, 138, 149, 148, 146, 143, 140,
548
+ 144, 145, 136, 135, 133, 132, 125, 124, 120, 147,
549
+ 154, 154, 154, 154, 154, 154, 154, 154, 154, 155,
550
+ 119, 155, 155, 155, 155, 155, 155, 155, 156, 156,
551
+ 117, 156, 109, 156, 157, 106, 157, 103, 157, 158,
552
+ 158, 158, 100, 158, 159, 159, 98, 159, 159, 159,
553
+ 159, 97, 159, 160, 160, 160, 160, 160, 160, 160,
554
+ 160, 160, 161, 95, 161, 93, 161, 162, 87, 162,
555
+ 162, 163, 82, 163, 164, 75, 164, 164, 165, 72,
556
+
557
+ 165, 165, 166, 71, 166, 166, 64, 48, 34, 32,
558
+ 31, 30, 26, 25, 24, 21, 17, 13, 153, 153,
559
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
560
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
561
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
562
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
563
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
564
+ 153, 153
565
+ } ;
566
+
567
+ /* The intent behind this definition is that it'll catch
568
+ * any uses of REJECT which flex missed.
569
+ */
570
+ #define REJECT reject_used_but_not_detected
571
+ #define yymore() yymore_used_but_not_detected
572
+ #define YY_MORE_ADJ 0
573
+ #define YY_RESTORE_YY_MORE_OFFSET
574
+ #line 1 "lexer.l"
575
+ #line 2 "lexer.l"
576
+ #include <assert.h>
577
+ #include "jv_alloc.h"
578
+ #include "compile.h"
579
+
580
+ struct lexer_param;
581
+
582
+ #include "parser.h" /* Generated by bison. */
583
+
584
+ #define YY_USER_ACTION \
585
+ do { \
586
+ yylloc->start = jq_yyget_extra(yyscanner); \
587
+ yylloc->end = yylloc->start + yyleng; \
588
+ jq_yyset_extra(yylloc->end,yyscanner); \
589
+ } while (0);
590
+
591
+
592
+
593
+
594
+
595
+
596
+ #line 25 "lexer.l"
597
+ static int enter(int opening, int state, yyscan_t yyscanner);
598
+ static int try_exit(int closing, int state, yyscan_t yyscanner);
599
+ #define YY_NO_INPUT 1
600
+ #line 601 "lexer.c"
601
+
602
+ #define INITIAL 0
603
+ #define IN_PAREN 1
604
+ #define IN_BRACKET 2
605
+ #define IN_BRACE 3
606
+ #define IN_QQINTERP 4
607
+ #define IN_QQSTRING 5
608
+
609
+ #ifndef YY_NO_UNISTD_H
610
+ /* Special case for "unistd.h", since it is non-ANSI. We include it way
611
+ * down here because we want the user's section 1 to have been scanned first.
612
+ * The user has a chance to override it with an option.
613
+ */
614
+ #include <unistd.h>
615
+ #endif
616
+
617
+ #define YY_EXTRA_TYPE int
618
+
619
+ /* Holds the entire state of the reentrant scanner. */
620
+ struct yyguts_t
621
+ {
622
+
623
+ /* User-defined. Not touched by flex. */
624
+ YY_EXTRA_TYPE yyextra_r;
625
+
626
+ /* The rest are the same as the globals declared in the non-reentrant scanner. */
627
+ FILE *yyin_r, *yyout_r;
628
+ size_t yy_buffer_stack_top; /**< index of top of stack. */
629
+ size_t yy_buffer_stack_max; /**< capacity of stack. */
630
+ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
631
+ char yy_hold_char;
632
+ int yy_n_chars;
633
+ int yyleng_r;
634
+ char *yy_c_buf_p;
635
+ int yy_init;
636
+ int yy_start;
637
+ int yy_did_buffer_switch_on_eof;
638
+ int yy_start_stack_ptr;
639
+ int yy_start_stack_depth;
640
+ int *yy_start_stack;
641
+ yy_state_type yy_last_accepting_state;
642
+ char* yy_last_accepting_cpos;
643
+
644
+ int yylineno_r;
645
+ int yy_flex_debug_r;
646
+
647
+ char *yytext_r;
648
+ int yy_more_flag;
649
+ int yy_more_len;
650
+
651
+ YYSTYPE * yylval_r;
652
+
653
+ YYLTYPE * yylloc_r;
654
+
655
+ }; /* end struct yyguts_t */
656
+
657
+ static int yy_init_globals (yyscan_t yyscanner );
658
+
659
+ /* This must go here because YYSTYPE and YYLTYPE are included
660
+ * from bison output in section 1.*/
661
+ # define yylval yyg->yylval_r
662
+
663
+ # define yylloc yyg->yylloc_r
664
+
665
+ int jq_yylex_init (yyscan_t* scanner);
666
+
667
+ int jq_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
668
+
669
+ /* Accessor methods to globals.
670
+ These are made visible to non-reentrant scanners for convenience. */
671
+
672
+ int jq_yylex_destroy (yyscan_t yyscanner );
673
+
674
+ int jq_yyget_debug (yyscan_t yyscanner );
675
+
676
+ void jq_yyset_debug (int debug_flag ,yyscan_t yyscanner );
677
+
678
+ YY_EXTRA_TYPE jq_yyget_extra (yyscan_t yyscanner );
679
+
680
+ void jq_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
681
+
682
+ FILE *jq_yyget_in (yyscan_t yyscanner );
683
+
684
+ void jq_yyset_in (FILE * in_str ,yyscan_t yyscanner );
685
+
686
+ FILE *jq_yyget_out (yyscan_t yyscanner );
687
+
688
+ void jq_yyset_out (FILE * out_str ,yyscan_t yyscanner );
689
+
690
+ int jq_yyget_leng (yyscan_t yyscanner );
691
+
692
+ char *jq_yyget_text (yyscan_t yyscanner );
693
+
694
+ int jq_yyget_lineno (yyscan_t yyscanner );
695
+
696
+ void jq_yyset_lineno (int line_number ,yyscan_t yyscanner );
697
+
698
+ YYSTYPE * jq_yyget_lval (yyscan_t yyscanner );
699
+
700
+ void jq_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
701
+
702
+ YYLTYPE *jq_yyget_lloc (yyscan_t yyscanner );
703
+
704
+ void jq_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
705
+
706
+ /* Macros after this point can all be overridden by user definitions in
707
+ * section 1.
708
+ */
709
+
710
+ #ifndef YY_SKIP_YYWRAP
711
+ #ifdef __cplusplus
712
+ extern "C" int jq_yywrap (yyscan_t yyscanner );
713
+ #else
714
+ extern int jq_yywrap (yyscan_t yyscanner );
715
+ #endif
716
+ #endif
717
+
718
+ #ifndef yytext_ptr
719
+ static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
720
+ #endif
721
+
722
+ #ifdef YY_NEED_STRLEN
723
+ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
724
+ #endif
725
+
726
+ #ifndef YY_NO_INPUT
727
+
728
+ #ifdef __cplusplus
729
+ static int yyinput (yyscan_t yyscanner );
730
+ #else
731
+ static int input (yyscan_t yyscanner );
732
+ #endif
733
+
734
+ #endif
735
+
736
+ static void yy_push_state (int new_state ,yyscan_t yyscanner);
737
+
738
+ static void yy_pop_state (yyscan_t yyscanner );
739
+
740
+ static int yy_top_state (yyscan_t yyscanner );
741
+
742
+ /* Amount of stuff to slurp up with each read. */
743
+ #ifndef YY_READ_BUF_SIZE
744
+ #ifdef __ia64__
745
+ /* On IA-64, the buffer size is 16k, not 8k */
746
+ #define YY_READ_BUF_SIZE 16384
747
+ #else
748
+ #define YY_READ_BUF_SIZE 8192
749
+ #endif /* __ia64__ */
750
+ #endif
751
+
752
+ /* Copy whatever the last rule matched to the standard output. */
753
+ #ifndef ECHO
754
+ /* This used to be an fputs(), but since the string might contain NUL's,
755
+ * we now use fwrite().
756
+ */
757
+ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
758
+ #endif
759
+
760
+ /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
761
+ * is returned in "result".
762
+ */
763
+ #ifndef YY_INPUT
764
+ #define YY_INPUT(buf,result,max_size) \
765
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
766
+ { \
767
+ int c = '*'; \
768
+ size_t n; \
769
+ for ( n = 0; n < max_size && \
770
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
771
+ buf[n] = (char) c; \
772
+ if ( c == '\n' ) \
773
+ buf[n++] = (char) c; \
774
+ if ( c == EOF && ferror( yyin ) ) \
775
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
776
+ result = n; \
777
+ } \
778
+ else \
779
+ { \
780
+ errno=0; \
781
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
782
+ { \
783
+ if( errno != EINTR) \
784
+ { \
785
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
786
+ break; \
787
+ } \
788
+ errno=0; \
789
+ clearerr(yyin); \
790
+ } \
791
+ }\
792
+ \
793
+
794
+ #endif
795
+
796
+ /* No semi-colon after return; correct usage is to write "yyterminate();" -
797
+ * we don't want an extra ';' after the "return" because that will cause
798
+ * some compilers to complain about unreachable statements.
799
+ */
800
+ #ifndef yyterminate
801
+ #define yyterminate() return YY_NULL
802
+ #endif
803
+
804
+ /* Number of entries by which start-condition stack grows. */
805
+ #ifndef YY_START_STACK_INCR
806
+ #define YY_START_STACK_INCR 25
807
+ #endif
808
+
809
+ /* Report a fatal error. */
810
+ #ifndef YY_FATAL_ERROR
811
+ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
812
+ #endif
813
+
814
+ /* end tables serialization structures and prototypes */
815
+
816
+ /* Default declaration of generated scanner - a define so the user can
817
+ * easily add parameters.
818
+ */
819
+ #ifndef YY_DECL
820
+ #define YY_DECL_IS_OURS 1
821
+
822
+ extern int jq_yylex \
823
+ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
824
+
825
+ #define YY_DECL int jq_yylex \
826
+ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
827
+ #endif /* !YY_DECL */
828
+
829
+ /* Code executed at the beginning of each rule, after yytext and yyleng
830
+ * have been set up.
831
+ */
832
+ #ifndef YY_USER_ACTION
833
+ #define YY_USER_ACTION
834
+ #endif
835
+
836
+ /* Code executed at the end of each rule. */
837
+ #ifndef YY_BREAK
838
+ #define YY_BREAK break;
839
+ #endif
840
+
841
+ #define YY_RULE_SETUP \
842
+ YY_USER_ACTION
843
+
844
+ /** The main scanner function which does all the work.
845
+ */
846
+ YY_DECL
847
+ {
848
+ register yy_state_type yy_current_state;
849
+ register char *yy_cp, *yy_bp;
850
+ register int yy_act;
851
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
852
+
853
+ #line 38 "lexer.l"
854
+
855
+
856
+ #line 857 "lexer.c"
857
+
858
+ yylval = yylval_param;
859
+
860
+ yylloc = yylloc_param;
861
+
862
+ if ( !yyg->yy_init )
863
+ {
864
+ yyg->yy_init = 1;
865
+
866
+ #ifdef YY_USER_INIT
867
+ YY_USER_INIT;
868
+ #endif
869
+
870
+ if ( ! yyg->yy_start )
871
+ yyg->yy_start = 1; /* first start state */
872
+
873
+ if ( ! yyin )
874
+ yyin = stdin;
875
+
876
+ if ( ! yyout )
877
+ yyout = stdout;
878
+
879
+ if ( ! YY_CURRENT_BUFFER ) {
880
+ jq_yyensure_buffer_stack (yyscanner);
881
+ YY_CURRENT_BUFFER_LVALUE =
882
+ jq_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
883
+ }
884
+
885
+ jq_yy_load_buffer_state(yyscanner );
886
+ }
887
+
888
+ while ( 1 ) /* loops until end-of-file is reached */
889
+ {
890
+ yy_cp = yyg->yy_c_buf_p;
891
+
892
+ /* Support of yytext. */
893
+ *yy_cp = yyg->yy_hold_char;
894
+
895
+ /* yy_bp points to the position in yy_ch_buf of the start of
896
+ * the current run.
897
+ */
898
+ yy_bp = yy_cp;
899
+
900
+ yy_current_state = yyg->yy_start;
901
+ yy_match:
902
+ do
903
+ {
904
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
905
+ if ( yy_accept[yy_current_state] )
906
+ {
907
+ yyg->yy_last_accepting_state = yy_current_state;
908
+ yyg->yy_last_accepting_cpos = yy_cp;
909
+ }
910
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
911
+ {
912
+ yy_current_state = (int) yy_def[yy_current_state];
913
+ if ( yy_current_state >= 154 )
914
+ yy_c = yy_meta[(unsigned int) yy_c];
915
+ }
916
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
917
+ ++yy_cp;
918
+ }
919
+ while ( yy_base[yy_current_state] != 319 );
920
+
921
+ yy_find_action:
922
+ yy_act = yy_accept[yy_current_state];
923
+ if ( yy_act == 0 )
924
+ { /* have to back up */
925
+ yy_cp = yyg->yy_last_accepting_cpos;
926
+ yy_current_state = yyg->yy_last_accepting_state;
927
+ yy_act = yy_accept[yy_current_state];
928
+ }
929
+
930
+ YY_DO_BEFORE_ACTION;
931
+
932
+ do_action: /* This label is used only to access EOF actions. */
933
+
934
+ switch ( yy_act )
935
+ { /* beginning of action switch */
936
+ case 0: /* must back up */
937
+ /* undo the effects of YY_DO_BEFORE_ACTION */
938
+ *yy_cp = yyg->yy_hold_char;
939
+ yy_cp = yyg->yy_last_accepting_cpos;
940
+ yy_current_state = yyg->yy_last_accepting_state;
941
+ goto yy_find_action;
942
+
943
+ case 1:
944
+ YY_RULE_SETUP
945
+ #line 40 "lexer.l"
946
+ { /* comments */ }
947
+ YY_BREAK
948
+ case 2:
949
+ YY_RULE_SETUP
950
+ #line 42 "lexer.l"
951
+ { return NEQ; }
952
+ YY_BREAK
953
+ case 3:
954
+ YY_RULE_SETUP
955
+ #line 43 "lexer.l"
956
+ { return EQ; }
957
+ YY_BREAK
958
+ case 4:
959
+ YY_RULE_SETUP
960
+ #line 44 "lexer.l"
961
+ { return AS; }
962
+ YY_BREAK
963
+ case 5:
964
+ YY_RULE_SETUP
965
+ #line 45 "lexer.l"
966
+ { return IMPORT; }
967
+ YY_BREAK
968
+ case 6:
969
+ YY_RULE_SETUP
970
+ #line 46 "lexer.l"
971
+ { return INCLUDE; }
972
+ YY_BREAK
973
+ case 7:
974
+ YY_RULE_SETUP
975
+ #line 47 "lexer.l"
976
+ { return MODULE; }
977
+ YY_BREAK
978
+ case 8:
979
+ YY_RULE_SETUP
980
+ #line 48 "lexer.l"
981
+ { return DEF; }
982
+ YY_BREAK
983
+ case 9:
984
+ YY_RULE_SETUP
985
+ #line 49 "lexer.l"
986
+ { return IF; }
987
+ YY_BREAK
988
+ case 10:
989
+ YY_RULE_SETUP
990
+ #line 50 "lexer.l"
991
+ { return THEN; }
992
+ YY_BREAK
993
+ case 11:
994
+ YY_RULE_SETUP
995
+ #line 51 "lexer.l"
996
+ { return ELSE; }
997
+ YY_BREAK
998
+ case 12:
999
+ YY_RULE_SETUP
1000
+ #line 52 "lexer.l"
1001
+ { return ELSE_IF; }
1002
+ YY_BREAK
1003
+ case 13:
1004
+ YY_RULE_SETUP
1005
+ #line 53 "lexer.l"
1006
+ { return AND; }
1007
+ YY_BREAK
1008
+ case 14:
1009
+ YY_RULE_SETUP
1010
+ #line 54 "lexer.l"
1011
+ { return OR; }
1012
+ YY_BREAK
1013
+ case 15:
1014
+ YY_RULE_SETUP
1015
+ #line 55 "lexer.l"
1016
+ { return END; }
1017
+ YY_BREAK
1018
+ case 16:
1019
+ YY_RULE_SETUP
1020
+ #line 56 "lexer.l"
1021
+ { return REDUCE; }
1022
+ YY_BREAK
1023
+ case 17:
1024
+ YY_RULE_SETUP
1025
+ #line 57 "lexer.l"
1026
+ { return FOREACH; }
1027
+ YY_BREAK
1028
+ case 18:
1029
+ YY_RULE_SETUP
1030
+ #line 58 "lexer.l"
1031
+ { return DEFINEDOR; }
1032
+ YY_BREAK
1033
+ case 19:
1034
+ YY_RULE_SETUP
1035
+ #line 59 "lexer.l"
1036
+ { return TRY; }
1037
+ YY_BREAK
1038
+ case 20:
1039
+ YY_RULE_SETUP
1040
+ #line 60 "lexer.l"
1041
+ { return CATCH; }
1042
+ YY_BREAK
1043
+ case 21:
1044
+ YY_RULE_SETUP
1045
+ #line 61 "lexer.l"
1046
+ { return LABEL; }
1047
+ YY_BREAK
1048
+ case 22:
1049
+ YY_RULE_SETUP
1050
+ #line 62 "lexer.l"
1051
+ { return BREAK; }
1052
+ YY_BREAK
1053
+ case 23:
1054
+ YY_RULE_SETUP
1055
+ #line 63 "lexer.l"
1056
+ { return LOC; }
1057
+ YY_BREAK
1058
+ case 24:
1059
+ YY_RULE_SETUP
1060
+ #line 64 "lexer.l"
1061
+ { return SETPIPE; }
1062
+ YY_BREAK
1063
+ case 25:
1064
+ YY_RULE_SETUP
1065
+ #line 65 "lexer.l"
1066
+ { return SETPLUS; }
1067
+ YY_BREAK
1068
+ case 26:
1069
+ YY_RULE_SETUP
1070
+ #line 66 "lexer.l"
1071
+ { return SETMINUS; }
1072
+ YY_BREAK
1073
+ case 27:
1074
+ YY_RULE_SETUP
1075
+ #line 67 "lexer.l"
1076
+ { return SETMULT; }
1077
+ YY_BREAK
1078
+ case 28:
1079
+ YY_RULE_SETUP
1080
+ #line 68 "lexer.l"
1081
+ { return SETDIV; }
1082
+ YY_BREAK
1083
+ case 29:
1084
+ YY_RULE_SETUP
1085
+ #line 69 "lexer.l"
1086
+ { return SETMOD; }
1087
+ YY_BREAK
1088
+ case 30:
1089
+ YY_RULE_SETUP
1090
+ #line 70 "lexer.l"
1091
+ { return SETDEFINEDOR; }
1092
+ YY_BREAK
1093
+ case 31:
1094
+ YY_RULE_SETUP
1095
+ #line 71 "lexer.l"
1096
+ { return LESSEQ; }
1097
+ YY_BREAK
1098
+ case 32:
1099
+ YY_RULE_SETUP
1100
+ #line 72 "lexer.l"
1101
+ { return GREATEREQ; }
1102
+ YY_BREAK
1103
+ case 33:
1104
+ YY_RULE_SETUP
1105
+ #line 73 "lexer.l"
1106
+ { return REC; }
1107
+ YY_BREAK
1108
+ case 34:
1109
+ YY_RULE_SETUP
1110
+ #line 74 "lexer.l"
1111
+ { return yytext[0];}
1112
+ YY_BREAK
1113
+ case 35:
1114
+ YY_RULE_SETUP
1115
+ #line 76 "lexer.l"
1116
+ {
1117
+ return enter(yytext[0], YY_START, yyscanner);
1118
+ }
1119
+ YY_BREAK
1120
+ case 36:
1121
+ YY_RULE_SETUP
1122
+ #line 80 "lexer.l"
1123
+ {
1124
+ return try_exit(yytext[0], YY_START, yyscanner);
1125
+ }
1126
+ YY_BREAK
1127
+ case 37:
1128
+ YY_RULE_SETUP
1129
+ #line 84 "lexer.l"
1130
+ {
1131
+ yylval->literal = jv_string_sized(yytext + 1, yyleng - 1); return FORMAT;
1132
+ }
1133
+ YY_BREAK
1134
+ case 38:
1135
+ YY_RULE_SETUP
1136
+ #line 88 "lexer.l"
1137
+ {
1138
+ yylval->literal = jv_parse_sized(yytext, yyleng); return LITERAL;
1139
+ }
1140
+ YY_BREAK
1141
+ case 39:
1142
+ YY_RULE_SETUP
1143
+ #line 92 "lexer.l"
1144
+ {
1145
+ yy_push_state(IN_QQSTRING, yyscanner);
1146
+ return QQSTRING_START;
1147
+ }
1148
+ YY_BREAK
1149
+
1150
+ case 40:
1151
+ YY_RULE_SETUP
1152
+ #line 98 "lexer.l"
1153
+ {
1154
+ return enter(QQSTRING_INTERP_START, YY_START, yyscanner);
1155
+ }
1156
+ YY_BREAK
1157
+ case 41:
1158
+ YY_RULE_SETUP
1159
+ #line 101 "lexer.l"
1160
+ {
1161
+ yy_pop_state(yyscanner);
1162
+ return QQSTRING_END;
1163
+ }
1164
+ YY_BREAK
1165
+ case 42:
1166
+ /* rule 42 can match eol */
1167
+ YY_RULE_SETUP
1168
+ #line 105 "lexer.l"
1169
+ {
1170
+ /* pass escapes to the json parser */
1171
+ jv escapes = jv_string_fmt("\"%.*s\"", (int)yyleng, yytext);
1172
+ yylval->literal = jv_parse_sized(jv_string_value(escapes), jv_string_length_bytes(jv_copy(escapes)));
1173
+ jv_free(escapes);
1174
+ return QQSTRING_TEXT;
1175
+ }
1176
+ YY_BREAK
1177
+ case 43:
1178
+ /* rule 43 can match eol */
1179
+ YY_RULE_SETUP
1180
+ #line 112 "lexer.l"
1181
+ {
1182
+ yylval->literal = jv_string_sized(yytext, yyleng);
1183
+ return QQSTRING_TEXT;
1184
+ }
1185
+ YY_BREAK
1186
+ case 44:
1187
+ YY_RULE_SETUP
1188
+ #line 116 "lexer.l"
1189
+ {
1190
+ return INVALID_CHARACTER;
1191
+ }
1192
+ YY_BREAK
1193
+
1194
+ case 45:
1195
+ YY_RULE_SETUP
1196
+ #line 122 "lexer.l"
1197
+ { yylval->literal = jv_string(yytext); return IDENT;}
1198
+ YY_BREAK
1199
+ case 46:
1200
+ YY_RULE_SETUP
1201
+ #line 123 "lexer.l"
1202
+ { yylval->literal = jv_string(yytext+1); return FIELD;}
1203
+ YY_BREAK
1204
+ case 47:
1205
+ /* rule 47 can match eol */
1206
+ YY_RULE_SETUP
1207
+ #line 125 "lexer.l"
1208
+ {}
1209
+ YY_BREAK
1210
+ case 48:
1211
+ YY_RULE_SETUP
1212
+ #line 127 "lexer.l"
1213
+ { return INVALID_CHARACTER; }
1214
+ YY_BREAK
1215
+ case 49:
1216
+ YY_RULE_SETUP
1217
+ #line 129 "lexer.l"
1218
+ YY_FATAL_ERROR( "flex scanner jammed" );
1219
+ YY_BREAK
1220
+ #line 1221 "lexer.c"
1221
+ case YY_STATE_EOF(INITIAL):
1222
+ case YY_STATE_EOF(IN_PAREN):
1223
+ case YY_STATE_EOF(IN_BRACKET):
1224
+ case YY_STATE_EOF(IN_BRACE):
1225
+ case YY_STATE_EOF(IN_QQINTERP):
1226
+ case YY_STATE_EOF(IN_QQSTRING):
1227
+ yyterminate();
1228
+
1229
+ case YY_END_OF_BUFFER:
1230
+ {
1231
+ /* Amount of text matched not including the EOB char. */
1232
+ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1233
+
1234
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
1235
+ *yy_cp = yyg->yy_hold_char;
1236
+ YY_RESTORE_YY_MORE_OFFSET
1237
+
1238
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1239
+ {
1240
+ /* We're scanning a new file or input source. It's
1241
+ * possible that this happened because the user
1242
+ * just pointed yyin at a new source and called
1243
+ * jq_yylex(). If so, then we have to assure
1244
+ * consistency between YY_CURRENT_BUFFER and our
1245
+ * globals. Here is the right place to do so, because
1246
+ * this is the first action (other than possibly a
1247
+ * back-up) that will match for the new input source.
1248
+ */
1249
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1250
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1251
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1252
+ }
1253
+
1254
+ /* Note that here we test for yy_c_buf_p "<=" to the position
1255
+ * of the first EOB in the buffer, since yy_c_buf_p will
1256
+ * already have been incremented past the NUL character
1257
+ * (since all states make transitions on EOB to the
1258
+ * end-of-buffer state). Contrast this with the test
1259
+ * in input().
1260
+ */
1261
+ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1262
+ { /* This was really a NUL. */
1263
+ yy_state_type yy_next_state;
1264
+
1265
+ yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1266
+
1267
+ yy_current_state = yy_get_previous_state( yyscanner );
1268
+
1269
+ /* Okay, we're now positioned to make the NUL
1270
+ * transition. We couldn't have
1271
+ * yy_get_previous_state() go ahead and do it
1272
+ * for us because it doesn't know how to deal
1273
+ * with the possibility of jamming (and we don't
1274
+ * want to build jamming into it because then it
1275
+ * will run more slowly).
1276
+ */
1277
+
1278
+ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1279
+
1280
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1281
+
1282
+ if ( yy_next_state )
1283
+ {
1284
+ /* Consume the NUL. */
1285
+ yy_cp = ++yyg->yy_c_buf_p;
1286
+ yy_current_state = yy_next_state;
1287
+ goto yy_match;
1288
+ }
1289
+
1290
+ else
1291
+ {
1292
+ yy_cp = yyg->yy_c_buf_p;
1293
+ goto yy_find_action;
1294
+ }
1295
+ }
1296
+
1297
+ else switch ( yy_get_next_buffer( yyscanner ) )
1298
+ {
1299
+ case EOB_ACT_END_OF_FILE:
1300
+ {
1301
+ yyg->yy_did_buffer_switch_on_eof = 0;
1302
+
1303
+ if ( jq_yywrap(yyscanner ) )
1304
+ {
1305
+ /* Note: because we've taken care in
1306
+ * yy_get_next_buffer() to have set up
1307
+ * yytext, we can now set up
1308
+ * yy_c_buf_p so that if some total
1309
+ * hoser (like flex itself) wants to
1310
+ * call the scanner after we return the
1311
+ * YY_NULL, it'll still work - another
1312
+ * YY_NULL will get returned.
1313
+ */
1314
+ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1315
+
1316
+ yy_act = YY_STATE_EOF(YY_START);
1317
+ goto do_action;
1318
+ }
1319
+
1320
+ else
1321
+ {
1322
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
1323
+ YY_NEW_FILE;
1324
+ }
1325
+ break;
1326
+ }
1327
+
1328
+ case EOB_ACT_CONTINUE_SCAN:
1329
+ yyg->yy_c_buf_p =
1330
+ yyg->yytext_ptr + yy_amount_of_matched_text;
1331
+
1332
+ yy_current_state = yy_get_previous_state( yyscanner );
1333
+
1334
+ yy_cp = yyg->yy_c_buf_p;
1335
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1336
+ goto yy_match;
1337
+
1338
+ case EOB_ACT_LAST_MATCH:
1339
+ yyg->yy_c_buf_p =
1340
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1341
+
1342
+ yy_current_state = yy_get_previous_state( yyscanner );
1343
+
1344
+ yy_cp = yyg->yy_c_buf_p;
1345
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1346
+ goto yy_find_action;
1347
+ }
1348
+ break;
1349
+ }
1350
+
1351
+ default:
1352
+ YY_FATAL_ERROR(
1353
+ "fatal flex scanner internal error--no action found" );
1354
+ } /* end of action switch */
1355
+ } /* end of scanning one token */
1356
+ } /* end of jq_yylex */
1357
+
1358
+ /* yy_get_next_buffer - try to read in a new buffer
1359
+ *
1360
+ * Returns a code representing an action:
1361
+ * EOB_ACT_LAST_MATCH -
1362
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1363
+ * EOB_ACT_END_OF_FILE - end of file
1364
+ */
1365
+ static int yy_get_next_buffer (yyscan_t yyscanner)
1366
+ {
1367
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1368
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1369
+ register char *source = yyg->yytext_ptr;
1370
+ register int number_to_move, i;
1371
+ int ret_val;
1372
+
1373
+ if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1374
+ YY_FATAL_ERROR(
1375
+ "fatal flex scanner internal error--end of buffer missed" );
1376
+
1377
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1378
+ { /* Don't try to fill the buffer, so this is an EOF. */
1379
+ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1380
+ {
1381
+ /* We matched a single character, the EOB, so
1382
+ * treat this as a final EOF.
1383
+ */
1384
+ return EOB_ACT_END_OF_FILE;
1385
+ }
1386
+
1387
+ else
1388
+ {
1389
+ /* We matched some text prior to the EOB, first
1390
+ * process it.
1391
+ */
1392
+ return EOB_ACT_LAST_MATCH;
1393
+ }
1394
+ }
1395
+
1396
+ /* Try to read more data. */
1397
+
1398
+ /* First move last chars to start of buffer. */
1399
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1400
+
1401
+ for ( i = 0; i < number_to_move; ++i )
1402
+ *(dest++) = *(source++);
1403
+
1404
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1405
+ /* don't do the read, it's not guaranteed to return an EOF,
1406
+ * just force an EOF
1407
+ */
1408
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1409
+
1410
+ else
1411
+ {
1412
+ int num_to_read =
1413
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1414
+
1415
+ while ( num_to_read <= 0 )
1416
+ { /* Not enough room in the buffer - grow it. */
1417
+
1418
+ /* just a shorter name for the current buffer */
1419
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1420
+
1421
+ int yy_c_buf_p_offset =
1422
+ (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1423
+
1424
+ if ( b->yy_is_our_buffer )
1425
+ {
1426
+ int new_size = b->yy_buf_size * 2;
1427
+
1428
+ if ( new_size <= 0 )
1429
+ b->yy_buf_size += b->yy_buf_size / 8;
1430
+ else
1431
+ b->yy_buf_size *= 2;
1432
+
1433
+ b->yy_ch_buf = (char *)
1434
+ /* Include room in for 2 EOB chars. */
1435
+ jq_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1436
+ }
1437
+ else
1438
+ /* Can't grow it, we don't own it. */
1439
+ b->yy_ch_buf = 0;
1440
+
1441
+ if ( ! b->yy_ch_buf )
1442
+ YY_FATAL_ERROR(
1443
+ "fatal error - scanner input buffer overflow" );
1444
+
1445
+ yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1446
+
1447
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1448
+ number_to_move - 1;
1449
+
1450
+ }
1451
+
1452
+ if ( num_to_read > YY_READ_BUF_SIZE )
1453
+ num_to_read = YY_READ_BUF_SIZE;
1454
+
1455
+ /* Read in more data. */
1456
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1457
+ yyg->yy_n_chars, (size_t) num_to_read );
1458
+
1459
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1460
+ }
1461
+
1462
+ if ( yyg->yy_n_chars == 0 )
1463
+ {
1464
+ if ( number_to_move == YY_MORE_ADJ )
1465
+ {
1466
+ ret_val = EOB_ACT_END_OF_FILE;
1467
+ jq_yyrestart(yyin ,yyscanner);
1468
+ }
1469
+
1470
+ else
1471
+ {
1472
+ ret_val = EOB_ACT_LAST_MATCH;
1473
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1474
+ YY_BUFFER_EOF_PENDING;
1475
+ }
1476
+ }
1477
+
1478
+ else
1479
+ ret_val = EOB_ACT_CONTINUE_SCAN;
1480
+
1481
+ if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1482
+ /* Extend the array by 50%, plus the number we really need. */
1483
+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1484
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) jq_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1485
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1486
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1487
+ }
1488
+
1489
+ yyg->yy_n_chars += number_to_move;
1490
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1491
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1492
+
1493
+ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1494
+
1495
+ return ret_val;
1496
+ }
1497
+
1498
+ /* yy_get_previous_state - get the state just before the EOB char was reached */
1499
+
1500
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1501
+ {
1502
+ register yy_state_type yy_current_state;
1503
+ register char *yy_cp;
1504
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1505
+
1506
+ yy_current_state = yyg->yy_start;
1507
+
1508
+ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1509
+ {
1510
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1511
+ if ( yy_accept[yy_current_state] )
1512
+ {
1513
+ yyg->yy_last_accepting_state = yy_current_state;
1514
+ yyg->yy_last_accepting_cpos = yy_cp;
1515
+ }
1516
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1517
+ {
1518
+ yy_current_state = (int) yy_def[yy_current_state];
1519
+ if ( yy_current_state >= 154 )
1520
+ yy_c = yy_meta[(unsigned int) yy_c];
1521
+ }
1522
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1523
+ }
1524
+
1525
+ return yy_current_state;
1526
+ }
1527
+
1528
+ /* yy_try_NUL_trans - try to make a transition on the NUL character
1529
+ *
1530
+ * synopsis
1531
+ * next_state = yy_try_NUL_trans( current_state );
1532
+ */
1533
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1534
+ {
1535
+ register int yy_is_jam;
1536
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1537
+ register char *yy_cp = yyg->yy_c_buf_p;
1538
+
1539
+ register YY_CHAR yy_c = 1;
1540
+ if ( yy_accept[yy_current_state] )
1541
+ {
1542
+ yyg->yy_last_accepting_state = yy_current_state;
1543
+ yyg->yy_last_accepting_cpos = yy_cp;
1544
+ }
1545
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1546
+ {
1547
+ yy_current_state = (int) yy_def[yy_current_state];
1548
+ if ( yy_current_state >= 154 )
1549
+ yy_c = yy_meta[(unsigned int) yy_c];
1550
+ }
1551
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1552
+ yy_is_jam = (yy_current_state == 153);
1553
+
1554
+ return yy_is_jam ? 0 : yy_current_state;
1555
+ }
1556
+
1557
+ #ifndef YY_NO_INPUT
1558
+ #ifdef __cplusplus
1559
+ static int yyinput (yyscan_t yyscanner)
1560
+ #else
1561
+ static int input (yyscan_t yyscanner)
1562
+ #endif
1563
+
1564
+ {
1565
+ int c;
1566
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1567
+
1568
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
1569
+
1570
+ if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1571
+ {
1572
+ /* yy_c_buf_p now points to the character we want to return.
1573
+ * If this occurs *before* the EOB characters, then it's a
1574
+ * valid NUL; if not, then we've hit the end of the buffer.
1575
+ */
1576
+ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1577
+ /* This was really a NUL. */
1578
+ *yyg->yy_c_buf_p = '\0';
1579
+
1580
+ else
1581
+ { /* need more input */
1582
+ int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1583
+ ++yyg->yy_c_buf_p;
1584
+
1585
+ switch ( yy_get_next_buffer( yyscanner ) )
1586
+ {
1587
+ case EOB_ACT_LAST_MATCH:
1588
+ /* This happens because yy_g_n_b()
1589
+ * sees that we've accumulated a
1590
+ * token and flags that we need to
1591
+ * try matching the token before
1592
+ * proceeding. But for input(),
1593
+ * there's no matching to consider.
1594
+ * So convert the EOB_ACT_LAST_MATCH
1595
+ * to EOB_ACT_END_OF_FILE.
1596
+ */
1597
+
1598
+ /* Reset buffer status. */
1599
+ jq_yyrestart(yyin ,yyscanner);
1600
+
1601
+ /*FALLTHROUGH*/
1602
+
1603
+ case EOB_ACT_END_OF_FILE:
1604
+ {
1605
+ if ( jq_yywrap(yyscanner ) )
1606
+ return EOF;
1607
+
1608
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
1609
+ YY_NEW_FILE;
1610
+ #ifdef __cplusplus
1611
+ return yyinput(yyscanner);
1612
+ #else
1613
+ return input(yyscanner);
1614
+ #endif
1615
+ }
1616
+
1617
+ case EOB_ACT_CONTINUE_SCAN:
1618
+ yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1619
+ break;
1620
+ }
1621
+ }
1622
+ }
1623
+
1624
+ c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1625
+ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1626
+ yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1627
+
1628
+ return c;
1629
+ }
1630
+ #endif /* ifndef YY_NO_INPUT */
1631
+
1632
+ /** Immediately switch to a different input stream.
1633
+ * @param input_file A readable stream.
1634
+ * @param yyscanner The scanner object.
1635
+ * @note This function does not reset the start condition to @c INITIAL .
1636
+ */
1637
+ void jq_yyrestart (FILE * input_file , yyscan_t yyscanner)
1638
+ {
1639
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1640
+
1641
+ if ( ! YY_CURRENT_BUFFER ){
1642
+ jq_yyensure_buffer_stack (yyscanner);
1643
+ YY_CURRENT_BUFFER_LVALUE =
1644
+ jq_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1645
+ }
1646
+
1647
+ jq_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1648
+ jq_yy_load_buffer_state(yyscanner );
1649
+ }
1650
+
1651
+ /** Switch to a different input buffer.
1652
+ * @param new_buffer The new input buffer.
1653
+ * @param yyscanner The scanner object.
1654
+ */
1655
+ void jq_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1656
+ {
1657
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1658
+
1659
+ /* TODO. We should be able to replace this entire function body
1660
+ * with
1661
+ * jq_yypop_buffer_state();
1662
+ * jq_yypush_buffer_state(new_buffer);
1663
+ */
1664
+ jq_yyensure_buffer_stack (yyscanner);
1665
+ if ( YY_CURRENT_BUFFER == new_buffer )
1666
+ return;
1667
+
1668
+ if ( YY_CURRENT_BUFFER )
1669
+ {
1670
+ /* Flush out information for old buffer. */
1671
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
1672
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1673
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1674
+ }
1675
+
1676
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
1677
+ jq_yy_load_buffer_state(yyscanner );
1678
+
1679
+ /* We don't actually know whether we did this switch during
1680
+ * EOF (jq_yywrap()) processing, but the only time this flag
1681
+ * is looked at is after jq_yywrap() is called, so it's safe
1682
+ * to go ahead and always set it.
1683
+ */
1684
+ yyg->yy_did_buffer_switch_on_eof = 1;
1685
+ }
1686
+
1687
+ static void jq_yy_load_buffer_state (yyscan_t yyscanner)
1688
+ {
1689
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1690
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1691
+ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1692
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1693
+ yyg->yy_hold_char = *yyg->yy_c_buf_p;
1694
+ }
1695
+
1696
+ /** Allocate and initialize an input buffer state.
1697
+ * @param file A readable stream.
1698
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1699
+ * @param yyscanner The scanner object.
1700
+ * @return the allocated buffer state.
1701
+ */
1702
+ YY_BUFFER_STATE jq_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1703
+ {
1704
+ YY_BUFFER_STATE b;
1705
+
1706
+ b = (YY_BUFFER_STATE) jq_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1707
+ if ( ! b )
1708
+ YY_FATAL_ERROR( "out of dynamic memory in jq_yy_create_buffer()" );
1709
+
1710
+ b->yy_buf_size = size;
1711
+
1712
+ /* yy_ch_buf has to be 2 characters longer than the size given because
1713
+ * we need to put in 2 end-of-buffer characters.
1714
+ */
1715
+ b->yy_ch_buf = (char *) jq_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1716
+ if ( ! b->yy_ch_buf )
1717
+ YY_FATAL_ERROR( "out of dynamic memory in jq_yy_create_buffer()" );
1718
+
1719
+ b->yy_is_our_buffer = 1;
1720
+
1721
+ jq_yy_init_buffer(b,file ,yyscanner);
1722
+
1723
+ return b;
1724
+ }
1725
+
1726
+ /** Destroy the buffer.
1727
+ * @param b a buffer created with jq_yy_create_buffer()
1728
+ * @param yyscanner The scanner object.
1729
+ */
1730
+ void jq_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1731
+ {
1732
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1733
+
1734
+ if ( ! b )
1735
+ return;
1736
+
1737
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1738
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1739
+
1740
+ if ( b->yy_is_our_buffer )
1741
+ jq_yyfree((void *) b->yy_ch_buf ,yyscanner );
1742
+
1743
+ jq_yyfree((void *) b ,yyscanner );
1744
+ }
1745
+
1746
+ #ifndef __cplusplus
1747
+ extern int isatty (int );
1748
+ #endif /* __cplusplus */
1749
+
1750
+ /* Initializes or reinitializes a buffer.
1751
+ * This function is sometimes called more than once on the same buffer,
1752
+ * such as during a jq_yyrestart() or at EOF.
1753
+ */
1754
+ static void jq_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1755
+
1756
+ {
1757
+ int oerrno = errno;
1758
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1759
+
1760
+ jq_yy_flush_buffer(b ,yyscanner);
1761
+
1762
+ b->yy_input_file = file;
1763
+ b->yy_fill_buffer = 1;
1764
+
1765
+ /* If b is the current buffer, then jq_yy_init_buffer was _probably_
1766
+ * called from jq_yyrestart() or through yy_get_next_buffer.
1767
+ * In that case, we don't want to reset the lineno or column.
1768
+ */
1769
+ if (b != YY_CURRENT_BUFFER){
1770
+ b->yy_bs_lineno = 1;
1771
+ b->yy_bs_column = 0;
1772
+ }
1773
+
1774
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1775
+
1776
+ errno = oerrno;
1777
+ }
1778
+
1779
+ /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1780
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1781
+ * @param yyscanner The scanner object.
1782
+ */
1783
+ void jq_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1784
+ {
1785
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1786
+ if ( ! b )
1787
+ return;
1788
+
1789
+ b->yy_n_chars = 0;
1790
+
1791
+ /* We always need two end-of-buffer characters. The first causes
1792
+ * a transition to the end-of-buffer state. The second causes
1793
+ * a jam in that state.
1794
+ */
1795
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1796
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1797
+
1798
+ b->yy_buf_pos = &b->yy_ch_buf[0];
1799
+
1800
+ b->yy_at_bol = 1;
1801
+ b->yy_buffer_status = YY_BUFFER_NEW;
1802
+
1803
+ if ( b == YY_CURRENT_BUFFER )
1804
+ jq_yy_load_buffer_state(yyscanner );
1805
+ }
1806
+
1807
+ /** Pushes the new state onto the stack. The new state becomes
1808
+ * the current state. This function will allocate the stack
1809
+ * if necessary.
1810
+ * @param new_buffer The new state.
1811
+ * @param yyscanner The scanner object.
1812
+ */
1813
+ void jq_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1814
+ {
1815
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1816
+ if (new_buffer == NULL)
1817
+ return;
1818
+
1819
+ jq_yyensure_buffer_stack(yyscanner);
1820
+
1821
+ /* This block is copied from jq_yy_switch_to_buffer. */
1822
+ if ( YY_CURRENT_BUFFER )
1823
+ {
1824
+ /* Flush out information for old buffer. */
1825
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
1826
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1827
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1828
+ }
1829
+
1830
+ /* Only push if top exists. Otherwise, replace top. */
1831
+ if (YY_CURRENT_BUFFER)
1832
+ yyg->yy_buffer_stack_top++;
1833
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
1834
+
1835
+ /* copied from jq_yy_switch_to_buffer. */
1836
+ jq_yy_load_buffer_state(yyscanner );
1837
+ yyg->yy_did_buffer_switch_on_eof = 1;
1838
+ }
1839
+
1840
+ /** Removes and deletes the top of the stack, if present.
1841
+ * The next element becomes the new top.
1842
+ * @param yyscanner The scanner object.
1843
+ */
1844
+ void jq_yypop_buffer_state (yyscan_t yyscanner)
1845
+ {
1846
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1847
+ if (!YY_CURRENT_BUFFER)
1848
+ return;
1849
+
1850
+ jq_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1851
+ YY_CURRENT_BUFFER_LVALUE = NULL;
1852
+ if (yyg->yy_buffer_stack_top > 0)
1853
+ --yyg->yy_buffer_stack_top;
1854
+
1855
+ if (YY_CURRENT_BUFFER) {
1856
+ jq_yy_load_buffer_state(yyscanner );
1857
+ yyg->yy_did_buffer_switch_on_eof = 1;
1858
+ }
1859
+ }
1860
+
1861
+ /* Allocates the stack if it does not exist.
1862
+ * Guarantees space for at least one push.
1863
+ */
1864
+ static void jq_yyensure_buffer_stack (yyscan_t yyscanner)
1865
+ {
1866
+ int num_to_alloc;
1867
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1868
+
1869
+ if (!yyg->yy_buffer_stack) {
1870
+
1871
+ /* First allocation is just for 2 elements, since we don't know if this
1872
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
1873
+ * immediate realloc on the next call.
1874
+ */
1875
+ num_to_alloc = 1;
1876
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)jq_yyalloc
1877
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
1878
+ , yyscanner);
1879
+ if ( ! yyg->yy_buffer_stack )
1880
+ YY_FATAL_ERROR( "out of dynamic memory in jq_yyensure_buffer_stack()" );
1881
+
1882
+ memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1883
+
1884
+ yyg->yy_buffer_stack_max = num_to_alloc;
1885
+ yyg->yy_buffer_stack_top = 0;
1886
+ return;
1887
+ }
1888
+
1889
+ if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1890
+
1891
+ /* Increase the buffer to prepare for a possible push. */
1892
+ int grow_size = 8 /* arbitrary grow size */;
1893
+
1894
+ num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1895
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)jq_yyrealloc
1896
+ (yyg->yy_buffer_stack,
1897
+ num_to_alloc * sizeof(struct yy_buffer_state*)
1898
+ , yyscanner);
1899
+ if ( ! yyg->yy_buffer_stack )
1900
+ YY_FATAL_ERROR( "out of dynamic memory in jq_yyensure_buffer_stack()" );
1901
+
1902
+ /* zero only the new slots.*/
1903
+ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1904
+ yyg->yy_buffer_stack_max = num_to_alloc;
1905
+ }
1906
+ }
1907
+
1908
+ /** Setup the input buffer state to scan directly from a user-specified character buffer.
1909
+ * @param base the character buffer
1910
+ * @param size the size in bytes of the character buffer
1911
+ * @param yyscanner The scanner object.
1912
+ * @return the newly allocated buffer state object.
1913
+ */
1914
+ YY_BUFFER_STATE jq_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1915
+ {
1916
+ YY_BUFFER_STATE b;
1917
+
1918
+ if ( size < 2 ||
1919
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
1920
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
1921
+ /* They forgot to leave room for the EOB's. */
1922
+ return 0;
1923
+
1924
+ b = (YY_BUFFER_STATE) jq_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1925
+ if ( ! b )
1926
+ YY_FATAL_ERROR( "out of dynamic memory in jq_yy_scan_buffer()" );
1927
+
1928
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1929
+ b->yy_buf_pos = b->yy_ch_buf = base;
1930
+ b->yy_is_our_buffer = 0;
1931
+ b->yy_input_file = 0;
1932
+ b->yy_n_chars = b->yy_buf_size;
1933
+ b->yy_is_interactive = 0;
1934
+ b->yy_at_bol = 1;
1935
+ b->yy_fill_buffer = 0;
1936
+ b->yy_buffer_status = YY_BUFFER_NEW;
1937
+
1938
+ jq_yy_switch_to_buffer(b ,yyscanner );
1939
+
1940
+ return b;
1941
+ }
1942
+
1943
+ /** Setup the input buffer state to scan a string. The next call to jq_yylex() will
1944
+ * scan from a @e copy of @a str.
1945
+ * @param yystr a NUL-terminated string to scan
1946
+ * @param yyscanner The scanner object.
1947
+ * @return the newly allocated buffer state object.
1948
+ * @note If you want to scan bytes that may contain NUL values, then use
1949
+ * jq_yy_scan_bytes() instead.
1950
+ */
1951
+ YY_BUFFER_STATE jq_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1952
+ {
1953
+
1954
+ return jq_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1955
+ }
1956
+
1957
+ /** Setup the input buffer state to scan the given bytes. The next call to jq_yylex() will
1958
+ * scan from a @e copy of @a bytes.
1959
+ * @param yybytes the byte buffer to scan
1960
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1961
+ * @param yyscanner The scanner object.
1962
+ * @return the newly allocated buffer state object.
1963
+ */
1964
+ YY_BUFFER_STATE jq_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1965
+ {
1966
+ YY_BUFFER_STATE b;
1967
+ char *buf;
1968
+ yy_size_t n;
1969
+ int i;
1970
+
1971
+ /* Get memory for full buffer, including space for trailing EOB's. */
1972
+ n = _yybytes_len + 2;
1973
+ buf = (char *) jq_yyalloc(n ,yyscanner );
1974
+ if ( ! buf )
1975
+ YY_FATAL_ERROR( "out of dynamic memory in jq_yy_scan_bytes()" );
1976
+
1977
+ for ( i = 0; i < _yybytes_len; ++i )
1978
+ buf[i] = yybytes[i];
1979
+
1980
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1981
+
1982
+ b = jq_yy_scan_buffer(buf,n ,yyscanner);
1983
+ if ( ! b )
1984
+ YY_FATAL_ERROR( "bad buffer in jq_yy_scan_bytes()" );
1985
+
1986
+ /* It's okay to grow etc. this buffer, and we should throw it
1987
+ * away when we're done.
1988
+ */
1989
+ b->yy_is_our_buffer = 1;
1990
+
1991
+ return b;
1992
+ }
1993
+
1994
+ static void yy_push_state (int new_state , yyscan_t yyscanner)
1995
+ {
1996
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1997
+ if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
1998
+ {
1999
+ yy_size_t new_size;
2000
+
2001
+ yyg->yy_start_stack_depth += YY_START_STACK_INCR;
2002
+ new_size = yyg->yy_start_stack_depth * sizeof( int );
2003
+
2004
+ if ( ! yyg->yy_start_stack )
2005
+ yyg->yy_start_stack = (int *) jq_yyalloc(new_size ,yyscanner );
2006
+
2007
+ else
2008
+ yyg->yy_start_stack = (int *) jq_yyrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner );
2009
+
2010
+ if ( ! yyg->yy_start_stack )
2011
+ YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2012
+ }
2013
+
2014
+ yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
2015
+
2016
+ BEGIN(new_state);
2017
+ }
2018
+
2019
+ static void yy_pop_state (yyscan_t yyscanner)
2020
+ {
2021
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2022
+ if ( --yyg->yy_start_stack_ptr < 0 )
2023
+ YY_FATAL_ERROR( "start-condition stack underflow" );
2024
+
2025
+ BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
2026
+ }
2027
+
2028
+ static int yy_top_state (yyscan_t yyscanner)
2029
+ {
2030
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2031
+ return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
2032
+ }
2033
+
2034
+ #ifndef YY_EXIT_FAILURE
2035
+ #define YY_EXIT_FAILURE 2
2036
+ #endif
2037
+
2038
+ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2039
+ {
2040
+ (void) fprintf( stderr, "%s\n", msg );
2041
+ exit( YY_EXIT_FAILURE );
2042
+ }
2043
+
2044
+ /* Redefine yyless() so it works in section 3 code. */
2045
+
2046
+ #undef yyless
2047
+ #define yyless(n) \
2048
+ do \
2049
+ { \
2050
+ /* Undo effects of setting up yytext. */ \
2051
+ int yyless_macro_arg = (n); \
2052
+ YY_LESS_LINENO(yyless_macro_arg);\
2053
+ yytext[yyleng] = yyg->yy_hold_char; \
2054
+ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2055
+ yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2056
+ *yyg->yy_c_buf_p = '\0'; \
2057
+ yyleng = yyless_macro_arg; \
2058
+ } \
2059
+ while ( 0 )
2060
+
2061
+ /* Accessor methods (get/set functions) to struct members. */
2062
+
2063
+ /** Get the user-defined data for this scanner.
2064
+ * @param yyscanner The scanner object.
2065
+ */
2066
+ YY_EXTRA_TYPE jq_yyget_extra (yyscan_t yyscanner)
2067
+ {
2068
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2069
+ return yyextra;
2070
+ }
2071
+
2072
+ /** Get the current line number.
2073
+ * @param yyscanner The scanner object.
2074
+ */
2075
+ int jq_yyget_lineno (yyscan_t yyscanner)
2076
+ {
2077
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2078
+
2079
+ if (! YY_CURRENT_BUFFER)
2080
+ return 0;
2081
+
2082
+ return yylineno;
2083
+ }
2084
+
2085
+ /** Get the current column number.
2086
+ * @param yyscanner The scanner object.
2087
+ */
2088
+ int jq_yyget_column (yyscan_t yyscanner)
2089
+ {
2090
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2091
+
2092
+ if (! YY_CURRENT_BUFFER)
2093
+ return 0;
2094
+
2095
+ return yycolumn;
2096
+ }
2097
+
2098
+ /** Get the input stream.
2099
+ * @param yyscanner The scanner object.
2100
+ */
2101
+ FILE *jq_yyget_in (yyscan_t yyscanner)
2102
+ {
2103
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2104
+ return yyin;
2105
+ }
2106
+
2107
+ /** Get the output stream.
2108
+ * @param yyscanner The scanner object.
2109
+ */
2110
+ FILE *jq_yyget_out (yyscan_t yyscanner)
2111
+ {
2112
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2113
+ return yyout;
2114
+ }
2115
+
2116
+ /** Get the length of the current token.
2117
+ * @param yyscanner The scanner object.
2118
+ */
2119
+ int jq_yyget_leng (yyscan_t yyscanner)
2120
+ {
2121
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2122
+ return yyleng;
2123
+ }
2124
+
2125
+ /** Get the current token.
2126
+ * @param yyscanner The scanner object.
2127
+ */
2128
+
2129
+ char *jq_yyget_text (yyscan_t yyscanner)
2130
+ {
2131
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2132
+ return yytext;
2133
+ }
2134
+
2135
+ /** Set the user-defined data. This data is never touched by the scanner.
2136
+ * @param user_defined The data to be associated with this scanner.
2137
+ * @param yyscanner The scanner object.
2138
+ */
2139
+ void jq_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2140
+ {
2141
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2142
+ yyextra = user_defined ;
2143
+ }
2144
+
2145
+ /** Set the current line number.
2146
+ * @param line_number
2147
+ * @param yyscanner The scanner object.
2148
+ */
2149
+ void jq_yyset_lineno (int line_number , yyscan_t yyscanner)
2150
+ {
2151
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2152
+
2153
+ /* lineno is only valid if an input buffer exists. */
2154
+ if (! YY_CURRENT_BUFFER )
2155
+ yy_fatal_error( "jq_yyset_lineno called with no buffer" , yyscanner);
2156
+
2157
+ yylineno = line_number;
2158
+ }
2159
+
2160
+ /** Set the current column.
2161
+ * @param line_number
2162
+ * @param yyscanner The scanner object.
2163
+ */
2164
+ void jq_yyset_column (int column_no , yyscan_t yyscanner)
2165
+ {
2166
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2167
+
2168
+ /* column is only valid if an input buffer exists. */
2169
+ if (! YY_CURRENT_BUFFER )
2170
+ yy_fatal_error( "jq_yyset_column called with no buffer" , yyscanner);
2171
+
2172
+ yycolumn = column_no;
2173
+ }
2174
+
2175
+ /** Set the input stream. This does not discard the current
2176
+ * input buffer.
2177
+ * @param in_str A readable stream.
2178
+ * @param yyscanner The scanner object.
2179
+ * @see jq_yy_switch_to_buffer
2180
+ */
2181
+ void jq_yyset_in (FILE * in_str , yyscan_t yyscanner)
2182
+ {
2183
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2184
+ yyin = in_str ;
2185
+ }
2186
+
2187
+ void jq_yyset_out (FILE * out_str , yyscan_t yyscanner)
2188
+ {
2189
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2190
+ yyout = out_str ;
2191
+ }
2192
+
2193
+ int jq_yyget_debug (yyscan_t yyscanner)
2194
+ {
2195
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2196
+ return yy_flex_debug;
2197
+ }
2198
+
2199
+ void jq_yyset_debug (int bdebug , yyscan_t yyscanner)
2200
+ {
2201
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2202
+ yy_flex_debug = bdebug ;
2203
+ }
2204
+
2205
+ /* Accessor methods for yylval and yylloc */
2206
+
2207
+ YYSTYPE * jq_yyget_lval (yyscan_t yyscanner)
2208
+ {
2209
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2210
+ return yylval;
2211
+ }
2212
+
2213
+ void jq_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2214
+ {
2215
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2216
+ yylval = yylval_param;
2217
+ }
2218
+
2219
+ YYLTYPE *jq_yyget_lloc (yyscan_t yyscanner)
2220
+ {
2221
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2222
+ return yylloc;
2223
+ }
2224
+
2225
+ void jq_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
2226
+ {
2227
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2228
+ yylloc = yylloc_param;
2229
+ }
2230
+
2231
+ /* User-visible API */
2232
+
2233
+ /* jq_yylex_init is special because it creates the scanner itself, so it is
2234
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
2235
+ * That's why we explicitly handle the declaration, instead of using our macros.
2236
+ */
2237
+
2238
+ int jq_yylex_init(yyscan_t* ptr_yy_globals)
2239
+
2240
+ {
2241
+ if (ptr_yy_globals == NULL){
2242
+ errno = EINVAL;
2243
+ return 1;
2244
+ }
2245
+
2246
+ *ptr_yy_globals = (yyscan_t) jq_yyalloc ( sizeof( struct yyguts_t ), NULL );
2247
+
2248
+ if (*ptr_yy_globals == NULL){
2249
+ errno = ENOMEM;
2250
+ return 1;
2251
+ }
2252
+
2253
+ /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2254
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2255
+
2256
+ return yy_init_globals ( *ptr_yy_globals );
2257
+ }
2258
+
2259
+ /* jq_yylex_init_extra has the same functionality as jq_yylex_init, but follows the
2260
+ * convention of taking the scanner as the last argument. Note however, that
2261
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
2262
+ * is the reason, too, why this function also must handle its own declaration).
2263
+ * The user defined value in the first argument will be available to jq_yyalloc in
2264
+ * the yyextra field.
2265
+ */
2266
+
2267
+ int jq_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2268
+
2269
+ {
2270
+ struct yyguts_t dummy_yyguts;
2271
+
2272
+ jq_yyset_extra (yy_user_defined, &dummy_yyguts);
2273
+
2274
+ if (ptr_yy_globals == NULL){
2275
+ errno = EINVAL;
2276
+ return 1;
2277
+ }
2278
+
2279
+ *ptr_yy_globals = (yyscan_t) jq_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2280
+
2281
+ if (*ptr_yy_globals == NULL){
2282
+ errno = ENOMEM;
2283
+ return 1;
2284
+ }
2285
+
2286
+ /* By setting to 0xAA, we expose bugs in
2287
+ yy_init_globals. Leave at 0x00 for releases. */
2288
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2289
+
2290
+ jq_yyset_extra (yy_user_defined, *ptr_yy_globals);
2291
+
2292
+ return yy_init_globals ( *ptr_yy_globals );
2293
+ }
2294
+
2295
+ static int yy_init_globals (yyscan_t yyscanner)
2296
+ {
2297
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2298
+ /* Initialization is the same as for the non-reentrant scanner.
2299
+ * This function is called from jq_yylex_destroy(), so don't allocate here.
2300
+ */
2301
+
2302
+ yyg->yy_buffer_stack = 0;
2303
+ yyg->yy_buffer_stack_top = 0;
2304
+ yyg->yy_buffer_stack_max = 0;
2305
+ yyg->yy_c_buf_p = (char *) 0;
2306
+ yyg->yy_init = 0;
2307
+ yyg->yy_start = 0;
2308
+
2309
+ yyg->yy_start_stack_ptr = 0;
2310
+ yyg->yy_start_stack_depth = 0;
2311
+ yyg->yy_start_stack = NULL;
2312
+
2313
+ /* Defined in main.c */
2314
+ #ifdef YY_STDINIT
2315
+ yyin = stdin;
2316
+ yyout = stdout;
2317
+ #else
2318
+ yyin = (FILE *) 0;
2319
+ yyout = (FILE *) 0;
2320
+ #endif
2321
+
2322
+ /* For future reference: Set errno on error, since we are called by
2323
+ * jq_yylex_init()
2324
+ */
2325
+ return 0;
2326
+ }
2327
+
2328
+ /* jq_yylex_destroy is for both reentrant and non-reentrant scanners. */
2329
+ int jq_yylex_destroy (yyscan_t yyscanner)
2330
+ {
2331
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2332
+
2333
+ /* Pop the buffer stack, destroying each element. */
2334
+ while(YY_CURRENT_BUFFER){
2335
+ jq_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2336
+ YY_CURRENT_BUFFER_LVALUE = NULL;
2337
+ jq_yypop_buffer_state(yyscanner);
2338
+ }
2339
+
2340
+ /* Destroy the stack itself. */
2341
+ jq_yyfree(yyg->yy_buffer_stack ,yyscanner);
2342
+ yyg->yy_buffer_stack = NULL;
2343
+
2344
+ /* Destroy the start condition stack. */
2345
+ jq_yyfree(yyg->yy_start_stack ,yyscanner );
2346
+ yyg->yy_start_stack = NULL;
2347
+
2348
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
2349
+ * jq_yylex() is called, initialization will occur. */
2350
+ yy_init_globals( yyscanner);
2351
+
2352
+ /* Destroy the main struct (reentrant only). */
2353
+ jq_yyfree ( yyscanner , yyscanner );
2354
+ yyscanner = NULL;
2355
+ return 0;
2356
+ }
2357
+
2358
+ /*
2359
+ * Internal utility routines.
2360
+ */
2361
+
2362
+ #ifndef yytext_ptr
2363
+ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2364
+ {
2365
+ register int i;
2366
+ for ( i = 0; i < n; ++i )
2367
+ s1[i] = s2[i];
2368
+ }
2369
+ #endif
2370
+
2371
+ #ifdef YY_NEED_STRLEN
2372
+ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2373
+ {
2374
+ register int n;
2375
+ for ( n = 0; s[n]; ++n )
2376
+ ;
2377
+
2378
+ return n;
2379
+ }
2380
+ #endif
2381
+
2382
+ #define YYTABLES_NAME "yytables"
2383
+
2384
+ #line 129 "lexer.l"
2385
+
2386
+
2387
+ /* perhaps these should be calls... */
2388
+ /*
2389
+ "true" { return TRUE; }
2390
+ "false" { return FALSE; }
2391
+ "null" { return NULL; }
2392
+ */
2393
+ static int try_exit(int c, int state, yyscan_t yyscanner) {
2394
+ char match = 0;
2395
+ int ret;
2396
+ switch (state) {
2397
+ case IN_PAREN: match = ret = ')'; break;
2398
+ case IN_BRACKET: match = ret = ']'; break;
2399
+ case IN_BRACE: match = ret = '}'; break;
2400
+
2401
+ case IN_QQINTERP:
2402
+ match = ')';
2403
+ ret = QQSTRING_INTERP_END;
2404
+ break;
2405
+
2406
+ default:
2407
+ // may not be the best error to give
2408
+ return INVALID_CHARACTER;
2409
+ }
2410
+ assert(match);
2411
+ if (match == c) {
2412
+ yy_pop_state(yyscanner);
2413
+ return ret;
2414
+ } else {
2415
+ // FIXME: should we pop? Give a better error at least
2416
+ return INVALID_CHARACTER;
2417
+ }
2418
+ }
2419
+
2420
+ static int enter(int c, int currstate, yyscan_t yyscanner) {
2421
+ int state = 0;
2422
+ switch (c) {
2423
+ case '(': state = IN_PAREN; break;
2424
+ case '[': state = IN_BRACKET; break;
2425
+ case '{': state = IN_BRACE; break;
2426
+ case QQSTRING_INTERP_START: state = IN_QQINTERP; break;
2427
+ }
2428
+ assert(state);
2429
+ yy_push_state(state, yyscanner);
2430
+ return c;
2431
+ }
2432
+
2433
+ void* jq_yyalloc(size_t sz,void* extra) {
2434
+ return jv_mem_alloc(sz);
2435
+ }
2436
+ void* jq_yyrealloc(void* p,size_t sz,void* extra) {
2437
+ return jv_mem_realloc(p, sz);
2438
+ }
2439
+ void jq_yyfree(void* p,void* extra) {
2440
+ jv_mem_free(p);
2441
+ }
2442
+