-/* A Bison parser, made by GNU Bison 3.3.2. */
+/* A Bison parser, made by GNU Bison 3.5.1. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.3.2"
+#define YYBISON_VERSION "3.5.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* First part of user prologue. */
-#line 18 "Oberon.y" /* yacc.c:337 */
+#line 18 "Oberon.y"
#include "Config.h"
#include "Error.h"
static void ExportSymbolTable(const char symfilePath[]);
-#line 159 "y.tab.c" /* yacc.c:337 */
+#line 159 "y.tab.c"
+
+# ifndef YY_CAST
+# ifdef __cplusplus
+# define YY_CAST(Type, Val) static_cast<Type> (Val)
+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
+# else
+# define YY_CAST(Type, Val) ((Type) (Val))
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
+# endif
+# endif
# ifndef YY_NULLPTR
# if defined __cplusplus
# if 201103L <= __cplusplus
# define YYERROR_VERBOSE 1
#endif
-/* In a future release of Bison, this section will be replaced
- by #include "y.tab.h". */
+/* Use api.header.include to #include this header
+ instead of duplicating it here. */
#ifndef YY_YY_Y_TAB_H_INCLUDED
# define YY_YY_Y_TAB_H_INCLUDED
/* Debug traces. */
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
union YYSTYPE
{
-#line 107 "Oberon.y" /* yacc.c:352 */
+#line 107 "Oberon.y"
const char *ident;
OBNC_INTEGER integer;
const char *string;
Trees_Node node;
-#line 300 "y.tab.c" /* yacc.c:352 */
-};
+#line 309 "y.tab.c"
+};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
# undef short
#endif
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+ <limits.h> and (if available) <stdint.h> are included
+ so that the code can choose integer types of a good width. */
+
+#ifndef __PTRDIFF_MAX__
+# include <limits.h> /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_STDINT_H
+# endif
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
+/* Narrow types that promote to a signed type and that can represent a
+ signed or unsigned integer of at least N bits. In tables they can
+ save space and decrease cache pressure. Promoting to a signed type
+ helps avoid bugs in integer arithmetic. */
+
+#ifdef __INT_LEAST8_MAX__
+typedef __INT_LEAST8_TYPE__ yytype_int8;
+#elif defined YY_STDINT_H
+typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
#else
-typedef unsigned short yytype_uint16;
+typedef short yytype_int16;
#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
+#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST8_TYPE__ yytype_uint8;
+#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST8_MAX <= INT_MAX)
+typedef uint_least8_t yytype_uint8;
+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
+typedef unsigned char yytype_uint8;
#else
-typedef short yytype_int16;
+typedef short yytype_uint8;
+#endif
+
+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST16_MAX <= INT_MAX)
+typedef uint_least16_t yytype_uint16;
+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
+typedef unsigned short yytype_uint16;
+#else
+typedef int yytype_uint16;
+#endif
+
+#ifndef YYPTRDIFF_T
+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
+# define YYPTRDIFF_T __PTRDIFF_TYPE__
+# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
+# elif defined PTRDIFF_MAX
+# ifndef ptrdiff_t
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# endif
+# define YYPTRDIFF_T ptrdiff_t
+# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
+# else
+# define YYPTRDIFF_T long
+# define YYPTRDIFF_MAXIMUM LONG_MAX
+# endif
#endif
#ifndef YYSIZE_T
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
# endif
#endif
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+#define YYSIZE_MAXIMUM \
+ YY_CAST (YYPTRDIFF_T, \
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
+ ? YYPTRDIFF_MAXIMUM \
+ : YY_CAST (YYSIZE_T, -1)))
+
+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
+
+/* Stored state numbers (used for stacks). */
+typedef yytype_int16 yy_state_t;
+
+/* State numbers in computations. */
+typedef int yy_state_fast_t;
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
# endif
#endif
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__ \
- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+#ifndef YY_ATTRIBUTE_PURE
+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
-# define YY_ATTRIBUTE(Spec) /* empty */
+# define YY_ATTRIBUTE_PURE
# endif
#endif
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
-#endif
-
#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+# else
+# define YY_ATTRIBUTE_UNUSED
+# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
+# define YY_IGNORE_USELESS_CAST_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
+# define YY_IGNORE_USELESS_CAST_END \
+ _Pragma ("GCC diagnostic pop")
+#endif
+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_END
+#endif
+
+
+#define YY_ASSERT(E) ((void) (0 && (E)))
#if ! defined yyoverflow || YYERROR_VERBOSE
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
+ yy_state_t yyss_alloc;
YYSTYPE yyvs_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
- YYSIZE_T yynewbytes; \
+ YYPTRDIFF_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
} \
while (0)
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
- YYSIZE_T yyi; \
+ YYPTRDIFF_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
#define YYUNDEFTOK 2
#define YYMAXUTOK 300
+
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
as returned by yylex, with out-of-bounds checking. */
#define YYTRANSLATE(YYX) \
- ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
as returned by yylex. */
-static const yytype_uint8 yytranslate[] =
+static const yytype_int8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
-static const yytype_uint16 yyrline[] =
+static const yytype_int16 yyrline[] =
{
0, 221, 221, 225, 232, 250, 255, 264, 268, 278,
294, 309, 332, 342, 343, 344, 345, 346, 350, 370,
# ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
(internal) symbol number NUM (which must be that of a token). */
-static const yytype_uint16 yytoknum[] =
+static const yytype_int16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
};
# endif
-#define YYPACT_NINF -132
+#define YYPACT_NINF (-132)
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-132)))
+#define yypact_value_is_default(Yyn) \
+ ((Yyn) == YYPACT_NINF)
-#define YYTABLE_NINF -166
+#define YYTABLE_NINF (-166)
-#define yytable_value_is_error(Yytable_value) \
+#define yytable_value_is_error(Yyn) \
0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
+static const yytype_int8 yyr2[] =
{
0, 2, 1, 3, 2, 1, 0, 1, 1, 3,
1, 2, 2, 1, 1, 1, 1, 1, 2, 3,
if (yytype < YYNTOKENS)
YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
# endif
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
`------------------------------------------------------------------*/
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
`------------------------------------------------*/
static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule)
{
- unsigned long yylno = yyrline[yyrule];
+ int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
- yystos[yyssp[yyi + 1 - yynrhs]],
+ yystos[+yyssp[yyi + 1 - yynrhs]],
&yyvsp[(yyi + 1) - (yynrhs)]
);
YYFPRINTF (stderr, "\n");
# ifndef yystrlen
# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
+# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
# else
/* Return the length of YYSTR. */
-static YYSIZE_T
+static YYPTRDIFF_T
yystrlen (const char *yystr)
{
- YYSIZE_T yylen;
+ YYPTRDIFF_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
continue;
return yylen;
backslash-backslash). YYSTR is taken from yytname. If YYRES is
null, do not copy; instead, return the length of what the result
would have been. */
-static YYSIZE_T
+static YYPTRDIFF_T
yytnamerr (char *yyres, const char *yystr)
{
if (*yystr == '"')
{
- YYSIZE_T yyn = 0;
+ YYPTRDIFF_T yyn = 0;
char const *yyp = yystr;
for (;;)
do_not_strip_quotes: ;
}
- if (! yyres)
+ if (yyres)
+ return yystpcpy (yyres, yystr) - yyres;
+ else
return yystrlen (yystr);
-
- return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
}
# endif
*YYMSG_ALLOC to the required number of bytes. Return 2 if the
required number of bytes is too large to store. */
static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
+yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
+ yy_state_t *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = YY_NULLPTR;
- /* Arguments of yyformat. */
+ /* Arguments of yyformat: reported tokens (one for the "unexpected",
+ one per "expected"). */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
+ /* Actual size of YYARG. */
int yycount = 0;
+ /* Cumulated lengths of YYARG. */
+ YYPTRDIFF_T yysize = 0;
/* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then
*/
if (yytoken != YYEMPTY)
{
- int yyn = yypact[*yyssp];
+ int yyn = yypact[+*yyssp];
+ YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ yysize = yysize0;
yyarg[yycount++] = yytname[yytoken];
if (!yypact_value_is_default (yyn))
{
}
yyarg[yycount++] = yytname[yyx];
{
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ YYPTRDIFF_T yysize1
+ = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
yysize = yysize1;
else
}
{
- YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ /* Don't count the "%s"s in the final size, but reserve room for
+ the terminator. */
+ YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
yysize = yysize1;
else
}
else
{
- yyp++;
- yyformat++;
+ ++yyp;
+ ++yyformat;
}
}
return 0;
int
yyparse (void)
{
- int yystate;
+ yy_state_fast_t yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
to reallocate them elsewhere. */
/* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
+ yy_state_t yyssa[YYINITDEPTH];
+ yy_state_t *yyss;
+ yy_state_t *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs;
YYSTYPE *yyvsp;
- YYSIZE_T yystacksize;
+ YYPTRDIFF_T yystacksize;
int yyn;
int yyresult;
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+ YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
#endif
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/*--------------------------------------------------------------------.
-| yynewstate -- set current state (the top of the stack) to yystate. |
+| yysetstate -- set current state (the top of the stack) to yystate. |
`--------------------------------------------------------------------*/
yysetstate:
- *yyssp = (yytype_int16) yystate;
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ YY_IGNORE_USELESS_CAST_BEGIN
+ *yyssp = YY_CAST (yy_state_t, yystate);
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
# if defined yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
+ yy_state_t *yyss1 = yyss;
YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
+ &yyss1, yysize * YYSIZEOF (*yyssp),
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
&yystacksize);
yyss = yyss1;
yyvs = yyvs1;
yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
+ yy_state_t *yyss1 = yyss;
union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ YY_CAST (union yyalloc *,
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
if (! yyptr)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss);
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long) yystacksize));
+ YY_IGNORE_USELESS_CAST_BEGIN
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
+ YY_CAST (long, yystacksize)));
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
if (yystate == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token. */
- yychar = YYEMPTY;
-
yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
goto yynewstate;
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 2:
-#line 222 "Oberon.y" /* yacc.c:1652 */
- {
+ case 2:
+#line 222 "Oberon.y"
+ {
(yyval.node) = Trees_NewIdent((yyvsp[0].ident));
}
-#line 1626 "y.tab.c" /* yacc.c:1652 */
+#line 1717 "y.tab.c"
break;
case 3:
-#line 226 "Oberon.y" /* yacc.c:1652 */
- {
+#line 226 "Oberon.y"
+ {
(yyval.node) = Trees_NewIdent(Util_String("%s.%s", (yyvsp[-2].ident), (yyvsp[0].ident)));
}
-#line 1634 "y.tab.c" /* yacc.c:1652 */
+#line 1725 "y.tab.c"
break;
case 4:
-#line 233 "Oberon.y" /* yacc.c:1652 */
- {
+#line 233 "Oberon.y"
+ {
if (! Table_LocallyDeclared((yyvsp[-1].ident)) || (recordDeclarationStack != NULL)) {
(yyval.node) = Trees_NewIdent((yyvsp[-1].ident));
if ((yyvsp[0].integer)) {
YYABORT;
}
}
-#line 1653 "y.tab.c" /* yacc.c:1652 */
+#line 1744 "y.tab.c"
break;
case 5:
-#line 251 "Oberon.y" /* yacc.c:1652 */
- {
+#line 251 "Oberon.y"
+ {
(yyval.integer) = 1;
}
-#line 1661 "y.tab.c" /* yacc.c:1652 */
+#line 1752 "y.tab.c"
break;
case 6:
-#line 255 "Oberon.y" /* yacc.c:1652 */
- {
+#line 255 "Oberon.y"
+ {
(yyval.integer) = 0;
}
-#line 1669 "y.tab.c" /* yacc.c:1652 */
+#line 1760 "y.tab.c"
break;
case 7:
-#line 265 "Oberon.y" /* yacc.c:1652 */
- {
+#line 265 "Oberon.y"
+ {
(yyval.node) = Trees_NewInteger((yyvsp[0].integer));
}
-#line 1677 "y.tab.c" /* yacc.c:1652 */
+#line 1768 "y.tab.c"
break;
case 8:
-#line 269 "Oberon.y" /* yacc.c:1652 */
- {
+#line 269 "Oberon.y"
+ {
(yyval.node) = Trees_NewReal((yyvsp[0].real));
}
-#line 1685 "y.tab.c" /* yacc.c:1652 */
+#line 1776 "y.tab.c"
break;
case 9:
-#line 279 "Oberon.y" /* yacc.c:1652 */
- {
+#line 279 "Oberon.y"
+ {
if (! (Trees_Exported((yyvsp[-2].node)) && Trees_Local((yyvsp[-2].node)))) {
Trees_SetKind(TREES_CONSTANT_KIND, (yyvsp[-2].node));
Trees_SetType(Trees_Type((yyvsp[0].node)), (yyvsp[-2].node));
YYABORT;
}
}
-#line 1702 "y.tab.c" /* yacc.c:1652 */
+#line 1793 "y.tab.c"
break;
case 10:
-#line 295 "Oberon.y" /* yacc.c:1652 */
- {
+#line 295 "Oberon.y"
+ {
if (IsConstExpression((yyvsp[0].node))) {
(yyval.node) = (yyvsp[0].node);
} else {
YYABORT;
}
}
-#line 1715 "y.tab.c" /* yacc.c:1652 */
+#line 1806 "y.tab.c"
break;
case 11:
-#line 310 "Oberon.y" /* yacc.c:1652 */
- {
+#line 310 "Oberon.y"
+ {
Trees_Node sourceType;
sourceType = ResolvedType((yyvsp[0].node), 1);
YYABORT;
}
} else {
- Oberon_PrintError("error: undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
+ Oberon_PrintError("error: 8 undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
YYABORT;
}
}
-#line 1739 "y.tab.c" /* yacc.c:1652 */
+#line 1830 "y.tab.c"
break;
case 12:
-#line 333 "Oberon.y" /* yacc.c:1652 */
- {
+#line 333 "Oberon.y"
+ {
Trees_SetKind(TREES_TYPE_KIND, (yyvsp[-1].node));
currentTypeIdentdef = (yyvsp[-1].node);
Table_Put((yyvsp[-1].node));
(yyval.node) = (yyvsp[-1].node);
}
-#line 1750 "y.tab.c" /* yacc.c:1652 */
+#line 1841 "y.tab.c"
break;
case 18:
-#line 351 "Oberon.y" /* yacc.c:1652 */
- {
+#line 351 "Oberon.y"
+ {
Trees_Node reversedLengths, length;
(yyval.node) = ResolvedType((yyvsp[0].node), 0);
reversedLengths = Trees_Right(reversedLengths);
} while (reversedLengths != NULL);
} else {
- Oberon_PrintError("error: undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
+ Oberon_PrintError("error: 10 undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
exit(EXIT_FAILURE);
}
}
-#line 1771 "y.tab.c" /* yacc.c:1652 */
+#line 1862 "y.tab.c"
break;
case 19:
-#line 371 "Oberon.y" /* yacc.c:1652 */
- {
+#line 371 "Oberon.y"
+ {
if ((currentTypeIdentdef != NULL) && (Trees_Type(currentTypeIdentdef) == NULL)) {
Trees_SetType(Trees_NewLeaf(ARRAY), currentTypeIdentdef); /*incomplete type*/
}
(yyval.node) = (yyvsp[-1].node);
}
-#line 1782 "y.tab.c" /* yacc.c:1652 */
+#line 1873 "y.tab.c"
break;
case 20:
-#line 381 "Oberon.y" /* yacc.c:1652 */
- {
+#line 381 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), NULL);
}
-#line 1790 "y.tab.c" /* yacc.c:1652 */
+#line 1881 "y.tab.c"
break;
case 21:
-#line 385 "Oberon.y" /* yacc.c:1652 */
- {
+#line 385 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), (yyvsp[-2].node));
}
-#line 1798 "y.tab.c" /* yacc.c:1652 */
+#line 1889 "y.tab.c"
break;
case 22:
-#line 392 "Oberon.y" /* yacc.c:1652 */
- {
+#line 392 "Oberon.y"
+ {
if (Types_IsInteger(Trees_Type((yyvsp[0].node)))) {
if (IsInteger((yyvsp[0].node))) {
if (Trees_Integer((yyvsp[0].node)) <= 0) {
YYABORT;
}
}
-#line 1819 "y.tab.c" /* yacc.c:1652 */
+#line 1910 "y.tab.c"
break;
case 23:
-#line 412 "Oberon.y" /* yacc.c:1652 */
- {
+#line 412 "Oberon.y"
+ {
recordDeclarationStack = Trees_Right(recordDeclarationStack);
(yyval.node) = Types_NewRecord(Types_RecordBaseType((yyvsp[-2].node)), (yyvsp[-1].node));
}
-#line 1828 "y.tab.c" /* yacc.c:1652 */
+#line 1919 "y.tab.c"
break;
case 24:
-#line 420 "Oberon.y" /* yacc.c:1652 */
- {
+#line 420 "Oberon.y"
+ {
(yyval.node) = Types_NewRecord((yyvsp[0].node), NULL);
if ((currentTypeIdentdef != NULL) && (Trees_Type(currentTypeIdentdef) == NULL)) {
Trees_SetType((yyval.node), currentTypeIdentdef);
}
recordDeclarationStack = Trees_NewNode(TREES_NOSYM, (yyval.node), recordDeclarationStack);
}
-#line 1840 "y.tab.c" /* yacc.c:1652 */
+#line 1931 "y.tab.c"
break;
case 25:
-#line 431 "Oberon.y" /* yacc.c:1652 */
- {
+#line 431 "Oberon.y"
+ {
(yyval.node) = (yyvsp[-1].node);
}
-#line 1848 "y.tab.c" /* yacc.c:1652 */
+#line 1939 "y.tab.c"
break;
case 26:
-#line 435 "Oberon.y" /* yacc.c:1652 */
- {
+#line 435 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 1856 "y.tab.c" /* yacc.c:1652 */
+#line 1947 "y.tab.c"
break;
case 27:
-#line 442 "Oberon.y" /* yacc.c:1652 */
- {
+#line 442 "Oberon.y"
+ {
const char *name;
Trees_Node symbol;
YYABORT;
}
} else {
- Oberon_PrintError("error: undeclared identifier: %s", name);
+ Oberon_PrintError("error: 11 undeclared identifier: %s", name);
YYABORT;
}
}
-#line 1898 "y.tab.c" /* yacc.c:1652 */
+#line 1989 "y.tab.c"
break;
case 28:
-#line 483 "Oberon.y" /* yacc.c:1652 */
- {
+#line 483 "Oberon.y"
+ {
Trees_ReverseList(&(yyvsp[0].node)); /*correct order*/
(yyval.node) = (yyvsp[0].node);
}
-#line 1907 "y.tab.c" /* yacc.c:1652 */
+#line 1998 "y.tab.c"
break;
case 29:
-#line 488 "Oberon.y" /* yacc.c:1652 */
- {
+#line 488 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 1915 "y.tab.c" /* yacc.c:1652 */
+#line 2006 "y.tab.c"
break;
case 30:
-#line 495 "Oberon.y" /* yacc.c:1652 */
- {
+#line 495 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(TREES_FIELD_LIST_SEQUENCE, (yyvsp[0].node), NULL);
}
-#line 1923 "y.tab.c" /* yacc.c:1652 */
+#line 2014 "y.tab.c"
break;
case 31:
-#line 499 "Oberon.y" /* yacc.c:1652 */
- {
+#line 499 "Oberon.y"
+ {
Trees_Node currSeq, currList, currSeqList;
const char *seqIdentName, *listIdentName;
}
(yyval.node) = Trees_NewNode(TREES_FIELD_LIST_SEQUENCE, (yyvsp[0].node), (yyvsp[-2].node));
}
-#line 1952 "y.tab.c" /* yacc.c:1652 */
+#line 2043 "y.tab.c"
break;
case 32:
-#line 527 "Oberon.y" /* yacc.c:1652 */
- {
+#line 527 "Oberon.y"
+ {
Trees_Node type, tail, ident, p, directBaseType, baseTypeField, baseType;
(yyval.node) = NULL;
YYABORT;
}
}
-#line 2002 "y.tab.c" /* yacc.c:1652 */
+#line 2093 "y.tab.c"
break;
case 33:
-#line 576 "Oberon.y" /* yacc.c:1652 */
- {
+#line 576 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(TREES_IDENT_LIST, (yyvsp[0].node), NULL);
}
-#line 2010 "y.tab.c" /* yacc.c:1652 */
+#line 2101 "y.tab.c"
break;
case 34:
-#line 580 "Oberon.y" /* yacc.c:1652 */
- {
+#line 580 "Oberon.y"
+ {
Trees_Node reversedIdents;
reversedIdents = Trees_NewNode(TREES_IDENT_LIST, (yyvsp[0].node), (yyvsp[-2].node));
(yyval.node) = reversedIdents;
}
-#line 2021 "y.tab.c" /* yacc.c:1652 */
+#line 2112 "y.tab.c"
break;
case 35:
-#line 590 "Oberon.y" /* yacc.c:1652 */
- {
+#line 590 "Oberon.y"
+ {
const char *baseTypeName;
Trees_Node declaredBaseType;
YYABORT;
}
}
-#line 2057 "y.tab.c" /* yacc.c:1652 */
+#line 2148 "y.tab.c"
break;
case 36:
-#line 625 "Oberon.y" /* yacc.c:1652 */
- {
+#line 625 "Oberon.y"
+ {
if ((currentTypeIdentdef != NULL) && (Trees_Type(currentTypeIdentdef) == NULL)) {
Trees_SetType(Types_NewPointer(NULL), currentTypeIdentdef); /*incomplete type*/
}
}
-#line 2067 "y.tab.c" /* yacc.c:1652 */
+#line 2158 "y.tab.c"
break;
case 37:
-#line 634 "Oberon.y" /* yacc.c:1652 */
- {
+#line 634 "Oberon.y"
+ {
(yyval.node) = (yyvsp[0].node);
}
-#line 2075 "y.tab.c" /* yacc.c:1652 */
+#line 2166 "y.tab.c"
break;
case 38:
-#line 641 "Oberon.y" /* yacc.c:1652 */
- {
+#line 641 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 2083 "y.tab.c" /* yacc.c:1652 */
+#line 2174 "y.tab.c"
break;
case 40:
-#line 649 "Oberon.y" /* yacc.c:1652 */
- {
+#line 649 "Oberon.y"
+ {
(yyval.node) = Trees_NewLeaf(PROCEDURE);
}
-#line 2091 "y.tab.c" /* yacc.c:1652 */
+#line 2182 "y.tab.c"
break;
case 41:
-#line 659 "Oberon.y" /* yacc.c:1652 */
- {
+#line 659 "Oberon.y"
+ {
Trees_Node type, identList, ident;
type = ResolvedType((yyvsp[0].node), 0);
Generate_VariableDeclaration((yyvsp[-2].node));
} else {
- Oberon_PrintError("error: undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
+ Oberon_PrintError("error: 1 undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
exit(EXIT_FAILURE);
}
}
-#line 2127 "y.tab.c" /* yacc.c:1652 */
+#line 2218 "y.tab.c"
break;
case 43:
-#line 698 "Oberon.y" /* yacc.c:1652 */
- {
+#line 698 "Oberon.y"
+ {
Trees_Node expA, expB, typeA, typeB;
int op = (int) (yyvsp[-1].integer);
YYABORT;
}
}
-#line 2175 "y.tab.c" /* yacc.c:1652 */
+#line 2266 "y.tab.c"
break;
case 44:
-#line 745 "Oberon.y" /* yacc.c:1652 */
- {
+#line 745 "Oberon.y"
+ {
(yyval.integer) = '=';
}
-#line 2183 "y.tab.c" /* yacc.c:1652 */
+#line 2274 "y.tab.c"
break;
case 45:
-#line 749 "Oberon.y" /* yacc.c:1652 */
- {
+#line 749 "Oberon.y"
+ {
(yyval.integer) = '#';
}
-#line 2191 "y.tab.c" /* yacc.c:1652 */
+#line 2282 "y.tab.c"
break;
case 46:
-#line 753 "Oberon.y" /* yacc.c:1652 */
- {
+#line 753 "Oberon.y"
+ {
(yyval.integer) = '<';
}
-#line 2199 "y.tab.c" /* yacc.c:1652 */
+#line 2290 "y.tab.c"
break;
case 47:
-#line 757 "Oberon.y" /* yacc.c:1652 */
- {
+#line 757 "Oberon.y"
+ {
(yyval.integer) = LE;
}
-#line 2207 "y.tab.c" /* yacc.c:1652 */
+#line 2298 "y.tab.c"
break;
case 48:
-#line 761 "Oberon.y" /* yacc.c:1652 */
- {
+#line 761 "Oberon.y"
+ {
(yyval.integer) = '>';
}
-#line 2215 "y.tab.c" /* yacc.c:1652 */
+#line 2306 "y.tab.c"
break;
case 49:
-#line 765 "Oberon.y" /* yacc.c:1652 */
- {
+#line 765 "Oberon.y"
+ {
(yyval.integer) = GE;
}
-#line 2223 "y.tab.c" /* yacc.c:1652 */
+#line 2314 "y.tab.c"
break;
case 50:
-#line 769 "Oberon.y" /* yacc.c:1652 */
- {
+#line 769 "Oberon.y"
+ {
(yyval.integer) = IN;
}
-#line 2231 "y.tab.c" /* yacc.c:1652 */
+#line 2322 "y.tab.c"
break;
case 51:
-#line 773 "Oberon.y" /* yacc.c:1652 */
- {
+#line 773 "Oberon.y"
+ {
(yyval.integer) = IS;
}
-#line 2239 "y.tab.c" /* yacc.c:1652 */
+#line 2330 "y.tab.c"
break;
case 52:
-#line 780 "Oberon.y" /* yacc.c:1652 */
- {
+#line 780 "Oberon.y"
+ {
int op = (int) (yyvsp[-1].integer);
(yyval.node) = (yyvsp[0].node);
if (op >= 0) {
}
}
}
-#line 2265 "y.tab.c" /* yacc.c:1652 */
+#line 2356 "y.tab.c"
break;
case 53:
-#line 802 "Oberon.y" /* yacc.c:1652 */
- {
+#line 802 "Oberon.y"
+ {
int op = (int) (yyvsp[-1].integer);
(yyval.node) = NULL;
}
assert((yyval.node) != NULL);
}
-#line 2295 "y.tab.c" /* yacc.c:1652 */
+#line 2386 "y.tab.c"
break;
case 54:
-#line 831 "Oberon.y" /* yacc.c:1652 */
- {
+#line 831 "Oberon.y"
+ {
(yyval.integer) = '+';
}
-#line 2303 "y.tab.c" /* yacc.c:1652 */
+#line 2394 "y.tab.c"
break;
case 55:
-#line 835 "Oberon.y" /* yacc.c:1652 */
- {
+#line 835 "Oberon.y"
+ {
(yyval.integer) = '-';
}
-#line 2311 "y.tab.c" /* yacc.c:1652 */
+#line 2402 "y.tab.c"
break;
case 56:
-#line 839 "Oberon.y" /* yacc.c:1652 */
- {
+#line 839 "Oberon.y"
+ {
(yyval.integer) = -1;
}
-#line 2319 "y.tab.c" /* yacc.c:1652 */
+#line 2410 "y.tab.c"
break;
case 57:
-#line 846 "Oberon.y" /* yacc.c:1652 */
- {
+#line 846 "Oberon.y"
+ {
(yyval.integer) = '+';
}
-#line 2327 "y.tab.c" /* yacc.c:1652 */
+#line 2418 "y.tab.c"
break;
case 58:
-#line 850 "Oberon.y" /* yacc.c:1652 */
- {
+#line 850 "Oberon.y"
+ {
(yyval.integer) = '-';
}
-#line 2335 "y.tab.c" /* yacc.c:1652 */
+#line 2426 "y.tab.c"
break;
case 59:
-#line 854 "Oberon.y" /* yacc.c:1652 */
- {
+#line 854 "Oberon.y"
+ {
(yyval.integer) = OR;
}
-#line 2343 "y.tab.c" /* yacc.c:1652 */
+#line 2434 "y.tab.c"
break;
case 61:
-#line 862 "Oberon.y" /* yacc.c:1652 */
- {
+#line 862 "Oberon.y"
+ {
int op = (int) (yyvsp[-1].integer);
(yyval.node) = NULL;
assert((yyval.node) != NULL);
}
-#line 2374 "y.tab.c" /* yacc.c:1652 */
+#line 2465 "y.tab.c"
break;
case 62:
-#line 892 "Oberon.y" /* yacc.c:1652 */
- {
+#line 892 "Oberon.y"
+ {
(yyval.integer) = '*';
}
-#line 2382 "y.tab.c" /* yacc.c:1652 */
+#line 2473 "y.tab.c"
break;
case 63:
-#line 896 "Oberon.y" /* yacc.c:1652 */
- {
+#line 896 "Oberon.y"
+ {
(yyval.integer) = '/';
}
-#line 2390 "y.tab.c" /* yacc.c:1652 */
+#line 2481 "y.tab.c"
break;
case 64:
-#line 900 "Oberon.y" /* yacc.c:1652 */
- {
+#line 900 "Oberon.y"
+ {
(yyval.integer) = DIV;
}
-#line 2398 "y.tab.c" /* yacc.c:1652 */
+#line 2489 "y.tab.c"
break;
case 65:
-#line 904 "Oberon.y" /* yacc.c:1652 */
- {
+#line 904 "Oberon.y"
+ {
(yyval.integer) = MOD;
}
-#line 2406 "y.tab.c" /* yacc.c:1652 */
+#line 2497 "y.tab.c"
break;
case 66:
-#line 908 "Oberon.y" /* yacc.c:1652 */
- {
+#line 908 "Oberon.y"
+ {
(yyval.integer) = '&';
}
-#line 2414 "y.tab.c" /* yacc.c:1652 */
+#line 2505 "y.tab.c"
break;
case 68:
-#line 916 "Oberon.y" /* yacc.c:1652 */
- {
+#line 916 "Oberon.y"
+ {
(yyval.node) = Trees_NewString((yyvsp[0].string));
}
-#line 2422 "y.tab.c" /* yacc.c:1652 */
+#line 2513 "y.tab.c"
break;
case 69:
-#line 920 "Oberon.y" /* yacc.c:1652 */
- {
+#line 920 "Oberon.y"
+ {
(yyval.node) = Trees_NewLeaf(NIL);
Trees_SetType(Trees_NewLeaf(TREES_NIL_TYPE), (yyval.node));
}
-#line 2431 "y.tab.c" /* yacc.c:1652 */
+#line 2522 "y.tab.c"
break;
case 70:
-#line 925 "Oberon.y" /* yacc.c:1652 */
- {
+#line 925 "Oberon.y"
+ {
(yyval.node) = Trees_NewBoolean(1);
}
-#line 2439 "y.tab.c" /* yacc.c:1652 */
+#line 2530 "y.tab.c"
break;
case 71:
-#line 929 "Oberon.y" /* yacc.c:1652 */
- {
+#line 929 "Oberon.y"
+ {
(yyval.node) = Trees_NewBoolean(0);
}
-#line 2447 "y.tab.c" /* yacc.c:1652 */
+#line 2538 "y.tab.c"
break;
case 72:
-#line 933 "Oberon.y" /* yacc.c:1652 */
- {
+#line 933 "Oberon.y"
+ {
(yyval.node) = (yyvsp[0].node);
Trees_SetType(Trees_NewLeaf(TREES_SET_TYPE), (yyval.node));
}
-#line 2456 "y.tab.c" /* yacc.c:1652 */
+#line 2547 "y.tab.c"
break;
case 73:
-#line 939 "Oberon.y" /* yacc.c:1652 */
- {
+#line 939 "Oberon.y"
+ {
const int isFunctionCall = 1;
Trees_Node designator, actualParameters, ident;
}
assert((yyval.node) != NULL);
}
-#line 2480 "y.tab.c" /* yacc.c:1652 */
+#line 2571 "y.tab.c"
break;
case 74:
-#line 959 "Oberon.y" /* yacc.c:1652 */
- {
+#line 959 "Oberon.y"
+ {
CheckIsValueExpression((yyvsp[-1].node));
(yyval.node) = (yyvsp[-1].node);
}
-#line 2489 "y.tab.c" /* yacc.c:1652 */
+#line 2580 "y.tab.c"
break;
case 75:
-#line 964 "Oberon.y" /* yacc.c:1652 */
- {
+#line 964 "Oberon.y"
+ {
(yyval.node) = NULL;
CheckIsValueExpression((yyvsp[0].node));
if (Types_ExpressionCompatible('~', Trees_Type((yyvsp[0].node)), NULL)) {
}
assert((yyval.node) != NULL);
}
-#line 2510 "y.tab.c" /* yacc.c:1652 */
+#line 2601 "y.tab.c"
break;
case 76:
-#line 985 "Oberon.y" /* yacc.c:1652 */
- {
+#line 985 "Oberon.y"
+ {
Trees_Node designator, identType, actualParameters;
int parameterListFound; /*possibly empty*/
(yyval.node) = designator;
}
}
-#line 2531 "y.tab.c" /* yacc.c:1652 */
+#line 2622 "y.tab.c"
break;
case 77:
-#line 1005 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1005 "Oberon.y"
+ {
Trees_Node curr;
if ((Trees_Symbol((yyvsp[0].node)) == '[') && (Trees_Right((yyvsp[0].node)) != NULL)) { /*multi-dimensional element selector*/
(yyval.node) = Trees_NewNode(Trees_Symbol((yyvsp[0].node)), Trees_Left((yyvsp[0].node)), (yyvsp[-1].node));
}
}
-#line 2553 "y.tab.c" /* yacc.c:1652 */
+#line 2644 "y.tab.c"
break;
case 78:
-#line 1023 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1023 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 2561 "y.tab.c" /* yacc.c:1652 */
+#line 2652 "y.tab.c"
break;
case 79:
-#line 1030 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1030 "Oberon.y"
+ {
Trees_Node field;
field = Trees_NewIdent((yyvsp[0].ident));
Trees_SetKind(TREES_FIELD_KIND, field);
(yyval.node) = Trees_NewNode('.', field, NULL);
}
-#line 2573 "y.tab.c" /* yacc.c:1652 */
+#line 2664 "y.tab.c"
break;
case 80:
-#line 1038 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1038 "Oberon.y"
+ {
Trees_Node curr, exp;
/*create one selector node per index*/
curr = Trees_Right(curr);
} while (curr != NULL);
}
-#line 2595 "y.tab.c" /* yacc.c:1652 */
+#line 2686 "y.tab.c"
break;
case 81:
-#line 1056 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1056 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode('^', NULL, NULL);
}
-#line 2603 "y.tab.c" /* yacc.c:1652 */
+#line 2694 "y.tab.c"
break;
case 82:
-#line 1061 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1061 "Oberon.y"
+ {
Trees_ReverseList(&(yyvsp[-1].node)); /*correct order*/
(yyval.node) = Trees_NewNode('(', (yyvsp[-1].node), NULL);
}
-#line 2612 "y.tab.c" /* yacc.c:1652 */
+#line 2703 "y.tab.c"
break;
case 83:
-#line 1066 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1066 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode('(', NULL, NULL);
}
-#line 2620 "y.tab.c" /* yacc.c:1652 */
+#line 2711 "y.tab.c"
break;
case 84:
-#line 1073 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1073 "Oberon.y"
+ {
(yyval.node) = Trees_NewSet(0x0u);
}
-#line 2628 "y.tab.c" /* yacc.c:1652 */
+#line 2719 "y.tab.c"
break;
case 85:
-#line 1077 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1077 "Oberon.y"
+ {
(yyval.node) = (yyvsp[-1].node);
}
-#line 2636 "y.tab.c" /* yacc.c:1652 */
+#line 2727 "y.tab.c"
break;
case 87:
-#line 1085 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1085 "Oberon.y"
+ {
if ((Trees_Symbol((yyvsp[-2].node)) == TREES_SET_CONSTANT)
&& (Trees_Symbol((yyvsp[0].node)) == TREES_SET_CONSTANT)) {
(yyval.node) = Trees_NewSet(Trees_Set((yyvsp[-2].node)) | Trees_Set((yyvsp[0].node)));
Trees_SetType(Trees_NewLeaf(TREES_SET_TYPE), (yyval.node));
}
}
-#line 2650 "y.tab.c" /* yacc.c:1652 */
+#line 2741 "y.tab.c"
break;
case 88:
-#line 1098 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1098 "Oberon.y"
+ {
OBNC_INTEGER i;
Trees_Node type;
YYABORT;
}
}
-#line 2674 "y.tab.c" /* yacc.c:1652 */
+#line 2765 "y.tab.c"
break;
case 89:
-#line 1118 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1118 "Oberon.y"
+ {
CheckIsValueExpression((yyvsp[-2].node));
CheckIsValueExpression((yyvsp[0].node));
(yyval.node) = NULL;
YYABORT;
}
}
-#line 2699 "y.tab.c" /* yacc.c:1652 */
+#line 2790 "y.tab.c"
break;
case 90:
-#line 1142 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1142 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(TREES_EXP_LIST, (yyvsp[0].node), NULL);
Trees_SetType(Trees_Type((yyvsp[0].node)), (yyval.node));
}
-#line 2708 "y.tab.c" /* yacc.c:1652 */
+#line 2799 "y.tab.c"
break;
case 91:
-#line 1147 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1147 "Oberon.y"
+ {
Trees_Node reversedList;
reversedList = Trees_NewNode(TREES_EXP_LIST, (yyvsp[0].node), (yyvsp[-2].node));
(yyval.node) = reversedList;
Trees_SetType(Trees_Type((yyvsp[0].node)), (yyval.node));
}
-#line 2720 "y.tab.c" /* yacc.c:1652 */
+#line 2811 "y.tab.c"
break;
case 99:
-#line 1168 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1168 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 2728 "y.tab.c" /* yacc.c:1652 */
+#line 2819 "y.tab.c"
break;
case 100:
-#line 1175 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1175 "Oberon.y"
+ {
Trees_Node designator, ident, designatorType, exp;
CheckIsValueExpression((yyvsp[0].node));
assert(0);
}
}
-#line 2771 "y.tab.c" /* yacc.c:1652 */
+#line 2862 "y.tab.c"
break;
case 101:
-#line 1218 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1218 "Oberon.y"
+ {
const int isFunctionCall = 0;
Trees_Node designator, actualParameters;
HandleProcedureCall(designator, actualParameters, isFunctionCall, &(yyval.node));
assert((yyval.node) != NULL);
}
-#line 2790 "y.tab.c" /* yacc.c:1652 */
+#line 2881 "y.tab.c"
break;
case 102:
-#line 1236 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1236 "Oberon.y"
+ {
Trees_ReverseList(&(yyvsp[0].node)); /*correct order*/
(yyval.node) = (yyvsp[0].node);
}
-#line 2799 "y.tab.c" /* yacc.c:1652 */
+#line 2890 "y.tab.c"
break;
case 103:
-#line 1244 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1244 "Oberon.y"
+ {
if ((yyvsp[0].node) == NULL) {
(yyval.node) = NULL;
} else {
(yyval.node) = Trees_NewNode(TREES_STATEMENT_SEQUENCE, (yyvsp[0].node), NULL);
}
}
-#line 2811 "y.tab.c" /* yacc.c:1652 */
+#line 2902 "y.tab.c"
break;
case 104:
-#line 1252 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1252 "Oberon.y"
+ {
if ((yyvsp[0].node) != NULL) {
(yyval.node) = Trees_NewNode(TREES_STATEMENT_SEQUENCE, (yyvsp[0].node), (yyvsp[-2].node));
} else {
(yyval.node) = (yyvsp[-2].node);
}
}
-#line 2823 "y.tab.c" /* yacc.c:1652 */
+#line 2914 "y.tab.c"
break;
case 105:
-#line 1263 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1263 "Oberon.y"
+ {
Trees_Node currElsif, currExp, currThen, currStmt;
if ((yyvsp[-2].node) == NULL) {
(yyval.node) = Trees_NewNode(IF, (yyvsp[-5].node), Trees_NewNode(THEN, (yyvsp[-3].node), (yyval.node)));
}
}
-#line 2847 "y.tab.c" /* yacc.c:1652 */
+#line 2938 "y.tab.c"
break;
case 106:
-#line 1286 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1286 "Oberon.y"
+ {
CheckIsValueExpression((yyvsp[0].node));
if (Types_IsBoolean(Trees_Type((yyvsp[0].node)))) {
(yyval.node) = (yyvsp[0].node);
YYABORT;
}
}
-#line 2861 "y.tab.c" /* yacc.c:1652 */
+#line 2952 "y.tab.c"
break;
case 107:
-#line 1299 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1299 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(ELSIF, (yyvsp[-2].node), Trees_NewNode(THEN, (yyvsp[0].node), (yyvsp[-4].node)));
}
-#line 2869 "y.tab.c" /* yacc.c:1652 */
+#line 2960 "y.tab.c"
break;
case 108:
-#line 1303 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1303 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 2877 "y.tab.c" /* yacc.c:1652 */
+#line 2968 "y.tab.c"
break;
case 109:
-#line 1310 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1310 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(ELSE, (yyvsp[0].node), NULL);
}
-#line 2885 "y.tab.c" /* yacc.c:1652 */
+#line 2976 "y.tab.c"
break;
case 110:
-#line 1314 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1314 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 2893 "y.tab.c" /* yacc.c:1652 */
+#line 2984 "y.tab.c"
break;
case 111:
-#line 1321 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1321 "Oberon.y"
+ {
Trees_Node expType, caseVariable;
if ((yyvsp[-1].node) != NULL) {
}
(yyval.node) = Trees_NewNode(CASE, (yyvsp[-3].node), (yyvsp[-1].node));
}
-#line 2915 "y.tab.c" /* yacc.c:1652 */
+#line 3006 "y.tab.c"
break;
case 112:
-#line 1342 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1342 "Oberon.y"
+ {
Trees_Node typeStruct, caseVariable;
CheckIsValueExpression((yyvsp[0].node));
YYABORT;
}
}
-#line 2954 "y.tab.c" /* yacc.c:1652 */
+#line 3045 "y.tab.c"
break;
case 113:
-#line 1380 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1380 "Oberon.y"
+ {
if ((yyvsp[0].node) != NULL) {
(yyval.node) = Trees_NewNode(TREES_CASE_REP, (yyvsp[0].node), NULL);
} else {
(yyval.node) = NULL;
}
}
-#line 2966 "y.tab.c" /* yacc.c:1652 */
+#line 3057 "y.tab.c"
break;
case 114:
-#line 1388 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1388 "Oberon.y"
+ {
if ((yyvsp[0].node) != NULL) {
if ((yyvsp[-2].node) != NULL) {
(yyval.node) = Trees_NewNode(TREES_CASE_REP, (yyvsp[0].node), (yyvsp[-2].node));
(yyval.node) = NULL;
}
}
-#line 2982 "y.tab.c" /* yacc.c:1652 */
+#line 3073 "y.tab.c"
break;
case 115:
-#line 1403 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1403 "Oberon.y"
+ {
Trees_ReverseList(&(yyvsp[-2].node)); /*correct order*/
(yyval.node) = Trees_NewNode(TREES_CASE, (yyvsp[-2].node), (yyvsp[0].node));
}
-#line 2991 "y.tab.c" /* yacc.c:1652 */
+#line 3082 "y.tab.c"
break;
case 116:
-#line 1408 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1408 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 2999 "y.tab.c" /* yacc.c:1652 */
+#line 3090 "y.tab.c"
break;
case 117:
-#line 1415 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1415 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(TREES_CASE_LABEL_LIST, (yyvsp[0].node), NULL);
}
-#line 3007 "y.tab.c" /* yacc.c:1652 */
+#line 3098 "y.tab.c"
break;
case 118:
-#line 1419 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1419 "Oberon.y"
+ {
switch (Trees_Symbol((yyvsp[0].node))) {
case INTEGER:
case TREES_CHAR_CONSTANT:
YYABORT;
}
}
-#line 3024 "y.tab.c" /* yacc.c:1652 */
+#line 3115 "y.tab.c"
break;
case 119:
-#line 1435 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1435 "Oberon.y"
+ {
(yyval.node) = (yyvsp[0].node);
CheckCaseLabelUniqueness((yyvsp[0].node));
assert(caseLabelsStack != NULL);
Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), Trees_Left(caseLabelsStack)),
Trees_Right(caseLabelsStack));
}
-#line 3037 "y.tab.c" /* yacc.c:1652 */
+#line 3128 "y.tab.c"
break;
case 120:
-#line 1444 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1444 "Oberon.y"
+ {
const int rangeLenMax = 255;
int leftSym, rightSym;
OBNC_INTEGER rangeMin, rangeMax;
Trees_NewNode(TREES_NOSYM, (yyval.node), Trees_Left(caseLabelsStack)),
Trees_Right(caseLabelsStack));
}
-#line 3085 "y.tab.c" /* yacc.c:1652 */
+#line 3176 "y.tab.c"
break;
case 121:
-#line 1491 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1491 "Oberon.y"
+ {
if (Types_IsInteger(Trees_Type(Trees_Left(caseExpressionStack)))) {
(yyval.node) = Trees_NewInteger((yyvsp[0].integer));
} else {
YYABORT;
}
}
-#line 3098 "y.tab.c" /* yacc.c:1652 */
+#line 3189 "y.tab.c"
break;
case 122:
-#line 1500 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1500 "Oberon.y"
+ {
if (Types_IsChar(Trees_Type(Trees_Left(caseExpressionStack)))) {
if (strlen((yyvsp[0].string)) <= 1) {
(yyval.node) = Trees_NewChar((yyvsp[0].string)[0]);
YYABORT;
}
}
-#line 3116 "y.tab.c" /* yacc.c:1652 */
+#line 3207 "y.tab.c"
break;
case 123:
-#line 1514 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1514 "Oberon.y"
+ {
Trees_Node caseExp, constValue, caseVariable;
(yyval.node) = Table_At(Trees_Name((yyvsp[0].node)));
assert(0);
}
} else {
- Oberon_PrintError("error: undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
+ Oberon_PrintError("error: 2 undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
YYABORT;
}
}
-#line 3202 "y.tab.c" /* yacc.c:1652 */
+#line 3293 "y.tab.c"
break;
case 124:
-#line 1599 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1599 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(WHILE, (yyvsp[-4].node), Trees_NewNode(DO, (yyvsp[-2].node), (yyvsp[-1].node)));
}
-#line 3210 "y.tab.c" /* yacc.c:1652 */
+#line 3301 "y.tab.c"
break;
case 125:
-#line 1606 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1606 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(ELSIF, (yyvsp[-2].node), Trees_NewNode(THEN, (yyvsp[0].node), (yyvsp[-4].node)));
}
-#line 3218 "y.tab.c" /* yacc.c:1652 */
+#line 3309 "y.tab.c"
break;
case 126:
-#line 1610 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1610 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 3226 "y.tab.c" /* yacc.c:1652 */
+#line 3317 "y.tab.c"
break;
case 127:
-#line 1617 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1617 "Oberon.y"
+ {
CheckIsValueExpression((yyvsp[0].node));
(yyval.node) = NULL;
if (Types_IsBoolean(Trees_Type((yyvsp[0].node)))) {
YYABORT;
}
}
-#line 3241 "y.tab.c" /* yacc.c:1652 */
+#line 3332 "y.tab.c"
break;
case 128:
-#line 1632 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1632 "Oberon.y"
+ {
Trees_Node byExp;
if ((yyvsp[-3].node) != NULL) {
(yyvsp[-4].node),
Trees_NewNode(BY, byExp, (yyvsp[-1].node))));
}
-#line 3260 "y.tab.c" /* yacc.c:1652 */
+#line 3351 "y.tab.c"
break;
case 129:
-#line 1650 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1650 "Oberon.y"
+ {
Trees_Node ctrlVar, ctrlVarType;
CheckIsValueExpression((yyvsp[0].node));
YYABORT;
}
}
-#line 3288 "y.tab.c" /* yacc.c:1652 */
+#line 3379 "y.tab.c"
break;
case 130:
-#line 1676 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1676 "Oberon.y"
+ {
CheckIsValueExpression((yyvsp[0].node));
if (! Types_IsInteger(Trees_Type((yyvsp[0].node)))) {
Oberon_PrintError("error: integer expression expected as upper limit");
YYABORT;
}
}
-#line 3300 "y.tab.c" /* yacc.c:1652 */
+#line 3391 "y.tab.c"
break;
case 131:
-#line 1687 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1687 "Oberon.y"
+ {
if (Types_IsInteger(Trees_Type((yyvsp[0].node)))) {
if (IsInteger((yyvsp[0].node))) {
if (Trees_Integer((yyvsp[0].node)) == 0) {
YYABORT;
}
}
-#line 3321 "y.tab.c" /* yacc.c:1652 */
+#line 3412 "y.tab.c"
break;
case 132:
-#line 1704 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1704 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 3329 "y.tab.c" /* yacc.c:1652 */
+#line 3420 "y.tab.c"
break;
case 133:
-#line 1714 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1714 "Oberon.y"
+ {
Trees_Node procIdent, procType, resultType, procStatements, returnExp;
const char *procName;
YYABORT;
}
}
-#line 3380 "y.tab.c" /* yacc.c:1652 */
+#line 3471 "y.tab.c"
break;
case 134:
-#line 1764 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1764 "Oberon.y"
+ {
Trees_Node paramList, param;
(yyval.node) = NULL;
Generate_ProcedureHeading((yyvsp[-1].node));
(yyval.node) = (yyvsp[-1].node);
}
-#line 3402 "y.tab.c" /* yacc.c:1652 */
+#line 3493 "y.tab.c"
break;
case 135:
-#line 1785 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1785 "Oberon.y"
+ {
if (! (Trees_Exported((yyvsp[0].node)) && Trees_Local((yyvsp[0].node)))) {
Trees_SetKind(TREES_PROCEDURE_KIND, (yyvsp[0].node));
Table_Put((yyvsp[0].node));
}
(yyval.node) = (yyvsp[0].node);
}
-#line 3418 "y.tab.c" /* yacc.c:1652 */
+#line 3509 "y.tab.c"
break;
case 136:
-#line 1800 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1800 "Oberon.y"
+ {
(yyval.node) = (yyvsp[0].node);
}
-#line 3426 "y.tab.c" /* yacc.c:1652 */
+#line 3517 "y.tab.c"
break;
case 137:
-#line 1804 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1804 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 3434 "y.tab.c" /* yacc.c:1652 */
+#line 3525 "y.tab.c"
break;
case 138:
-#line 1811 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1811 "Oberon.y"
+ {
(yyval.node) = (yyvsp[0].node);
}
-#line 3442 "y.tab.c" /* yacc.c:1652 */
+#line 3533 "y.tab.c"
break;
case 139:
-#line 1815 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1815 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 3450 "y.tab.c" /* yacc.c:1652 */
+#line 3541 "y.tab.c"
break;
case 145:
-#line 1836 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1836 "Oberon.y"
+ {
Trees_Node unresolvedPointerType, undeclaredBaseType;
if (unresolvedPointerTypes != NULL) {
YYABORT;
}
}
-#line 3465 "y.tab.c" /* yacc.c:1652 */
+#line 3556 "y.tab.c"
break;
case 146:
-#line 1847 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1847 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 3473 "y.tab.c" /* yacc.c:1652 */
+#line 3564 "y.tab.c"
break;
case 147:
-#line 1854 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1854 "Oberon.y"
+ {
unresolvedPointerTypes = NULL;
}
-#line 3481 "y.tab.c" /* yacc.c:1652 */
+#line 3572 "y.tab.c"
break;
case 156:
-#line 1881 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1881 "Oberon.y"
+ {
(yyval.node) = Types_NewProcedure((yyvsp[-2].node), (yyvsp[0].node));
}
-#line 3489 "y.tab.c" /* yacc.c:1652 */
+#line 3580 "y.tab.c"
break;
case 157:
-#line 1888 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1888 "Oberon.y"
+ {
Trees_ReverseList(&(yyvsp[0].node)); /*correct order*/
(yyval.node) = (yyvsp[0].node);
}
-#line 3498 "y.tab.c" /* yacc.c:1652 */
+#line 3589 "y.tab.c"
break;
case 158:
-#line 1893 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1893 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 3506 "y.tab.c" /* yacc.c:1652 */
+#line 3597 "y.tab.c"
break;
case 159:
-#line 1900 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1900 "Oberon.y"
+ {
(yyval.node) = (yyvsp[0].node);
Trees_ReverseList(&(yyval.node));
}
-#line 3515 "y.tab.c" /* yacc.c:1652 */
+#line 3606 "y.tab.c"
break;
case 160:
-#line 1905 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1905 "Oberon.y"
+ {
Trees_Node p, p1;
const char *paramName, *paramName1;
} while (p != NULL);
/*$$ in reversed order*/
}
-#line 3549 "y.tab.c" /* yacc.c:1652 */
+#line 3640 "y.tab.c"
break;
case 161:
-#line 1938 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1938 "Oberon.y"
+ {
(yyval.node) = ResolvedType((yyvsp[0].node), 0);
if ((yyval.node) != NULL) {
if (Trees_Symbol((yyval.node)) == IDENT) {
}
}
} else {
- Oberon_PrintError("error: undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
+ Oberon_PrintError("error: 3 undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
YYABORT;
}
}
-#line 3572 "y.tab.c" /* yacc.c:1652 */
+#line 3663 "y.tab.c"
break;
case 162:
-#line 1957 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1957 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 3580 "y.tab.c" /* yacc.c:1652 */
+#line 3671 "y.tab.c"
break;
case 163:
-#line 1964 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1964 "Oberon.y"
+ {
Trees_Node curr, ident;
Trees_ReverseList(&(yyvsp[-2].node)); /*correct order*/
(yyval.node) = (yyvsp[-2].node);
}
-#line 3600 "y.tab.c" /* yacc.c:1652 */
+#line 3691 "y.tab.c"
break;
case 164:
-#line 1983 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1983 "Oberon.y"
+ {
(yyval.integer) = TREES_VAR_PARAM_KIND;
}
-#line 3608 "y.tab.c" /* yacc.c:1652 */
+#line 3699 "y.tab.c"
break;
case 165:
-#line 1987 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1987 "Oberon.y"
+ {
(yyval.integer) = TREES_VALUE_PARAM_KIND;
}
-#line 3616 "y.tab.c" /* yacc.c:1652 */
+#line 3707 "y.tab.c"
break;
case 166:
-#line 1994 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1994 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(TREES_IDENT_LIST, Trees_NewIdent((yyvsp[0].ident)), NULL);
}
-#line 3624 "y.tab.c" /* yacc.c:1652 */
+#line 3715 "y.tab.c"
break;
case 167:
-#line 1998 "Oberon.y" /* yacc.c:1652 */
- {
+#line 1998 "Oberon.y"
+ {
Trees_Node curr;
const char *identName;
(yyval.node) = Trees_NewNode(TREES_IDENT_LIST, Trees_NewIdent((yyvsp[0].ident)), (yyvsp[-2].node));
}
-#line 3646 "y.tab.c" /* yacc.c:1652 */
+#line 3737 "y.tab.c"
break;
case 168:
-#line 2019 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2019 "Oberon.y"
+ {
(yyval.node) = ResolvedType((yyvsp[0].node), 0);
if ((yyval.node) != NULL) {
while ((yyvsp[-1].node) != NULL) {
(yyvsp[-1].node) = Trees_Right((yyvsp[-1].node));
}
} else {
- Oberon_PrintError("error: undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
+ Oberon_PrintError("error: 4 undeclared identifier: %s", Trees_Name((yyvsp[0].node)));
exit(EXIT_FAILURE);
}
}
-#line 3663 "y.tab.c" /* yacc.c:1652 */
+#line 3754 "y.tab.c"
break;
case 169:
-#line 2035 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2035 "Oberon.y"
+ {
(yyval.node) = Trees_NewNode(ARRAY, NULL, (yyvsp[-2].node));
}
-#line 3671 "y.tab.c" /* yacc.c:1652 */
+#line 3762 "y.tab.c"
break;
case 170:
-#line 2039 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2039 "Oberon.y"
+ {
(yyval.node) = NULL;
}
-#line 3679 "y.tab.c" /* yacc.c:1652 */
+#line 3770 "y.tab.c"
break;
case 171:
-#line 2049 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2049 "Oberon.y"
+ {
const char *symfilePath;
if (strcmp((yyvsp[-1].ident), inputModuleName) == 0) {
YYABORT;
}
}
-#line 3706 "y.tab.c" /* yacc.c:1652 */
+#line 3797 "y.tab.c"
break;
case 172:
-#line 2076 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2076 "Oberon.y"
+ {
if (strcmp((yyvsp[0].ident), inputModuleName) == 0) {
if (parseMode != OBERON_IMPORT_LIST_MODE) {
Generate_ModuleHeading();
YYABORT;
}
}
-#line 3721 "y.tab.c" /* yacc.c:1652 */
+#line 3812 "y.tab.c"
break;
case 173:
-#line 2090 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2090 "Oberon.y"
+ {
if (parseMode == OBERON_IMPORT_LIST_MODE) {
YYACCEPT;
}
}
-#line 3731 "y.tab.c" /* yacc.c:1652 */
+#line 3822 "y.tab.c"
break;
case 174:
-#line 2096 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2096 "Oberon.y"
+ {
if (parseMode == OBERON_IMPORT_LIST_MODE) {
YYACCEPT;
}
}
-#line 3741 "y.tab.c" /* yacc.c:1652 */
+#line 3832 "y.tab.c"
break;
case 175:
-#line 2105 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2105 "Oberon.y"
+ {
const char *impfilePath;
Trees_Node moduleAndDirPath, module, p;
FILE *impFile;
}
}
}
-#line 3778 "y.tab.c" /* yacc.c:1652 */
+#line 3869 "y.tab.c"
break;
case 176:
-#line 2141 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2141 "Oberon.y"
+ {
if ((yyvsp[0].node) != NULL) {
(yyval.node) = Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), NULL);
} else {
(yyval.node) = NULL;
}
}
-#line 3790 "y.tab.c" /* yacc.c:1652 */
+#line 3881 "y.tab.c"
break;
case 177:
-#line 2149 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2149 "Oberon.y"
+ {
if ((yyvsp[0].node) != NULL) {
(yyval.node) = Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), (yyvsp[-2].node));
} else {
(yyval.node) = (yyvsp[-2].node);
}
}
-#line 3802 "y.tab.c" /* yacc.c:1652 */
+#line 3893 "y.tab.c"
break;
case 178:
-#line 2160 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2160 "Oberon.y"
+ {
static Maps_Map importedModules = NULL;
const char *module, *qualifier, *symbolFileDir, *symbolFileName, *moduleDirPath;
Trees_Node qualifierSym, moduleIdent;
YYABORT;
}
}
-#line 3878 "y.tab.c" /* yacc.c:1652 */
+#line 3969 "y.tab.c"
break;
case 179:
-#line 2235 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2235 "Oberon.y"
+ {
(yyval.ident) = (yyvsp[0].ident);
}
-#line 3886 "y.tab.c" /* yacc.c:1652 */
+#line 3977 "y.tab.c"
break;
case 180:
-#line 2239 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2239 "Oberon.y"
+ {
(yyval.ident) = NULL;
}
-#line 3894 "y.tab.c" /* yacc.c:1652 */
+#line 3985 "y.tab.c"
break;
case 181:
-#line 2246 "Oberon.y" /* yacc.c:1652 */
- {
+#line 2246 "Oberon.y"
+ {
Generate_ModuleStatements((yyvsp[0].node));
}
-#line 3902 "y.tab.c" /* yacc.c:1652 */
+#line 3993 "y.tab.c"
break;
-#line 3906 "y.tab.c" /* yacc.c:1652 */
+#line 3997 "y.tab.c"
+
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
{
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
if (!yymsg)
{
yymsg = yymsgbuf;
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
+ yystos[+*yyssp], yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
#endif
return yyresult;
}
-#line 2251 "Oberon.y" /* yacc.c:1918 */
+#line 2251 "Oberon.y"
void Oberon_Init(void)
result = NULL;
if (Trees_Symbol(type) == IDENT) {
name = Trees_Name(type);
+ fprintf(stderr,"%s\n", name);
identDef = Table_At(name);
+ fprintf(stderr,"%p\n", identDef);
if (identDef != NULL) {
if (Trees_Kind(identDef) == TREES_TYPE_KIND) {
typeStruct = Types_Structure(identDef);
qualidentSym = Table_At(qualidentName);
qualidentSelectorList = Trees_Right(selectorList);
if (qualidentSym == NULL) {
- Oberon_PrintError("error: undeclared identifier: %s", qualidentName);
+ Oberon_PrintError("error: 5 undeclared identifier: %s", qualidentName);
exit(EXIT_FAILURE);
}
} else {
}
} else {
- Oberon_PrintError("error: undeclared identifier: %s", identName);
+ Oberon_PrintError("error: 6 undeclared identifier: %s", identName);
exit(EXIT_FAILURE);
}
}
exit(EXIT_FAILURE);
}
} else {
- Oberon_PrintError("error: undeclared identifier: %s", Trees_Name(extendedType));
+ Oberon_PrintError("error: 7 undeclared identifier: %s", Trees_Name(extendedType));
exit(EXIT_FAILURE);
}
} else {