summaryrefslogtreecommitdiffstats
path: root/y.tab.h.shipped
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-26 22:48:52 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-26 22:48:52 -0700
commit2df469c3cda02c07f17e65cdaae5d9d16dc6b978 (patch)
treeba88b0ceff362bf8f544fbac9bd389eda7da486a /y.tab.h.shipped
parent644a28827acc238aefcd907820eed3378d41e3eb (diff)
downloadtxr-2df469c3cda02c07f17e65cdaae5d9d16dc6b978.tar.gz
txr-2df469c3cda02c07f17e65cdaae5d9d16dc6b978.tar.bz2
txr-2df469c3cda02c07f17e65cdaae5d9d16dc6b978.zip
New #J syntax for JSON objects in TXR Lisp.
(needs buffer literal error message cleanup) * parser.c (json_s): New symbol variable. (is_balanced_line): Follow braces out of initial state. This concession allows the listener to accept input like #J{"a":"b"}. (me_json): New static function (macro expander). The #J X syntax produces a (json Y) form, with the JSON syntax X translated to a Lisp object Y. If that is evaluated, this macro translates it to (quote Y). (parse_init): initialize json_s variable with interned symbol, and register the json macro. * parser.h (json_s): Declared. (end_of_json): Declared. * parser.l (num_esc): Treat u escape sequences in the same way as x. This function can then be used for handling the \u escapes in JSON string literals. (DIG19, JNUM, JPUNC, NJPUNC): New lex named patterns. (JSON, JLIT): New lex start conditions. (grammar): Recognize #J syntax, mapping to HASH_J token, which transitions into JSON start state. In JSON start state, handle all the elements: numbers, keywords, arrays and objects. Transition into JLIT state. In JLIT start state, handle all the elements of JSON string literals, including surrogate pair escapes. JSON literals share the fallback {UANY} fallback patter with other literals. (end_of_jason): New function. * parser.y (HASH_J, JSKW): New token symbols. (json, json_val, json_vals, json_pairs): New nonterminal symbols, and rules. (i_expr, n_expr): Generate json nonterminal, to hook the stuff into the grammar. (yybadtoken): Handle JKSW and HASH_J tokens. * lex.yy.c.shipped, y.tab.c.shipped, y.tab.h.shipped: Updated.
Diffstat (limited to 'y.tab.h.shipped')
-rw-r--r--y.tab.h.shipped122
1 files changed, 63 insertions, 59 deletions
diff --git a/y.tab.h.shipped b/y.tab.h.shipped
index 82de207d..fb0e5a09 100644
--- a/y.tab.h.shipped
+++ b/y.tab.h.shipped
@@ -46,35 +46,37 @@
HASH_H = 293,
HASH_S = 294,
HASH_R = 295,
- HASH_SEMI = 296,
- HASH_B_QUOTE = 297,
- HASH_N = 298,
- HASH_T = 299,
- WORDS = 300,
- WSPLICE = 301,
- QWORDS = 302,
- QWSPLICE = 303,
- SECRET_ESCAPE_R = 304,
- SECRET_ESCAPE_E = 305,
- SECRET_ESCAPE_I = 306,
- OLD_DOTDOT = 307,
- NUMBER = 308,
- METANUM = 309,
- HASH_N_EQUALS = 310,
- HASH_N_HASH = 311,
- REGCHAR = 312,
- REGTOKEN = 313,
- LITCHAR = 314,
- SPLICE = 315,
- OLD_AT = 316,
- CONSDOT = 317,
- LAMBDOT = 318,
- UREFDOT = 319,
- OREFDOT = 320,
- UOREFDOT = 321,
- LOW = 322,
- ELSE = 323,
- ELIF = 324
+ HASH_J = 296,
+ HASH_SEMI = 297,
+ HASH_B_QUOTE = 298,
+ HASH_N = 299,
+ HASH_T = 300,
+ WORDS = 301,
+ WSPLICE = 302,
+ QWORDS = 303,
+ QWSPLICE = 304,
+ SECRET_ESCAPE_R = 305,
+ SECRET_ESCAPE_E = 306,
+ SECRET_ESCAPE_I = 307,
+ OLD_DOTDOT = 308,
+ NUMBER = 309,
+ METANUM = 310,
+ JSKW = 311,
+ HASH_N_EQUALS = 312,
+ HASH_N_HASH = 313,
+ REGCHAR = 314,
+ REGTOKEN = 315,
+ LITCHAR = 316,
+ SPLICE = 317,
+ OLD_AT = 318,
+ CONSDOT = 319,
+ LAMBDOT = 320,
+ UREFDOT = 321,
+ OREFDOT = 322,
+ UOREFDOT = 323,
+ LOW = 324,
+ ELSE = 325,
+ ELIF = 326
};
#endif
/* Tokens. */
@@ -116,35 +118,37 @@
#define HASH_H 293
#define HASH_S 294
#define HASH_R 295
-#define HASH_SEMI 296
-#define HASH_B_QUOTE 297
-#define HASH_N 298
-#define HASH_T 299
-#define WORDS 300
-#define WSPLICE 301
-#define QWORDS 302
-#define QWSPLICE 303
-#define SECRET_ESCAPE_R 304
-#define SECRET_ESCAPE_E 305
-#define SECRET_ESCAPE_I 306
-#define OLD_DOTDOT 307
-#define NUMBER 308
-#define METANUM 309
-#define HASH_N_EQUALS 310
-#define HASH_N_HASH 311
-#define REGCHAR 312
-#define REGTOKEN 313
-#define LITCHAR 314
-#define SPLICE 315
-#define OLD_AT 316
-#define CONSDOT 317
-#define LAMBDOT 318
-#define UREFDOT 319
-#define OREFDOT 320
-#define UOREFDOT 321
-#define LOW 322
-#define ELSE 323
-#define ELIF 324
+#define HASH_J 296
+#define HASH_SEMI 297
+#define HASH_B_QUOTE 298
+#define HASH_N 299
+#define HASH_T 300
+#define WORDS 301
+#define WSPLICE 302
+#define QWORDS 303
+#define QWSPLICE 304
+#define SECRET_ESCAPE_R 305
+#define SECRET_ESCAPE_E 306
+#define SECRET_ESCAPE_I 307
+#define OLD_DOTDOT 308
+#define NUMBER 309
+#define METANUM 310
+#define JSKW 311
+#define HASH_N_EQUALS 312
+#define HASH_N_HASH 313
+#define REGCHAR 314
+#define REGTOKEN 315
+#define LITCHAR 316
+#define SPLICE 317
+#define OLD_AT 318
+#define CONSDOT 319
+#define LAMBDOT 320
+#define UREFDOT 321
+#define OREFDOT 322
+#define UOREFDOT 323
+#define LOW 324
+#define ELSE 325
+#define ELIF 326
@@ -164,7 +168,7 @@ typedef union YYSTYPE
/* Line 2068 of yacc.c */
-#line 197 "y.tab.h"
+#line 201 "y.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */