···11+#include <stdio.h>
22+#include <stdlib.h>
33+#include <string.h>
44+#include "lexer.h"
55+#include "node.h"
66+#include "parser.h"
77+#include "lexer_adapter.h"
88+/* enable parser debug trace when built with -DYYDEBUG=1 */
99+extern int yydebug;
1010+1111+static char *token_text(const LexResult *lr, int idx) {
1212+ if (!lr || idx < 0 || idx >= (int)lr->ntokens) return NULL;
1313+ int s = lr->tokens[idx].Pos;
1414+ int e = lr->tokens[idx].End;
1515+ int n = e - s;
1616+ char *t = malloc(n + 1);
1717+ if (!t) return NULL;
1818+ memcpy(t, lr->data + s, n);
1919+ t[n] = '\0';
2020+ return t;
2121+}
2222+2323+int main(int argc, char **argv) {
2424+ if (argc < 2) {
2525+ fprintf(stderr, "usage: %s <file>\n", argv[0]);
2626+ return 2;
2727+ }
2828+2929+ int dump_tokens = 0;
3030+ const char *path = NULL;
3131+ if (argc >= 2 && strcmp(argv[1], "--dump-tokens") == 0) {
3232+ if (argc < 3) {
3333+ fprintf(stderr, "usage: %s --dump-tokens <file>\n", argv[0]);
3434+ return 2;
3535+ }
3636+ dump_tokens = 1;
3737+ path = argv[2];
3838+ } else {
3939+ path = argv[1];
4040+ }
4141+4242+ FILE *f = fopen(path, "rb");
4343+ if (!f) { perror("open"); return 2; }
4444+ if (fseek(f, 0, SEEK_END) != 0) { perror("seek"); fclose(f); return 2; }
4545+ long sz = ftell(f);
4646+ if (sz < 0) { perror("tell"); fclose(f); return 2; }
4747+ if (fseek(f, 0, SEEK_SET) != 0) { perror("seek"); fclose(f); return 2; }
4848+ char *buf = malloc((size_t)sz);
4949+ if (!buf) { fclose(f); return 2; }
5050+ if (fread(buf, 1, (size_t)sz, f) != (size_t)sz) { perror("read"); fclose(f); free(buf); return 2; }
5151+ fclose(f);
5252+5353+ void *scanner = create_scanner(buf, (int)sz, path);
5454+ if (!scanner) { fprintf(stderr, "failed to create scanner\n"); free(buf); return 2; }
5555+5656+ void *ast = NULL;
5757+ /* enable runtime parser tracing */
5858+ yydebug = 0;
5959+ int perr = yyparse(&ast, scanner);
6060+ LexResult *lr = scanner_lexresult(scanner);
6161+6262+ /* If user requested token dump, print tokens in the legacy dump format to stdout
6363+ so external comparison scripts can parse them. */
6464+ if (dump_tokens && lr) {
6565+ /* header line (optional) */
6666+ printf("tokens: %zu comments: %zu lines: %zu\n", lr->ntokens, lr->ncomments, lr->nlines);
6767+ for (size_t i = 0; i < lr->ntokens; ++i) {
6868+ char *txt = token_text(lr, (int)i);
6969+ printf("%4zu: sym=%s(%d) pos=%d end=%d txt='%s' prev=%d\n", i, symString(lr->tokens[i].Sym), lr->tokens[i].Sym, lr->tokens[i].Pos, lr->tokens[i].End, txt ? txt : "", lr->tokens[i].Prev);
7070+ free(txt);
7171+ }
7272+ }
7373+7474+ if (perr) {
7575+ fprintf(stderr, "parse failed\n");
7676+ if (lr && lr->errmsg) fprintf(stderr, "lexing failed: %s\n", lr->errmsg);
7777+ if (lr) {
7878+ fprintf(stderr, "tokens: %zu comments: %zu lines: %zu\n", lr->ntokens, lr->ncomments, lr->nlines);
7979+ /* print all tokens for full comparison with legacy lexer */
8080+ for (size_t i = 0; i < lr->ntokens; ++i) {
8181+ char *txt = token_text(lr, (int)i);
8282+ fprintf(stderr, "%4zu: sym=%s(%d) pos=%d end=%d txt='%s' prev=%d\n", i, symString(lr->tokens[i].Sym), lr->tokens[i].Sym, lr->tokens[i].Pos, lr->tokens[i].End, txt ? txt : "", lr->tokens[i].Prev);
8383+ free(txt);
8484+ }
8585+ }
8686+ free_scanner(scanner);
8787+ free(buf);
8888+ return 1;
8989+ }
9090+9191+ if (ast && lr) {
9292+ char *s = node_lisp_format((Node*)ast, lr);
9393+ if (s) {
9494+ puts(s);
9595+ free(s);
9696+ }
9797+ } else if (lr && !dump_tokens) {
9898+ /* only print summary to stdout when not in dump mode */
9999+ printf("got %zu tokens, %zu comments, %zu lines\n", lr->ntokens, lr->ncomments, lr->nlines);
100100+ }
101101+102102+ free_scanner(scanner);
103103+ free(buf);
104104+ return 0;
105105+}
+57
parser/node.h
···11+#ifndef PARSER_NODE_H
22+#define PARSER_NODE_H
33+44+#include <stddef.h>
55+#include "lexer.h"
66+77+typedef enum {
88+ APPLY_NODE,
99+ ARG_NODE,
1010+ ARG_SET_NODE,
1111+ ASSERT_NODE,
1212+ ATTR_PATH_NODE,
1313+ BIND_NODE,
1414+ BINDS_NODE,
1515+ FLOAT_NODE,
1616+ FUNCTION_NODE,
1717+ ID_NODE,
1818+ I_STRING_NODE,
1919+ IF_NODE,
2020+ INHERIT_FROM_NODE,
2121+ INHERIT_LIST_NODE,
2222+ INHERIT_NODE,
2323+ INT_NODE,
2424+ INTERP_NODE,
2525+ LET_NODE,
2626+ LIST_NODE,
2727+ PARENS_NODE,
2828+ PATH_NODE,
2929+ REC_SET_NODE,
3030+ SELECT_NODE,
3131+ SELECT_OR_NODE,
3232+ SET_NODE,
3333+ STRING_NODE,
3434+ TEXT_NODE,
3535+ URI_NODE,
3636+ WITH_NODE,
3737+ OP_NODE
3838+} NodeType;
3939+4040+typedef struct Node {
4141+ NodeType type;
4242+ int token_start;
4343+ int token_end;
4444+ int op; /* operator code for OP_NODE (ASCII or token id) */
4545+ struct Node **children;
4646+ size_t nchildren;
4747+ size_t cchildren;
4848+} Node;
4949+5050+/* Produce a lisp-format string representation of the node using the
5151+ provided LexResult (for token text lookup). Caller must free result. */
5252+char *node_lisp_format(Node *n, LexResult *lr);
5353+5454+/* Return canonical node type name used in legacy lisp format. */
5555+const char *node_type_name(NodeType t);
5656+5757+#endif /* PARSER_NODE_H */
+257
parser/nodetype.c
···11+#include "node.h"
22+#include "parser.h"
33+#include <stdlib.h>
44+#include <string.h>
55+#include <stdio.h>
66+#include <stdarg.h>
77+88+/* forward declaration to satisfy calls before definition */
99+void add_child(Node* parent, Node* child);
1010+1111+Node* new_node(NodeType type, int token_start) {
1212+ Node *n = calloc(1, sizeof(Node));
1313+ n->type = type;
1414+ n->token_start = token_start;
1515+ n->token_end = 0;
1616+ n->op = 0;
1717+ n->children = NULL;
1818+ n->nchildren = n->cchildren = 0;
1919+ return n;
2020+}
2121+2222+Node* new_node1(NodeType type, int token_start, Node* n1) {
2323+ Node *n = new_node(type, token_start);
2424+ add_child(n, n1);
2525+ return n;
2626+}
2727+2828+Node* new_node2(NodeType type, int token_start, Node* n1, Node* n2) {
2929+ Node *n = new_node(type, token_start);
3030+ add_child(n, n1);
3131+ add_child(n, n2);
3232+ return n;
3333+}
3434+3535+Node* new_node3(NodeType type, int token_start, Node* n1, Node* n2, Node* n3) {
3636+ Node *n = new_node(type, token_start);
3737+ add_child(n, n1);
3838+ add_child(n, n2);
3939+ add_child(n, n3);
4040+ return n;
4141+}
4242+4343+void set_node_type(Node* node, NodeType type) {
4444+ if (!node) return;
4545+ node->type = type;
4646+}
4747+4848+void add_child(Node* parent, Node* child) {
4949+ if (!parent || !child) return;
5050+ if (parent->nchildren >= parent->cchildren) {
5151+ size_t nc = parent->cchildren ? parent->cchildren * 2 : 4;
5252+ parent->children = realloc(parent->children, nc * sizeof(Node*));
5353+ parent->cchildren = nc;
5454+ }
5555+ parent->children[parent->nchildren++] = child;
5656+}
5757+5858+void set_token_end(Node* node, int token_end) {
5959+ if (!node) return;
6060+ node->token_end = token_end;
6161+}
6262+6363+/* Operator node helpers required by the generated parser */
6464+Node* op_node1(int op, int token_start, Node* n1) {
6565+ Node *n = new_node(OP_NODE, token_start);
6666+ n->op = op;
6767+ add_child(n, n1);
6868+ return n;
6969+}
7070+7171+Node* op_node2(int op, int token_start, Node* n1, Node* n2) {
7272+ Node *n = new_node(OP_NODE, token_start);
7373+ n->op = op;
7474+ add_child(n, n1);
7575+ add_child(n, n2);
7676+ return n;
7777+}
7878+7979+/* Node type names mapping (partial; mirror legacy names) */
8080+static const char *node_names[] = {
8181+ "apply",
8282+ "arg",
8383+ "argset",
8484+ "assert",
8585+ "attrpath",
8686+ "bind",
8787+ "binds",
8888+ "float",
8989+ "function",
9090+ "id",
9191+ "istring",
9292+ "if",
9393+ "inheritfrom",
9494+ "inheritlist",
9595+ "inherit",
9696+ "int",
9797+ "interp",
9898+ "let",
9999+ "list",
100100+ "parens",
101101+ "path",
102102+ "recset",
103103+ "select",
104104+ "selector",
105105+ "set",
106106+ "string",
107107+ "text",
108108+ "uri",
109109+ "with",
110110+ "op",
111111+};
112112+113113+const char *node_type_name(NodeType t) {
114114+ if ((size_t)t < sizeof(node_names)/sizeof(node_names[0])) return node_names[t];
115115+ return "unknown";
116116+}
117117+118118+/* Helper to get token text from LexResult */
119119+static char *token_text(LexResult *lr, int token_index) {
120120+ if (!lr || token_index < 0 || token_index >= (int)lr->ntokens) {
121121+ char *empty = malloc(1);
122122+ if (empty) empty[0] = '\0';
123123+ return empty;
124124+ }
125125+ int s = lr->tokens[token_index].Pos;
126126+ int e = lr->tokens[token_index].End;
127127+ size_t n = (size_t)(e - s);
128128+ char *tmp = malloc(n+1);
129129+ if (!tmp) return NULL;
130130+ memcpy(tmp, lr->data + s, n);
131131+ tmp[n] = '\0';
132132+ return tmp; /* caller must free */
133133+}
134134+135135+static void appendf(char **outp, size_t *lenp, size_t *capp, const char *fmt, ...) {
136136+ va_list ap;
137137+ va_start(ap, fmt);
138138+ va_list ap2;
139139+ va_copy(ap2, ap);
140140+ int need = vsnprintf(NULL, 0, fmt, ap2);
141141+ va_end(ap2);
142142+ if (need < 0) { va_end(ap); return; }
143143+ if (*lenp + (size_t)need + 1 > *capp) {
144144+ *capp = (*lenp + (size_t)need + 1) * 2;
145145+ *outp = realloc(*outp, *capp);
146146+ }
147147+ vsnprintf(*outp + *lenp, (size_t)need + 1, fmt, ap);
148148+ *lenp += (size_t)need;
149149+ va_end(ap);
150150+}
151151+152152+char *node_lisp_format(Node *n, LexResult *lr) {
153153+ if (!n) return NULL;
154154+ size_t cap = 256;
155155+ char *out = malloc(cap);
156156+ if (!out) return NULL;
157157+ size_t len = 0;
158158+159159+ /* For OP_NODE emit the operator symbol as the node name to match legacy
160160+ output: e.g. '(? <left> <right>)' or '(// <a> <b>)'. If op is 0 use
161161+ the '//' token; if op is a printable ASCII char use that char. */
162162+ if (n->type == OP_NODE) {
163163+ char opname_buf[4] = {0};
164164+ char *optext = NULL;
165165+ const char *oname = NULL;
166166+ if (n->op == 0) {
167167+ oname = "//";
168168+ } else {
169169+ /* Prefer the original token text from the lexer if available
170170+ (covers multi-char tokens like '++', '>=', '!=', etc.). */
171171+ optext = token_text(lr, n->token_start);
172172+ if (optext && optext[0] != '\0') {
173173+ oname = optext;
174174+ } else if (n->op >= 32 && n->op <= 126) {
175175+ opname_buf[0] = (char)n->op;
176176+ opname_buf[1] = '\0';
177177+ oname = opname_buf;
178178+ } else {
179179+ oname = node_type_name(n->type);
180180+ }
181181+ }
182182+ appendf(&out, &len, &cap, "(%s", oname);
183183+ if (optext) free(optext);
184184+ } else {
185185+ appendf(&out, &len, &cap, "(%s", node_type_name(n->type));
186186+ }
187187+188188+ /* Coalesce adjacent TEXT children to preserve original string pieces
189189+ (legacy keeps things like "$CXX" as a single text token). */
190190+ size_t i = 0;
191191+ while (i < n->nchildren) {
192192+ Node *child = n->children[i];
193193+ if (child->type == TEXT_NODE) {
194194+ char *t = token_text(lr, child->token_start);
195195+ if (t) {
196196+ appendf(&out, &len, &cap, " (text \"%s\")", t);
197197+ } else {
198198+ appendf(&out, &len, &cap, " (text \"\")");
199199+ }
200200+ free(t);
201201+ i++;
202202+ } else {
203203+ char *c = node_lisp_format(child, lr);
204204+ appendf(&out, &len, &cap, " %s", c ? c : "");
205205+ free(c);
206206+ i++;
207207+ }
208208+ }
209209+ switch (n->type) {
210210+ case URI_NODE:
211211+ case PATH_NODE:
212212+ case FLOAT_NODE:
213213+ case INT_NODE: {
214214+ char *t = token_text(lr, n->token_start);
215215+ appendf(&out, &len, &cap, " %s", t ? t : "");
216216+ free(t);
217217+ break;
218218+ }
219219+ case ID_NODE: {
220220+ char *t = token_text(lr, n->token_start);
221221+ appendf(&out, &len, &cap, " |%s|", t ? t : "");
222222+ free(t);
223223+ break;
224224+ }
225225+ case TEXT_NODE: {
226226+ char *t = token_text(lr, n->token_start);
227227+ if (t) {
228228+ size_t lt = strlen(t);
229229+ /* If the lexer included surrounding double-quotes, strip them so
230230+ the emitted value matches the legacy TokenString (which returns
231231+ the inner text). */
232232+ if (lt >= 2 && t[0] == '"' && t[lt-1] == '"') {
233233+ t[lt-1] = '\0';
234234+ appendf(&out, &len, &cap, " \"%s\"", t + 1);
235235+ } else if (lt >= 1 && t[0] == '"') {
236236+ /* strip leading quote only */
237237+ appendf(&out, &len, &cap, " \"%s\"", t + 1);
238238+ } else {
239239+ appendf(&out, &len, &cap, " \"%s\"", t);
240240+ }
241241+ } else {
242242+ appendf(&out, &len, &cap, " \"\"");
243243+ }
244244+ free(t);
245245+ break;
246246+ }
247247+ case OP_NODE: {
248248+ /* operator already used as node name; do not append trailing op
249249+ character after the children (legacy prints operator as the
250250+ node name). */
251251+ break;
252252+ }
253253+ default: break;
254254+ }
255255+ appendf(&out, &len, &cap, ")");
256256+ return out;
257257+}
+1866
parser/parser.c
···11+/* A Bison parser, made by GNU Bison 3.8.2. */
22+33+/* Bison implementation for Yacc-like parsers in C
44+55+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
66+ Inc.
77+88+ This program is free software: you can redistribute it and/or modify
99+ it under the terms of the GNU General Public License as published by
1010+ the Free Software Foundation, either version 3 of the License, or
1111+ (at your option) any later version.
1212+1313+ This program is distributed in the hope that it will be useful,
1414+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1515+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616+ GNU General Public License for more details.
1717+1818+ You should have received a copy of the GNU General Public License
1919+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
2020+2121+/* As a special exception, you may create a larger work that contains
2222+ part or all of the Bison parser skeleton and distribute that work
2323+ under terms of your choice, so long as that work isn't itself a
2424+ parser generator using the skeleton or a modified version thereof
2525+ as a parser skeleton. Alternatively, if you modify or redistribute
2626+ the parser skeleton itself, you may (at your option) remove this
2727+ special exception, which will cause the skeleton and the resulting
2828+ Bison output files to be licensed under the GNU General Public
2929+ License without this special exception.
3030+3131+ This special exception was added by the Free Software Foundation in
3232+ version 2.2 of Bison. */
3333+3434+/* C LALR(1) parser skeleton written by Richard Stallman, by
3535+ simplifying the original so-called "semantic" parser. */
3636+3737+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
3838+ especially those whose name start with YY_ or yy_. They are
3939+ private implementation details that can be changed or removed. */
4040+4141+/* All symbols defined below should begin with yy or YY, to avoid
4242+ infringing on user name space. This should be done even for local
4343+ variables, as they might otherwise be expanded by user macros.
4444+ There are some unavoidable exceptions within include files to
4545+ define necessary library symbols; they are noted "INFRINGES ON
4646+ USER NAME SPACE" below. */
4747+4848+/* Identify Bison output, and Bison version. */
4949+#define YYBISON 30802
5050+5151+/* Bison version string. */
5252+#define YYBISON_VERSION "3.8.2"
5353+5454+/* Skeleton name. */
5555+#define YYSKELETON_NAME "yacc.c"
5656+5757+/* Pure parsers. */
5858+#define YYPURE 2
5959+6060+/* Push parsers. */
6161+#define YYPUSH 0
6262+6363+/* Pull parsers. */
6464+#define YYPULL 1
6565+6666+6767+6868+6969+/* First part of user prologue. */
7070+#line 1 "parser/parser.y"
7171+7272+#include "node.h"
7373+#include "lexer.h"
7474+#include <stdio.h>
7575+#include <stdlib.h>
7676+7777+/* Forward declarations of node helpers implemented in parser/nodetype.c */
7878+Node* new_node(NodeType type, int token_start);
7979+Node* new_node1(NodeType type, int token_start, Node* n1);
8080+Node* new_node2(NodeType type, int token_start, Node* n1, Node* n2);
8181+Node* new_node3(NodeType type, int token_start, Node* n1, Node* n2, Node* n3);
8282+Node* op_node1(int op, int token_start, Node* n1);
8383+Node* op_node2(int op, int token_start, Node* n1, Node* n2);
8484+void set_node_type(Node* node, NodeType type);
8585+void add_child(Node* parent, Node* child);
8686+void set_token_end(Node* node, int token_end);
8787+8888+/* yyerror matching the generated parser expectations */
8989+void yyerror(void **ast_root, void *scanner, const char *s) {
9090+ (void)ast_root; (void)scanner;
9191+ fprintf(stderr, "parse error: %s\n", s);
9292+}
9393+9494+/* yylex prototype using void* so it's visible before YYSTYPE is defined in the generated file */
9595+int yylex(void *yylval_param, void *scanner);
9696+9797+9898+#line 99 "parser/parser.c"
9999+100100+# ifndef YY_CAST
101101+# ifdef __cplusplus
102102+# define YY_CAST(Type, Val) static_cast<Type> (Val)
103103+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
104104+# else
105105+# define YY_CAST(Type, Val) ((Type) (Val))
106106+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
107107+# endif
108108+# endif
109109+# ifndef YY_NULLPTR
110110+# if defined __cplusplus
111111+# if 201103L <= __cplusplus
112112+# define YY_NULLPTR nullptr
113113+# else
114114+# define YY_NULLPTR 0
115115+# endif
116116+# else
117117+# define YY_NULLPTR ((void*)0)
118118+# endif
119119+# endif
120120+121121+#include "parser.h"
122122+/* Symbol kind. */
123123+enum yysymbol_kind_t
124124+{
125125+ YYSYMBOL_YYEMPTY = -2,
126126+ YYSYMBOL_YYEOF = 0, /* "end of file" */
127127+ YYSYMBOL_YYerror = 1, /* error */
128128+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
129129+ YYSYMBOL_ASSERT_ = 3, /* ASSERT_ */
130130+ YYSYMBOL_IF_ = 4, /* IF_ */
131131+ YYSYMBOL_THEN = 5, /* THEN */
132132+ YYSYMBOL_ELSE_ = 6, /* ELSE_ */
133133+ YYSYMBOL_LET = 7, /* LET */
134134+ YYSYMBOL_IN = 8, /* IN */
135135+ YYSYMBOL_WITH = 9, /* WITH */
136136+ YYSYMBOL_OR_ = 10, /* OR_ */
137137+ YYSYMBOL_REC = 11, /* REC */
138138+ YYSYMBOL_INHERIT = 12, /* INHERIT */
139139+ YYSYMBOL_ELLIPSIS = 13, /* ELLIPSIS */
140140+ YYSYMBOL_INTERP = 14, /* INTERP */
141141+ YYSYMBOL_SPACE = 15, /* SPACE */
142142+ YYSYMBOL_COMMENT = 16, /* COMMENT */
143143+ YYSYMBOL_II = 17, /* II */
144144+ YYSYMBOL_URI = 18, /* URI */
145145+ YYSYMBOL_PATH = 19, /* PATH */
146146+ YYSYMBOL_FLOAT = 20, /* FLOAT */
147147+ YYSYMBOL_INT_ = 21, /* INT_ */
148148+ YYSYMBOL_T_ID = 22, /* T_ID */
149149+ YYSYMBOL_TEXT = 23, /* TEXT */
150150+ YYSYMBOL_ARG_ID = 24, /* ARG_ID */
151151+ YYSYMBOL_ARG_BRACKET = 25, /* ARG_BRACKET */
152152+ YYSYMBOL_26_ = 26, /* ':' */
153153+ YYSYMBOL_27_ = 27, /* '@' */
154154+ YYSYMBOL_28_ = 28, /* ',' */
155155+ YYSYMBOL_29_ = 29, /* ';' */
156156+ YYSYMBOL_30_ = 30, /* '"' */
157157+ YYSYMBOL_31_ = 31, /* '.' */
158158+ YYSYMBOL_32_ = 32, /* '(' */
159159+ YYSYMBOL_33_ = 33, /* ')' */
160160+ YYSYMBOL_34_ = 34, /* '[' */
161161+ YYSYMBOL_35_ = 35, /* ']' */
162162+ YYSYMBOL_36_ = 36, /* '{' */
163163+ YYSYMBOL_37_ = 37, /* '}' */
164164+ YYSYMBOL_38_ = 38, /* '=' */
165165+ YYSYMBOL_IMPL = 39, /* IMPL */
166166+ YYSYMBOL_OR = 40, /* OR */
167167+ YYSYMBOL_AND = 41, /* AND */
168168+ YYSYMBOL_EQ = 42, /* EQ */
169169+ YYSYMBOL_NEQ = 43, /* NEQ */
170170+ YYSYMBOL_44_ = 44, /* '<' */
171171+ YYSYMBOL_45_ = 45, /* '>' */
172172+ YYSYMBOL_LEQ = 46, /* LEQ */
173173+ YYSYMBOL_GEQ = 47, /* GEQ */
174174+ YYSYMBOL_UPDATE = 48, /* UPDATE */
175175+ YYSYMBOL_49_ = 49, /* '!' */
176176+ YYSYMBOL_50_ = 50, /* '+' */
177177+ YYSYMBOL_51_ = 51, /* '-' */
178178+ YYSYMBOL_52_ = 52, /* '*' */
179179+ YYSYMBOL_53_ = 53, /* '/' */
180180+ YYSYMBOL_CONCAT = 54, /* CONCAT */
181181+ YYSYMBOL_55_ = 55, /* '?' */
182182+ YYSYMBOL_NEGATE = 56, /* NEGATE */
183183+ YYSYMBOL_YYACCEPT = 57, /* $accept */
184184+ YYSYMBOL_Main = 58, /* Main */
185185+ YYSYMBOL_Expression = 59, /* Expression */
186186+ YYSYMBOL_Interp = 60, /* Interp */
187187+ YYSYMBOL_String = 61, /* String */
188188+ YYSYMBOL_ID = 62, /* ID */
189189+ YYSYMBOL_Atom = 63, /* Atom */
190190+ YYSYMBOL_Select = 64, /* Select */
191191+ YYSYMBOL_Apply = 65, /* Apply */
192192+ YYSYMBOL_Op = 66, /* Op */
193193+ YYSYMBOL_InterpID = 67, /* InterpID */
194194+ YYSYMBOL_AttrPath = 68, /* AttrPath */
195195+ YYSYMBOL_List = 69, /* List */
196196+ YYSYMBOL_Binds = 70, /* Binds */
197197+ YYSYMBOL_InheritList = 71, /* InheritList */
198198+ YYSYMBOL_Function = 72, /* Function */
199199+ YYSYMBOL_ArgSet = 73, /* ArgSet */
200200+ YYSYMBOL_Arg = 74 /* Arg */
201201+};
202202+typedef enum yysymbol_kind_t yysymbol_kind_t;
203203+204204+205205+206206+207207+#ifdef short
208208+# undef short
209209+#endif
210210+211211+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
212212+ <limits.h> and (if available) <stdint.h> are included
213213+ so that the code can choose integer types of a good width. */
214214+215215+#ifndef __PTRDIFF_MAX__
216216+# include <limits.h> /* INFRINGES ON USER NAME SPACE */
217217+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
218218+# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
219219+# define YY_STDINT_H
220220+# endif
221221+#endif
222222+223223+/* Narrow types that promote to a signed type and that can represent a
224224+ signed or unsigned integer of at least N bits. In tables they can
225225+ save space and decrease cache pressure. Promoting to a signed type
226226+ helps avoid bugs in integer arithmetic. */
227227+228228+#ifdef __INT_LEAST8_MAX__
229229+typedef __INT_LEAST8_TYPE__ yytype_int8;
230230+#elif defined YY_STDINT_H
231231+typedef int_least8_t yytype_int8;
232232+#else
233233+typedef signed char yytype_int8;
234234+#endif
235235+236236+#ifdef __INT_LEAST16_MAX__
237237+typedef __INT_LEAST16_TYPE__ yytype_int16;
238238+#elif defined YY_STDINT_H
239239+typedef int_least16_t yytype_int16;
240240+#else
241241+typedef short yytype_int16;
242242+#endif
243243+244244+/* Work around bug in HP-UX 11.23, which defines these macros
245245+ incorrectly for preprocessor constants. This workaround can likely
246246+ be removed in 2023, as HPE has promised support for HP-UX 11.23
247247+ (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
248248+ <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
249249+#ifdef __hpux
250250+# undef UINT_LEAST8_MAX
251251+# undef UINT_LEAST16_MAX
252252+# define UINT_LEAST8_MAX 255
253253+# define UINT_LEAST16_MAX 65535
254254+#endif
255255+256256+#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
257257+typedef __UINT_LEAST8_TYPE__ yytype_uint8;
258258+#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
259259+ && UINT_LEAST8_MAX <= INT_MAX)
260260+typedef uint_least8_t yytype_uint8;
261261+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
262262+typedef unsigned char yytype_uint8;
263263+#else
264264+typedef short yytype_uint8;
265265+#endif
266266+267267+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
268268+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
269269+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
270270+ && UINT_LEAST16_MAX <= INT_MAX)
271271+typedef uint_least16_t yytype_uint16;
272272+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
273273+typedef unsigned short yytype_uint16;
274274+#else
275275+typedef int yytype_uint16;
276276+#endif
277277+278278+#ifndef YYPTRDIFF_T
279279+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
280280+# define YYPTRDIFF_T __PTRDIFF_TYPE__
281281+# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
282282+# elif defined PTRDIFF_MAX
283283+# ifndef ptrdiff_t
284284+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
285285+# endif
286286+# define YYPTRDIFF_T ptrdiff_t
287287+# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
288288+# else
289289+# define YYPTRDIFF_T long
290290+# define YYPTRDIFF_MAXIMUM LONG_MAX
291291+# endif
292292+#endif
293293+294294+#ifndef YYSIZE_T
295295+# ifdef __SIZE_TYPE__
296296+# define YYSIZE_T __SIZE_TYPE__
297297+# elif defined size_t
298298+# define YYSIZE_T size_t
299299+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
300300+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
301301+# define YYSIZE_T size_t
302302+# else
303303+# define YYSIZE_T unsigned
304304+# endif
305305+#endif
306306+307307+#define YYSIZE_MAXIMUM \
308308+ YY_CAST (YYPTRDIFF_T, \
309309+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
310310+ ? YYPTRDIFF_MAXIMUM \
311311+ : YY_CAST (YYSIZE_T, -1)))
312312+313313+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
314314+315315+316316+/* Stored state numbers (used for stacks). */
317317+typedef yytype_uint8 yy_state_t;
318318+319319+/* State numbers in computations. */
320320+typedef int yy_state_fast_t;
321321+322322+#ifndef YY_
323323+# if defined YYENABLE_NLS && YYENABLE_NLS
324324+# if ENABLE_NLS
325325+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
326326+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
327327+# endif
328328+# endif
329329+# ifndef YY_
330330+# define YY_(Msgid) Msgid
331331+# endif
332332+#endif
333333+334334+335335+#ifndef YY_ATTRIBUTE_PURE
336336+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
337337+# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
338338+# else
339339+# define YY_ATTRIBUTE_PURE
340340+# endif
341341+#endif
342342+343343+#ifndef YY_ATTRIBUTE_UNUSED
344344+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
345345+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
346346+# else
347347+# define YY_ATTRIBUTE_UNUSED
348348+# endif
349349+#endif
350350+351351+/* Suppress unused-variable warnings by "using" E. */
352352+#if ! defined lint || defined __GNUC__
353353+# define YY_USE(E) ((void) (E))
354354+#else
355355+# define YY_USE(E) /* empty */
356356+#endif
357357+358358+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
359359+#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
360360+# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
361361+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
362362+ _Pragma ("GCC diagnostic push") \
363363+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
364364+# else
365365+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
366366+ _Pragma ("GCC diagnostic push") \
367367+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
368368+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
369369+# endif
370370+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
371371+ _Pragma ("GCC diagnostic pop")
372372+#else
373373+# define YY_INITIAL_VALUE(Value) Value
374374+#endif
375375+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
376376+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
377377+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
378378+#endif
379379+#ifndef YY_INITIAL_VALUE
380380+# define YY_INITIAL_VALUE(Value) /* Nothing. */
381381+#endif
382382+383383+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
384384+# define YY_IGNORE_USELESS_CAST_BEGIN \
385385+ _Pragma ("GCC diagnostic push") \
386386+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
387387+# define YY_IGNORE_USELESS_CAST_END \
388388+ _Pragma ("GCC diagnostic pop")
389389+#endif
390390+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
391391+# define YY_IGNORE_USELESS_CAST_BEGIN
392392+# define YY_IGNORE_USELESS_CAST_END
393393+#endif
394394+395395+396396+#define YY_ASSERT(E) ((void) (0 && (E)))
397397+398398+#if !defined yyoverflow
399399+400400+/* The parser invokes alloca or malloc; define the necessary symbols. */
401401+402402+# ifdef YYSTACK_USE_ALLOCA
403403+# if YYSTACK_USE_ALLOCA
404404+# ifdef __GNUC__
405405+# define YYSTACK_ALLOC __builtin_alloca
406406+# elif defined __BUILTIN_VA_ARG_INCR
407407+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
408408+# elif defined _AIX
409409+# define YYSTACK_ALLOC __alloca
410410+# elif defined _MSC_VER
411411+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
412412+# define alloca _alloca
413413+# else
414414+# define YYSTACK_ALLOC alloca
415415+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
416416+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
417417+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
418418+# ifndef EXIT_SUCCESS
419419+# define EXIT_SUCCESS 0
420420+# endif
421421+# endif
422422+# endif
423423+# endif
424424+# endif
425425+426426+# ifdef YYSTACK_ALLOC
427427+ /* Pacify GCC's 'empty if-body' warning. */
428428+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
429429+# ifndef YYSTACK_ALLOC_MAXIMUM
430430+ /* The OS might guarantee only one guard page at the bottom of the stack,
431431+ and a page size can be as small as 4096 bytes. So we cannot safely
432432+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
433433+ to allow for a few compiler-allocated temporary stack slots. */
434434+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
435435+# endif
436436+# else
437437+# define YYSTACK_ALLOC YYMALLOC
438438+# define YYSTACK_FREE YYFREE
439439+# ifndef YYSTACK_ALLOC_MAXIMUM
440440+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
441441+# endif
442442+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
443443+ && ! ((defined YYMALLOC || defined malloc) \
444444+ && (defined YYFREE || defined free)))
445445+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
446446+# ifndef EXIT_SUCCESS
447447+# define EXIT_SUCCESS 0
448448+# endif
449449+# endif
450450+# ifndef YYMALLOC
451451+# define YYMALLOC malloc
452452+# if ! defined malloc && ! defined EXIT_SUCCESS
453453+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
454454+# endif
455455+# endif
456456+# ifndef YYFREE
457457+# define YYFREE free
458458+# if ! defined free && ! defined EXIT_SUCCESS
459459+void free (void *); /* INFRINGES ON USER NAME SPACE */
460460+# endif
461461+# endif
462462+# endif
463463+#endif /* !defined yyoverflow */
464464+465465+#if (! defined yyoverflow \
466466+ && (! defined __cplusplus \
467467+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
468468+469469+/* A type that is properly aligned for any stack member. */
470470+union yyalloc
471471+{
472472+ yy_state_t yyss_alloc;
473473+ YYSTYPE yyvs_alloc;
474474+};
475475+476476+/* The size of the maximum gap between one aligned stack and the next. */
477477+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
478478+479479+/* The size of an array large to enough to hold all stacks, each with
480480+ N elements. */
481481+# define YYSTACK_BYTES(N) \
482482+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
483483+ + YYSTACK_GAP_MAXIMUM)
484484+485485+# define YYCOPY_NEEDED 1
486486+487487+/* Relocate STACK from its old location to the new one. The
488488+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
489489+ elements in the stack, and YYPTR gives the new location of the
490490+ stack. Advance YYPTR to a properly aligned location for the next
491491+ stack. */
492492+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
493493+ do \
494494+ { \
495495+ YYPTRDIFF_T yynewbytes; \
496496+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
497497+ Stack = &yyptr->Stack_alloc; \
498498+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
499499+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
500500+ } \
501501+ while (0)
502502+503503+#endif
504504+505505+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
506506+/* Copy COUNT objects from SRC to DST. The source and destination do
507507+ not overlap. */
508508+# ifndef YYCOPY
509509+# if defined __GNUC__ && 1 < __GNUC__
510510+# define YYCOPY(Dst, Src, Count) \
511511+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
512512+# else
513513+# define YYCOPY(Dst, Src, Count) \
514514+ do \
515515+ { \
516516+ YYPTRDIFF_T yyi; \
517517+ for (yyi = 0; yyi < (Count); yyi++) \
518518+ (Dst)[yyi] = (Src)[yyi]; \
519519+ } \
520520+ while (0)
521521+# endif
522522+# endif
523523+#endif /* !YYCOPY_NEEDED */
524524+525525+/* YYFINAL -- State number of the termination state. */
526526+#define YYFINAL 46
527527+/* YYLAST -- Last index in YYTABLE. */
528528+#define YYLAST 293
529529+530530+/* YYNTOKENS -- Number of terminals. */
531531+#define YYNTOKENS 57
532532+/* YYNNTS -- Number of nonterminals. */
533533+#define YYNNTS 18
534534+/* YYNRULES -- Number of rules. */
535535+#define YYNRULES 73
536536+/* YYNSTATES -- Number of states. */
537537+#define YYNSTATES 149
538538+539539+/* YYMAXUTOK -- Last valid token kind. */
540540+#define YYMAXUTOK 290
541541+542542+543543+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
544544+ as returned by yylex, with out-of-bounds checking. */
545545+#define YYTRANSLATE(YYX) \
546546+ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
547547+ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
548548+ : YYSYMBOL_YYUNDEF)
549549+550550+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
551551+ as returned by yylex. */
552552+static const yytype_int8 yytranslate[] =
553553+{
554554+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555555+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556556+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557557+ 2, 2, 2, 49, 30, 2, 2, 2, 2, 2,
558558+ 32, 33, 52, 50, 28, 51, 31, 53, 2, 2,
559559+ 2, 2, 2, 2, 2, 2, 2, 2, 26, 29,
560560+ 44, 38, 45, 55, 27, 2, 2, 2, 2, 2,
561561+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562562+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563563+ 2, 34, 2, 35, 2, 2, 2, 2, 2, 2,
564564+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565565+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566566+ 2, 2, 2, 36, 2, 37, 2, 2, 2, 2,
567567+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568568+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569569+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570570+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571571+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572572+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573573+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574574+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575575+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576576+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577577+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578578+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579579+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
580580+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
581581+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
582582+ 25, 39, 40, 41, 42, 43, 46, 47, 48, 54,
583583+ 56
584584+};
585585+586586+#if YYDEBUG
587587+/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
588588+static const yytype_uint8 yyrline[] =
589589+{
590590+ 0, 66, 66, 71, 72, 74, 76, 78, 80, 84,
591591+ 90, 91, 93, 98, 103, 105, 107, 109, 111, 112,
592592+ 114, 116, 118, 120, 122, 127, 128, 130, 135, 136,
593593+ 141, 142, 144, 146, 148, 150, 152, 154, 156, 158,
594594+ 160, 162, 164, 166, 168, 170, 172, 174, 176, 181,
595595+ 182, 184, 185, 190, 192, 198, 199, 205, 206, 208,
596596+ 210, 216, 217, 222, 224, 226, 228, 230, 236, 237,
597597+ 239, 241, 246, 248
598598+};
599599+#endif
600600+601601+/** Accessing symbol of state STATE. */
602602+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
603603+604604+#if YYDEBUG || 0
605605+/* The user-facing name of the symbol whose (internal) number is
606606+ YYSYMBOL. No bounds checking. */
607607+static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
608608+609609+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
610610+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
611611+static const char *const yytname[] =
612612+{
613613+ "\"end of file\"", "error", "\"invalid token\"", "ASSERT_", "IF_",
614614+ "THEN", "ELSE_", "LET", "IN", "WITH", "OR_", "REC", "INHERIT",
615615+ "ELLIPSIS", "INTERP", "SPACE", "COMMENT", "II", "URI", "PATH", "FLOAT",
616616+ "INT_", "T_ID", "TEXT", "ARG_ID", "ARG_BRACKET", "':'", "'@'", "','",
617617+ "';'", "'\"'", "'.'", "'('", "')'", "'['", "']'", "'{'", "'}'", "'='",
618618+ "IMPL", "OR", "AND", "EQ", "NEQ", "'<'", "'>'", "LEQ", "GEQ", "UPDATE",
619619+ "'!'", "'+'", "'-'", "'*'", "'/'", "CONCAT", "'?'", "NEGATE", "$accept",
620620+ "Main", "Expression", "Interp", "String", "ID", "Atom", "Select",
621621+ "Apply", "Op", "InterpID", "AttrPath", "List", "Binds", "InheritList",
622622+ "Function", "ArgSet", "Arg", YY_NULLPTR
623623+};
624624+625625+static const char *
626626+yysymbol_name (yysymbol_kind_t yysymbol)
627627+{
628628+ return yytname[yysymbol];
629629+}
630630+#endif
631631+632632+#define YYPACT_NINF (-91)
633633+634634+#define yypact_value_is_default(Yyn) \
635635+ ((Yyn) == YYPACT_NINF)
636636+637637+#define YYTABLE_NINF (-1)
638638+639639+#define yytable_value_is_error(Yyn) \
640640+ ((Yyn) == YYTABLE_NINF)
641641+642642+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
643643+ STATE-NUM. */
644644+static const yytype_int16 yypact[] =
645645+{
646646+ 127, 127, 127, -91, 127, -18, -91, -91, -91, -91,
647647+ -91, -91, 65, 13, -91, 127, -91, -91, 147, 147,
648648+ 24, -91, -91, 25, -91, 189, 187, -91, 8, 56,
649649+ 86, 43, -91, 76, 127, 63, -91, 40, 75, 74,
650650+ 6, 81, 169, 48, 120, -91, -91, 95, -91, 147,
651651+ 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
652652+ 147, 147, 147, 147, 95, 127, 127, 127, -91, 89,
653653+ 127, -91, -91, -91, -91, 36, 127, 67, -91, -91,
654654+ -91, -91, 13, 127, 96, 13, -91, -91, -91, -91,
655655+ -91, -3, 187, 202, 216, 230, 230, 238, 238, 238,
656656+ 238, 238, 101, 101, 29, 29, 29, 87, -91, 122,
657657+ -91, 127, 1, 92, 57, 95, 127, -91, -91, 100,
658658+ -91, 127, 35, -91, 189, 127, 99, -91, -91, -91,
659659+ -91, -91, 104, 113, -91, 117, 124, -91, -91, -91,
660660+ -91, 127, 127, 127, 97, -91, -91, -91, -91
661661+};
662662+663663+/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
664664+ Performed when YYTABLE does not specify something else to do. Zero
665665+ means the default is an error. */
666666+static const yytype_int8 yydefact[] =
667667+{
668668+ 0, 0, 0, 57, 0, 0, 10, 14, 15, 16,
669669+ 17, 13, 0, 68, 10, 0, 55, 57, 0, 0,
670670+ 0, 2, 18, 25, 28, 30, 3, 8, 0, 0,
671671+ 0, 0, 57, 0, 0, 0, 70, 72, 0, 69,
672672+ 0, 0, 0, 0, 38, 31, 1, 0, 29, 0,
673673+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
674674+ 0, 0, 0, 0, 0, 0, 0, 0, 50, 61,
675675+ 0, 10, 51, 49, 53, 0, 0, 0, 20, 11,
676676+ 12, 63, 68, 0, 0, 68, 19, 21, 22, 56,
677677+ 23, 26, 48, 47, 46, 45, 44, 43, 42, 41,
678678+ 40, 39, 37, 36, 35, 34, 33, 32, 4, 0,
679679+ 6, 0, 0, 0, 0, 0, 0, 7, 24, 0,
680680+ 73, 0, 0, 71, 0, 0, 0, 59, 62, 9,
681681+ 52, 54, 0, 0, 64, 0, 0, 27, 5, 61,
682682+ 58, 0, 0, 0, 0, 65, 67, 66, 60
683683+};
684684+685685+/* YYPGOTO[NTERM-NUM]. */
686686+static const yytype_int8 yypgoto[] =
687687+{
688688+ -91, -91, -1, -28, -8, -9, -91, -23, -91, -10,
689689+ -90, -37, -91, 0, 21, -91, -69, -91
690690+};
691691+692692+/* YYDEFGOTO[NTERM-NUM]. */
693693+static const yytype_int8 yydefgoto[] =
694694+{
695695+ 0, 20, 21, 72, 33, 22, 23, 24, 25, 26,
696696+ 74, 75, 42, 30, 112, 27, 38, 39
697697+};
698698+699699+/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
700700+ positive, shift that token. If negative, reduce the rule whose
701701+ number is the opposite. If YYTABLE_NINF, syntax error. */
702702+static const yytype_int16 yytable[] =
703703+{
704704+ 28, 29, 48, 31, 37, 80, 40, 124, 44, 45,
705705+ 91, 68, 80, 119, 41, 70, 123, 43, 32, 89,
706706+ 70, 73, 128, 11, 46, 131, 36, 107, 115, 79,
707707+ 127, 71, 77, 81, 73, 11, 86, 65, 73, 92,
708708+ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
709709+ 103, 104, 105, 106, 128, 73, 47, 11, 68, 135,
710710+ 69, 66, 70, 114, 108, 109, 110, 115, 73, 113,
711711+ 11, 70, 76, 37, 116, 117, 37, 68, 71, 69,
712712+ 79, 70, 120, 63, 64, 90, 80, 130, 82, 11,
713713+ 70, 34, 35, 78, 67, 83, 68, 71, 69, 79,
714714+ 70, 137, 85, 73, 118, 68, 73, 68, 11, 70,
715715+ 126, 70, 84, 136, 87, 132, 71, 11, 115, 11,
716716+ 134, 111, 121, 122, 138, 71, 148, 71, 125, 129,
717717+ 1, 2, 139, 140, 3, 73, 4, 133, 5, 141,
718718+ 145, 146, 147, 142, 6, 7, 8, 9, 10, 11,
719719+ 143, 12, 13, 61, 62, 63, 64, 14, 5, 15,
720720+ 144, 16, 0, 17, 6, 7, 8, 9, 10, 11,
721721+ 59, 60, 61, 62, 63, 64, 18, 14, 19, 15,
722722+ 5, 16, 0, 17, 0, 0, 6, 7, 8, 9,
723723+ 10, 11, 0, 0, 0, 0, 18, 0, 19, 14,
724724+ 5, 15, 0, 16, 88, 17, 6, 7, 8, 9,
725725+ 10, 11, 0, 0, 0, 0, 0, 0, 0, 14,
726726+ 0, 15, 0, 16, 0, 17, 49, 50, 51, 52,
727727+ 53, 54, 55, 56, 57, 58, 0, 59, 60, 61,
728728+ 62, 63, 64, 51, 52, 53, 54, 55, 56, 57,
729729+ 58, 0, 59, 60, 61, 62, 63, 64, 52, 53,
730730+ 54, 55, 56, 57, 58, 0, 59, 60, 61, 62,
731731+ 63, 64, -1, -1, 54, 55, 56, 57, 58, 0,
732732+ 59, 60, 61, 62, 63, 64, 58, 0, 59, 60,
733733+ 61, 62, 63, 64
734734+};
735735+736736+static const yytype_int16 yycheck[] =
737737+{
738738+ 1, 2, 25, 4, 13, 33, 14, 10, 18, 19,
739739+ 47, 10, 40, 82, 15, 14, 85, 17, 36, 42,
740740+ 14, 30, 112, 22, 0, 115, 13, 64, 31, 23,
741741+ 29, 30, 32, 34, 43, 22, 30, 29, 47, 49,
742742+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
743743+ 60, 61, 62, 63, 144, 64, 31, 22, 10, 24,
744744+ 12, 5, 14, 71, 65, 66, 67, 31, 77, 70,
745745+ 22, 14, 29, 82, 38, 76, 85, 10, 30, 12,
746746+ 23, 14, 83, 54, 55, 37, 114, 30, 25, 22,
747747+ 14, 26, 27, 17, 8, 55, 10, 30, 12, 23,
748748+ 14, 124, 28, 112, 37, 10, 115, 10, 22, 14,
749749+ 111, 14, 37, 122, 33, 116, 30, 22, 31, 22,
750750+ 121, 32, 26, 27, 125, 30, 29, 30, 6, 37,
751751+ 3, 4, 33, 29, 7, 144, 9, 37, 11, 26,
752752+ 141, 142, 143, 26, 17, 18, 19, 20, 21, 22,
753753+ 26, 24, 25, 52, 53, 54, 55, 30, 11, 32,
754754+ 139, 34, -1, 36, 17, 18, 19, 20, 21, 22,
755755+ 50, 51, 52, 53, 54, 55, 49, 30, 51, 32,
756756+ 11, 34, -1, 36, -1, -1, 17, 18, 19, 20,
757757+ 21, 22, -1, -1, -1, -1, 49, -1, 51, 30,
758758+ 11, 32, -1, 34, 35, 36, 17, 18, 19, 20,
759759+ 21, 22, -1, -1, -1, -1, -1, -1, -1, 30,
760760+ -1, 32, -1, 34, -1, 36, 39, 40, 41, 42,
761761+ 43, 44, 45, 46, 47, 48, -1, 50, 51, 52,
762762+ 53, 54, 55, 41, 42, 43, 44, 45, 46, 47,
763763+ 48, -1, 50, 51, 52, 53, 54, 55, 42, 43,
764764+ 44, 45, 46, 47, 48, -1, 50, 51, 52, 53,
765765+ 54, 55, 42, 43, 44, 45, 46, 47, 48, -1,
766766+ 50, 51, 52, 53, 54, 55, 48, -1, 50, 51,
767767+ 52, 53, 54, 55
768768+};
769769+770770+/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
771771+ state STATE-NUM. */
772772+static const yytype_int8 yystos[] =
773773+{
774774+ 0, 3, 4, 7, 9, 11, 17, 18, 19, 20,
775775+ 21, 22, 24, 25, 30, 32, 34, 36, 49, 51,
776776+ 58, 59, 62, 63, 64, 65, 66, 72, 59, 59,
777777+ 70, 59, 36, 61, 26, 27, 13, 62, 73, 74,
778778+ 61, 59, 69, 70, 66, 66, 0, 31, 64, 39,
779779+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 50,
780780+ 51, 52, 53, 54, 55, 29, 5, 8, 10, 12,
781781+ 14, 30, 60, 62, 67, 68, 29, 70, 17, 23,
782782+ 60, 59, 25, 55, 37, 28, 30, 33, 35, 64,
783783+ 37, 68, 66, 66, 66, 66, 66, 66, 66, 66,
784784+ 66, 66, 66, 66, 66, 66, 66, 68, 59, 59,
785785+ 59, 32, 71, 59, 61, 31, 38, 59, 37, 73,
786786+ 59, 26, 27, 73, 10, 6, 59, 29, 67, 37,
787787+ 30, 67, 59, 37, 59, 24, 62, 64, 59, 33,
788788+ 29, 26, 26, 26, 71, 59, 59, 59, 29
789789+};
790790+791791+/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
792792+static const yytype_int8 yyr1[] =
793793+{
794794+ 0, 57, 58, 59, 59, 59, 59, 59, 59, 60,
795795+ 61, 61, 61, 62, 63, 63, 63, 63, 63, 63,
796796+ 63, 63, 63, 63, 63, 64, 64, 64, 65, 65,
797797+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
798798+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 67,
799799+ 67, 67, 67, 68, 68, 69, 69, 70, 70, 70,
800800+ 70, 71, 71, 72, 72, 72, 72, 72, 73, 73,
801801+ 73, 73, 74, 74
802802+};
803803+804804+/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
805805+static const yytype_int8 yyr2[] =
806806+{
807807+ 0, 2, 1, 1, 4, 6, 4, 4, 1, 3,
808808+ 0, 2, 2, 1, 1, 1, 1, 1, 1, 3,
809809+ 3, 3, 3, 3, 4, 1, 3, 5, 1, 2,
810810+ 1, 2, 3, 3, 3, 3, 3, 3, 2, 3,
811811+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
812812+ 1, 1, 3, 1, 3, 0, 2, 0, 5, 4,
813813+ 7, 0, 2, 3, 5, 7, 7, 7, 0, 1,
814814+ 1, 3, 1, 3
815815+};
816816+817817+818818+enum { YYENOMEM = -2 };
819819+820820+#define yyerrok (yyerrstatus = 0)
821821+#define yyclearin (yychar = YYEMPTY)
822822+823823+#define YYACCEPT goto yyacceptlab
824824+#define YYABORT goto yyabortlab
825825+#define YYERROR goto yyerrorlab
826826+#define YYNOMEM goto yyexhaustedlab
827827+828828+829829+#define YYRECOVERING() (!!yyerrstatus)
830830+831831+#define YYBACKUP(Token, Value) \
832832+ do \
833833+ if (yychar == YYEMPTY) \
834834+ { \
835835+ yychar = (Token); \
836836+ yylval = (Value); \
837837+ YYPOPSTACK (yylen); \
838838+ yystate = *yyssp; \
839839+ goto yybackup; \
840840+ } \
841841+ else \
842842+ { \
843843+ yyerror (ast_root, scanner, YY_("syntax error: cannot back up")); \
844844+ YYERROR; \
845845+ } \
846846+ while (0)
847847+848848+/* Backward compatibility with an undocumented macro.
849849+ Use YYerror or YYUNDEF. */
850850+#define YYERRCODE YYUNDEF
851851+852852+853853+/* Enable debugging if requested. */
854854+#if YYDEBUG
855855+856856+# ifndef YYFPRINTF
857857+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
858858+# define YYFPRINTF fprintf
859859+# endif
860860+861861+# define YYDPRINTF(Args) \
862862+do { \
863863+ if (yydebug) \
864864+ YYFPRINTF Args; \
865865+} while (0)
866866+867867+868868+869869+870870+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
871871+do { \
872872+ if (yydebug) \
873873+ { \
874874+ YYFPRINTF (stderr, "%s ", Title); \
875875+ yy_symbol_print (stderr, \
876876+ Kind, Value, ast_root, scanner); \
877877+ YYFPRINTF (stderr, "\n"); \
878878+ } \
879879+} while (0)
880880+881881+882882+/*-----------------------------------.
883883+| Print this symbol's value on YYO. |
884884+`-----------------------------------*/
885885+886886+static void
887887+yy_symbol_value_print (FILE *yyo,
888888+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, void** ast_root, void* scanner)
889889+{
890890+ FILE *yyoutput = yyo;
891891+ YY_USE (yyoutput);
892892+ YY_USE (ast_root);
893893+ YY_USE (scanner);
894894+ if (!yyvaluep)
895895+ return;
896896+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
897897+ YY_USE (yykind);
898898+ YY_IGNORE_MAYBE_UNINITIALIZED_END
899899+}
900900+901901+902902+/*---------------------------.
903903+| Print this symbol on YYO. |
904904+`---------------------------*/
905905+906906+static void
907907+yy_symbol_print (FILE *yyo,
908908+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, void** ast_root, void* scanner)
909909+{
910910+ YYFPRINTF (yyo, "%s %s (",
911911+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
912912+913913+ yy_symbol_value_print (yyo, yykind, yyvaluep, ast_root, scanner);
914914+ YYFPRINTF (yyo, ")");
915915+}
916916+917917+/*------------------------------------------------------------------.
918918+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
919919+| TOP (included). |
920920+`------------------------------------------------------------------*/
921921+922922+static void
923923+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
924924+{
925925+ YYFPRINTF (stderr, "Stack now");
926926+ for (; yybottom <= yytop; yybottom++)
927927+ {
928928+ int yybot = *yybottom;
929929+ YYFPRINTF (stderr, " %d", yybot);
930930+ }
931931+ YYFPRINTF (stderr, "\n");
932932+}
933933+934934+# define YY_STACK_PRINT(Bottom, Top) \
935935+do { \
936936+ if (yydebug) \
937937+ yy_stack_print ((Bottom), (Top)); \
938938+} while (0)
939939+940940+941941+/*------------------------------------------------.
942942+| Report that the YYRULE is going to be reduced. |
943943+`------------------------------------------------*/
944944+945945+static void
946946+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
947947+ int yyrule, void** ast_root, void* scanner)
948948+{
949949+ int yylno = yyrline[yyrule];
950950+ int yynrhs = yyr2[yyrule];
951951+ int yyi;
952952+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
953953+ yyrule - 1, yylno);
954954+ /* The symbols being reduced. */
955955+ for (yyi = 0; yyi < yynrhs; yyi++)
956956+ {
957957+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
958958+ yy_symbol_print (stderr,
959959+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
960960+ &yyvsp[(yyi + 1) - (yynrhs)], ast_root, scanner);
961961+ YYFPRINTF (stderr, "\n");
962962+ }
963963+}
964964+965965+# define YY_REDUCE_PRINT(Rule) \
966966+do { \
967967+ if (yydebug) \
968968+ yy_reduce_print (yyssp, yyvsp, Rule, ast_root, scanner); \
969969+} while (0)
970970+971971+/* Nonzero means print parse trace. It is left uninitialized so that
972972+ multiple parsers can coexist. */
973973+int yydebug;
974974+#else /* !YYDEBUG */
975975+# define YYDPRINTF(Args) ((void) 0)
976976+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
977977+# define YY_STACK_PRINT(Bottom, Top)
978978+# define YY_REDUCE_PRINT(Rule)
979979+#endif /* !YYDEBUG */
980980+981981+982982+/* YYINITDEPTH -- initial size of the parser's stacks. */
983983+#ifndef YYINITDEPTH
984984+# define YYINITDEPTH 200
985985+#endif
986986+987987+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
988988+ if the built-in stack extension method is used).
989989+990990+ Do not make this value too large; the results are undefined if
991991+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
992992+ evaluated with infinite-precision integer arithmetic. */
993993+994994+#ifndef YYMAXDEPTH
995995+# define YYMAXDEPTH 10000
996996+#endif
997997+998998+999999+10001000+10011001+10021002+10031003+/*-----------------------------------------------.
10041004+| Release the memory associated to this symbol. |
10051005+`-----------------------------------------------*/
10061006+10071007+static void
10081008+yydestruct (const char *yymsg,
10091009+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep, void** ast_root, void* scanner)
10101010+{
10111011+ YY_USE (yyvaluep);
10121012+ YY_USE (ast_root);
10131013+ YY_USE (scanner);
10141014+ if (!yymsg)
10151015+ yymsg = "Deleting";
10161016+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
10171017+10181018+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
10191019+ YY_USE (yykind);
10201020+ YY_IGNORE_MAYBE_UNINITIALIZED_END
10211021+}
10221022+10231023+10241024+10251025+10261026+10271027+10281028+/*----------.
10291029+| yyparse. |
10301030+`----------*/
10311031+10321032+int
10331033+yyparse (void** ast_root, void* scanner)
10341034+{
10351035+/* Lookahead token kind. */
10361036+int yychar;
10371037+10381038+10391039+/* The semantic value of the lookahead symbol. */
10401040+/* Default value used for initialization, for pacifying older GCCs
10411041+ or non-GCC compilers. */
10421042+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
10431043+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
10441044+10451045+ /* Number of syntax errors so far. */
10461046+ int yynerrs = 0;
10471047+10481048+ yy_state_fast_t yystate = 0;
10491049+ /* Number of tokens to shift before error messages enabled. */
10501050+ int yyerrstatus = 0;
10511051+10521052+ /* Refer to the stacks through separate pointers, to allow yyoverflow
10531053+ to reallocate them elsewhere. */
10541054+10551055+ /* Their size. */
10561056+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
10571057+10581058+ /* The state stack: array, bottom, top. */
10591059+ yy_state_t yyssa[YYINITDEPTH];
10601060+ yy_state_t *yyss = yyssa;
10611061+ yy_state_t *yyssp = yyss;
10621062+10631063+ /* The semantic value stack: array, bottom, top. */
10641064+ YYSTYPE yyvsa[YYINITDEPTH];
10651065+ YYSTYPE *yyvs = yyvsa;
10661066+ YYSTYPE *yyvsp = yyvs;
10671067+10681068+ int yyn;
10691069+ /* The return value of yyparse. */
10701070+ int yyresult;
10711071+ /* Lookahead symbol kind. */
10721072+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
10731073+ /* The variables used to return semantic value and location from the
10741074+ action routines. */
10751075+ YYSTYPE yyval;
10761076+10771077+10781078+10791079+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
10801080+10811081+ /* The number of symbols on the RHS of the reduced rule.
10821082+ Keep to zero when no symbol should be popped. */
10831083+ int yylen = 0;
10841084+10851085+ YYDPRINTF ((stderr, "Starting parse\n"));
10861086+10871087+ yychar = YYEMPTY; /* Cause a token to be read. */
10881088+10891089+ goto yysetstate;
10901090+10911091+10921092+/*------------------------------------------------------------.
10931093+| yynewstate -- push a new state, which is found in yystate. |
10941094+`------------------------------------------------------------*/
10951095+yynewstate:
10961096+ /* In all cases, when you get here, the value and location stacks
10971097+ have just been pushed. So pushing a state here evens the stacks. */
10981098+ yyssp++;
10991099+11001100+11011101+/*--------------------------------------------------------------------.
11021102+| yysetstate -- set current state (the top of the stack) to yystate. |
11031103+`--------------------------------------------------------------------*/
11041104+yysetstate:
11051105+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
11061106+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
11071107+ YY_IGNORE_USELESS_CAST_BEGIN
11081108+ *yyssp = YY_CAST (yy_state_t, yystate);
11091109+ YY_IGNORE_USELESS_CAST_END
11101110+ YY_STACK_PRINT (yyss, yyssp);
11111111+11121112+ if (yyss + yystacksize - 1 <= yyssp)
11131113+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
11141114+ YYNOMEM;
11151115+#else
11161116+ {
11171117+ /* Get the current used size of the three stacks, in elements. */
11181118+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
11191119+11201120+# if defined yyoverflow
11211121+ {
11221122+ /* Give user a chance to reallocate the stack. Use copies of
11231123+ these so that the &'s don't force the real ones into
11241124+ memory. */
11251125+ yy_state_t *yyss1 = yyss;
11261126+ YYSTYPE *yyvs1 = yyvs;
11271127+11281128+ /* Each stack pointer address is followed by the size of the
11291129+ data in use in that stack, in bytes. This used to be a
11301130+ conditional around just the two extra args, but that might
11311131+ be undefined if yyoverflow is a macro. */
11321132+ yyoverflow (YY_("memory exhausted"),
11331133+ &yyss1, yysize * YYSIZEOF (*yyssp),
11341134+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
11351135+ &yystacksize);
11361136+ yyss = yyss1;
11371137+ yyvs = yyvs1;
11381138+ }
11391139+# else /* defined YYSTACK_RELOCATE */
11401140+ /* Extend the stack our own way. */
11411141+ if (YYMAXDEPTH <= yystacksize)
11421142+ YYNOMEM;
11431143+ yystacksize *= 2;
11441144+ if (YYMAXDEPTH < yystacksize)
11451145+ yystacksize = YYMAXDEPTH;
11461146+11471147+ {
11481148+ yy_state_t *yyss1 = yyss;
11491149+ union yyalloc *yyptr =
11501150+ YY_CAST (union yyalloc *,
11511151+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
11521152+ if (! yyptr)
11531153+ YYNOMEM;
11541154+ YYSTACK_RELOCATE (yyss_alloc, yyss);
11551155+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
11561156+# undef YYSTACK_RELOCATE
11571157+ if (yyss1 != yyssa)
11581158+ YYSTACK_FREE (yyss1);
11591159+ }
11601160+# endif
11611161+11621162+ yyssp = yyss + yysize - 1;
11631163+ yyvsp = yyvs + yysize - 1;
11641164+11651165+ YY_IGNORE_USELESS_CAST_BEGIN
11661166+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
11671167+ YY_CAST (long, yystacksize)));
11681168+ YY_IGNORE_USELESS_CAST_END
11691169+11701170+ if (yyss + yystacksize - 1 <= yyssp)
11711171+ YYABORT;
11721172+ }
11731173+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
11741174+11751175+11761176+ if (yystate == YYFINAL)
11771177+ YYACCEPT;
11781178+11791179+ goto yybackup;
11801180+11811181+11821182+/*-----------.
11831183+| yybackup. |
11841184+`-----------*/
11851185+yybackup:
11861186+ /* Do appropriate processing given the current state. Read a
11871187+ lookahead token if we need one and don't already have one. */
11881188+11891189+ /* First try to decide what to do without reference to lookahead token. */
11901190+ yyn = yypact[yystate];
11911191+ if (yypact_value_is_default (yyn))
11921192+ goto yydefault;
11931193+11941194+ /* Not known => get a lookahead token if don't already have one. */
11951195+11961196+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
11971197+ if (yychar == YYEMPTY)
11981198+ {
11991199+ YYDPRINTF ((stderr, "Reading a token\n"));
12001200+ yychar = yylex (&yylval, scanner);
12011201+ }
12021202+12031203+ if (yychar <= YYEOF)
12041204+ {
12051205+ yychar = YYEOF;
12061206+ yytoken = YYSYMBOL_YYEOF;
12071207+ YYDPRINTF ((stderr, "Now at end of input.\n"));
12081208+ }
12091209+ else if (yychar == YYerror)
12101210+ {
12111211+ /* The scanner already issued an error message, process directly
12121212+ to error recovery. But do not keep the error token as
12131213+ lookahead, it is too special and may lead us to an endless
12141214+ loop in error recovery. */
12151215+ yychar = YYUNDEF;
12161216+ yytoken = YYSYMBOL_YYerror;
12171217+ goto yyerrlab1;
12181218+ }
12191219+ else
12201220+ {
12211221+ yytoken = YYTRANSLATE (yychar);
12221222+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
12231223+ }
12241224+12251225+ /* If the proper action on seeing token YYTOKEN is to reduce or to
12261226+ detect an error, take that action. */
12271227+ yyn += yytoken;
12281228+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
12291229+ goto yydefault;
12301230+ yyn = yytable[yyn];
12311231+ if (yyn <= 0)
12321232+ {
12331233+ if (yytable_value_is_error (yyn))
12341234+ goto yyerrlab;
12351235+ yyn = -yyn;
12361236+ goto yyreduce;
12371237+ }
12381238+12391239+ /* Count tokens shifted since error; after three, turn off error
12401240+ status. */
12411241+ if (yyerrstatus)
12421242+ yyerrstatus--;
12431243+12441244+ /* Shift the lookahead token. */
12451245+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
12461246+ yystate = yyn;
12471247+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
12481248+ *++yyvsp = yylval;
12491249+ YY_IGNORE_MAYBE_UNINITIALIZED_END
12501250+12511251+ /* Discard the shifted token. */
12521252+ yychar = YYEMPTY;
12531253+ goto yynewstate;
12541254+12551255+12561256+/*-----------------------------------------------------------.
12571257+| yydefault -- do the default action for the current state. |
12581258+`-----------------------------------------------------------*/
12591259+yydefault:
12601260+ yyn = yydefact[yystate];
12611261+ if (yyn == 0)
12621262+ goto yyerrlab;
12631263+ goto yyreduce;
12641264+12651265+12661266+/*-----------------------------.
12671267+| yyreduce -- do a reduction. |
12681268+`-----------------------------*/
12691269+yyreduce:
12701270+ /* yyn is the number of a rule to reduce with. */
12711271+ yylen = yyr2[yyn];
12721272+12731273+ /* If YYLEN is nonzero, implement the default value of the action:
12741274+ '$$ = $1'.
12751275+12761276+ Otherwise, the following line sets YYVAL to garbage.
12771277+ This behavior is undocumented and Bison
12781278+ users should not rely upon it. Assigning to YYVAL
12791279+ unconditionally makes the parser a bit smaller, and it avoids a
12801280+ GCC warning that YYVAL may be used uninitialized. */
12811281+ yyval = yyvsp[1-yylen];
12821282+12831283+12841284+ YY_REDUCE_PRINT (yyn);
12851285+ switch (yyn)
12861286+ {
12871287+ case 2: /* Main: Expression */
12881288+#line 67 "parser/parser.y"
12891289+{ *ast_root = (yyvsp[0].node); }
12901290+#line 1291 "parser/parser.c"
12911291+ break;
12921292+12931293+ case 4: /* Expression: ASSERT_ Expression ';' Expression */
12941294+#line 73 "parser/parser.y"
12951295+{ (yyval.node) = new_node2(ASSERT_NODE, (yyvsp[-3].token), (yyvsp[-2].node), (yyvsp[0].node)); set_token_end((yyval.node), (yyvsp[-1].token)); }
12961296+#line 1297 "parser/parser.c"
12971297+ break;
12981298+12991299+ case 5: /* Expression: IF_ Expression THEN Expression ELSE_ Expression */
13001300+#line 75 "parser/parser.y"
13011301+{ (yyval.node) = new_node3(IF_NODE, (yyvsp[-5].token), (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); set_token_end((yyval.node), (yyvsp[-3].token)); }
13021302+#line 1303 "parser/parser.c"
13031303+ break;
13041304+13051305+ case 6: /* Expression: LET Binds IN Expression */
13061306+#line 77 "parser/parser.y"
13071307+{ (yyval.node) = new_node2(LET_NODE, (yyvsp[-3].token), (yyvsp[-2].node), (yyvsp[0].node)); set_token_end((yyval.node), (yyvsp[-1].token)); }
13081308+#line 1309 "parser/parser.c"
13091309+ break;
13101310+13111311+ case 7: /* Expression: WITH Expression ';' Expression */
13121312+#line 79 "parser/parser.y"
13131313+{ (yyval.node) = new_node2(WITH_NODE, (yyvsp[-3].token), (yyvsp[-2].node), (yyvsp[0].node)); set_token_end((yyval.node), (yyvsp[-1].token)); }
13141314+#line 1315 "parser/parser.c"
13151315+ break;
13161316+13171317+ case 9: /* Interp: INTERP Expression '}' */
13181318+#line 85 "parser/parser.y"
13191319+{ (yyval.node) = new_node1(INTERP_NODE, (yyvsp[-2].token), (yyvsp[-1].node)); set_token_end((yyval.node), (yyvsp[0].token)); }
13201320+#line 1321 "parser/parser.c"
13211321+ break;
13221322+13231323+ case 10: /* String: %empty */
13241324+#line 90 "parser/parser.y"
13251325+{ (yyval.node) = new_node(STRING_NODE, 0); }
13261326+#line 1327 "parser/parser.c"
13271327+ break;
13281328+13291329+ case 11: /* String: String TEXT */
13301330+#line 92 "parser/parser.y"
13311331+{ add_child((yyvsp[-1].node), new_node(TEXT_NODE, (yyvsp[0].token))); (yyval.node) = (yyvsp[-1].node); }
13321332+#line 1333 "parser/parser.c"
13331333+ break;
13341334+13351335+ case 12: /* String: String Interp */
13361336+#line 94 "parser/parser.y"
13371337+{ add_child((yyvsp[-1].node), (yyvsp[0].node)); (yyval.node) = (yyvsp[-1].node); }
13381338+#line 1339 "parser/parser.c"
13391339+ break;
13401340+13411341+ case 13: /* ID: T_ID */
13421342+#line 99 "parser/parser.y"
13431343+{ (yyval.node) = new_node(ID_NODE, (yyvsp[0].token)); }
13441344+#line 1345 "parser/parser.c"
13451345+ break;
13461346+13471347+ case 14: /* Atom: URI */
13481348+#line 104 "parser/parser.y"
13491349+{ (yyval.node) = new_node(URI_NODE, (yyvsp[0].token)); }
13501350+#line 1351 "parser/parser.c"
13511351+ break;
13521352+13531353+ case 15: /* Atom: PATH */
13541354+#line 106 "parser/parser.y"
13551355+{ (yyval.node) = new_node(PATH_NODE, (yyvsp[0].token)); }
13561356+#line 1357 "parser/parser.c"
13571357+ break;
13581358+13591359+ case 16: /* Atom: FLOAT */
13601360+#line 108 "parser/parser.y"
13611361+{ (yyval.node) = new_node(FLOAT_NODE, (yyvsp[0].token)); }
13621362+#line 1363 "parser/parser.c"
13631363+ break;
13641364+13651365+ case 17: /* Atom: INT_ */
13661366+#line 110 "parser/parser.y"
13671367+{ (yyval.node) = new_node(INT_NODE, (yyvsp[0].token)); }
13681368+#line 1369 "parser/parser.c"
13691369+ break;
13701370+13711371+ case 19: /* Atom: '"' String '"' */
13721372+#line 113 "parser/parser.y"
13731373+{ set_token_end((yyvsp[-1].node), (yyvsp[0].token)); (yyval.node) = (yyvsp[-1].node); }
13741374+#line 1375 "parser/parser.c"
13751375+ break;
13761376+13771377+ case 20: /* Atom: II String II */
13781378+#line 115 "parser/parser.y"
13791379+{ set_node_type((yyvsp[-1].node), I_STRING_NODE); set_token_end((yyvsp[-1].node), (yyvsp[0].token)); (yyval.node) = (yyvsp[-1].node); }
13801380+#line 1381 "parser/parser.c"
13811381+ break;
13821382+13831383+ case 21: /* Atom: '(' Expression ')' */
13841384+#line 117 "parser/parser.y"
13851385+{ (yyval.node) = new_node1(PARENS_NODE, (yyvsp[-2].token), (yyvsp[-1].node)); set_token_end((yyval.node), (yyvsp[0].token)); }
13861386+#line 1387 "parser/parser.c"
13871387+ break;
13881388+13891389+ case 22: /* Atom: '[' List ']' */
13901390+#line 119 "parser/parser.y"
13911391+{ set_token_end((yyvsp[-1].node), (yyvsp[0].token)); (yyval.node) = (yyvsp[-1].node); }
13921392+#line 1393 "parser/parser.c"
13931393+ break;
13941394+13951395+ case 23: /* Atom: '{' Binds '}' */
13961396+#line 121 "parser/parser.y"
13971397+{ set_node_type((yyvsp[-1].node), SET_NODE); set_token_end((yyvsp[-1].node), (yyvsp[0].token)); (yyval.node) = (yyvsp[-1].node); }
13981398+#line 1399 "parser/parser.c"
13991399+ break;
14001400+14011401+ case 24: /* Atom: REC '{' Binds '}' */
14021402+#line 123 "parser/parser.y"
14031403+{ set_node_type((yyvsp[-1].node), REC_SET_NODE); set_token_end((yyvsp[-1].node), (yyvsp[0].token)); (yyval.node) = (yyvsp[-1].node); }
14041404+#line 1405 "parser/parser.c"
14051405+ break;
14061406+14071407+ case 26: /* Select: Atom '.' AttrPath */
14081408+#line 129 "parser/parser.y"
14091409+{ (yyval.node) = new_node2(SELECT_NODE, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14101410+#line 1411 "parser/parser.c"
14111411+ break;
14121412+14131413+ case 27: /* Select: Atom '.' AttrPath OR_ Select */
14141414+#line 131 "parser/parser.y"
14151415+{ (yyval.node) = new_node3(SELECT_OR_NODE, (yyvsp[-3].token), (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); set_token_end((yyval.node), (yyvsp[-1].token)); }
14161416+#line 1417 "parser/parser.c"
14171417+ break;
14181418+14191419+ case 29: /* Apply: Apply Select */
14201420+#line 137 "parser/parser.y"
14211421+{ (yyval.node) = new_node2(APPLY_NODE, 0, (yyvsp[-1].node), (yyvsp[0].node)); }
14221422+#line 1423 "parser/parser.c"
14231423+ break;
14241424+14251425+ case 31: /* Op: '-' Op */
14261426+#line 143 "parser/parser.y"
14271427+{ (yyval.node) = op_node1('-', (yyvsp[-1].token), (yyvsp[0].node)); }
14281428+#line 1429 "parser/parser.c"
14291429+ break;
14301430+14311431+ case 32: /* Op: Op '?' AttrPath */
14321432+#line 145 "parser/parser.y"
14331433+{ (yyval.node) = op_node2('?', (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14341434+#line 1435 "parser/parser.c"
14351435+ break;
14361436+14371437+ case 33: /* Op: Op CONCAT Op */
14381438+#line 147 "parser/parser.y"
14391439+{ (yyval.node) = op_node2(CONCAT, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14401440+#line 1441 "parser/parser.c"
14411441+ break;
14421442+14431443+ case 34: /* Op: Op '/' Op */
14441444+#line 149 "parser/parser.y"
14451445+{ (yyval.node) = op_node2('/', (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14461446+#line 1447 "parser/parser.c"
14471447+ break;
14481448+14491449+ case 35: /* Op: Op '*' Op */
14501450+#line 151 "parser/parser.y"
14511451+{ (yyval.node) = op_node2('*', (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14521452+#line 1453 "parser/parser.c"
14531453+ break;
14541454+14551455+ case 36: /* Op: Op '-' Op */
14561456+#line 153 "parser/parser.y"
14571457+{ (yyval.node) = op_node2('-', (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14581458+#line 1459 "parser/parser.c"
14591459+ break;
14601460+14611461+ case 37: /* Op: Op '+' Op */
14621462+#line 155 "parser/parser.y"
14631463+{ (yyval.node) = op_node2('+', (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14641464+#line 1465 "parser/parser.c"
14651465+ break;
14661466+14671467+ case 38: /* Op: '!' Op */
14681468+#line 157 "parser/parser.y"
14691469+{ (yyval.node) = op_node1('!', (yyvsp[-1].token), (yyvsp[0].node)); }
14701470+#line 1471 "parser/parser.c"
14711471+ break;
14721472+14731473+ case 39: /* Op: Op UPDATE Op */
14741474+#line 159 "parser/parser.y"
14751475+{ (yyval.node) = op_node2(UPDATE, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14761476+#line 1477 "parser/parser.c"
14771477+ break;
14781478+14791479+ case 40: /* Op: Op GEQ Op */
14801480+#line 161 "parser/parser.y"
14811481+{ (yyval.node) = op_node2(GEQ, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14821482+#line 1483 "parser/parser.c"
14831483+ break;
14841484+14851485+ case 41: /* Op: Op LEQ Op */
14861486+#line 163 "parser/parser.y"
14871487+{ (yyval.node) = op_node2(LEQ, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14881488+#line 1489 "parser/parser.c"
14891489+ break;
14901490+14911491+ case 42: /* Op: Op '>' Op */
14921492+#line 165 "parser/parser.y"
14931493+{ (yyval.node) = op_node2('>', (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
14941494+#line 1495 "parser/parser.c"
14951495+ break;
14961496+14971497+ case 43: /* Op: Op '<' Op */
14981498+#line 167 "parser/parser.y"
14991499+{ (yyval.node) = op_node2('<', (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
15001500+#line 1501 "parser/parser.c"
15011501+ break;
15021502+15031503+ case 44: /* Op: Op NEQ Op */
15041504+#line 169 "parser/parser.y"
15051505+{ (yyval.node) = op_node2(NEQ, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
15061506+#line 1507 "parser/parser.c"
15071507+ break;
15081508+15091509+ case 45: /* Op: Op EQ Op */
15101510+#line 171 "parser/parser.y"
15111511+{ (yyval.node) = op_node2(EQ, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
15121512+#line 1513 "parser/parser.c"
15131513+ break;
15141514+15151515+ case 46: /* Op: Op AND Op */
15161516+#line 173 "parser/parser.y"
15171517+{ (yyval.node) = op_node2(AND, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
15181518+#line 1519 "parser/parser.c"
15191519+ break;
15201520+15211521+ case 47: /* Op: Op OR Op */
15221522+#line 175 "parser/parser.y"
15231523+{ (yyval.node) = op_node2(OR, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
15241524+#line 1525 "parser/parser.c"
15251525+ break;
15261526+15271527+ case 48: /* Op: Op IMPL Op */
15281528+#line 177 "parser/parser.y"
15291529+{ (yyval.node) = op_node2(IMPL, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
15301530+#line 1531 "parser/parser.c"
15311531+ break;
15321532+15331533+ case 50: /* InterpID: OR_ */
15341534+#line 183 "parser/parser.y"
15351535+{ (yyval.node) = new_node(ID_NODE, (yyvsp[0].token)); }
15361536+#line 1537 "parser/parser.c"
15371537+ break;
15381538+15391539+ case 52: /* InterpID: '"' String '"' */
15401540+#line 186 "parser/parser.y"
15411541+{ set_token_end((yyvsp[-1].node), (yyvsp[0].token)); (yyval.node) = (yyvsp[-1].node); }
15421542+#line 1543 "parser/parser.c"
15431543+ break;
15441544+15451545+ case 53: /* AttrPath: InterpID */
15461546+#line 191 "parser/parser.y"
15471547+{ (yyval.node) = new_node1(ATTR_PATH_NODE, 0, (yyvsp[0].node)); }
15481548+#line 1549 "parser/parser.c"
15491549+ break;
15501550+15511551+ case 54: /* AttrPath: AttrPath '.' InterpID */
15521552+#line 193 "parser/parser.y"
15531553+{ add_child((yyvsp[-2].node), (yyvsp[0].node)); set_token_end((yyvsp[-2].node), 0); (yyval.node) = (yyvsp[-2].node); }
15541554+#line 1555 "parser/parser.c"
15551555+ break;
15561556+15571557+ case 55: /* List: %empty */
15581558+#line 198 "parser/parser.y"
15591559+{ (yyval.node) = new_node(LIST_NODE, 0); }
15601560+#line 1561 "parser/parser.c"
15611561+ break;
15621562+15631563+ case 56: /* List: List Select */
15641564+#line 200 "parser/parser.y"
15651565+{ add_child((yyvsp[-1].node), (yyvsp[0].node)); (yyval.node) = (yyvsp[-1].node); }
15661566+#line 1567 "parser/parser.c"
15671567+ break;
15681568+15691569+ case 57: /* Binds: %empty */
15701570+#line 205 "parser/parser.y"
15711571+{ (yyval.node) = new_node(BINDS_NODE, 0); }
15721572+#line 1573 "parser/parser.c"
15731573+ break;
15741574+15751575+ case 58: /* Binds: Binds AttrPath '=' Expression ';' */
15761576+#line 207 "parser/parser.y"
15771577+{ add_child((yyvsp[-4].node), new_node2(BIND_NODE, (yyvsp[-2].token), (yyvsp[-3].node), (yyvsp[-1].node))); (yyval.node) = (yyvsp[-4].node); }
15781578+#line 1579 "parser/parser.c"
15791579+ break;
15801580+15811581+ case 59: /* Binds: Binds INHERIT InheritList ';' */
15821582+#line 209 "parser/parser.y"
15831583+{ add_child((yyvsp[-3].node), new_node1(INHERIT_NODE, (yyvsp[-2].token), (yyvsp[-1].node))); (yyval.node) = (yyvsp[-3].node); }
15841584+#line 1585 "parser/parser.c"
15851585+ break;
15861586+15871587+ case 60: /* Binds: Binds INHERIT '(' Expression ')' InheritList ';' */
15881588+#line 211 "parser/parser.y"
15891589+{ add_child((yyvsp[-6].node), new_node2(INHERIT_FROM_NODE, (yyvsp[-5].token), (yyvsp[-3].node), (yyvsp[-1].node))); (yyval.node) = (yyvsp[-6].node); }
15901590+#line 1591 "parser/parser.c"
15911591+ break;
15921592+15931593+ case 61: /* InheritList: %empty */
15941594+#line 216 "parser/parser.y"
15951595+{ (yyval.node) = new_node(INHERIT_LIST_NODE, 0); }
15961596+#line 1597 "parser/parser.c"
15971597+ break;
15981598+15991599+ case 62: /* InheritList: InheritList InterpID */
16001600+#line 218 "parser/parser.y"
16011601+{ add_child((yyvsp[-1].node), (yyvsp[0].node)); (yyval.node) = (yyvsp[-1].node); }
16021602+#line 1603 "parser/parser.c"
16031603+ break;
16041604+16051605+ case 63: /* Function: ARG_ID ':' Expression */
16061606+#line 223 "parser/parser.y"
16071607+{ (yyval.node) = new_node2(FUNCTION_NODE, (yyvsp[-1].token), new_node(ID_NODE, (yyvsp[-2].token)), (yyvsp[0].node)); }
16081608+#line 1609 "parser/parser.c"
16091609+ break;
16101610+16111611+ case 64: /* Function: ARG_BRACKET ArgSet '}' ':' Expression */
16121612+#line 225 "parser/parser.y"
16131613+{ (yyval.node) = new_node2(FUNCTION_NODE, (yyvsp[-1].token), (yyvsp[-3].node), (yyvsp[0].node)); set_token_end((yyvsp[-3].node), (yyvsp[-2].token)); }
16141614+#line 1615 "parser/parser.c"
16151615+ break;
16161616+16171617+ case 65: /* Function: ARG_ID '@' ARG_BRACKET ArgSet '}' ':' Expression */
16181618+#line 227 "parser/parser.y"
16191619+{ (yyval.node) = new_node3(FUNCTION_NODE, (yyvsp[-5].token), new_node(ID_NODE, (yyvsp[-6].token)), (yyvsp[-3].node), (yyvsp[0].node)); set_token_end((yyvsp[-3].node), (yyvsp[-2].token)); }
16201620+#line 1621 "parser/parser.c"
16211621+ break;
16221622+16231623+ case 66: /* Function: ARG_BRACKET ArgSet '}' '@' ID ':' Expression */
16241624+#line 229 "parser/parser.y"
16251625+{ (yyval.node) = new_node3(FUNCTION_NODE, (yyvsp[-3].token), (yyvsp[-2].node), (yyvsp[-5].node), (yyvsp[0].node)); set_token_end((yyvsp[-5].node), (yyvsp[-4].token)); }
16261626+#line 1627 "parser/parser.c"
16271627+ break;
16281628+16291629+ case 67: /* Function: ARG_BRACKET ArgSet '}' '@' ARG_ID ':' Expression */
16301630+#line 231 "parser/parser.y"
16311631+{ (yyval.node) = new_node3(FUNCTION_NODE, (yyvsp[-3].token), new_node(ID_NODE, (yyvsp[-2].token)), (yyvsp[-5].node), (yyvsp[0].node)); set_token_end((yyvsp[-5].node), (yyvsp[-4].token)); }
16321632+#line 1633 "parser/parser.c"
16331633+ break;
16341634+16351635+ case 68: /* ArgSet: %empty */
16361636+#line 236 "parser/parser.y"
16371637+{ (yyval.node) = new_node(ARG_SET_NODE, 0); }
16381638+#line 1639 "parser/parser.c"
16391639+ break;
16401640+16411641+ case 69: /* ArgSet: Arg */
16421642+#line 238 "parser/parser.y"
16431643+{ (yyval.node) = new_node1(ARG_SET_NODE, 0, (yyvsp[0].node)); }
16441644+#line 1645 "parser/parser.c"
16451645+ break;
16461646+16471647+ case 70: /* ArgSet: ELLIPSIS */
16481648+#line 240 "parser/parser.y"
16491649+{ (yyval.node) = new_node1(ARG_SET_NODE, 0, new_node(ARG_NODE, (yyvsp[0].token))); }
16501650+#line 1651 "parser/parser.c"
16511651+ break;
16521652+16531653+ case 71: /* ArgSet: Arg ',' ArgSet */
16541654+#line 242 "parser/parser.y"
16551655+{ add_child((yyvsp[0].node), (yyvsp[-2].node)); (yyval.node) = (yyvsp[0].node); }
16561656+#line 1657 "parser/parser.c"
16571657+ break;
16581658+16591659+ case 72: /* Arg: ID */
16601660+#line 247 "parser/parser.y"
16611661+{ (yyval.node) = new_node1(ARG_NODE, 0, (yyvsp[0].node)); }
16621662+#line 1663 "parser/parser.c"
16631663+ break;
16641664+16651665+ case 73: /* Arg: ID '?' Expression */
16661666+#line 249 "parser/parser.y"
16671667+{ (yyval.node) = new_node2(ARG_NODE, (yyvsp[-1].token), (yyvsp[-2].node), (yyvsp[0].node)); }
16681668+#line 1669 "parser/parser.c"
16691669+ break;
16701670+16711671+16721672+#line 1673 "parser/parser.c"
16731673+16741674+ default: break;
16751675+ }
16761676+ /* User semantic actions sometimes alter yychar, and that requires
16771677+ that yytoken be updated with the new translation. We take the
16781678+ approach of translating immediately before every use of yytoken.
16791679+ One alternative is translating here after every semantic action,
16801680+ but that translation would be missed if the semantic action invokes
16811681+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
16821682+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
16831683+ incorrect destructor might then be invoked immediately. In the
16841684+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
16851685+ to an incorrect destructor call or verbose syntax error message
16861686+ before the lookahead is translated. */
16871687+ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
16881688+16891689+ YYPOPSTACK (yylen);
16901690+ yylen = 0;
16911691+16921692+ *++yyvsp = yyval;
16931693+16941694+ /* Now 'shift' the result of the reduction. Determine what state
16951695+ that goes to, based on the state we popped back to and the rule
16961696+ number reduced by. */
16971697+ {
16981698+ const int yylhs = yyr1[yyn] - YYNTOKENS;
16991699+ const int yyi = yypgoto[yylhs] + *yyssp;
17001700+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
17011701+ ? yytable[yyi]
17021702+ : yydefgoto[yylhs]);
17031703+ }
17041704+17051705+ goto yynewstate;
17061706+17071707+17081708+/*--------------------------------------.
17091709+| yyerrlab -- here on detecting error. |
17101710+`--------------------------------------*/
17111711+yyerrlab:
17121712+ /* Make sure we have latest lookahead translation. See comments at
17131713+ user semantic actions for why this is necessary. */
17141714+ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
17151715+ /* If not already recovering from an error, report this error. */
17161716+ if (!yyerrstatus)
17171717+ {
17181718+ ++yynerrs;
17191719+ yyerror (ast_root, scanner, YY_("syntax error"));
17201720+ }
17211721+17221722+ if (yyerrstatus == 3)
17231723+ {
17241724+ /* If just tried and failed to reuse lookahead token after an
17251725+ error, discard it. */
17261726+17271727+ if (yychar <= YYEOF)
17281728+ {
17291729+ /* Return failure if at end of input. */
17301730+ if (yychar == YYEOF)
17311731+ YYABORT;
17321732+ }
17331733+ else
17341734+ {
17351735+ yydestruct ("Error: discarding",
17361736+ yytoken, &yylval, ast_root, scanner);
17371737+ yychar = YYEMPTY;
17381738+ }
17391739+ }
17401740+17411741+ /* Else will try to reuse lookahead token after shifting the error
17421742+ token. */
17431743+ goto yyerrlab1;
17441744+17451745+17461746+/*---------------------------------------------------.
17471747+| yyerrorlab -- error raised explicitly by YYERROR. |
17481748+`---------------------------------------------------*/
17491749+yyerrorlab:
17501750+ /* Pacify compilers when the user code never invokes YYERROR and the
17511751+ label yyerrorlab therefore never appears in user code. */
17521752+ if (0)
17531753+ YYERROR;
17541754+ ++yynerrs;
17551755+17561756+ /* Do not reclaim the symbols of the rule whose action triggered
17571757+ this YYERROR. */
17581758+ YYPOPSTACK (yylen);
17591759+ yylen = 0;
17601760+ YY_STACK_PRINT (yyss, yyssp);
17611761+ yystate = *yyssp;
17621762+ goto yyerrlab1;
17631763+17641764+17651765+/*-------------------------------------------------------------.
17661766+| yyerrlab1 -- common code for both syntax error and YYERROR. |
17671767+`-------------------------------------------------------------*/
17681768+yyerrlab1:
17691769+ yyerrstatus = 3; /* Each real token shifted decrements this. */
17701770+17711771+ /* Pop stack until we find a state that shifts the error token. */
17721772+ for (;;)
17731773+ {
17741774+ yyn = yypact[yystate];
17751775+ if (!yypact_value_is_default (yyn))
17761776+ {
17771777+ yyn += YYSYMBOL_YYerror;
17781778+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
17791779+ {
17801780+ yyn = yytable[yyn];
17811781+ if (0 < yyn)
17821782+ break;
17831783+ }
17841784+ }
17851785+17861786+ /* Pop the current state because it cannot handle the error token. */
17871787+ if (yyssp == yyss)
17881788+ YYABORT;
17891789+17901790+17911791+ yydestruct ("Error: popping",
17921792+ YY_ACCESSING_SYMBOL (yystate), yyvsp, ast_root, scanner);
17931793+ YYPOPSTACK (1);
17941794+ yystate = *yyssp;
17951795+ YY_STACK_PRINT (yyss, yyssp);
17961796+ }
17971797+17981798+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
17991799+ *++yyvsp = yylval;
18001800+ YY_IGNORE_MAYBE_UNINITIALIZED_END
18011801+18021802+18031803+ /* Shift the error token. */
18041804+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
18051805+18061806+ yystate = yyn;
18071807+ goto yynewstate;
18081808+18091809+18101810+/*-------------------------------------.
18111811+| yyacceptlab -- YYACCEPT comes here. |
18121812+`-------------------------------------*/
18131813+yyacceptlab:
18141814+ yyresult = 0;
18151815+ goto yyreturnlab;
18161816+18171817+18181818+/*-----------------------------------.
18191819+| yyabortlab -- YYABORT comes here. |
18201820+`-----------------------------------*/
18211821+yyabortlab:
18221822+ yyresult = 1;
18231823+ goto yyreturnlab;
18241824+18251825+18261826+/*-----------------------------------------------------------.
18271827+| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
18281828+`-----------------------------------------------------------*/
18291829+yyexhaustedlab:
18301830+ yyerror (ast_root, scanner, YY_("memory exhausted"));
18311831+ yyresult = 2;
18321832+ goto yyreturnlab;
18331833+18341834+18351835+/*----------------------------------------------------------.
18361836+| yyreturnlab -- parsing is finished, clean up and return. |
18371837+`----------------------------------------------------------*/
18381838+yyreturnlab:
18391839+ if (yychar != YYEMPTY)
18401840+ {
18411841+ /* Make sure we have latest lookahead translation. See comments at
18421842+ user semantic actions for why this is necessary. */
18431843+ yytoken = YYTRANSLATE (yychar);
18441844+ yydestruct ("Cleanup: discarding lookahead",
18451845+ yytoken, &yylval, ast_root, scanner);
18461846+ }
18471847+ /* Do not reclaim the symbols of the rule whose action triggered
18481848+ this YYABORT or YYACCEPT. */
18491849+ YYPOPSTACK (yylen);
18501850+ YY_STACK_PRINT (yyss, yyssp);
18511851+ while (yyssp != yyss)
18521852+ {
18531853+ yydestruct ("Cleanup: popping",
18541854+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, ast_root, scanner);
18551855+ YYPOPSTACK (1);
18561856+ }
18571857+#ifndef yyoverflow
18581858+ if (yyss != yyssa)
18591859+ YYSTACK_FREE (yyss);
18601860+#endif
18611861+18621862+ return yyresult;
18631863+}
18641864+18651865+#line 252 "parser/parser.y"
18661866+
+117
parser/parser.h
···11+/* A Bison parser, made by GNU Bison 3.8.2. */
22+33+/* Bison interface for Yacc-like parsers in C
44+55+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
66+ Inc.
77+88+ This program is free software: you can redistribute it and/or modify
99+ it under the terms of the GNU General Public License as published by
1010+ the Free Software Foundation, either version 3 of the License, or
1111+ (at your option) any later version.
1212+1313+ This program is distributed in the hope that it will be useful,
1414+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1515+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616+ GNU General Public License for more details.
1717+1818+ You should have received a copy of the GNU General Public License
1919+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
2020+2121+/* As a special exception, you may create a larger work that contains
2222+ part or all of the Bison parser skeleton and distribute that work
2323+ under terms of your choice, so long as that work isn't itself a
2424+ parser generator using the skeleton or a modified version thereof
2525+ as a parser skeleton. Alternatively, if you modify or redistribute
2626+ the parser skeleton itself, you may (at your option) remove this
2727+ special exception, which will cause the skeleton and the resulting
2828+ Bison output files to be licensed under the GNU General Public
2929+ License without this special exception.
3030+3131+ This special exception was added by the Free Software Foundation in
3232+ version 2.2 of Bison. */
3333+3434+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
3535+ especially those whose name start with YY_ or yy_. They are
3636+ private implementation details that can be changed or removed. */
3737+3838+#ifndef YY_YY_PARSER_PARSER_H_INCLUDED
3939+# define YY_YY_PARSER_PARSER_H_INCLUDED
4040+/* Debug traces. */
4141+#ifndef YYDEBUG
4242+# define YYDEBUG 1
4343+#endif
4444+#if YYDEBUG
4545+extern int yydebug;
4646+#endif
4747+4848+/* Token kinds. */
4949+#ifndef YYTOKENTYPE
5050+# define YYTOKENTYPE
5151+ enum yytokentype
5252+ {
5353+ YYEMPTY = -2,
5454+ YYEOF = 0, /* "end of file" */
5555+ YYerror = 256, /* error */
5656+ YYUNDEF = 257, /* "invalid token" */
5757+ ASSERT_ = 258, /* ASSERT_ */
5858+ IF_ = 259, /* IF_ */
5959+ THEN = 260, /* THEN */
6060+ ELSE_ = 261, /* ELSE_ */
6161+ LET = 262, /* LET */
6262+ IN = 263, /* IN */
6363+ WITH = 264, /* WITH */
6464+ OR_ = 265, /* OR_ */
6565+ REC = 266, /* REC */
6666+ INHERIT = 267, /* INHERIT */
6767+ ELLIPSIS = 268, /* ELLIPSIS */
6868+ INTERP = 269, /* INTERP */
6969+ SPACE = 270, /* SPACE */
7070+ COMMENT = 271, /* COMMENT */
7171+ II = 272, /* II */
7272+ URI = 273, /* URI */
7373+ PATH = 274, /* PATH */
7474+ FLOAT = 275, /* FLOAT */
7575+ INT_ = 276, /* INT_ */
7676+ T_ID = 277, /* T_ID */
7777+ TEXT = 278, /* TEXT */
7878+ ARG_ID = 279, /* ARG_ID */
7979+ ARG_BRACKET = 280, /* ARG_BRACKET */
8080+ IMPL = 281, /* IMPL */
8181+ OR = 282, /* OR */
8282+ AND = 283, /* AND */
8383+ EQ = 284, /* EQ */
8484+ NEQ = 285, /* NEQ */
8585+ LEQ = 286, /* LEQ */
8686+ GEQ = 287, /* GEQ */
8787+ UPDATE = 288, /* UPDATE */
8888+ CONCAT = 289, /* CONCAT */
8989+ NEGATE = 290 /* NEGATE */
9090+ };
9191+ typedef enum yytokentype yytoken_kind_t;
9292+#endif
9393+9494+/* Value type. */
9595+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
9696+union YYSTYPE
9797+{
9898+#line 34 "parser/parser.y"
9999+100100+ int token;
101101+ Node* node;
102102+103103+#line 104 "parser/parser.h"
104104+105105+};
106106+typedef union YYSTYPE YYSTYPE;
107107+# define YYSTYPE_IS_TRIVIAL 1
108108+# define YYSTYPE_IS_DECLARED 1
109109+#endif
110110+111111+112112+113113+114114+int yyparse (void** ast_root, void* scanner);
115115+116116+117117+#endif /* !YY_YY_PARSER_PARSER_H_INCLUDED */