Commit d00bd1d1 authored by Rob Pike's avatar Rob Pike

cmd/gc: better error messages for C-style if statements.

Given
        if (i == 0)
                x++
The old message was
        x.go:6: syntax error: unexpected semicolon or newline before {
Now we see
        x.go:6: syntax error: missing { after if clause

Fixes #5687

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12822045
parent bc6bb3ef
...@@ -21,16 +21,16 @@ static struct { ...@@ -21,16 +21,16 @@ static struct {
"missing import path; require quoted string", "missing import path; require quoted string",
% loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header ';' % loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header ';'
"unexpected semicolon or newline before {", "missing { after if clause",
% loadsys package imports LFUNC LNAME '(' ')' '{' LSWITCH if_header ';' % loadsys package imports LFUNC LNAME '(' ')' '{' LSWITCH if_header ';'
"unexpected semicolon or newline before {", "missing { after switch clause",
% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR for_header ';' % loadsys package imports LFUNC LNAME '(' ')' '{' LFOR for_header ';'
"unexpected semicolon or newline before {", "missing { after for clause",
% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR ';' LBODY % loadsys package imports LFUNC LNAME '(' ')' '{' LFOR ';' LBODY
"unexpected semicolon or newline before {", "missing { after for clause",
% loadsys package imports LFUNC LNAME '(' ')' ';' '{' % loadsys package imports LFUNC LNAME '(' ')' ';' '{'
"unexpected semicolon or newline before {", "unexpected semicolon or newline before {",
......
/* A Bison parser, made by GNU Bison 2.5. */ /* A Bison parser, made by GNU Bison 2.3. */
/* Bison implementation for Yacc-like parsers in C /* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation; either version 2, or (at your option)
(at your option) any later version. any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
...@@ -15,7 +16,9 @@ ...@@ -15,7 +16,9 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -44,7 +47,7 @@ ...@@ -44,7 +47,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.5" #define YYBISON_VERSION "2.3"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
...@@ -52,54 +55,11 @@ ...@@ -52,54 +55,11 @@
/* Pure parsers. */ /* Pure parsers. */
#define YYPURE 0 #define YYPURE 0
/* Push parsers. */
#define YYPUSH 0
/* Pull parsers. */
#define YYPULL 1
/* Using locations. */ /* Using locations. */
#define YYLSP_NEEDED 0 #define YYLSP_NEEDED 0
/* Copy the first part of user declarations. */
/* Line 268 of yacc.c */
#line 20 "go.y"
#include <u.h>
#include <stdio.h> /* if we don't, bison will, and go.h re-#defines getc */
#include <libc.h>
#include "go.h"
static int isrelease = -1;
static void fixlbrace(int);
/* Line 268 of yacc.c */
#line 83 "y.tab.c"
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 1
#endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
...@@ -211,36 +171,63 @@ static void fixlbrace(int); ...@@ -211,36 +171,63 @@ static void fixlbrace(int);
/* Copy the first part of user declarations. */
#line 20 "go.y"
#include <u.h>
#include <stdio.h> /* if we don't, bison will, and go.h re-#defines getc */
#include <libc.h>
#include "go.h"
static int isrelease = -1;
static void fixlbrace(int);
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 1
#endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{
/* Line 293 of yacc.c */
#line 30 "go.y" #line 30 "go.y"
{
Node* node; Node* node;
NodeList* list; NodeList* list;
Type* type; Type* type;
Sym* sym; Sym* sym;
struct Val val; struct Val val;
int i; int i;
}
/* Line 193 of yacc.c. */
#line 218 "y.tab.c"
/* Line 293 of yacc.c */ YYSTYPE;
#line 232 "y.tab.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
/* Line 343 of yacc.c */ /* Line 216 of yacc.c. */
#line 244 "y.tab.c" #line 231 "y.tab.c"
#ifdef short #ifdef short
# undef short # undef short
...@@ -315,14 +302,14 @@ typedef short int yytype_int16; ...@@ -315,14 +302,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static int static int
YYID (int yyi) YYID (int i)
#else #else
static int static int
YYID (yyi) YYID (i)
int yyi; int i;
#endif #endif
{ {
return yyi; return i;
} }
#endif #endif
...@@ -343,11 +330,11 @@ YYID (yyi) ...@@ -343,11 +330,11 @@ YYID (yyi)
# define alloca _alloca # define alloca _alloca
# else # else
# define YYSTACK_ALLOC alloca # define YYSTACK_ALLOC alloca
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef EXIT_SUCCESS # ifndef _STDLIB_H
# define EXIT_SUCCESS 0 # define _STDLIB_H 1
# endif # endif
# endif # endif
# endif # endif
...@@ -370,24 +357,24 @@ YYID (yyi) ...@@ -370,24 +357,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM # ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif # endif
# if (defined __cplusplus && ! defined EXIT_SUCCESS \ # if (defined __cplusplus && ! defined _STDLIB_H \
&& ! ((defined YYMALLOC || defined malloc) \ && ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free))) && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef EXIT_SUCCESS # ifndef _STDLIB_H
# define EXIT_SUCCESS 0 # define _STDLIB_H 1
# endif # endif
# endif # endif
# ifndef YYMALLOC # ifndef YYMALLOC
# define YYMALLOC malloc # define YYMALLOC malloc
# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif # endif
# endif # endif
# ifndef YYFREE # ifndef YYFREE
# define YYFREE free # define YYFREE free
# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */ void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif # endif
...@@ -403,9 +390,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ ...@@ -403,9 +390,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
yytype_int16 yyss_alloc; yytype_int16 yyss;
YYSTYPE yyvs_alloc; YYSTYPE yyvs;
}; };
/* The size of the maximum gap between one aligned stack and the next. */ /* 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 (sizeof (union yyalloc) - 1)
...@@ -416,27 +403,6 @@ union yyalloc ...@@ -416,27 +403,6 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM) + YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (YYID (0))
#endif
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from FROM to TO. The source and destination do /* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */ not overlap. */
# ifndef YYCOPY # ifndef YYCOPY
...@@ -454,7 +420,24 @@ union yyalloc ...@@ -454,7 +420,24 @@ union yyalloc
while (YYID (0)) while (YYID (0))
# endif # endif
# endif # endif
#endif /* !YYCOPY_NEEDED */
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (YYID (0))
#endif
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
#define YYFINAL 4 #define YYFINAL 4
...@@ -677,42 +660,42 @@ static const yytype_int16 yyrhs[] = ...@@ -677,42 +660,42 @@ static const yytype_int16 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 126, 126, 135, 142, 153, 153, 168, 169, 172, 0, 126, 126, 135, 141, 152, 152, 167, 168, 171,
173, 174, 177, 214, 225, 226, 229, 236, 243, 252, 172, 173, 176, 213, 224, 225, 228, 235, 242, 251,
266, 267, 274, 274, 287, 291, 292, 296, 301, 307, 265, 266, 273, 273, 286, 290, 291, 295, 300, 306,
311, 315, 319, 325, 331, 337, 342, 346, 350, 356, 310, 314, 318, 324, 330, 336, 341, 345, 349, 355,
362, 366, 370, 376, 380, 386, 387, 391, 397, 406, 361, 365, 369, 375, 379, 385, 386, 390, 396, 405,
412, 430, 435, 447, 463, 468, 475, 495, 513, 522, 411, 429, 434, 446, 462, 467, 474, 494, 512, 521,
541, 540, 555, 554, 585, 588, 595, 594, 605, 611, 540, 539, 554, 553, 584, 587, 594, 593, 604, 610,
620, 631, 637, 640, 648, 647, 658, 664, 676, 680, 619, 630, 636, 639, 647, 646, 657, 663, 675, 679,
685, 675, 706, 705, 718, 721, 727, 730, 742, 746, 684, 674, 705, 704, 717, 720, 726, 729, 741, 745,
741, 764, 763, 779, 780, 784, 788, 792, 796, 800, 740, 763, 762, 778, 779, 783, 787, 791, 795, 799,
804, 808, 812, 816, 820, 824, 828, 832, 836, 840, 803, 807, 811, 815, 819, 823, 827, 831, 835, 839,
844, 848, 852, 857, 863, 864, 868, 879, 883, 887, 843, 847, 851, 856, 862, 863, 867, 878, 882, 886,
891, 896, 900, 910, 914, 919, 927, 931, 932, 943, 890, 895, 899, 909, 913, 918, 926, 930, 931, 942,
947, 951, 955, 959, 974, 975, 981, 988, 994, 1001, 946, 950, 954, 958, 973, 974, 980, 987, 993, 1000,
1004, 1011, 1017, 1034, 1041, 1042, 1049, 1050, 1069, 1070, 1003, 1010, 1016, 1033, 1040, 1041, 1048, 1049, 1068, 1069,
1073, 1076, 1080, 1091, 1100, 1106, 1109, 1112, 1119, 1120, 1072, 1075, 1079, 1090, 1099, 1105, 1108, 1111, 1118, 1119,
1126, 1141, 1149, 1161, 1166, 1172, 1173, 1174, 1175, 1176, 1125, 1140, 1148, 1160, 1165, 1171, 1172, 1173, 1174, 1175,
1177, 1183, 1184, 1185, 1186, 1192, 1193, 1194, 1195, 1196, 1176, 1182, 1183, 1184, 1185, 1191, 1192, 1193, 1194, 1195,
1202, 1203, 1206, 1209, 1210, 1211, 1212, 1213, 1216, 1217, 1201, 1202, 1205, 1208, 1209, 1210, 1211, 1212, 1215, 1216,
1230, 1234, 1239, 1244, 1249, 1253, 1254, 1257, 1263, 1270, 1229, 1233, 1238, 1243, 1248, 1252, 1253, 1256, 1262, 1269,
1276, 1283, 1289, 1300, 1314, 1343, 1383, 1408, 1426, 1435, 1275, 1282, 1288, 1299, 1313, 1342, 1382, 1407, 1425, 1434,
1438, 1446, 1450, 1454, 1461, 1467, 1472, 1484, 1487, 1497, 1437, 1445, 1449, 1453, 1460, 1466, 1471, 1483, 1486, 1496,
1498, 1504, 1505, 1511, 1515, 1521, 1522, 1528, 1532, 1538, 1497, 1503, 1504, 1510, 1514, 1520, 1521, 1527, 1531, 1537,
1561, 1566, 1572, 1578, 1585, 1594, 1603, 1618, 1624, 1629, 1560, 1565, 1571, 1577, 1584, 1593, 1602, 1617, 1623, 1628,
1633, 1640, 1653, 1654, 1660, 1666, 1669, 1673, 1679, 1682, 1632, 1639, 1652, 1653, 1659, 1665, 1668, 1672, 1678, 1681,
1691, 1694, 1695, 1699, 1700, 1706, 1707, 1708, 1709, 1710, 1690, 1693, 1694, 1698, 1699, 1705, 1706, 1707, 1708, 1709,
1712, 1711, 1726, 1731, 1735, 1739, 1743, 1747, 1752, 1771, 1711, 1710, 1725, 1730, 1734, 1738, 1742, 1746, 1751, 1770,
1777, 1785, 1789, 1795, 1799, 1805, 1809, 1815, 1819, 1828, 1776, 1784, 1788, 1794, 1798, 1804, 1808, 1814, 1818, 1827,
1832, 1836, 1840, 1846, 1849, 1857, 1858, 1860, 1861, 1864, 1831, 1835, 1839, 1845, 1848, 1856, 1857, 1859, 1860, 1863,
1867, 1870, 1873, 1876, 1879, 1882, 1885, 1888, 1891, 1894, 1866, 1869, 1872, 1875, 1878, 1881, 1884, 1887, 1890, 1893,
1897, 1900, 1903, 1909, 1913, 1917, 1921, 1925, 1929, 1949, 1896, 1899, 1902, 1908, 1912, 1916, 1920, 1924, 1928, 1948,
1956, 1967, 1968, 1969, 1972, 1973, 1976, 1980, 1990, 1994, 1955, 1966, 1967, 1968, 1971, 1972, 1975, 1979, 1989, 1993,
1998, 2002, 2006, 2010, 2014, 2020, 2026, 2034, 2042, 2048, 1997, 2001, 2005, 2009, 2013, 2019, 2025, 2033, 2041, 2047,
2055, 2071, 2089, 2093, 2099, 2102, 2105, 2109, 2119, 2123, 2054, 2070, 2088, 2092, 2098, 2101, 2104, 2108, 2118, 2122,
2138, 2146, 2147, 2159, 2160, 2163, 2167, 2173, 2177, 2183, 2137, 2145, 2146, 2158, 2159, 2162, 2166, 2172, 2176, 2182,
2187 2186
}; };
#endif #endif
...@@ -731,16 +714,16 @@ const char *yytname[] = ...@@ -731,16 +714,16 @@ const char *yytname[] =
"'/'", "'%'", "'&'", "NotPackage", "NotParen", "'('", "')'", "'/'", "'%'", "'&'", "NotPackage", "NotParen", "'('", "')'",
"PreferToRightParen", "';'", "'.'", "'$'", "'='", "':'", "'{'", "'}'", "PreferToRightParen", "';'", "'.'", "'$'", "'='", "':'", "'{'", "'}'",
"'!'", "'~'", "'['", "']'", "'?'", "'@'", "','", "$accept", "file", "'!'", "'~'", "'['", "']'", "'?'", "'@'", "','", "$accept", "file",
"package", "loadsys", "$@1", "imports", "import", "import_stmt", "package", "loadsys", "@1", "imports", "import", "import_stmt",
"import_stmt_list", "import_here", "import_package", "import_safety", "import_stmt_list", "import_here", "import_package", "import_safety",
"import_there", "$@2", "xdcl", "common_dcl", "lconst", "vardcl", "import_there", "@2", "xdcl", "common_dcl", "lconst", "vardcl",
"constdcl", "constdcl1", "typedclname", "typedcl", "simple_stmt", "case", "constdcl", "constdcl1", "typedclname", "typedcl", "simple_stmt", "case",
"compound_stmt", "$@3", "caseblock", "$@4", "caseblock_list", "compound_stmt", "@3", "caseblock", "@4", "caseblock_list", "loop_body",
"loop_body", "$@5", "range_stmt", "for_header", "for_body", "for_stmt", "@5", "range_stmt", "for_header", "for_body", "for_stmt", "@6",
"$@6", "if_header", "if_stmt", "$@7", "$@8", "$@9", "elseif", "$@10", "if_header", "if_stmt", "@7", "@8", "@9", "elseif", "@10", "elseif_list",
"elseif_list", "else", "switch_stmt", "$@11", "$@12", "select_stmt", "else", "switch_stmt", "@11", "@12", "select_stmt", "@13", "expr",
"$@13", "expr", "uexpr", "pseudocall", "pexpr_no_paren", "start_complit", "uexpr", "pseudocall", "pexpr_no_paren", "start_complit", "keyval",
"keyval", "bare_complitexpr", "complitexpr", "pexpr", "expr_or_type", "bare_complitexpr", "complitexpr", "pexpr", "expr_or_type",
"name_or_type", "lbrace", "new_name", "dcl_name", "onew_name", "sym", "name_or_type", "lbrace", "new_name", "dcl_name", "onew_name", "sym",
"hidden_importsym", "name", "labelname", "dotdotdot", "ntype", "hidden_importsym", "name", "labelname", "dotdotdot", "ntype",
"non_expr_type", "non_recvchantype", "convtype", "comptype", "non_expr_type", "non_recvchantype", "convtype", "comptype",
...@@ -750,7 +733,7 @@ const char *yytname[] = ...@@ -750,7 +733,7 @@ const char *yytname[] =
"vardcl_list", "constdcl_list", "typedcl_list", "structdcl_list", "vardcl_list", "constdcl_list", "typedcl_list", "structdcl_list",
"interfacedcl_list", "structdcl", "packname", "embed", "interfacedcl", "interfacedcl_list", "structdcl", "packname", "embed", "interfacedcl",
"indcl", "arg_type", "arg_type_list", "oarg_type_list_ocomma", "stmt", "indcl", "arg_type", "arg_type_list", "oarg_type_list_ocomma", "stmt",
"non_dcl_stmt", "$@14", "stmt_list", "new_name_list", "dcl_name_list", "non_dcl_stmt", "@14", "stmt_list", "new_name_list", "dcl_name_list",
"expr_list", "expr_or_type_list", "keyval_list", "braced_keyval_list", "expr_list", "expr_or_type_list", "keyval_list", "braced_keyval_list",
"osemi", "ocomma", "oexpr", "oexpr_list", "osimple_stmt", "osemi", "ocomma", "oexpr", "oexpr_list", "osimple_stmt",
"ohidden_funarg_list", "ohidden_structdcl_list", "ohidden_funarg_list", "ohidden_structdcl_list",
...@@ -863,8 +846,8 @@ static const yytype_uint8 yyr2[] = ...@@ -863,8 +846,8 @@ static const yytype_uint8 yyr2[] =
3 3
}; };
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
Performed when YYTABLE doesn't specify something else to do. Zero STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */ means the default is an error. */
static const yytype_uint16 yydefact[] = static const yytype_uint16 yydefact[] =
{ {
...@@ -1053,7 +1036,8 @@ static const yytype_int16 yypgoto[] = ...@@ -1053,7 +1036,8 @@ static const yytype_int16 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which positive, shift that token. If negative, reduce the rule which
number is the opposite. If YYTABLE_NINF, syntax error. */ number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -276 #define YYTABLE_NINF -276
static const yytype_int16 yytable[] = static const yytype_int16 yytable[] =
{ {
...@@ -1279,12 +1263,6 @@ static const yytype_int16 yytable[] = ...@@ -1279,12 +1263,6 @@ static const yytype_int16 yytable[] =
189, 190, 191, 192, 193, 194, 195, 196, 197 189, 190, 191, 192, 193, 194, 195, 196, 197
}; };
#define yypact_value_is_default(yystate) \
((yystate) == (-552))
#define yytable_value_is_error(yytable_value) \
YYID (0)
static const yytype_int16 yycheck[] = static const yytype_int16 yycheck[] =
{ {
37, 37, 61, 142, 67, 37, 37, 201, 250, 143, 37, 37, 61, 142, 67, 37, 37, 201, 250, 143,
...@@ -1594,18 +1572,9 @@ static const yytype_uint8 yystos[] = ...@@ -1594,18 +1572,9 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily /* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC. to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. However, Once GCC version 2 has supplanted version 1, this can go. */
YYFAIL appears to be in use. Nevertheless, it is formally deprecated
in Bison 2.4.2's NEWS entry, where a plan to phase it out is
discussed. */
#define YYFAIL goto yyerrlab #define YYFAIL goto yyerrlab
#if defined YYFAIL
/* This is here to suppress warnings from the GCC cpp's
-Wunused-macros. Normally we don't worry about that warning, but
some users do, and we want to make it easy for users to remove
YYFAIL uses, which will produce warnings from Bison 2.5. */
#endif
#define YYRECOVERING() (!!yyerrstatus) #define YYRECOVERING() (!!yyerrstatus)
...@@ -1615,6 +1584,7 @@ do \ ...@@ -1615,6 +1584,7 @@ do \
{ \ { \
yychar = (Token); \ yychar = (Token); \
yylval = (Value); \ yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \ YYPOPSTACK (1); \
goto yybackup; \ goto yybackup; \
} \ } \
...@@ -1656,10 +1626,19 @@ while (YYID (0)) ...@@ -1656,10 +1626,19 @@ while (YYID (0))
#endif #endif
/* This macro is provided for backward compatibility. */ /* YY_LOCATION_PRINT -- Print the location on the stream.
This macro was not mandated originally: define only if we know
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT #ifndef YY_LOCATION_PRINT
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0) # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif #endif
...@@ -1763,20 +1742,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) ...@@ -1763,20 +1742,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else #else
static void static void
yy_stack_print (yybottom, yytop) yy_stack_print (bottom, top)
yytype_int16 *yybottom; yytype_int16 *bottom;
yytype_int16 *yytop; yytype_int16 *top;
#endif #endif
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++) for (; bottom <= top; ++bottom)
{ YYFPRINTF (stderr, " %d", *bottom);
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
...@@ -1810,11 +1786,11 @@ yy_reduce_print (yyvsp, yyrule) ...@@ -1810,11 +1786,11 @@ yy_reduce_print (yyvsp, yyrule)
/* The symbols being reduced. */ /* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++) for (yyi = 0; yyi < yynrhs; yyi++)
{ {
YYFPRINTF (stderr, " $%d = ", yyi + 1); fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)]) &(yyvsp[(yyi + 1) - (yynrhs)])
); );
YYFPRINTF (stderr, "\n"); fprintf (stderr, "\n");
} }
} }
...@@ -1851,6 +1827,7 @@ int yydebug; ...@@ -1851,6 +1827,7 @@ int yydebug;
# define YYMAXDEPTH 10000 # define YYMAXDEPTH 10000
#endif #endif
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
...@@ -1953,142 +1930,115 @@ yytnamerr (char *yyres, const char *yystr) ...@@ -1953,142 +1930,115 @@ yytnamerr (char *yyres, const char *yystr)
} }
# endif # endif
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message /* Copy into YYRESULT an error message about the unexpected token
about the unexpected token YYTOKEN for the state stack whose top is YYCHAR while in state YYSTATE. Return the number of bytes copied,
YYSSP. including the terminating null byte. If YYRESULT is null, do not
copy anything; just return the number of bytes that would be
Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is copied. As a special case, return 0 if an ordinary "syntax error"
not large enough to hold the message. In that case, also set message will do. Return YYSIZE_MAXIMUM if overflow occurs during
*YYMSG_ALLOC to the required number of bytes. Return 2 if the size calculation. */
required number of bytes is too large to store. */ static YYSIZE_T
static int yysyntax_error (char *yyresult, int yystate, int yychar)
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{ {
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); int yyn = yypact[yystate];
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
return 0;
else
{
int yytype = YYTRANSLATE (yychar);
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
YYSIZE_T yysize = yysize0; YYSIZE_T yysize = yysize0;
YYSIZE_T yysize1; YYSIZE_T yysize1;
int yysize_overflow = 0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = 0;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per int yyx;
"expected"). */
int yycount = 0; # if 0
/* This is so xgettext sees the translatable formats that are
/* There are many possibilities here to consider: constructed on the fly. */
- Assume YYFAIL is not used. It's too flawed to consider. See YY_("syntax error, unexpected %s");
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> YY_("syntax error, unexpected %s, expecting %s");
for details. YYERROR is fine as it does not invoke this YY_("syntax error, unexpected %s, expecting %s or %s");
function. YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- If this state is a consistent state with a default action, then YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
the only way this function was invoked is if the default action # endif
is an error action. In that case, don't check for expected char *yyfmt;
tokens because there are none. char const *yyf;
- The only way there can be no lookahead present (in yychar) is if static char const yyunexpected[] = "syntax error, unexpected %s";
this state is a consistent state with a default action. Thus, static char const yyexpecting[] = ", expecting %s";
detecting the absence of a lookahead is sufficient to determine static char const yyor[] = " or %s";
that there is no unexpected or expected token to report. In that char yyformat[sizeof yyunexpected
case, just report a simple "syntax error". + sizeof yyexpecting - 1
- Don't assume there isn't a lookahead just because this state is a + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
consistent state with a default action. There might have been a * (sizeof yyor - 1))];
previous inconsistent state, consistent state with a non-default char const *yyprefix = yyexpecting;
action, or user semantic action that manipulated yychar.
- Of course, the expected token list depends on states to have
correct lookahead information, and it depends on the parser not
to perform extra reductions after fetching a lookahead from the
scanner and before detecting a syntax error. Thus, state merging
(from LALR or IELR) and default reductions corrupt the expected
token list. However, the list is correct for canonical LR with
one exception: it will still contain any token that will not be
accepted due to an error action in a later state.
*/
if (yytoken != YYEMPTY)
{
int yyn = yypact[*yyssp];
yyarg[yycount++] = yytname[yytoken];
if (!yypact_value_is_default (yyn))
{
/* Start YYX at -YYN if negative to avoid negative indexes in /* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. In other words, skip the first -YYN actions for YYCHECK. */
this state because they are default actions. */
int yyxbegin = yyn < 0 ? -yyn : 0; int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */ /* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn + 1; int yychecklim = YYLAST - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yyx; int yycount = 1;
yyarg[0] = yytname[yytype];
yyfmt = yystpcpy (yyformat, yyunexpected);
for (yyx = yyxbegin; yyx < yyxend; ++yyx) for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
&& !yytable_value_is_error (yytable[yyx + yyn]))
{ {
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{ {
yycount = 1; yycount = 1;
yysize = yysize0; yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break; break;
} }
yyarg[yycount++] = yytname[yyx]; yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize1 = yysize + yytnamerr (0, yytname[yyx]);
if (! (yysize <= yysize1 yysize_overflow |= (yysize1 < yysize);
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1; yysize = yysize1;
} yyfmt = yystpcpy (yyfmt, yyprefix);
} yyprefix = yyor;
} }
switch (yycount) yyf = YY_(yyformat);
{ yysize1 = yysize + yystrlen (yyf);
# define YYCASE_(N, S) \ yysize_overflow |= (yysize1 < yysize);
case N: \
yyformat = S; \
break
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
# undef YYCASE_
}
yysize1 = yysize + yystrlen (yyformat);
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1; yysize = yysize1;
if (*yymsg_alloc < yysize) if (yysize_overflow)
{ return YYSIZE_MAXIMUM;
*yymsg_alloc = 2 * yysize;
if (! (yysize <= *yymsg_alloc
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
return 1;
}
if (yyresult)
{
/* Avoid sprintf, as that infringes on the user's name space. /* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */ produced a string with the wrong number of "%s"s. */
{ char *yyp = yyresult;
char *yyp = *yymsg;
int yyi = 0; int yyi = 0;
while ((*yyp = *yyformat) != '\0') while ((*yyp = *yyf) != '\0')
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) {
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{ {
yyp += yytnamerr (yyp, yyarg[yyi++]); yyp += yytnamerr (yyp, yyarg[yyi++]);
yyformat += 2; yyf += 2;
} }
else else
{ {
yyp++; yyp++;
yyformat++; yyf++;
} }
} }
return 0; }
return yysize;
}
} }
#endif /* YYERROR_VERBOSE */ #endif /* YYERROR_VERBOSE */
/*-----------------------------------------------. /*-----------------------------------------------.
| Release the memory associated to this symbol. | | Release the memory associated to this symbol. |
...@@ -2120,9 +2070,10 @@ yydestruct (yymsg, yytype, yyvaluep) ...@@ -2120,9 +2070,10 @@ yydestruct (yymsg, yytype, yyvaluep)
break; break;
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */ /* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus #if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM); int yyparse (void *YYPARSE_PARAM);
...@@ -2138,16 +2089,18 @@ int yyparse (); ...@@ -2138,16 +2089,18 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */ #endif /* ! YYPARSE_PARAM */
/* The lookahead symbol. */
/* The look-ahead symbol. */
int yychar, yystate; int yychar, yystate;
/* The semantic value of the lookahead symbol. */ /* The semantic value of the look-ahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Number of syntax errors so far. */ /* Number of syntax errors so far. */
int yynerrs; int yynerrs;
/*----------. /*----------.
| yyparse. | | yyparse. |
`----------*/ `----------*/
...@@ -2174,54 +2127,53 @@ yyparse () ...@@ -2174,54 +2127,53 @@ yyparse ()
#endif #endif
#endif #endif
{ {
int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */ /* Number of tokens to shift before error messages enabled. */
int yyerrstatus; int yyerrstatus;
/* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
/* The stacks and their tools: /* Three stacks and their tools:
`yyss': related to states. `yyss': related to states,
`yyvs': related to semantic values. `yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */ to reallocate them elsewhere. */
/* The state stack. */ /* The state stack. */
yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 yyssa[YYINITDEPTH];
yytype_int16 *yyss; yytype_int16 *yyss = yyssa;
yytype_int16 *yyssp; yytype_int16 *yyssp;
/* The semantic value stack. */ /* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs; YYSTYPE *yyvs = yyvsa;
YYSTYPE *yyvsp; YYSTYPE *yyvsp;
YYSIZE_T yystacksize;
int yyn;
int yyresult; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/* Lookahead token as an internal (translated) token number. */
int yytoken; YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the /* The variables used to return semantic value and location from the
action routines. */ action routines. */
YYSTYPE yyval; YYSTYPE yyval;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/* The number of symbols on the RHS of the reduced rule. /* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0; yystate = 0;
...@@ -2233,6 +2185,7 @@ yyparse () ...@@ -2233,6 +2185,7 @@ yyparse ()
Waste one element of value and location stack Waste one element of value and location stack
so that they stay on the same level as the state stack. so that they stay on the same level as the state stack.
The wasted elements are never initialized. */ The wasted elements are never initialized. */
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
...@@ -2262,6 +2215,7 @@ yyparse () ...@@ -2262,6 +2215,7 @@ yyparse ()
YYSTYPE *yyvs1 = yyvs; YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss; yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the /* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might conditional around just the two extra args, but that might
...@@ -2269,6 +2223,7 @@ yyparse () ...@@ -2269,6 +2223,7 @@ yyparse ()
yyoverflow (YY_("memory exhausted"), yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp), &yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp), &yyvs1, yysize * sizeof (*yyvsp),
&yystacksize); &yystacksize);
yyss = yyss1; yyss = yyss1;
...@@ -2291,8 +2246,9 @@ yyparse () ...@@ -2291,8 +2246,9 @@ yyparse ()
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs); YYSTACK_RELOCATE (yyvs);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
if (yyss1 != yyssa) if (yyss1 != yyssa)
YYSTACK_FREE (yyss1); YYSTACK_FREE (yyss1);
...@@ -2303,6 +2259,7 @@ yyparse () ...@@ -2303,6 +2259,7 @@ yyparse ()
yyssp = yyss + yysize - 1; yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1; yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n", YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize)); (unsigned long int) yystacksize));
...@@ -2312,9 +2269,6 @@ yyparse () ...@@ -2312,9 +2269,6 @@ yyparse ()
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup; goto yybackup;
/*-----------. /*-----------.
...@@ -2323,16 +2277,16 @@ yyparse () ...@@ -2323,16 +2277,16 @@ yyparse ()
yybackup: yybackup:
/* Do appropriate processing given the current state. Read a /* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */ look-ahead token if we need one and don't already have one. */
/* First try to decide what to do without reference to lookahead token. */ /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate]; yyn = yypact[yystate];
if (yypact_value_is_default (yyn)) if (yyn == YYPACT_NINF)
goto yydefault; goto yydefault;
/* Not known => get a lookahead token if don't already have one. */ /* Not known => get a look-ahead token if don't already have one. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY) if (yychar == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: ")); YYDPRINTF ((stderr, "Reading a token: "));
...@@ -2358,21 +2312,25 @@ yybackup: ...@@ -2358,21 +2312,25 @@ yybackup:
yyn = yytable[yyn]; yyn = yytable[yyn];
if (yyn <= 0) if (yyn <= 0)
{ {
if (yytable_value_is_error (yyn)) if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab; goto yyerrlab;
yyn = -yyn; yyn = -yyn;
goto yyreduce; goto yyreduce;
} }
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error /* Count tokens shifted since error; after three, turn off error
status. */ status. */
if (yyerrstatus) if (yyerrstatus)
yyerrstatus--; yyerrstatus--;
/* Shift the lookahead token. */ /* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token. */ /* Discard the shifted token unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY; yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
...@@ -2413,8 +2371,6 @@ yyreduce: ...@@ -2413,8 +2371,6 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 2: case 2:
/* Line 1806 of yacc.c */
#line 130 "go.y" #line 130 "go.y"
{ {
xtop = concat(xtop, (yyvsp[(4) - (4)].list)); xtop = concat(xtop, (yyvsp[(4) - (4)].list));
...@@ -2422,8 +2378,6 @@ yyreduce: ...@@ -2422,8 +2378,6 @@ yyreduce:
break; break;
case 3: case 3:
/* Line 1806 of yacc.c */
#line 136 "go.y" #line 136 "go.y"
{ {
prevlineno = lineno; prevlineno = lineno;
...@@ -2433,18 +2387,14 @@ yyreduce: ...@@ -2433,18 +2387,14 @@ yyreduce:
break; break;
case 4: case 4:
#line 142 "go.y"
/* Line 1806 of yacc.c */
#line 143 "go.y"
{ {
mkpackage((yyvsp[(2) - (3)].sym)->name); mkpackage((yyvsp[(2) - (3)].sym)->name);
} }
break; break;
case 5: case 5:
#line 152 "go.y"
/* Line 1806 of yacc.c */
#line 153 "go.y"
{ {
importpkg = runtimepkg; importpkg = runtimepkg;
...@@ -2457,18 +2407,14 @@ yyreduce: ...@@ -2457,18 +2407,14 @@ yyreduce:
break; break;
case 6: case 6:
#line 163 "go.y"
/* Line 1806 of yacc.c */
#line 164 "go.y"
{ {
importpkg = nil; importpkg = nil;
} }
break; break;
case 12: case 12:
#line 177 "go.y"
/* Line 1806 of yacc.c */
#line 178 "go.y"
{ {
Pkg *ipkg; Pkg *ipkg;
Sym *my; Sym *my;
...@@ -2508,9 +2454,7 @@ yyreduce: ...@@ -2508,9 +2454,7 @@ yyreduce:
break; break;
case 13: case 13:
#line 214 "go.y"
/* Line 1806 of yacc.c */
#line 215 "go.y"
{ {
// When an invalid import path is passed to importfile, // When an invalid import path is passed to importfile,
// it calls yyerror and then sets up a fake import with // it calls yyerror and then sets up a fake import with
...@@ -2522,9 +2466,7 @@ yyreduce: ...@@ -2522,9 +2466,7 @@ yyreduce:
break; break;
case 16: case 16:
#line 229 "go.y"
/* Line 1806 of yacc.c */
#line 230 "go.y"
{ {
// import with original name // import with original name
(yyval.i) = parserline(); (yyval.i) = parserline();
...@@ -2534,9 +2476,7 @@ yyreduce: ...@@ -2534,9 +2476,7 @@ yyreduce:
break; break;
case 17: case 17:
#line 236 "go.y"
/* Line 1806 of yacc.c */
#line 237 "go.y"
{ {
// import with given name // import with given name
(yyval.i) = parserline(); (yyval.i) = parserline();
...@@ -2546,9 +2486,7 @@ yyreduce: ...@@ -2546,9 +2486,7 @@ yyreduce:
break; break;
case 18: case 18:
#line 243 "go.y"
/* Line 1806 of yacc.c */
#line 244 "go.y"
{ {
// import into my name space // import into my name space
(yyval.i) = parserline(); (yyval.i) = parserline();
...@@ -2558,9 +2496,7 @@ yyreduce: ...@@ -2558,9 +2496,7 @@ yyreduce:
break; break;
case 19: case 19:
#line 252 "go.y"
/* Line 1806 of yacc.c */
#line 253 "go.y"
{ {
if(importpkg->name == nil) { if(importpkg->name == nil) {
importpkg->name = (yyvsp[(2) - (4)].sym)->name; importpkg->name = (yyvsp[(2) - (4)].sym)->name;
...@@ -2576,9 +2512,7 @@ yyreduce: ...@@ -2576,9 +2512,7 @@ yyreduce:
break; break;
case 21: case 21:
#line 267 "go.y"
/* Line 1806 of yacc.c */
#line 268 "go.y"
{ {
if(strcmp((yyvsp[(1) - (1)].sym)->name, "safe") == 0) if(strcmp((yyvsp[(1) - (1)].sym)->name, "safe") == 0)
curio.importsafe = 1; curio.importsafe = 1;
...@@ -2586,18 +2520,14 @@ yyreduce: ...@@ -2586,18 +2520,14 @@ yyreduce:
break; break;
case 22: case 22:
#line 273 "go.y"
/* Line 1806 of yacc.c */
#line 274 "go.y"
{ {
defercheckwidth(); defercheckwidth();
} }
break; break;
case 23: case 23:
#line 277 "go.y"
/* Line 1806 of yacc.c */
#line 278 "go.y"
{ {
resumecheckwidth(); resumecheckwidth();
unimportfile(); unimportfile();
...@@ -2605,9 +2535,7 @@ yyreduce: ...@@ -2605,9 +2535,7 @@ yyreduce:
break; break;
case 24: case 24:
#line 286 "go.y"
/* Line 1806 of yacc.c */
#line 287 "go.y"
{ {
yyerror("empty top-level declaration"); yyerror("empty top-level declaration");
(yyval.list) = nil; (yyval.list) = nil;
...@@ -2615,18 +2543,14 @@ yyreduce: ...@@ -2615,18 +2543,14 @@ yyreduce:
break; break;
case 26: case 26:
#line 292 "go.y"
/* Line 1806 of yacc.c */
#line 293 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 27: case 27:
#line 296 "go.y"
/* Line 1806 of yacc.c */
#line 297 "go.y"
{ {
yyerror("non-declaration statement outside function body"); yyerror("non-declaration statement outside function body");
(yyval.list) = nil; (yyval.list) = nil;
...@@ -2634,45 +2558,35 @@ yyreduce: ...@@ -2634,45 +2558,35 @@ yyreduce:
break; break;
case 28: case 28:
#line 301 "go.y"
/* Line 1806 of yacc.c */
#line 302 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 29: case 29:
#line 307 "go.y"
/* Line 1806 of yacc.c */
#line 308 "go.y"
{ {
(yyval.list) = (yyvsp[(2) - (2)].list); (yyval.list) = (yyvsp[(2) - (2)].list);
} }
break; break;
case 30: case 30:
#line 311 "go.y"
/* Line 1806 of yacc.c */
#line 312 "go.y"
{ {
(yyval.list) = (yyvsp[(3) - (5)].list); (yyval.list) = (yyvsp[(3) - (5)].list);
} }
break; break;
case 31: case 31:
#line 315 "go.y"
/* Line 1806 of yacc.c */
#line 316 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 32: case 32:
#line 319 "go.y"
/* Line 1806 of yacc.c */
#line 320 "go.y"
{ {
(yyval.list) = (yyvsp[(2) - (2)].list); (yyval.list) = (yyvsp[(2) - (2)].list);
iota = -100000; iota = -100000;
...@@ -2681,9 +2595,7 @@ yyreduce: ...@@ -2681,9 +2595,7 @@ yyreduce:
break; break;
case 33: case 33:
#line 325 "go.y"
/* Line 1806 of yacc.c */
#line 326 "go.y"
{ {
(yyval.list) = (yyvsp[(3) - (5)].list); (yyval.list) = (yyvsp[(3) - (5)].list);
iota = -100000; iota = -100000;
...@@ -2692,9 +2604,7 @@ yyreduce: ...@@ -2692,9 +2604,7 @@ yyreduce:
break; break;
case 34: case 34:
#line 331 "go.y"
/* Line 1806 of yacc.c */
#line 332 "go.y"
{ {
(yyval.list) = concat((yyvsp[(3) - (7)].list), (yyvsp[(5) - (7)].list)); (yyval.list) = concat((yyvsp[(3) - (7)].list), (yyvsp[(5) - (7)].list));
iota = -100000; iota = -100000;
...@@ -2703,9 +2613,7 @@ yyreduce: ...@@ -2703,9 +2613,7 @@ yyreduce:
break; break;
case 35: case 35:
#line 337 "go.y"
/* Line 1806 of yacc.c */
#line 338 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
iota = -100000; iota = -100000;
...@@ -2713,108 +2621,84 @@ yyreduce: ...@@ -2713,108 +2621,84 @@ yyreduce:
break; break;
case 36: case 36:
#line 342 "go.y"
/* Line 1806 of yacc.c */
#line 343 "go.y"
{ {
(yyval.list) = list1((yyvsp[(2) - (2)].node)); (yyval.list) = list1((yyvsp[(2) - (2)].node));
} }
break; break;
case 37: case 37:
#line 346 "go.y"
/* Line 1806 of yacc.c */
#line 347 "go.y"
{ {
(yyval.list) = (yyvsp[(3) - (5)].list); (yyval.list) = (yyvsp[(3) - (5)].list);
} }
break; break;
case 38: case 38:
#line 350 "go.y"
/* Line 1806 of yacc.c */
#line 351 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 39: case 39:
#line 356 "go.y"
/* Line 1806 of yacc.c */
#line 357 "go.y"
{ {
iota = 0; iota = 0;
} }
break; break;
case 40: case 40:
#line 362 "go.y"
/* Line 1806 of yacc.c */
#line 363 "go.y"
{ {
(yyval.list) = variter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil); (yyval.list) = variter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil);
} }
break; break;
case 41: case 41:
#line 366 "go.y"
/* Line 1806 of yacc.c */
#line 367 "go.y"
{ {
(yyval.list) = variter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list)); (yyval.list) = variter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list));
} }
break; break;
case 42: case 42:
#line 370 "go.y"
/* Line 1806 of yacc.c */
#line 371 "go.y"
{ {
(yyval.list) = variter((yyvsp[(1) - (3)].list), nil, (yyvsp[(3) - (3)].list)); (yyval.list) = variter((yyvsp[(1) - (3)].list), nil, (yyvsp[(3) - (3)].list));
} }
break; break;
case 43: case 43:
#line 376 "go.y"
/* Line 1806 of yacc.c */
#line 377 "go.y"
{ {
(yyval.list) = constiter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list)); (yyval.list) = constiter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list));
} }
break; break;
case 44: case 44:
#line 380 "go.y"
/* Line 1806 of yacc.c */
#line 381 "go.y"
{ {
(yyval.list) = constiter((yyvsp[(1) - (3)].list), N, (yyvsp[(3) - (3)].list)); (yyval.list) = constiter((yyvsp[(1) - (3)].list), N, (yyvsp[(3) - (3)].list));
} }
break; break;
case 46: case 46:
#line 387 "go.y"
/* Line 1806 of yacc.c */
#line 388 "go.y"
{ {
(yyval.list) = constiter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil); (yyval.list) = constiter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil);
} }
break; break;
case 47: case 47:
#line 391 "go.y"
/* Line 1806 of yacc.c */
#line 392 "go.y"
{ {
(yyval.list) = constiter((yyvsp[(1) - (1)].list), N, nil); (yyval.list) = constiter((yyvsp[(1) - (1)].list), N, nil);
} }
break; break;
case 48: case 48:
#line 397 "go.y"
/* Line 1806 of yacc.c */
#line 398 "go.y"
{ {
// different from dclname because the name // different from dclname because the name
// becomes visible right here, not at the end // becomes visible right here, not at the end
...@@ -2824,18 +2708,14 @@ yyreduce: ...@@ -2824,18 +2708,14 @@ yyreduce:
break; break;
case 49: case 49:
#line 406 "go.y"
/* Line 1806 of yacc.c */
#line 407 "go.y"
{ {
(yyval.node) = typedcl1((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node), 1); (yyval.node) = typedcl1((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node), 1);
} }
break; break;
case 50: case 50:
#line 412 "go.y"
/* Line 1806 of yacc.c */
#line 413 "go.y"
{ {
(yyval.node) = (yyvsp[(1) - (1)].node); (yyval.node) = (yyvsp[(1) - (1)].node);
...@@ -2856,9 +2736,7 @@ yyreduce: ...@@ -2856,9 +2736,7 @@ yyreduce:
break; break;
case 51: case 51:
#line 430 "go.y"
/* Line 1806 of yacc.c */
#line 431 "go.y"
{ {
(yyval.node) = nod(OASOP, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OASOP, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
(yyval.node)->etype = (yyvsp[(2) - (3)].i); // rathole to pass opcode (yyval.node)->etype = (yyvsp[(2) - (3)].i); // rathole to pass opcode
...@@ -2866,9 +2744,7 @@ yyreduce: ...@@ -2866,9 +2744,7 @@ yyreduce:
break; break;
case 52: case 52:
#line 435 "go.y"
/* Line 1806 of yacc.c */
#line 436 "go.y"
{ {
if((yyvsp[(1) - (3)].list)->next == nil && (yyvsp[(3) - (3)].list)->next == nil) { if((yyvsp[(1) - (3)].list)->next == nil && (yyvsp[(3) - (3)].list)->next == nil) {
// simple // simple
...@@ -2883,9 +2759,7 @@ yyreduce: ...@@ -2883,9 +2759,7 @@ yyreduce:
break; break;
case 53: case 53:
#line 447 "go.y"
/* Line 1806 of yacc.c */
#line 448 "go.y"
{ {
if((yyvsp[(3) - (3)].list)->n->op == OTYPESW) { if((yyvsp[(3) - (3)].list)->n->op == OTYPESW) {
(yyval.node) = nod(OTYPESW, N, (yyvsp[(3) - (3)].list)->n->right); (yyval.node) = nod(OTYPESW, N, (yyvsp[(3) - (3)].list)->n->right);
...@@ -2904,9 +2778,7 @@ yyreduce: ...@@ -2904,9 +2778,7 @@ yyreduce:
break; break;
case 54: case 54:
#line 463 "go.y"
/* Line 1806 of yacc.c */
#line 464 "go.y"
{ {
(yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1));
(yyval.node)->etype = OADD; (yyval.node)->etype = OADD;
...@@ -2914,9 +2786,7 @@ yyreduce: ...@@ -2914,9 +2786,7 @@ yyreduce:
break; break;
case 55: case 55:
#line 468 "go.y"
/* Line 1806 of yacc.c */
#line 469 "go.y"
{ {
(yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1));
(yyval.node)->etype = OSUB; (yyval.node)->etype = OSUB;
...@@ -2924,9 +2794,7 @@ yyreduce: ...@@ -2924,9 +2794,7 @@ yyreduce:
break; break;
case 56: case 56:
#line 475 "go.y"
/* Line 1806 of yacc.c */
#line 476 "go.y"
{ {
Node *n, *nn; Node *n, *nn;
...@@ -2949,9 +2817,7 @@ yyreduce: ...@@ -2949,9 +2817,7 @@ yyreduce:
break; break;
case 57: case 57:
#line 495 "go.y"
/* Line 1806 of yacc.c */
#line 496 "go.y"
{ {
Node *n; Node *n;
...@@ -2972,9 +2838,7 @@ yyreduce: ...@@ -2972,9 +2838,7 @@ yyreduce:
break; break;
case 58: case 58:
#line 513 "go.y"
/* Line 1806 of yacc.c */
#line 514 "go.y"
{ {
// will be converted to OCASE // will be converted to OCASE
// right will point to next case // right will point to next case
...@@ -2986,9 +2850,7 @@ yyreduce: ...@@ -2986,9 +2850,7 @@ yyreduce:
break; break;
case 59: case 59:
#line 522 "go.y"
/* Line 1806 of yacc.c */
#line 523 "go.y"
{ {
Node *n, *nn; Node *n, *nn;
...@@ -3007,18 +2869,14 @@ yyreduce: ...@@ -3007,18 +2869,14 @@ yyreduce:
break; break;
case 60: case 60:
#line 540 "go.y"
/* Line 1806 of yacc.c */
#line 541 "go.y"
{ {
markdcl(); markdcl();
} }
break; break;
case 61: case 61:
#line 544 "go.y"
/* Line 1806 of yacc.c */
#line 545 "go.y"
{ {
if((yyvsp[(3) - (4)].list) == nil) if((yyvsp[(3) - (4)].list) == nil)
(yyval.node) = nod(OEMPTY, N, N); (yyval.node) = nod(OEMPTY, N, N);
...@@ -3029,9 +2887,7 @@ yyreduce: ...@@ -3029,9 +2887,7 @@ yyreduce:
break; break;
case 62: case 62:
#line 554 "go.y"
/* Line 1806 of yacc.c */
#line 555 "go.y"
{ {
// If the last token read by the lexer was consumed // If the last token read by the lexer was consumed
// as part of the case, clear it (parser has cleared yychar). // as part of the case, clear it (parser has cleared yychar).
...@@ -3044,9 +2900,7 @@ yyreduce: ...@@ -3044,9 +2900,7 @@ yyreduce:
break; break;
case 63: case 63:
#line 564 "go.y"
/* Line 1806 of yacc.c */
#line 565 "go.y"
{ {
int last; int last;
...@@ -3068,36 +2922,28 @@ yyreduce: ...@@ -3068,36 +2922,28 @@ yyreduce:
break; break;
case 64: case 64:
#line 584 "go.y"
/* Line 1806 of yacc.c */
#line 585 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 65: case 65:
#line 588 "go.y"
/* Line 1806 of yacc.c */
#line 589 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); (yyval.list) = list((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node));
} }
break; break;
case 66: case 66:
#line 594 "go.y"
/* Line 1806 of yacc.c */
#line 595 "go.y"
{ {
markdcl(); markdcl();
} }
break; break;
case 67: case 67:
#line 598 "go.y"
/* Line 1806 of yacc.c */
#line 599 "go.y"
{ {
(yyval.list) = (yyvsp[(3) - (4)].list); (yyval.list) = (yyvsp[(3) - (4)].list);
popdcl(); popdcl();
...@@ -3105,9 +2951,7 @@ yyreduce: ...@@ -3105,9 +2951,7 @@ yyreduce:
break; break;
case 68: case 68:
#line 605 "go.y"
/* Line 1806 of yacc.c */
#line 606 "go.y"
{ {
(yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node));
(yyval.node)->list = (yyvsp[(1) - (4)].list); (yyval.node)->list = (yyvsp[(1) - (4)].list);
...@@ -3116,9 +2960,7 @@ yyreduce: ...@@ -3116,9 +2960,7 @@ yyreduce:
break; break;
case 69: case 69:
#line 611 "go.y"
/* Line 1806 of yacc.c */
#line 612 "go.y"
{ {
(yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node));
(yyval.node)->list = (yyvsp[(1) - (4)].list); (yyval.node)->list = (yyvsp[(1) - (4)].list);
...@@ -3128,9 +2970,7 @@ yyreduce: ...@@ -3128,9 +2970,7 @@ yyreduce:
break; break;
case 70: case 70:
#line 620 "go.y"
/* Line 1806 of yacc.c */
#line 621 "go.y"
{ {
// init ; test ; incr // init ; test ; incr
if((yyvsp[(5) - (5)].node) != N && (yyvsp[(5) - (5)].node)->colas != 0) if((yyvsp[(5) - (5)].node) != N && (yyvsp[(5) - (5)].node)->colas != 0)
...@@ -3144,9 +2984,7 @@ yyreduce: ...@@ -3144,9 +2984,7 @@ yyreduce:
break; break;
case 71: case 71:
#line 631 "go.y"
/* Line 1806 of yacc.c */
#line 632 "go.y"
{ {
// normal test // normal test
(yyval.node) = nod(OFOR, N, N); (yyval.node) = nod(OFOR, N, N);
...@@ -3155,9 +2993,7 @@ yyreduce: ...@@ -3155,9 +2993,7 @@ yyreduce:
break; break;
case 73: case 73:
#line 640 "go.y"
/* Line 1806 of yacc.c */
#line 641 "go.y"
{ {
(yyval.node) = (yyvsp[(1) - (2)].node); (yyval.node) = (yyvsp[(1) - (2)].node);
(yyval.node)->nbody = concat((yyval.node)->nbody, (yyvsp[(2) - (2)].list)); (yyval.node)->nbody = concat((yyval.node)->nbody, (yyvsp[(2) - (2)].list));
...@@ -3165,18 +3001,14 @@ yyreduce: ...@@ -3165,18 +3001,14 @@ yyreduce:
break; break;
case 74: case 74:
#line 647 "go.y"
/* Line 1806 of yacc.c */
#line 648 "go.y"
{ {
markdcl(); markdcl();
} }
break; break;
case 75: case 75:
#line 651 "go.y"
/* Line 1806 of yacc.c */
#line 652 "go.y"
{ {
(yyval.node) = (yyvsp[(3) - (3)].node); (yyval.node) = (yyvsp[(3) - (3)].node);
popdcl(); popdcl();
...@@ -3184,9 +3016,7 @@ yyreduce: ...@@ -3184,9 +3016,7 @@ yyreduce:
break; break;
case 76: case 76:
#line 658 "go.y"
/* Line 1806 of yacc.c */
#line 659 "go.y"
{ {
// test // test
(yyval.node) = nod(OIF, N, N); (yyval.node) = nod(OIF, N, N);
...@@ -3195,9 +3025,7 @@ yyreduce: ...@@ -3195,9 +3025,7 @@ yyreduce:
break; break;
case 77: case 77:
#line 664 "go.y"
/* Line 1806 of yacc.c */
#line 665 "go.y"
{ {
// init ; test // init ; test
(yyval.node) = nod(OIF, N, N); (yyval.node) = nod(OIF, N, N);
...@@ -3208,18 +3036,14 @@ yyreduce: ...@@ -3208,18 +3036,14 @@ yyreduce:
break; break;
case 78: case 78:
#line 675 "go.y"
/* Line 1806 of yacc.c */
#line 676 "go.y"
{ {
markdcl(); markdcl();
} }
break; break;
case 79: case 79:
#line 679 "go.y"
/* Line 1806 of yacc.c */
#line 680 "go.y"
{ {
if((yyvsp[(3) - (3)].node)->ntest == N) if((yyvsp[(3) - (3)].node)->ntest == N)
yyerror("missing condition in if statement"); yyerror("missing condition in if statement");
...@@ -3227,18 +3051,14 @@ yyreduce: ...@@ -3227,18 +3051,14 @@ yyreduce:
break; break;
case 80: case 80:
#line 684 "go.y"
/* Line 1806 of yacc.c */
#line 685 "go.y"
{ {
(yyvsp[(3) - (5)].node)->nbody = (yyvsp[(5) - (5)].list); (yyvsp[(3) - (5)].node)->nbody = (yyvsp[(5) - (5)].list);
} }
break; break;
case 81: case 81:
#line 688 "go.y"
/* Line 1806 of yacc.c */
#line 689 "go.y"
{ {
Node *n; Node *n;
NodeList *nn; NodeList *nn;
...@@ -3256,18 +3076,14 @@ yyreduce: ...@@ -3256,18 +3076,14 @@ yyreduce:
break; break;
case 82: case 82:
#line 705 "go.y"
/* Line 1806 of yacc.c */
#line 706 "go.y"
{ {
markdcl(); markdcl();
} }
break; break;
case 83: case 83:
#line 709 "go.y"
/* Line 1806 of yacc.c */
#line 710 "go.y"
{ {
if((yyvsp[(4) - (5)].node)->ntest == N) if((yyvsp[(4) - (5)].node)->ntest == N)
yyerror("missing condition in if statement"); yyerror("missing condition in if statement");
...@@ -3277,36 +3093,28 @@ yyreduce: ...@@ -3277,36 +3093,28 @@ yyreduce:
break; break;
case 84: case 84:
#line 717 "go.y"
/* Line 1806 of yacc.c */
#line 718 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 85: case 85:
#line 721 "go.y"
/* Line 1806 of yacc.c */
#line 722 "go.y"
{ {
(yyval.list) = concat((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list)); (yyval.list) = concat((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list));
} }
break; break;
case 86: case 86:
#line 726 "go.y"
/* Line 1806 of yacc.c */
#line 727 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 87: case 87:
#line 730 "go.y"
/* Line 1806 of yacc.c */
#line 731 "go.y"
{ {
NodeList *node; NodeList *node;
...@@ -3318,18 +3126,14 @@ yyreduce: ...@@ -3318,18 +3126,14 @@ yyreduce:
break; break;
case 88: case 88:
#line 741 "go.y"
/* Line 1806 of yacc.c */
#line 742 "go.y"
{ {
markdcl(); markdcl();
} }
break; break;
case 89: case 89:
#line 745 "go.y"
/* Line 1806 of yacc.c */
#line 746 "go.y"
{ {
Node *n; Node *n;
n = (yyvsp[(3) - (3)].node)->ntest; n = (yyvsp[(3) - (3)].node)->ntest;
...@@ -3340,9 +3144,7 @@ yyreduce: ...@@ -3340,9 +3144,7 @@ yyreduce:
break; break;
case 90: case 90:
#line 753 "go.y"
/* Line 1806 of yacc.c */
#line 754 "go.y"
{ {
(yyval.node) = (yyvsp[(3) - (7)].node); (yyval.node) = (yyvsp[(3) - (7)].node);
(yyval.node)->op = OSWITCH; (yyval.node)->op = OSWITCH;
...@@ -3353,18 +3155,14 @@ yyreduce: ...@@ -3353,18 +3155,14 @@ yyreduce:
break; break;
case 91: case 91:
#line 763 "go.y"
/* Line 1806 of yacc.c */
#line 764 "go.y"
{ {
typesw = nod(OXXX, typesw, N); typesw = nod(OXXX, typesw, N);
} }
break; break;
case 92: case 92:
#line 767 "go.y"
/* Line 1806 of yacc.c */
#line 768 "go.y"
{ {
(yyval.node) = nod(OSELECT, N, N); (yyval.node) = nod(OSELECT, N, N);
(yyval.node)->lineno = typesw->lineno; (yyval.node)->lineno = typesw->lineno;
...@@ -3374,198 +3172,154 @@ yyreduce: ...@@ -3374,198 +3172,154 @@ yyreduce:
break; break;
case 94: case 94:
#line 780 "go.y"
/* Line 1806 of yacc.c */
#line 781 "go.y"
{ {
(yyval.node) = nod(OOROR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OOROR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 95: case 95:
#line 784 "go.y"
/* Line 1806 of yacc.c */
#line 785 "go.y"
{ {
(yyval.node) = nod(OANDAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OANDAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 96: case 96:
#line 788 "go.y"
/* Line 1806 of yacc.c */
#line 789 "go.y"
{ {
(yyval.node) = nod(OEQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OEQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 97: case 97:
#line 792 "go.y"
/* Line 1806 of yacc.c */
#line 793 "go.y"
{ {
(yyval.node) = nod(ONE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(ONE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 98: case 98:
#line 796 "go.y"
/* Line 1806 of yacc.c */
#line 797 "go.y"
{ {
(yyval.node) = nod(OLT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OLT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 99: case 99:
#line 800 "go.y"
/* Line 1806 of yacc.c */
#line 801 "go.y"
{ {
(yyval.node) = nod(OLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 100: case 100:
#line 804 "go.y"
/* Line 1806 of yacc.c */
#line 805 "go.y"
{ {
(yyval.node) = nod(OGE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OGE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 101: case 101:
#line 808 "go.y"
/* Line 1806 of yacc.c */
#line 809 "go.y"
{ {
(yyval.node) = nod(OGT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OGT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 102: case 102:
#line 812 "go.y"
/* Line 1806 of yacc.c */
#line 813 "go.y"
{ {
(yyval.node) = nod(OADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 103: case 103:
#line 816 "go.y"
/* Line 1806 of yacc.c */
#line 817 "go.y"
{ {
(yyval.node) = nod(OSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 104: case 104:
#line 820 "go.y"
/* Line 1806 of yacc.c */
#line 821 "go.y"
{ {
(yyval.node) = nod(OOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 105: case 105:
#line 824 "go.y"
/* Line 1806 of yacc.c */
#line 825 "go.y"
{ {
(yyval.node) = nod(OXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 106: case 106:
#line 828 "go.y"
/* Line 1806 of yacc.c */
#line 829 "go.y"
{ {
(yyval.node) = nod(OMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 107: case 107:
#line 832 "go.y"
/* Line 1806 of yacc.c */
#line 833 "go.y"
{ {
(yyval.node) = nod(ODIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(ODIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 108: case 108:
#line 836 "go.y"
/* Line 1806 of yacc.c */
#line 837 "go.y"
{ {
(yyval.node) = nod(OMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 109: case 109:
#line 840 "go.y"
/* Line 1806 of yacc.c */
#line 841 "go.y"
{ {
(yyval.node) = nod(OAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 110: case 110:
#line 844 "go.y"
/* Line 1806 of yacc.c */
#line 845 "go.y"
{ {
(yyval.node) = nod(OANDNOT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OANDNOT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 111: case 111:
#line 848 "go.y"
/* Line 1806 of yacc.c */
#line 849 "go.y"
{ {
(yyval.node) = nod(OLSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OLSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 112: case 112:
#line 852 "go.y"
/* Line 1806 of yacc.c */
#line 853 "go.y"
{ {
(yyval.node) = nod(ORSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(ORSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 113: case 113:
#line 857 "go.y"
/* Line 1806 of yacc.c */
#line 858 "go.y"
{ {
(yyval.node) = nod(OSEND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OSEND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 115: case 115:
#line 864 "go.y"
/* Line 1806 of yacc.c */
#line 865 "go.y"
{ {
(yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 116: case 116:
#line 868 "go.y"
/* Line 1806 of yacc.c */
#line 869 "go.y"
{ {
if((yyvsp[(2) - (2)].node)->op == OCOMPLIT) { if((yyvsp[(2) - (2)].node)->op == OCOMPLIT) {
// Special case for &T{...}: turn into (*T){...}. // Special case for &T{...}: turn into (*T){...}.
...@@ -3579,36 +3333,28 @@ yyreduce: ...@@ -3579,36 +3333,28 @@ yyreduce:
break; break;
case 117: case 117:
#line 879 "go.y"
/* Line 1806 of yacc.c */
#line 880 "go.y"
{ {
(yyval.node) = nod(OPLUS, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OPLUS, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 118: case 118:
#line 883 "go.y"
/* Line 1806 of yacc.c */
#line 884 "go.y"
{ {
(yyval.node) = nod(OMINUS, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OMINUS, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 119: case 119:
#line 887 "go.y"
/* Line 1806 of yacc.c */
#line 888 "go.y"
{ {
(yyval.node) = nod(ONOT, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(ONOT, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 120: case 120:
#line 891 "go.y"
/* Line 1806 of yacc.c */
#line 892 "go.y"
{ {
yyerror("the bitwise complement operator is ^"); yyerror("the bitwise complement operator is ^");
(yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N);
...@@ -3616,36 +3362,28 @@ yyreduce: ...@@ -3616,36 +3362,28 @@ yyreduce:
break; break;
case 121: case 121:
#line 896 "go.y"
/* Line 1806 of yacc.c */
#line 897 "go.y"
{ {
(yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 122: case 122:
#line 900 "go.y"
/* Line 1806 of yacc.c */
#line 901 "go.y"
{ {
(yyval.node) = nod(ORECV, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(ORECV, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 123: case 123:
#line 910 "go.y"
/* Line 1806 of yacc.c */
#line 911 "go.y"
{ {
(yyval.node) = nod(OCALL, (yyvsp[(1) - (3)].node), N); (yyval.node) = nod(OCALL, (yyvsp[(1) - (3)].node), N);
} }
break; break;
case 124: case 124:
#line 914 "go.y"
/* Line 1806 of yacc.c */
#line 915 "go.y"
{ {
(yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N); (yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N);
(yyval.node)->list = (yyvsp[(3) - (5)].list); (yyval.node)->list = (yyvsp[(3) - (5)].list);
...@@ -3653,9 +3391,7 @@ yyreduce: ...@@ -3653,9 +3391,7 @@ yyreduce:
break; break;
case 125: case 125:
#line 919 "go.y"
/* Line 1806 of yacc.c */
#line 920 "go.y"
{ {
(yyval.node) = nod(OCALL, (yyvsp[(1) - (6)].node), N); (yyval.node) = nod(OCALL, (yyvsp[(1) - (6)].node), N);
(yyval.node)->list = (yyvsp[(3) - (6)].list); (yyval.node)->list = (yyvsp[(3) - (6)].list);
...@@ -3664,18 +3400,14 @@ yyreduce: ...@@ -3664,18 +3400,14 @@ yyreduce:
break; break;
case 126: case 126:
#line 927 "go.y"
/* Line 1806 of yacc.c */
#line 928 "go.y"
{ {
(yyval.node) = nodlit((yyvsp[(1) - (1)].val)); (yyval.node) = nodlit((yyvsp[(1) - (1)].val));
} }
break; break;
case 128: case 128:
#line 932 "go.y"
/* Line 1806 of yacc.c */
#line 933 "go.y"
{ {
if((yyvsp[(1) - (3)].node)->op == OPACK) { if((yyvsp[(1) - (3)].node)->op == OPACK) {
Sym *s; Sym *s;
...@@ -3689,45 +3421,35 @@ yyreduce: ...@@ -3689,45 +3421,35 @@ yyreduce:
break; break;
case 129: case 129:
#line 943 "go.y"
/* Line 1806 of yacc.c */
#line 944 "go.y"
{ {
(yyval.node) = nod(ODOTTYPE, (yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node)); (yyval.node) = nod(ODOTTYPE, (yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node));
} }
break; break;
case 130: case 130:
#line 947 "go.y"
/* Line 1806 of yacc.c */
#line 948 "go.y"
{ {
(yyval.node) = nod(OTYPESW, N, (yyvsp[(1) - (5)].node)); (yyval.node) = nod(OTYPESW, N, (yyvsp[(1) - (5)].node));
} }
break; break;
case 131: case 131:
#line 951 "go.y"
/* Line 1806 of yacc.c */
#line 952 "go.y"
{ {
(yyval.node) = nod(OINDEX, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node)); (yyval.node) = nod(OINDEX, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node));
} }
break; break;
case 132: case 132:
#line 955 "go.y"
/* Line 1806 of yacc.c */
#line 956 "go.y"
{ {
(yyval.node) = nod(OSLICE, (yyvsp[(1) - (6)].node), nod(OKEY, (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node))); (yyval.node) = nod(OSLICE, (yyvsp[(1) - (6)].node), nod(OKEY, (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node)));
} }
break; break;
case 133: case 133:
#line 959 "go.y"
/* Line 1806 of yacc.c */
#line 960 "go.y"
{ {
// Make sure we don't accidentally release this experimental feature. // Make sure we don't accidentally release this experimental feature.
// http://golang.org/s/go12slice. // http://golang.org/s/go12slice.
...@@ -3745,9 +3467,7 @@ yyreduce: ...@@ -3745,9 +3467,7 @@ yyreduce:
break; break;
case 135: case 135:
#line 975 "go.y"
/* Line 1806 of yacc.c */
#line 976 "go.y"
{ {
// conversion // conversion
(yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N); (yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N);
...@@ -3756,9 +3476,7 @@ yyreduce: ...@@ -3756,9 +3476,7 @@ yyreduce:
break; break;
case 136: case 136:
#line 981 "go.y"
/* Line 1806 of yacc.c */
#line 982 "go.y"
{ {
(yyval.node) = (yyvsp[(3) - (5)].node); (yyval.node) = (yyvsp[(3) - (5)].node);
(yyval.node)->right = (yyvsp[(1) - (5)].node); (yyval.node)->right = (yyvsp[(1) - (5)].node);
...@@ -3768,9 +3486,7 @@ yyreduce: ...@@ -3768,9 +3486,7 @@ yyreduce:
break; break;
case 137: case 137:
#line 988 "go.y"
/* Line 1806 of yacc.c */
#line 989 "go.y"
{ {
(yyval.node) = (yyvsp[(3) - (5)].node); (yyval.node) = (yyvsp[(3) - (5)].node);
(yyval.node)->right = (yyvsp[(1) - (5)].node); (yyval.node)->right = (yyvsp[(1) - (5)].node);
...@@ -3779,9 +3495,7 @@ yyreduce: ...@@ -3779,9 +3495,7 @@ yyreduce:
break; break;
case 138: case 138:
#line 994 "go.y"
/* Line 1806 of yacc.c */
#line 995 "go.y"
{ {
yyerror("cannot parenthesize type in composite literal"); yyerror("cannot parenthesize type in composite literal");
(yyval.node) = (yyvsp[(5) - (7)].node); (yyval.node) = (yyvsp[(5) - (7)].node);
...@@ -3791,9 +3505,7 @@ yyreduce: ...@@ -3791,9 +3505,7 @@ yyreduce:
break; break;
case 140: case 140:
#line 1003 "go.y"
/* Line 1806 of yacc.c */
#line 1004 "go.y"
{ {
// composite expression. // composite expression.
// make node early so we get the right line number. // make node early so we get the right line number.
...@@ -3802,18 +3514,14 @@ yyreduce: ...@@ -3802,18 +3514,14 @@ yyreduce:
break; break;
case 141: case 141:
#line 1011 "go.y"
/* Line 1806 of yacc.c */
#line 1012 "go.y"
{ {
(yyval.node) = nod(OKEY, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OKEY, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
} }
break; break;
case 142: case 142:
#line 1017 "go.y"
/* Line 1806 of yacc.c */
#line 1018 "go.y"
{ {
// These nodes do not carry line numbers. // These nodes do not carry line numbers.
// Since a composite literal commonly spans several lines, // Since a composite literal commonly spans several lines,
...@@ -3833,9 +3541,7 @@ yyreduce: ...@@ -3833,9 +3541,7 @@ yyreduce:
break; break;
case 143: case 143:
#line 1034 "go.y"
/* Line 1806 of yacc.c */
#line 1035 "go.y"
{ {
(yyval.node) = (yyvsp[(2) - (4)].node); (yyval.node) = (yyvsp[(2) - (4)].node);
(yyval.node)->list = (yyvsp[(3) - (4)].list); (yyval.node)->list = (yyvsp[(3) - (4)].list);
...@@ -3843,9 +3549,7 @@ yyreduce: ...@@ -3843,9 +3549,7 @@ yyreduce:
break; break;
case 145: case 145:
#line 1042 "go.y"
/* Line 1806 of yacc.c */
#line 1043 "go.y"
{ {
(yyval.node) = (yyvsp[(2) - (4)].node); (yyval.node) = (yyvsp[(2) - (4)].node);
(yyval.node)->list = (yyvsp[(3) - (4)].list); (yyval.node)->list = (yyvsp[(3) - (4)].list);
...@@ -3853,9 +3557,7 @@ yyreduce: ...@@ -3853,9 +3557,7 @@ yyreduce:
break; break;
case 147: case 147:
#line 1050 "go.y"
/* Line 1806 of yacc.c */
#line 1051 "go.y"
{ {
(yyval.node) = (yyvsp[(2) - (3)].node); (yyval.node) = (yyvsp[(2) - (3)].node);
...@@ -3875,27 +3577,21 @@ yyreduce: ...@@ -3875,27 +3577,21 @@ yyreduce:
break; break;
case 151: case 151:
#line 1076 "go.y"
/* Line 1806 of yacc.c */
#line 1077 "go.y"
{ {
(yyval.i) = LBODY; (yyval.i) = LBODY;
} }
break; break;
case 152: case 152:
#line 1080 "go.y"
/* Line 1806 of yacc.c */
#line 1081 "go.y"
{ {
(yyval.i) = '{'; (yyval.i) = '{';
} }
break; break;
case 153: case 153:
#line 1091 "go.y"
/* Line 1806 of yacc.c */
#line 1092 "go.y"
{ {
if((yyvsp[(1) - (1)].sym) == S) if((yyvsp[(1) - (1)].sym) == S)
(yyval.node) = N; (yyval.node) = N;
...@@ -3905,27 +3601,21 @@ yyreduce: ...@@ -3905,27 +3601,21 @@ yyreduce:
break; break;
case 154: case 154:
#line 1100 "go.y"
/* Line 1806 of yacc.c */
#line 1101 "go.y"
{ {
(yyval.node) = dclname((yyvsp[(1) - (1)].sym)); (yyval.node) = dclname((yyvsp[(1) - (1)].sym));
} }
break; break;
case 155: case 155:
#line 1105 "go.y"
/* Line 1806 of yacc.c */
#line 1106 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
} }
break; break;
case 157: case 157:
#line 1112 "go.y"
/* Line 1806 of yacc.c */
#line 1113 "go.y"
{ {
(yyval.sym) = (yyvsp[(1) - (1)].sym); (yyval.sym) = (yyvsp[(1) - (1)].sym);
// during imports, unqualified non-exported identifiers are from builtinpkg // during imports, unqualified non-exported identifiers are from builtinpkg
...@@ -3935,18 +3625,14 @@ yyreduce: ...@@ -3935,18 +3625,14 @@ yyreduce:
break; break;
case 159: case 159:
#line 1120 "go.y"
/* Line 1806 of yacc.c */
#line 1121 "go.y"
{ {
(yyval.sym) = S; (yyval.sym) = S;
} }
break; break;
case 160: case 160:
#line 1126 "go.y"
/* Line 1806 of yacc.c */
#line 1127 "go.y"
{ {
Pkg *p; Pkg *p;
...@@ -3962,9 +3648,7 @@ yyreduce: ...@@ -3962,9 +3648,7 @@ yyreduce:
break; break;
case 161: case 161:
#line 1141 "go.y"
/* Line 1806 of yacc.c */
#line 1142 "go.y"
{ {
(yyval.node) = oldname((yyvsp[(1) - (1)].sym)); (yyval.node) = oldname((yyvsp[(1) - (1)].sym));
if((yyval.node)->pack != N) if((yyval.node)->pack != N)
...@@ -3973,9 +3657,7 @@ yyreduce: ...@@ -3973,9 +3657,7 @@ yyreduce:
break; break;
case 163: case 163:
#line 1161 "go.y"
/* Line 1806 of yacc.c */
#line 1162 "go.y"
{ {
yyerror("final argument in variadic function missing type"); yyerror("final argument in variadic function missing type");
(yyval.node) = nod(ODDD, typenod(typ(TINTER)), N); (yyval.node) = nod(ODDD, typenod(typ(TINTER)), N);
...@@ -3983,45 +3665,35 @@ yyreduce: ...@@ -3983,45 +3665,35 @@ yyreduce:
break; break;
case 164: case 164:
#line 1166 "go.y"
/* Line 1806 of yacc.c */
#line 1167 "go.y"
{ {
(yyval.node) = nod(ODDD, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(ODDD, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 170: case 170:
#line 1177 "go.y"
/* Line 1806 of yacc.c */
#line 1178 "go.y"
{ {
(yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N);
} }
break; break;
case 174: case 174:
#line 1186 "go.y"
/* Line 1806 of yacc.c */
#line 1187 "go.y"
{ {
(yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 179: case 179:
#line 1196 "go.y"
/* Line 1806 of yacc.c */
#line 1197 "go.y"
{ {
(yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N);
} }
break; break;
case 189: case 189:
#line 1217 "go.y"
/* Line 1806 of yacc.c */
#line 1218 "go.y"
{ {
if((yyvsp[(1) - (3)].node)->op == OPACK) { if((yyvsp[(1) - (3)].node)->op == OPACK) {
Sym *s; Sym *s;
...@@ -4035,18 +3707,14 @@ yyreduce: ...@@ -4035,18 +3707,14 @@ yyreduce:
break; break;
case 190: case 190:
#line 1230 "go.y"
/* Line 1806 of yacc.c */
#line 1231 "go.y"
{ {
(yyval.node) = nod(OTARRAY, (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].node)); (yyval.node) = nod(OTARRAY, (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].node));
} }
break; break;
case 191: case 191:
#line 1234 "go.y"
/* Line 1806 of yacc.c */
#line 1235 "go.y"
{ {
// array literal of nelem // array literal of nelem
(yyval.node) = nod(OTARRAY, nod(ODDD, N, N), (yyvsp[(4) - (4)].node)); (yyval.node) = nod(OTARRAY, nod(ODDD, N, N), (yyvsp[(4) - (4)].node));
...@@ -4054,9 +3722,7 @@ yyreduce: ...@@ -4054,9 +3722,7 @@ yyreduce:
break; break;
case 192: case 192:
#line 1239 "go.y"
/* Line 1806 of yacc.c */
#line 1240 "go.y"
{ {
(yyval.node) = nod(OTCHAN, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OTCHAN, (yyvsp[(2) - (2)].node), N);
(yyval.node)->etype = Cboth; (yyval.node)->etype = Cboth;
...@@ -4064,9 +3730,7 @@ yyreduce: ...@@ -4064,9 +3730,7 @@ yyreduce:
break; break;
case 193: case 193:
#line 1244 "go.y"
/* Line 1806 of yacc.c */
#line 1245 "go.y"
{ {
(yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N);
(yyval.node)->etype = Csend; (yyval.node)->etype = Csend;
...@@ -4074,27 +3738,21 @@ yyreduce: ...@@ -4074,27 +3738,21 @@ yyreduce:
break; break;
case 194: case 194:
#line 1249 "go.y"
/* Line 1806 of yacc.c */
#line 1250 "go.y"
{ {
(yyval.node) = nod(OTMAP, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)); (yyval.node) = nod(OTMAP, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));
} }
break; break;
case 197: case 197:
#line 1257 "go.y"
/* Line 1806 of yacc.c */
#line 1258 "go.y"
{ {
(yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 198: case 198:
#line 1263 "go.y"
/* Line 1806 of yacc.c */
#line 1264 "go.y"
{ {
(yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N);
(yyval.node)->etype = Crecv; (yyval.node)->etype = Crecv;
...@@ -4102,9 +3760,7 @@ yyreduce: ...@@ -4102,9 +3760,7 @@ yyreduce:
break; break;
case 199: case 199:
#line 1270 "go.y"
/* Line 1806 of yacc.c */
#line 1271 "go.y"
{ {
(yyval.node) = nod(OTSTRUCT, N, N); (yyval.node) = nod(OTSTRUCT, N, N);
(yyval.node)->list = (yyvsp[(3) - (5)].list); (yyval.node)->list = (yyvsp[(3) - (5)].list);
...@@ -4113,9 +3769,7 @@ yyreduce: ...@@ -4113,9 +3769,7 @@ yyreduce:
break; break;
case 200: case 200:
#line 1276 "go.y"
/* Line 1806 of yacc.c */
#line 1277 "go.y"
{ {
(yyval.node) = nod(OTSTRUCT, N, N); (yyval.node) = nod(OTSTRUCT, N, N);
fixlbrace((yyvsp[(2) - (3)].i)); fixlbrace((yyvsp[(2) - (3)].i));
...@@ -4123,9 +3777,7 @@ yyreduce: ...@@ -4123,9 +3777,7 @@ yyreduce:
break; break;
case 201: case 201:
#line 1283 "go.y"
/* Line 1806 of yacc.c */
#line 1284 "go.y"
{ {
(yyval.node) = nod(OTINTER, N, N); (yyval.node) = nod(OTINTER, N, N);
(yyval.node)->list = (yyvsp[(3) - (5)].list); (yyval.node)->list = (yyvsp[(3) - (5)].list);
...@@ -4134,9 +3786,7 @@ yyreduce: ...@@ -4134,9 +3786,7 @@ yyreduce:
break; break;
case 202: case 202:
#line 1289 "go.y"
/* Line 1806 of yacc.c */
#line 1290 "go.y"
{ {
(yyval.node) = nod(OTINTER, N, N); (yyval.node) = nod(OTINTER, N, N);
fixlbrace((yyvsp[(2) - (3)].i)); fixlbrace((yyvsp[(2) - (3)].i));
...@@ -4144,9 +3794,7 @@ yyreduce: ...@@ -4144,9 +3794,7 @@ yyreduce:
break; break;
case 203: case 203:
#line 1300 "go.y"
/* Line 1806 of yacc.c */
#line 1301 "go.y"
{ {
(yyval.node) = (yyvsp[(2) - (3)].node); (yyval.node) = (yyvsp[(2) - (3)].node);
if((yyval.node) == N) if((yyval.node) == N)
...@@ -4161,9 +3809,7 @@ yyreduce: ...@@ -4161,9 +3809,7 @@ yyreduce:
break; break;
case 204: case 204:
#line 1314 "go.y"
/* Line 1806 of yacc.c */
#line 1315 "go.y"
{ {
Node *t; Node *t;
...@@ -4195,9 +3841,7 @@ yyreduce: ...@@ -4195,9 +3841,7 @@ yyreduce:
break; break;
case 205: case 205:
#line 1343 "go.y"
/* Line 1806 of yacc.c */
#line 1344 "go.y"
{ {
Node *rcvr, *t; Node *rcvr, *t;
...@@ -4238,9 +3882,7 @@ yyreduce: ...@@ -4238,9 +3882,7 @@ yyreduce:
break; break;
case 206: case 206:
#line 1383 "go.y"
/* Line 1806 of yacc.c */
#line 1384 "go.y"
{ {
Sym *s; Sym *s;
Type *t; Type *t;
...@@ -4268,9 +3910,7 @@ yyreduce: ...@@ -4268,9 +3910,7 @@ yyreduce:
break; break;
case 207: case 207:
#line 1408 "go.y"
/* Line 1806 of yacc.c */
#line 1409 "go.y"
{ {
(yyval.node) = methodname1(newname((yyvsp[(4) - (8)].sym)), (yyvsp[(2) - (8)].list)->n->right); (yyval.node) = methodname1(newname((yyvsp[(4) - (8)].sym)), (yyvsp[(2) - (8)].list)->n->right);
(yyval.node)->type = functype((yyvsp[(2) - (8)].list)->n, (yyvsp[(6) - (8)].list), (yyvsp[(8) - (8)].list)); (yyval.node)->type = functype((yyvsp[(2) - (8)].list)->n, (yyvsp[(6) - (8)].list), (yyvsp[(8) - (8)].list));
...@@ -4289,9 +3929,7 @@ yyreduce: ...@@ -4289,9 +3929,7 @@ yyreduce:
break; break;
case 208: case 208:
#line 1426 "go.y"
/* Line 1806 of yacc.c */
#line 1427 "go.y"
{ {
(yyvsp[(3) - (5)].list) = checkarglist((yyvsp[(3) - (5)].list), 1); (yyvsp[(3) - (5)].list) = checkarglist((yyvsp[(3) - (5)].list), 1);
(yyval.node) = nod(OTFUNC, N, N); (yyval.node) = nod(OTFUNC, N, N);
...@@ -4301,18 +3939,14 @@ yyreduce: ...@@ -4301,18 +3939,14 @@ yyreduce:
break; break;
case 209: case 209:
#line 1434 "go.y"
/* Line 1806 of yacc.c */
#line 1435 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 210: case 210:
#line 1438 "go.y"
/* Line 1806 of yacc.c */
#line 1439 "go.y"
{ {
(yyval.list) = (yyvsp[(2) - (3)].list); (yyval.list) = (yyvsp[(2) - (3)].list);
if((yyval.list) == nil) if((yyval.list) == nil)
...@@ -4321,27 +3955,21 @@ yyreduce: ...@@ -4321,27 +3955,21 @@ yyreduce:
break; break;
case 211: case 211:
#line 1446 "go.y"
/* Line 1806 of yacc.c */
#line 1447 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 212: case 212:
#line 1450 "go.y"
/* Line 1806 of yacc.c */
#line 1451 "go.y"
{ {
(yyval.list) = list1(nod(ODCLFIELD, N, (yyvsp[(1) - (1)].node))); (yyval.list) = list1(nod(ODCLFIELD, N, (yyvsp[(1) - (1)].node)));
} }
break; break;
case 213: case 213:
#line 1454 "go.y"
/* Line 1806 of yacc.c */
#line 1455 "go.y"
{ {
(yyvsp[(2) - (3)].list) = checkarglist((yyvsp[(2) - (3)].list), 0); (yyvsp[(2) - (3)].list) = checkarglist((yyvsp[(2) - (3)].list), 0);
(yyval.list) = (yyvsp[(2) - (3)].list); (yyval.list) = (yyvsp[(2) - (3)].list);
...@@ -4349,18 +3977,14 @@ yyreduce: ...@@ -4349,18 +3977,14 @@ yyreduce:
break; break;
case 214: case 214:
#line 1461 "go.y"
/* Line 1806 of yacc.c */
#line 1462 "go.y"
{ {
closurehdr((yyvsp[(1) - (1)].node)); closurehdr((yyvsp[(1) - (1)].node));
} }
break; break;
case 215: case 215:
#line 1467 "go.y"
/* Line 1806 of yacc.c */
#line 1468 "go.y"
{ {
(yyval.node) = closurebody((yyvsp[(3) - (4)].list)); (yyval.node) = closurebody((yyvsp[(3) - (4)].list));
fixlbrace((yyvsp[(2) - (4)].i)); fixlbrace((yyvsp[(2) - (4)].i));
...@@ -4368,27 +3992,21 @@ yyreduce: ...@@ -4368,27 +3992,21 @@ yyreduce:
break; break;
case 216: case 216:
#line 1472 "go.y"
/* Line 1806 of yacc.c */
#line 1473 "go.y"
{ {
(yyval.node) = closurebody(nil); (yyval.node) = closurebody(nil);
} }
break; break;
case 217: case 217:
#line 1483 "go.y"
/* Line 1806 of yacc.c */
#line 1484 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 218: case 218:
#line 1487 "go.y"
/* Line 1806 of yacc.c */
#line 1488 "go.y"
{ {
(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(2) - (3)].list)); (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(2) - (3)].list));
if(nsyntaxerrors == 0) if(nsyntaxerrors == 0)
...@@ -4399,72 +4017,56 @@ yyreduce: ...@@ -4399,72 +4017,56 @@ yyreduce:
break; break;
case 220: case 220:
#line 1498 "go.y"
/* Line 1806 of yacc.c */
#line 1499 "go.y"
{ {
(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
} }
break; break;
case 222: case 222:
#line 1505 "go.y"
/* Line 1806 of yacc.c */
#line 1506 "go.y"
{ {
(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
} }
break; break;
case 223: case 223:
#line 1511 "go.y"
/* Line 1806 of yacc.c */
#line 1512 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 224: case 224:
#line 1515 "go.y"
/* Line 1806 of yacc.c */
#line 1516 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 226: case 226:
#line 1522 "go.y"
/* Line 1806 of yacc.c */
#line 1523 "go.y"
{ {
(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
} }
break; break;
case 227: case 227:
#line 1528 "go.y"
/* Line 1806 of yacc.c */
#line 1529 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 228: case 228:
#line 1532 "go.y"
/* Line 1806 of yacc.c */
#line 1533 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 229: case 229:
#line 1538 "go.y"
/* Line 1806 of yacc.c */
#line 1539 "go.y"
{ {
NodeList *l; NodeList *l;
...@@ -4490,9 +4092,7 @@ yyreduce: ...@@ -4490,9 +4092,7 @@ yyreduce:
break; break;
case 230: case 230:
#line 1561 "go.y"
/* Line 1806 of yacc.c */
#line 1562 "go.y"
{ {
(yyvsp[(1) - (2)].node)->val = (yyvsp[(2) - (2)].val); (yyvsp[(1) - (2)].node)->val = (yyvsp[(2) - (2)].val);
(yyval.list) = list1((yyvsp[(1) - (2)].node)); (yyval.list) = list1((yyvsp[(1) - (2)].node));
...@@ -4500,9 +4100,7 @@ yyreduce: ...@@ -4500,9 +4100,7 @@ yyreduce:
break; break;
case 231: case 231:
#line 1566 "go.y"
/* Line 1806 of yacc.c */
#line 1567 "go.y"
{ {
(yyvsp[(2) - (4)].node)->val = (yyvsp[(4) - (4)].val); (yyvsp[(2) - (4)].node)->val = (yyvsp[(4) - (4)].val);
(yyval.list) = list1((yyvsp[(2) - (4)].node)); (yyval.list) = list1((yyvsp[(2) - (4)].node));
...@@ -4511,9 +4109,7 @@ yyreduce: ...@@ -4511,9 +4109,7 @@ yyreduce:
break; break;
case 232: case 232:
#line 1572 "go.y"
/* Line 1806 of yacc.c */
#line 1573 "go.y"
{ {
(yyvsp[(2) - (3)].node)->right = nod(OIND, (yyvsp[(2) - (3)].node)->right, N); (yyvsp[(2) - (3)].node)->right = nod(OIND, (yyvsp[(2) - (3)].node)->right, N);
(yyvsp[(2) - (3)].node)->val = (yyvsp[(3) - (3)].val); (yyvsp[(2) - (3)].node)->val = (yyvsp[(3) - (3)].val);
...@@ -4522,9 +4118,7 @@ yyreduce: ...@@ -4522,9 +4118,7 @@ yyreduce:
break; break;
case 233: case 233:
#line 1578 "go.y"
/* Line 1806 of yacc.c */
#line 1579 "go.y"
{ {
(yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N);
(yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val); (yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val);
...@@ -4534,9 +4128,7 @@ yyreduce: ...@@ -4534,9 +4128,7 @@ yyreduce:
break; break;
case 234: case 234:
#line 1585 "go.y"
/* Line 1806 of yacc.c */
#line 1586 "go.y"
{ {
(yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N);
(yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val); (yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val);
...@@ -4546,9 +4138,7 @@ yyreduce: ...@@ -4546,9 +4138,7 @@ yyreduce:
break; break;
case 235: case 235:
#line 1594 "go.y"
/* Line 1806 of yacc.c */
#line 1595 "go.y"
{ {
Node *n; Node *n;
...@@ -4560,9 +4150,7 @@ yyreduce: ...@@ -4560,9 +4150,7 @@ yyreduce:
break; break;
case 236: case 236:
#line 1603 "go.y"
/* Line 1806 of yacc.c */
#line 1604 "go.y"
{ {
Pkg *pkg; Pkg *pkg;
...@@ -4578,18 +4166,14 @@ yyreduce: ...@@ -4578,18 +4166,14 @@ yyreduce:
break; break;
case 237: case 237:
#line 1618 "go.y"
/* Line 1806 of yacc.c */
#line 1619 "go.y"
{ {
(yyval.node) = embedded((yyvsp[(1) - (1)].sym)); (yyval.node) = embedded((yyvsp[(1) - (1)].sym));
} }
break; break;
case 238: case 238:
#line 1624 "go.y"
/* Line 1806 of yacc.c */
#line 1625 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); (yyval.node) = nod(ODCLFIELD, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));
ifacedcl((yyval.node)); ifacedcl((yyval.node));
...@@ -4597,18 +4181,14 @@ yyreduce: ...@@ -4597,18 +4181,14 @@ yyreduce:
break; break;
case 239: case 239:
#line 1629 "go.y"
/* Line 1806 of yacc.c */
#line 1630 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(1) - (1)].sym))); (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(1) - (1)].sym)));
} }
break; break;
case 240: case 240:
#line 1633 "go.y"
/* Line 1806 of yacc.c */
#line 1634 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(2) - (3)].sym))); (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(2) - (3)].sym)));
yyerror("cannot parenthesize embedded type"); yyerror("cannot parenthesize embedded type");
...@@ -4616,9 +4196,7 @@ yyreduce: ...@@ -4616,9 +4196,7 @@ yyreduce:
break; break;
case 241: case 241:
#line 1640 "go.y"
/* Line 1806 of yacc.c */
#line 1641 "go.y"
{ {
// without func keyword // without func keyword
(yyvsp[(2) - (4)].list) = checkarglist((yyvsp[(2) - (4)].list), 1); (yyvsp[(2) - (4)].list) = checkarglist((yyvsp[(2) - (4)].list), 1);
...@@ -4629,9 +4207,7 @@ yyreduce: ...@@ -4629,9 +4207,7 @@ yyreduce:
break; break;
case 243: case 243:
#line 1654 "go.y"
/* Line 1806 of yacc.c */
#line 1655 "go.y"
{ {
(yyval.node) = nod(ONONAME, N, N); (yyval.node) = nod(ONONAME, N, N);
(yyval.node)->sym = (yyvsp[(1) - (2)].sym); (yyval.node)->sym = (yyvsp[(1) - (2)].sym);
...@@ -4640,9 +4216,7 @@ yyreduce: ...@@ -4640,9 +4216,7 @@ yyreduce:
break; break;
case 244: case 244:
#line 1660 "go.y"
/* Line 1806 of yacc.c */
#line 1661 "go.y"
{ {
(yyval.node) = nod(ONONAME, N, N); (yyval.node) = nod(ONONAME, N, N);
(yyval.node)->sym = (yyvsp[(1) - (2)].sym); (yyval.node)->sym = (yyvsp[(1) - (2)].sym);
...@@ -4651,72 +4225,56 @@ yyreduce: ...@@ -4651,72 +4225,56 @@ yyreduce:
break; break;
case 246: case 246:
#line 1669 "go.y"
/* Line 1806 of yacc.c */
#line 1670 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 247: case 247:
#line 1673 "go.y"
/* Line 1806 of yacc.c */
#line 1674 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 248: case 248:
#line 1678 "go.y"
/* Line 1806 of yacc.c */
#line 1679 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 249: case 249:
#line 1682 "go.y"
/* Line 1806 of yacc.c */
#line 1683 "go.y"
{ {
(yyval.list) = (yyvsp[(1) - (2)].list); (yyval.list) = (yyvsp[(1) - (2)].list);
} }
break; break;
case 250: case 250:
#line 1690 "go.y"
/* Line 1806 of yacc.c */
#line 1691 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
} }
break; break;
case 252: case 252:
#line 1695 "go.y"
/* Line 1806 of yacc.c */
#line 1696 "go.y"
{ {
(yyval.node) = liststmt((yyvsp[(1) - (1)].list)); (yyval.node) = liststmt((yyvsp[(1) - (1)].list));
} }
break; break;
case 254: case 254:
#line 1700 "go.y"
/* Line 1806 of yacc.c */
#line 1701 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
} }
break; break;
case 260: case 260:
#line 1711 "go.y"
/* Line 1806 of yacc.c */
#line 1712 "go.y"
{ {
(yyvsp[(1) - (2)].node) = nod(OLABEL, (yyvsp[(1) - (2)].node), N); (yyvsp[(1) - (2)].node) = nod(OLABEL, (yyvsp[(1) - (2)].node), N);
(yyvsp[(1) - (2)].node)->sym = dclstack; // context, for goto restrictions (yyvsp[(1) - (2)].node)->sym = dclstack; // context, for goto restrictions
...@@ -4724,9 +4282,7 @@ yyreduce: ...@@ -4724,9 +4282,7 @@ yyreduce:
break; break;
case 261: case 261:
#line 1716 "go.y"
/* Line 1806 of yacc.c */
#line 1717 "go.y"
{ {
NodeList *l; NodeList *l;
...@@ -4739,9 +4295,7 @@ yyreduce: ...@@ -4739,9 +4295,7 @@ yyreduce:
break; break;
case 262: case 262:
#line 1726 "go.y"
/* Line 1806 of yacc.c */
#line 1727 "go.y"
{ {
// will be converted to OFALL // will be converted to OFALL
(yyval.node) = nod(OXFALL, N, N); (yyval.node) = nod(OXFALL, N, N);
...@@ -4749,45 +4303,35 @@ yyreduce: ...@@ -4749,45 +4303,35 @@ yyreduce:
break; break;
case 263: case 263:
#line 1731 "go.y"
/* Line 1806 of yacc.c */
#line 1732 "go.y"
{ {
(yyval.node) = nod(OBREAK, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OBREAK, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 264: case 264:
#line 1735 "go.y"
/* Line 1806 of yacc.c */
#line 1736 "go.y"
{ {
(yyval.node) = nod(OCONTINUE, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OCONTINUE, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 265: case 265:
#line 1739 "go.y"
/* Line 1806 of yacc.c */
#line 1740 "go.y"
{ {
(yyval.node) = nod(OPROC, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OPROC, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 266: case 266:
#line 1743 "go.y"
/* Line 1806 of yacc.c */
#line 1744 "go.y"
{ {
(yyval.node) = nod(ODEFER, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(ODEFER, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 267: case 267:
#line 1747 "go.y"
/* Line 1806 of yacc.c */
#line 1748 "go.y"
{ {
(yyval.node) = nod(OGOTO, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OGOTO, (yyvsp[(2) - (2)].node), N);
(yyval.node)->sym = dclstack; // context, for goto restrictions (yyval.node)->sym = dclstack; // context, for goto restrictions
...@@ -4795,9 +4339,7 @@ yyreduce: ...@@ -4795,9 +4339,7 @@ yyreduce:
break; break;
case 268: case 268:
#line 1752 "go.y"
/* Line 1806 of yacc.c */
#line 1753 "go.y"
{ {
(yyval.node) = nod(ORETURN, N, N); (yyval.node) = nod(ORETURN, N, N);
(yyval.node)->list = (yyvsp[(2) - (2)].list); (yyval.node)->list = (yyvsp[(2) - (2)].list);
...@@ -4817,9 +4359,7 @@ yyreduce: ...@@ -4817,9 +4359,7 @@ yyreduce:
break; break;
case 269: case 269:
#line 1771 "go.y"
/* Line 1806 of yacc.c */
#line 1772 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
if((yyvsp[(1) - (1)].node) != N) if((yyvsp[(1) - (1)].node) != N)
...@@ -4828,9 +4368,7 @@ yyreduce: ...@@ -4828,9 +4368,7 @@ yyreduce:
break; break;
case 270: case 270:
#line 1777 "go.y"
/* Line 1806 of yacc.c */
#line 1778 "go.y"
{ {
(yyval.list) = (yyvsp[(1) - (3)].list); (yyval.list) = (yyvsp[(1) - (3)].list);
if((yyvsp[(3) - (3)].node) != N) if((yyvsp[(3) - (3)].node) != N)
...@@ -4839,243 +4377,189 @@ yyreduce: ...@@ -4839,243 +4377,189 @@ yyreduce:
break; break;
case 271: case 271:
#line 1785 "go.y"
/* Line 1806 of yacc.c */
#line 1786 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 272: case 272:
#line 1789 "go.y"
/* Line 1806 of yacc.c */
#line 1790 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 273: case 273:
#line 1795 "go.y"
/* Line 1806 of yacc.c */
#line 1796 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 274: case 274:
#line 1799 "go.y"
/* Line 1806 of yacc.c */
#line 1800 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 275: case 275:
#line 1805 "go.y"
/* Line 1806 of yacc.c */
#line 1806 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 276: case 276:
#line 1809 "go.y"
/* Line 1806 of yacc.c */
#line 1810 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 277: case 277:
#line 1815 "go.y"
/* Line 1806 of yacc.c */
#line 1816 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 278: case 278:
#line 1819 "go.y"
/* Line 1806 of yacc.c */
#line 1820 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 279: case 279:
#line 1828 "go.y"
/* Line 1806 of yacc.c */
#line 1829 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 280: case 280:
#line 1832 "go.y"
/* Line 1806 of yacc.c */
#line 1833 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 281: case 281:
#line 1836 "go.y"
/* Line 1806 of yacc.c */
#line 1837 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 282: case 282:
#line 1840 "go.y"
/* Line 1806 of yacc.c */
#line 1841 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 283: case 283:
#line 1845 "go.y"
/* Line 1806 of yacc.c */
#line 1846 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 284: case 284:
#line 1849 "go.y"
/* Line 1806 of yacc.c */
#line 1850 "go.y"
{ {
(yyval.list) = (yyvsp[(1) - (2)].list); (yyval.list) = (yyvsp[(1) - (2)].list);
} }
break; break;
case 289: case 289:
#line 1863 "go.y"
/* Line 1806 of yacc.c */
#line 1864 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
} }
break; break;
case 291: case 291:
#line 1869 "go.y"
/* Line 1806 of yacc.c */
#line 1870 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 293: case 293:
#line 1875 "go.y"
/* Line 1806 of yacc.c */
#line 1876 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
} }
break; break;
case 295: case 295:
#line 1881 "go.y"
/* Line 1806 of yacc.c */
#line 1882 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 297: case 297:
#line 1887 "go.y"
/* Line 1806 of yacc.c */
#line 1888 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 299: case 299:
#line 1893 "go.y"
/* Line 1806 of yacc.c */
#line 1894 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 301: case 301:
#line 1899 "go.y"
/* Line 1806 of yacc.c */
#line 1900 "go.y"
{ {
(yyval.val).ctype = CTxxx; (yyval.val).ctype = CTxxx;
} }
break; break;
case 303: case 303:
#line 1909 "go.y"
/* Line 1806 of yacc.c */
#line 1910 "go.y"
{ {
importimport((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].val).u.sval); importimport((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].val).u.sval);
} }
break; break;
case 304: case 304:
#line 1913 "go.y"
/* Line 1806 of yacc.c */
#line 1914 "go.y"
{ {
importvar((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].type)); importvar((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].type));
} }
break; break;
case 305: case 305:
#line 1917 "go.y"
/* Line 1806 of yacc.c */
#line 1918 "go.y"
{ {
importconst((yyvsp[(2) - (5)].sym), types[TIDEAL], (yyvsp[(4) - (5)].node)); importconst((yyvsp[(2) - (5)].sym), types[TIDEAL], (yyvsp[(4) - (5)].node));
} }
break; break;
case 306: case 306:
#line 1921 "go.y"
/* Line 1806 of yacc.c */
#line 1922 "go.y"
{ {
importconst((yyvsp[(2) - (6)].sym), (yyvsp[(3) - (6)].type), (yyvsp[(5) - (6)].node)); importconst((yyvsp[(2) - (6)].sym), (yyvsp[(3) - (6)].type), (yyvsp[(5) - (6)].node));
} }
break; break;
case 307: case 307:
#line 1925 "go.y"
/* Line 1806 of yacc.c */
#line 1926 "go.y"
{ {
importtype((yyvsp[(2) - (4)].type), (yyvsp[(3) - (4)].type)); importtype((yyvsp[(2) - (4)].type), (yyvsp[(3) - (4)].type));
} }
break; break;
case 308: case 308:
#line 1929 "go.y"
/* Line 1806 of yacc.c */
#line 1930 "go.y"
{ {
if((yyvsp[(2) - (4)].node) == N) { if((yyvsp[(2) - (4)].node) == N) {
dclcontext = PEXTERN; // since we skip the funcbody below dclcontext = PEXTERN; // since we skip the funcbody below
...@@ -5096,9 +4580,7 @@ yyreduce: ...@@ -5096,9 +4580,7 @@ yyreduce:
break; break;
case 309: case 309:
#line 1949 "go.y"
/* Line 1806 of yacc.c */
#line 1950 "go.y"
{ {
(yyval.sym) = (yyvsp[(1) - (1)].sym); (yyval.sym) = (yyvsp[(1) - (1)].sym);
structpkg = (yyval.sym)->pkg; structpkg = (yyval.sym)->pkg;
...@@ -5106,9 +4588,7 @@ yyreduce: ...@@ -5106,9 +4588,7 @@ yyreduce:
break; break;
case 310: case 310:
#line 1956 "go.y"
/* Line 1806 of yacc.c */
#line 1957 "go.y"
{ {
(yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym));
importsym((yyvsp[(1) - (1)].sym), OTYPE); importsym((yyvsp[(1) - (1)].sym), OTYPE);
...@@ -5116,18 +4596,14 @@ yyreduce: ...@@ -5116,18 +4596,14 @@ yyreduce:
break; break;
case 316: case 316:
#line 1976 "go.y"
/* Line 1806 of yacc.c */
#line 1977 "go.y"
{ {
(yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym));
} }
break; break;
case 317: case 317:
#line 1980 "go.y"
/* Line 1806 of yacc.c */
#line 1981 "go.y"
{ {
// predefined name like uint8 // predefined name like uint8
(yyvsp[(1) - (1)].sym) = pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg); (yyvsp[(1) - (1)].sym) = pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg);
...@@ -5140,63 +4616,49 @@ yyreduce: ...@@ -5140,63 +4616,49 @@ yyreduce:
break; break;
case 318: case 318:
#line 1990 "go.y"
/* Line 1806 of yacc.c */
#line 1991 "go.y"
{ {
(yyval.type) = aindex(N, (yyvsp[(3) - (3)].type)); (yyval.type) = aindex(N, (yyvsp[(3) - (3)].type));
} }
break; break;
case 319: case 319:
#line 1994 "go.y"
/* Line 1806 of yacc.c */
#line 1995 "go.y"
{ {
(yyval.type) = aindex(nodlit((yyvsp[(2) - (4)].val)), (yyvsp[(4) - (4)].type)); (yyval.type) = aindex(nodlit((yyvsp[(2) - (4)].val)), (yyvsp[(4) - (4)].type));
} }
break; break;
case 320: case 320:
#line 1998 "go.y"
/* Line 1806 of yacc.c */
#line 1999 "go.y"
{ {
(yyval.type) = maptype((yyvsp[(3) - (5)].type), (yyvsp[(5) - (5)].type)); (yyval.type) = maptype((yyvsp[(3) - (5)].type), (yyvsp[(5) - (5)].type));
} }
break; break;
case 321: case 321:
#line 2002 "go.y"
/* Line 1806 of yacc.c */
#line 2003 "go.y"
{ {
(yyval.type) = tostruct((yyvsp[(3) - (4)].list)); (yyval.type) = tostruct((yyvsp[(3) - (4)].list));
} }
break; break;
case 322: case 322:
#line 2006 "go.y"
/* Line 1806 of yacc.c */
#line 2007 "go.y"
{ {
(yyval.type) = tointerface((yyvsp[(3) - (4)].list)); (yyval.type) = tointerface((yyvsp[(3) - (4)].list));
} }
break; break;
case 323: case 323:
#line 2010 "go.y"
/* Line 1806 of yacc.c */
#line 2011 "go.y"
{ {
(yyval.type) = ptrto((yyvsp[(2) - (2)].type)); (yyval.type) = ptrto((yyvsp[(2) - (2)].type));
} }
break; break;
case 324: case 324:
#line 2014 "go.y"
/* Line 1806 of yacc.c */
#line 2015 "go.y"
{ {
(yyval.type) = typ(TCHAN); (yyval.type) = typ(TCHAN);
(yyval.type)->type = (yyvsp[(2) - (2)].type); (yyval.type)->type = (yyvsp[(2) - (2)].type);
...@@ -5205,9 +4667,7 @@ yyreduce: ...@@ -5205,9 +4667,7 @@ yyreduce:
break; break;
case 325: case 325:
#line 2020 "go.y"
/* Line 1806 of yacc.c */
#line 2021 "go.y"
{ {
(yyval.type) = typ(TCHAN); (yyval.type) = typ(TCHAN);
(yyval.type)->type = (yyvsp[(3) - (4)].type); (yyval.type)->type = (yyvsp[(3) - (4)].type);
...@@ -5216,9 +4676,7 @@ yyreduce: ...@@ -5216,9 +4676,7 @@ yyreduce:
break; break;
case 326: case 326:
#line 2026 "go.y"
/* Line 1806 of yacc.c */
#line 2027 "go.y"
{ {
(yyval.type) = typ(TCHAN); (yyval.type) = typ(TCHAN);
(yyval.type)->type = (yyvsp[(3) - (3)].type); (yyval.type)->type = (yyvsp[(3) - (3)].type);
...@@ -5227,9 +4685,7 @@ yyreduce: ...@@ -5227,9 +4685,7 @@ yyreduce:
break; break;
case 327: case 327:
#line 2034 "go.y"
/* Line 1806 of yacc.c */
#line 2035 "go.y"
{ {
(yyval.type) = typ(TCHAN); (yyval.type) = typ(TCHAN);
(yyval.type)->type = (yyvsp[(3) - (3)].type); (yyval.type)->type = (yyvsp[(3) - (3)].type);
...@@ -5238,18 +4694,14 @@ yyreduce: ...@@ -5238,18 +4694,14 @@ yyreduce:
break; break;
case 328: case 328:
#line 2042 "go.y"
/* Line 1806 of yacc.c */
#line 2043 "go.y"
{ {
(yyval.type) = functype(nil, (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)); (yyval.type) = functype(nil, (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list));
} }
break; break;
case 329: case 329:
#line 2048 "go.y"
/* Line 1806 of yacc.c */
#line 2049 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(2) - (3)].type))); (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(2) - (3)].type)));
if((yyvsp[(1) - (3)].sym)) if((yyvsp[(1) - (3)].sym))
...@@ -5259,9 +4711,7 @@ yyreduce: ...@@ -5259,9 +4711,7 @@ yyreduce:
break; break;
case 330: case 330:
#line 2055 "go.y"
/* Line 1806 of yacc.c */
#line 2056 "go.y"
{ {
Type *t; Type *t;
...@@ -5278,9 +4728,7 @@ yyreduce: ...@@ -5278,9 +4728,7 @@ yyreduce:
break; break;
case 331: case 331:
#line 2071 "go.y"
/* Line 1806 of yacc.c */
#line 2072 "go.y"
{ {
Sym *s; Sym *s;
...@@ -5299,63 +4747,49 @@ yyreduce: ...@@ -5299,63 +4747,49 @@ yyreduce:
break; break;
case 332: case 332:
#line 2089 "go.y"
/* Line 1806 of yacc.c */
#line 2090 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, newname((yyvsp[(1) - (5)].sym)), typenod(functype(fakethis(), (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)))); (yyval.node) = nod(ODCLFIELD, newname((yyvsp[(1) - (5)].sym)), typenod(functype(fakethis(), (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list))));
} }
break; break;
case 333: case 333:
#line 2093 "go.y"
/* Line 1806 of yacc.c */
#line 2094 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type))); (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type)));
} }
break; break;
case 334: case 334:
#line 2098 "go.y"
/* Line 1806 of yacc.c */
#line 2099 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 336: case 336:
#line 2105 "go.y"
/* Line 1806 of yacc.c */
#line 2106 "go.y"
{ {
(yyval.list) = (yyvsp[(2) - (3)].list); (yyval.list) = (yyvsp[(2) - (3)].list);
} }
break; break;
case 337: case 337:
#line 2109 "go.y"
/* Line 1806 of yacc.c */
#line 2110 "go.y"
{ {
(yyval.list) = list1(nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type)))); (yyval.list) = list1(nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type))));
} }
break; break;
case 338: case 338:
#line 2119 "go.y"
/* Line 1806 of yacc.c */
#line 2120 "go.y"
{ {
(yyval.node) = nodlit((yyvsp[(1) - (1)].val)); (yyval.node) = nodlit((yyvsp[(1) - (1)].val));
} }
break; break;
case 339: case 339:
#line 2123 "go.y"
/* Line 1806 of yacc.c */
#line 2124 "go.y"
{ {
(yyval.node) = nodlit((yyvsp[(2) - (2)].val)); (yyval.node) = nodlit((yyvsp[(2) - (2)].val));
switch((yyval.node)->val.ctype){ switch((yyval.node)->val.ctype){
...@@ -5373,9 +4807,7 @@ yyreduce: ...@@ -5373,9 +4807,7 @@ yyreduce:
break; break;
case 340: case 340:
#line 2138 "go.y"
/* Line 1806 of yacc.c */
#line 2139 "go.y"
{ {
(yyval.node) = oldname(pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg)); (yyval.node) = oldname(pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg));
if((yyval.node)->op != OLITERAL) if((yyval.node)->op != OLITERAL)
...@@ -5384,9 +4816,7 @@ yyreduce: ...@@ -5384,9 +4816,7 @@ yyreduce:
break; break;
case 342: case 342:
#line 2147 "go.y"
/* Line 1806 of yacc.c */
#line 2148 "go.y"
{ {
if((yyvsp[(2) - (5)].node)->val.ctype == CTRUNE && (yyvsp[(4) - (5)].node)->val.ctype == CTINT) { if((yyvsp[(2) - (5)].node)->val.ctype == CTRUNE && (yyvsp[(4) - (5)].node)->val.ctype == CTINT) {
(yyval.node) = (yyvsp[(2) - (5)].node); (yyval.node) = (yyvsp[(2) - (5)].node);
...@@ -5400,76 +4830,52 @@ yyreduce: ...@@ -5400,76 +4830,52 @@ yyreduce:
break; break;
case 345: case 345:
#line 2163 "go.y"
/* Line 1806 of yacc.c */
#line 2164 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 346: case 346:
#line 2167 "go.y"
/* Line 1806 of yacc.c */
#line 2168 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 347: case 347:
#line 2173 "go.y"
/* Line 1806 of yacc.c */
#line 2174 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 348: case 348:
#line 2177 "go.y"
/* Line 1806 of yacc.c */
#line 2178 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 349: case 349:
#line 2183 "go.y"
/* Line 1806 of yacc.c */
#line 2184 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 350: case 350:
#line 2187 "go.y"
/* Line 1806 of yacc.c */
#line 2188 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
/* Line 1267 of yacc.c. */
/* Line 1806 of yacc.c */ #line 4878 "y.tab.c"
#line 5462 "y.tab.c"
default: break; default: break;
} }
/* User semantic actions sometimes alter yychar, and that requires
that yytoken be updated with the new translation. We take the
approach of translating immediately before every use of yytoken.
One alternative is translating here after every semantic action,
but that translation would be missed if the semantic action invokes
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
incorrect destructor might then be invoked immediately. In the
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
...@@ -5478,6 +4884,7 @@ yyreduce: ...@@ -5478,6 +4884,7 @@ yyreduce:
*++yyvsp = yyval; *++yyvsp = yyval;
/* Now `shift' the result of the reduction. Determine what state /* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule that goes to, based on the state we popped back to and the rule
number reduced by. */ number reduced by. */
...@@ -5497,10 +4904,6 @@ yyreduce: ...@@ -5497,10 +4904,6 @@ yyreduce:
| yyerrlab -- here on detecting error | | yyerrlab -- here on detecting error |
`------------------------------------*/ `------------------------------------*/
yyerrlab: yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
/* If not already recovering from an error, report this error. */ /* If not already recovering from an error, report this error. */
if (!yyerrstatus) if (!yyerrstatus)
{ {
...@@ -5508,36 +4911,37 @@ yyerrlab: ...@@ -5508,36 +4911,37 @@ yyerrlab:
#if ! YYERROR_VERBOSE #if ! YYERROR_VERBOSE
yyerror (YY_("syntax error")); yyerror (YY_("syntax error"));
#else #else
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)
{ {
char *yymsgp = YY_("syntax error"); YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
int yysyntax_error_status; if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
yysyntax_error_status = YYSYNTAX_ERROR;
if (yysyntax_error_status == 0)
yymsgp = yymsg;
else if (yysyntax_error_status == 1)
{ {
YYSIZE_T yyalloc = 2 * yysize;
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
yyalloc = YYSTACK_ALLOC_MAXIMUM;
if (yymsg != yymsgbuf) if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg); YYSTACK_FREE (yymsg);
yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); yymsg = (char *) YYSTACK_ALLOC (yyalloc);
if (!yymsg) if (yymsg)
yymsg_alloc = yyalloc;
else
{ {
yymsg = yymsgbuf; yymsg = yymsgbuf;
yymsg_alloc = sizeof yymsgbuf; yymsg_alloc = sizeof yymsgbuf;
yysyntax_error_status = 2;
} }
else
{
yysyntax_error_status = YYSYNTAX_ERROR;
yymsgp = yymsg;
} }
if (0 < yysize && yysize <= yymsg_alloc)
{
(void) yysyntax_error (yymsg, yystate, yychar);
yyerror (yymsg);
} }
yyerror (yymsgp); else
if (yysyntax_error_status == 2) {
yyerror (YY_("syntax error"));
if (yysize != 0)
goto yyexhaustedlab; goto yyexhaustedlab;
} }
# undef YYSYNTAX_ERROR }
#endif #endif
} }
...@@ -5545,7 +4949,7 @@ yyerrlab: ...@@ -5545,7 +4949,7 @@ yyerrlab:
if (yyerrstatus == 3) if (yyerrstatus == 3)
{ {
/* If just tried and failed to reuse lookahead token after an /* If just tried and failed to reuse look-ahead token after an
error, discard it. */ error, discard it. */
if (yychar <= YYEOF) if (yychar <= YYEOF)
...@@ -5562,7 +4966,7 @@ yyerrlab: ...@@ -5562,7 +4966,7 @@ yyerrlab:
} }
} }
/* Else will try to reuse lookahead token after shifting the error /* Else will try to reuse look-ahead token after shifting the error
token. */ token. */
goto yyerrlab1; goto yyerrlab1;
...@@ -5596,7 +5000,7 @@ yyerrlab1: ...@@ -5596,7 +5000,7 @@ yyerrlab1:
for (;;) for (;;)
{ {
yyn = yypact[yystate]; yyn = yypact[yystate];
if (!yypact_value_is_default (yyn)) if (yyn != YYPACT_NINF)
{ {
yyn += YYTERROR; yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
...@@ -5619,6 +5023,9 @@ yyerrlab1: ...@@ -5619,6 +5023,9 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval; *++yyvsp = yylval;
...@@ -5643,7 +5050,7 @@ yyabortlab: ...@@ -5643,7 +5050,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#if !defined(yyoverflow) || YYERROR_VERBOSE #ifndef yyoverflow
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
...@@ -5654,14 +5061,9 @@ yyexhaustedlab: ...@@ -5654,14 +5061,9 @@ yyexhaustedlab:
#endif #endif
yyreturn: yyreturn:
if (yychar != YYEMPTY) if (yychar != YYEOF && yychar != YYEMPTY)
{
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = YYTRANSLATE (yychar);
yydestruct ("Cleanup: discarding lookahead", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval); yytoken, &yylval);
}
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */ this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
...@@ -5685,9 +5087,7 @@ yyreturn: ...@@ -5685,9 +5087,7 @@ yyreturn:
} }
#line 2191 "go.y"
/* Line 2067 of yacc.c */
#line 2192 "go.y"
static void static void
......
/* A Bison parser, made by GNU Bison 2.5. */ /* A Bison parser, made by GNU Bison 2.3. */
/* Bison interface for Yacc-like parsers in C /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation; either version 2, or (at your option)
(at your option) any later version. any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
...@@ -15,7 +16,9 @@ ...@@ -15,7 +16,9 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -30,7 +33,6 @@ ...@@ -30,7 +33,6 @@
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
...@@ -144,28 +146,22 @@ ...@@ -144,28 +146,22 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{
/* Line 2068 of yacc.c */
#line 30 "go.y" #line 30 "go.y"
{
Node* node; Node* node;
NodeList* list; NodeList* list;
Type* type; Type* type;
Sym* sym; Sym* sym;
struct Val val; struct Val val;
int i; int i;
}
/* Line 1529 of yacc.c. */
#line 160 "y.tab.h"
/* Line 2068 of yacc.c */ YYSTYPE;
#line 163 "y.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
extern YYSTYPE yylval; extern YYSTYPE yylval;
...@@ -21,16 +21,16 @@ static struct { ...@@ -21,16 +21,16 @@ static struct {
"missing import path; require quoted string", "missing import path; require quoted string",
377, ';', 377, ';',
"unexpected semicolon or newline before {", "missing { after if clause",
398, ';', 398, ';',
"unexpected semicolon or newline before {", "missing { after switch clause",
237, ';', 237, ';',
"unexpected semicolon or newline before {", "missing { after for clause",
475, LBODY, 475, LBODY,
"unexpected semicolon or newline before {", "missing { after for clause",
22, '{', 22, '{',
"unexpected semicolon or newline before {", "unexpected semicolon or newline before {",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment