49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
64 #define YYLSP_NEEDED 0
67 #define yyparse space_constitution_parse
68 #define yylex space_constitution_lex
69 #define yyerror space_constitution_error
70 #define yylval space_constitution_lval
71 #define yychar space_constitution_char
72 #define yydebug space_constitution_debug
73 #define yynerrs space_constitution_nerrs
79 #line 1 "space_constitution_yacc.y"
85 #line 104 "space_constitution_yacc.cc"
93 #ifdef YYERROR_VERBOSE
94 # undef YYERROR_VERBOSE
95 # define YYERROR_VERBOSE 1
97 # define YYERROR_VERBOSE 0
101 #ifndef YYTOKEN_TABLE
102 # define YYTOKEN_TABLE 0
123 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
128 #line 22 "space_constitution_yacc.y"
138 #line 157 "space_constitution_yacc.cc"
140 # define YYSTYPE_IS_TRIVIAL 1
141 # define yystype YYSTYPE
142 # define YYSTYPE_IS_DECLARED 1
150 #line 169 "space_constitution_yacc.cc"
164 #elif (defined __STDC__ || defined __C99__FUNC__ \
165 || defined __cplusplus || defined _MSC_VER)
184 # ifdef __SIZE_TYPE__
185 # define YYSIZE_T __SIZE_TYPE__
186 # elif defined size_t
187 # define YYSIZE_T size_t
188 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
189 || defined __cplusplus || defined _MSC_VER)
191 # define YYSIZE_T size_t
193 # define YYSIZE_T unsigned int
197 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
202 # include <libintl.h>
203 # define YY_(msgid) dgettext ("bison-runtime", msgid)
207 # define YY_(msgid) msgid
212 #if ! defined lint || defined __GNUC__
213 # define YYUSE(e) ((void) (e))
222 #if (defined __STDC__ || defined __C99__FUNC__ \
223 || defined __cplusplus || defined _MSC_VER)
236 #if ! defined yyoverflow || YYERROR_VERBOSE
240 # ifdef YYSTACK_USE_ALLOCA
241 # if YYSTACK_USE_ALLOCA
243 # define YYSTACK_ALLOC __builtin_alloca
244 # elif defined __BUILTIN_VA_ARG_INCR
247 # define YYSTACK_ALLOC __alloca
248 # elif defined _MSC_VER
250 # define alloca _alloca
252 # define YYSTACK_ALLOC alloca
253 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
254 || defined __cplusplus || defined _MSC_VER)
264 # ifdef YYSTACK_ALLOC
266 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
267 # ifndef YYSTACK_ALLOC_MAXIMUM
272 # define YYSTACK_ALLOC_MAXIMUM 4032
275 # define YYSTACK_ALLOC YYMALLOC
276 # define YYSTACK_FREE YYFREE
277 # ifndef YYSTACK_ALLOC_MAXIMUM
278 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
280 # if (defined __cplusplus && ! defined _STDLIB_H \
281 && ! ((defined YYMALLOC || defined malloc) \
282 && (defined YYFREE || defined free)))
289 # define YYMALLOC malloc
290 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
291 || defined __cplusplus || defined _MSC_VER)
297 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
298 || defined __cplusplus || defined _MSC_VER)
306 #if (! defined yyoverflow \
307 && (! defined __cplusplus \
308 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
318 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
322 # define YYSTACK_BYTES(N) \
323 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
324 + YYSTACK_GAP_MAXIMUM)
329 # if defined __GNUC__ && 1 < __GNUC__
330 # define YYCOPY(To, From, Count) \
331 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
333 # define YYCOPY(To, From, Count) \
337 for (yyi = 0; yyi < (Count); yyi++) \
338 (To)[yyi] = (From)[yyi]; \
349 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
352 YYSIZE_T yynewbytes; \
353 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
354 Stack = &yyptr->Stack_alloc; \
355 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
356 yyptr += yynewbytes / sizeof (*yyptr); \
378 #define YYMAXUTOK 263
380 #define YYTRANSLATE(YYX) \
381 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
386 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 9, 10, 11, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
420 0, 0, 3, 5, 7, 9, 11, 15, 18, 23,
421 28, 32, 36, 38, 40, 41, 43, 45, 47, 49
427 13, 0, -1, 14, -1, 16, -1, 18, -1, 16,
428 -1, 9, 18, 10, -1, 21, 17, -1, 22, 9,
429 17, 10, -1, 19, 9, 20, 10, -1, 15, 11,
430 15, -1, 18, 11, 15, -1, 3, -1, 3, -1,
431 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
438 0, 35, 35, 37, 38, 41, 42, 45, 47, 52,
439 55, 61, 64, 66, 68, 69, 71, 72, 73, 74
443 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
446 static const char *
const yytname[] =
448 "$end",
"error",
"$undefined",
"IDENTIFIER",
"SCALAR",
"VECTOR",
449 "TENSOR",
"UNSYMMETRIC_TENSOR",
"TENSOR4",
"'('",
"')'",
"'*'",
450 "$accept",
"all",
"top_expr",
"expr",
"factor",
"base_geo",
"expr_list",
451 "base",
"geo",
"scalar",
"multi", 0
460 0, 256, 257, 258, 259, 260, 261, 262, 263, 40,
468 0, 12, 13, 14, 14, 15, 15, 16, 16, 17,
469 18, 18, 19, 20, 21, 21, 22, 22, 22, 22
475 0, 2, 1, 1, 1, 1, 3, 2, 4, 4,
476 3, 3, 1, 1, 0, 1, 1, 1, 1, 1
484 14, 15, 16, 17, 18, 19, 14, 0, 2, 0,
485 3, 4, 0, 0, 5, 0, 1, 14, 14, 12,
486 7, 0, 0, 6, 10, 11, 0, 0, 13, 0,
493 -1, 7, 8, 9, 14, 20, 11, 21, 29, 12,
499 #define YYPACT_NINF -9
502 -4, -9, -9, -9, -9, -9, -4, 6, -9, 0,
503 1, 2, 11, 7, -9, -3, -9, -4, -4, -9,
504 -9, 8, 11, -9, -9, -9, 12, 9, -9, 10,
511 -9, -9, -9, -8, 18, -1, 16, -9, -9, -9,
519 #define YYTABLE_NINF -6
522 1, 2, 3, 4, 5, 6, 16, 23, 18, 24,
523 25, 17, -5, 18, 19, 28, 22, 26, 10, 30,
529 4, 5, 6, 7, 8, 9, 0, 10, 11, 17,
530 18, 11, 11, 11, 3, 3, 9, 9, 0, 10,
538 0, 4, 5, 6, 7, 8, 9, 13, 14, 15,
539 16, 18, 21, 22, 16, 18, 0, 11, 11, 3,
540 17, 19, 9, 10, 15, 15, 9, 17, 3, 20,
544 #define yyerrok (yyerrstatus = 0)
545 #define yyclearin (yychar = YYEMPTY)
549 #define YYACCEPT goto yyacceptlab
550 #define YYABORT goto yyabortlab
551 #define YYERROR goto yyerrorlab
558 #define YYFAIL goto yyerrlab
560 #define YYRECOVERING() (!!yyerrstatus)
562 #define YYBACKUP(Token, Value) \
564 if (yychar == YYEMPTY && yylen == 1) \
568 yytoken = YYTRANSLATE (yychar); \
574 yyerror (YY_("syntax error: cannot back up")); \
581 #define YYERRCODE 256
588 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
589 #ifndef YYLLOC_DEFAULT
590 # define YYLLOC_DEFAULT(Current, Rhs, N) \
594 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
595 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
596 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
597 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
601 (Current).first_line = (Current).last_line = \
602 YYRHSLOC (Rhs, 0).last_line; \
603 (Current).first_column = (Current).last_column = \
604 YYRHSLOC (Rhs, 0).last_column; \
614 #ifndef YY_LOCATION_PRINT
615 # if YYLTYPE_IS_TRIVIAL
616 # define YY_LOCATION_PRINT(File, Loc) \
617 fprintf (File, "%d.%d-%d.%d", \
618 (Loc).first_line, (Loc).first_column, \
619 (Loc).last_line, (Loc).last_column)
621 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
629 # define YYLEX yylex (YYLEX_PARAM)
631 # define YYLEX yylex ()
639 # define YYFPRINTF fprintf
642 # define YYDPRINTF(Args) \
648 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
652 YYFPRINTF (stderr, "%s ", Title); \
653 yy_symbol_print (stderr, \
655 YYFPRINTF (stderr, "\n"); \
665 #if (defined __STDC__ || defined __C99__FUNC__ \
666 || defined __cplusplus || defined _MSC_VER)
671 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
674 YYSTYPE const * const yyvaluep;
681 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
697 #if (defined __STDC__ || defined __C99__FUNC__ \
698 || defined __cplusplus || defined _MSC_VER)
700 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep)
703 yy_symbol_print (yyoutput, yytype, yyvaluep)
706 YYSTYPE const * const yyvaluep;
710 YYFPRINTF (yyoutput,
"token %s (", yytname[yytype]);
712 YYFPRINTF (yyoutput,
"nterm %s (", yytname[yytype]);
714 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
715 YYFPRINTF (yyoutput,
")");
723 #if (defined __STDC__ || defined __C99__FUNC__ \
724 || defined __cplusplus || defined _MSC_VER)
729 yy_stack_print (yybottom, yytop)
734 YYFPRINTF (stderr,
"Stack now");
735 for (; yybottom <= yytop; yybottom++)
737 int yybot = *yybottom;
738 YYFPRINTF (stderr,
" %d", yybot);
740 YYFPRINTF (stderr,
"\n");
743 # define YY_STACK_PRINT(Bottom, Top) \
746 yy_stack_print ((Bottom), (Top)); \
754 #if (defined __STDC__ || defined __C99__FUNC__ \
755 || defined __cplusplus || defined _MSC_VER)
757 yy_reduce_print (
YYSTYPE *yyvsp,
int yyrule)
760 yy_reduce_print (yyvsp, yyrule)
765 int yynrhs = yyr2[yyrule];
767 unsigned long int yylno = yyrline[yyrule];
768 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
771 for (yyi = 0; yyi < yynrhs; yyi++)
773 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
774 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
775 &(yyvsp[(yyi + 1) - (yynrhs)])
777 YYFPRINTF (stderr,
"\n");
781 # define YY_REDUCE_PRINT(Rule) \
784 yy_reduce_print (yyvsp, Rule); \
791 # define YYDPRINTF(Args)
792 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
793 # define YY_STACK_PRINT(Bottom, Top)
794 # define YY_REDUCE_PRINT(Rule)
800 # define YYINITDEPTH 200
811 # define YYMAXDEPTH 10000
819 # if defined __GLIBC__ && defined _STRING_H
820 # define yystrlen strlen
823 #if (defined __STDC__ || defined __C99__FUNC__ \
824 || defined __cplusplus || defined _MSC_VER)
826 yystrlen (
const char *yystr)
834 for (yylen = 0; yystr[yylen]; yylen++)
842 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
843 # define yystpcpy stpcpy
847 #if (defined __STDC__ || defined __C99__FUNC__ \
848 || defined __cplusplus || defined _MSC_VER)
850 yystpcpy (
char *yydest,
const char *yysrc)
853 yystpcpy (yydest, yysrc)
859 const char *yys = yysrc;
861 while ((*yyd++ = *yys++) !=
'\0')
878 yytnamerr (
char *yyres,
const char *yystr)
883 char const *yyp = yystr;
890 goto do_not_strip_quotes;
894 goto do_not_strip_quotes;
907 do_not_strip_quotes: ;
911 return yystrlen (yystr);
913 return yystpcpy (yyres, yystr) - yyres;
925 yysyntax_error (
char *yyresult,
int yystate,
int yychar)
927 int yyn = yypact[yystate];
934 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
937 int yysize_overflow = 0;
938 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
939 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
945 YY_(
"syntax error, unexpected %s");
946 YY_(
"syntax error, unexpected %s, expecting %s");
947 YY_(
"syntax error, unexpected %s, expecting %s or %s");
948 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s");
949 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s");
953 static char const yyunexpected[] =
"syntax error, unexpected %s";
954 static char const yyexpecting[] =
", expecting %s";
955 static char const yyor[] =
" or %s";
956 char yyformat[
sizeof yyunexpected
957 +
sizeof yyexpecting - 1
958 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
959 * (
sizeof yyor - 1))];
960 char const *yyprefix = yyexpecting;
964 int yyxbegin = yyn < 0 ? -yyn : 0;
967 int yychecklim =
YYLAST - yyn + 1;
971 yyarg[0] = yytname[
yytype];
972 yyfmt = yystpcpy (yyformat, yyunexpected);
974 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
975 if (yycheck[yyx + yyn] == yyx && yyx !=
YYTERROR)
977 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
981 yyformat[
sizeof yyunexpected - 1] =
'\0';
984 yyarg[yycount++] = yytname[yyx];
985 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
986 yysize_overflow |= (yysize1 < yysize);
988 yyfmt = yystpcpy (yyfmt, yyprefix);
993 yysize1 = yysize + yystrlen (yyf);
994 yysize_overflow |= (yysize1 < yysize);
1005 char *yyp = yyresult;
1007 while ((*yyp = *yyf) !=
'\0')
1009 if (*yyp ==
'%' && yyf[1] ==
's' && yyi < yycount)
1011 yyp += yytnamerr (yyp, yyarg[yyi++]);
1032 #if (defined __STDC__ || defined __C99__FUNC__ \
1033 || defined __cplusplus || defined _MSC_VER)
1059 #ifdef YYPARSE_PARAM
1060 #if defined __STDC__ || defined __cplusplus
1061 int yyparse (
void *YYPARSE_PARAM);
1066 #if defined __STDC__ || defined __cplusplus
1089 #ifdef YYPARSE_PARAM
1090 #if (defined __STDC__ || defined __C99__FUNC__ \
1091 || defined __cplusplus || defined _MSC_VER)
1097 void *YYPARSE_PARAM;
1100 #if (defined __STDC__ || defined __C99__FUNC__ \
1101 || defined __cplusplus || defined _MSC_VER)
1147 char *yymsg = yymsgbuf;
1148 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1151 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1162 YYDPRINTF ((stderr,
"Starting parse\n"));
1189 if (yyss + yystacksize - 1 <= yyssp)
1192 YYSIZE_T yysize = yyssp - yyss + 1;
1206 yyoverflow (
YY_(
"memory exhausted"),
1207 &yyss1, yysize *
sizeof (*yyssp),
1208 &yyvs1, yysize *
sizeof (*yyvsp),
1215 # ifndef YYSTACK_RELOCATE
1216 goto yyexhaustedlab;
1220 goto yyexhaustedlab;
1230 goto yyexhaustedlab;
1233 # undef YYSTACK_RELOCATE
1240 yyssp = yyss + yysize - 1;
1241 yyvsp = yyvs + yysize - 1;
1243 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1244 (
unsigned long int) yystacksize));
1246 if (yyss + yystacksize - 1 <= yyssp)
1250 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1266 yyn = yypact[yystate];
1275 YYDPRINTF ((stderr,
"Reading a token: "));
1279 if (yychar <=
YYEOF)
1281 yychar = yytoken =
YYEOF;
1282 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1293 if (yyn < 0 ||
YYLAST < yyn || yycheck[yyn] != yytoken)
1325 yyn = yydefact[yystate];
1346 yyval = yyvsp[1-yylen];
1355 #line 36 "space_constitution_yacc.y"
1362 #line 39 "space_constitution_yacc.y"
1369 #line 43 "space_constitution_yacc.y"
1376 #line 46 "space_constitution_yacc.y"
1377 { (yyval.
tree) = (yyvsp[(2) - (2)].tree); ;}
1383 #line 48 "space_constitution_yacc.y"
1392 #line 53 "space_constitution_yacc.y"
1393 { (yyval.
tree) =
new_macro(tree_type(
symbol((yyvsp[(1) - (4)].string_value)),
symbol((yyvsp[(3) - (4)].string_value)))); ;}
1399 #line 56 "space_constitution_yacc.y"
1402 (yyval.
list)->push_back(*(yyvsp[(1) - (3)].tree));
delete_macro ((yyvsp[(1) - (3)].tree));
1403 (yyval.
list)->push_back(*(yyvsp[(3) - (3)].tree));
delete_macro ((yyvsp[(3) - (3)].tree));
1410 #line 62 "space_constitution_yacc.y"
1411 { (yyval.
list) = (yyvsp[(1) - (3)].list); (yyval.
list)->push_back(*(yyvsp[(3) - (3)].tree));
delete_macro ((yyvsp[(3) - (3)].tree)); ;}
1417 #line 68 "space_constitution_yacc.y"
1424 #line 1443 "space_constitution_yacc.cc"
1441 yystate = yypgoto[yyn -
YYNTOKENS] + *yyssp;
1442 if (0 <= yystate && yystate <=
YYLAST && yycheck[yystate] == *yyssp)
1443 yystate = yytable[yystate];
1458 #if ! YYERROR_VERBOSE
1462 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1468 if (yymsg != yymsgbuf)
1472 yymsg_alloc = yyalloc;
1476 yymsg_alloc =
sizeof yymsgbuf;
1480 if (0 < yysize && yysize <= yymsg_alloc)
1482 (void) yysyntax_error (yymsg, yystate, yychar);
1489 goto yyexhaustedlab;
1497 if (yyerrstatus == 3)
1502 if (yychar <=
YYEOF)
1505 if (yychar ==
YYEOF)
1549 yyn = yypact[yystate];
1567 yystos[yystate], yyvsp);
1597 #if !defined(yyoverflow) || YYERROR_VERBOSE
1615 while (yyssp != yyss)
1618 yystos[*yyssp], yyvsp);
1626 if (yymsg != yymsgbuf)
1630 return YYID (yyresult);
1636 #line 75 "space_constitution_yacc.y"