blob: 72bce9a465cabb9b56d7173abecf25bd62efb435 [file] [log] [blame]
//line go.y:21
package gc
import __yyfmt__ "fmt"
//line go.y:21
import (
"fmt"
"strings"
)
//line go.y:28
type yySymType struct {
yys int
node *Node
list *NodeList
typ *Type
sym *Sym
val Val
i int
}
const LLITERAL = 57346
const LASOP = 57347
const LCOLAS = 57348
const LBREAK = 57349
const LCASE = 57350
const LCHAN = 57351
const LCONST = 57352
const LCONTINUE = 57353
const LDDD = 57354
const LDEFAULT = 57355
const LDEFER = 57356
const LELSE = 57357
const LFALL = 57358
const LFOR = 57359
const LFUNC = 57360
const LGO = 57361
const LGOTO = 57362
const LIF = 57363
const LIMPORT = 57364
const LINTERFACE = 57365
const LMAP = 57366
const LNAME = 57367
const LPACKAGE = 57368
const LRANGE = 57369
const LRETURN = 57370
const LSELECT = 57371
const LSTRUCT = 57372
const LSWITCH = 57373
const LTYPE = 57374
const LVAR = 57375
const LANDAND = 57376
const LANDNOT = 57377
const LBODY = 57378
const LCOMM = 57379
const LDEC = 57380
const LEQ = 57381
const LGE = 57382
const LGT = 57383
const LIGNORE = 57384
const LINC = 57385
const LLE = 57386
const LLSH = 57387
const LLT = 57388
const LNE = 57389
const LOROR = 57390
const LRSH = 57391
const NotPackage = 57392
const NotParen = 57393
const PreferToRightParen = 57394
var yyToknames = [...]string{
"$end",
"error",
"$unk",
"LLITERAL",
"LASOP",
"LCOLAS",
"LBREAK",
"LCASE",
"LCHAN",
"LCONST",
"LCONTINUE",
"LDDD",
"LDEFAULT",
"LDEFER",
"LELSE",
"LFALL",
"LFOR",
"LFUNC",
"LGO",
"LGOTO",
"LIF",
"LIMPORT",
"LINTERFACE",
"LMAP",
"LNAME",
"LPACKAGE",
"LRANGE",
"LRETURN",
"LSELECT",
"LSTRUCT",
"LSWITCH",
"LTYPE",
"LVAR",
"LANDAND",
"LANDNOT",
"LBODY",
"LCOMM",
"LDEC",
"LEQ",
"LGE",
"LGT",
"LIGNORE",
"LINC",
"LLE",
"LLSH",
"LLT",
"LNE",
"LOROR",
"LRSH",
"'+'",
"'-'",
"'|'",
"'^'",
"'*'",
"'/'",
"'%'",
"'&'",
"NotPackage",
"NotParen",
"'('",
"')'",
"PreferToRightParen",
"';'",
"'.'",
"'$'",
"'='",
"':'",
"'{'",
"'}'",
"'!'",
"'~'",
"'['",
"']'",
"'?'",
"'@'",
"','",
}
var yyStatenames = [...]string{}
const yyEofCode = 1
const yyErrCode = 2
const yyMaxDepth = 200
//line go.y:2304
func fixlbrace(lbr int) {
// If the opening brace was an LBODY,
// set up for another one now that we're done.
// See comment in lex.C about loophack.
if lbr == LBODY {
loophack = 1
}
}
//line yacctab:1
var yyExca = [...]int{
-1, 1,
1, -1,
-2, 0,
-1, 17,
1, 1,
63, 23,
-2, 0,
-1, 48,
6, 276,
66, 276,
76, 276,
-2, 49,
-1, 56,
67, 153,
-2, 162,
-1, 74,
60, 181,
-2, 215,
-1, 75,
60, 182,
-2, 183,
-1, 121,
60, 134,
64, 134,
68, 134,
72, 134,
-2, 266,
-1, 125,
60, 134,
64, 134,
68, 134,
72, 134,
-2, 267,
-1, 176,
2, 215,
36, 215,
60, 181,
68, 215,
-2, 173,
-1, 177,
36, 183,
60, 182,
68, 183,
-2, 174,
-1, 184,
63, 251,
69, 251,
-2, 0,
-1, 242,
63, 251,
69, 251,
-2, 0,
-1, 252,
8, 251,
13, 251,
63, 251,
69, 251,
-2, 0,
-1, 325,
4, 236,
63, 236,
69, 236,
-2, 157,
-1, 407,
36, 176,
60, 176,
68, 176,
-2, 167,
-1, 408,
36, 177,
60, 177,
68, 177,
-2, 168,
-1, 409,
36, 178,
60, 178,
68, 178,
-2, 169,
-1, 410,
36, 179,
60, 179,
68, 179,
-2, 170,
-1, 416,
8, 251,
13, 251,
63, 251,
69, 251,
-2, 0,
-1, 417,
63, 251,
69, 251,
-2, 0,
-1, 497,
63, 251,
69, 251,
-2, 0,
-1, 552,
60, 157,
-2, 318,
-1, 553,
60, 158,
-2, 317,
-1, 578,
8, 251,
13, 251,
63, 251,
69, 251,
-2, 0,
-1, 592,
36, 180,
60, 180,
68, 180,
-2, 171,
}
const yyNprod = 352
const yyPrivate = 57344
var yyTokenNames []string
var yyStates []string
const yyLast = 2282
var yyAct = [...]int{
74, 381, 304, 285, 291, 486, 610, 398, 545, 478,
549, 296, 186, 75, 400, 229, 302, 401, 103, 389,
458, 356, 290, 318, 457, 34, 303, 338, 230, 245,
466, 109, 339, 101, 337, 332, 85, 104, 374, 248,
246, 174, 467, 286, 14, 324, 479, 328, 241, 212,
108, 6, 325, 155, 243, 469, 226, 181, 468, 516,
413, 320, 373, 392, 325, 219, 13, 208, 176, 10,
11, 584, 172, 469, 651, 385, 599, 583, 106, 191,
13, 177, 460, 541, 422, 160, 310, 331, 613, 161,
309, 446, 192, 322, 193, 626, 327, 162, 198, 321,
88, 12, 13, 10, 227, 238, 662, 194, 317, 227,
632, 448, 227, 12, 13, 227, 209, 228, 12, 13,
447, 10, 228, 203, 175, 228, 108, 393, 228, 461,
54, 660, 205, 445, 184, 384, 222, 460, 459, 204,
199, 200, 239, 88, 506, 155, 214, 216, 218, 507,
427, 631, 12, 13, 233, 625, 624, 202, 10, 88,
90, 176, 55, 288, 10, 627, 213, 213, 213, 213,
12, 13, 118, 118, 177, 295, 126, 154, 308, 176,
10, 416, 282, 282, 461, 282, 603, 620, 416, 10,
600, 227, 177, 301, 593, 416, 227, 227, 404, 227,
280, 484, 444, 90, 228, 622, 536, 12, 13, 228,
228, 506, 228, 12, 13, 86, 507, 175, 527, 90,
298, 163, 164, 165, 166, 167, 168, 169, 170, 12,
13, 523, 227, 580, 515, 175, 182, 153, 12, 13,
242, 171, 325, 397, 416, 228, 330, 155, 227, 334,
415, 227, 227, 116, 227, 185, 358, 367, 463, 371,
360, 228, 355, 362, 228, 228, 353, 228, 183, 365,
210, 322, 504, 369, 434, 314, 68, 321, 91, 379,
614, 78, 416, 340, 609, 340, 340, 376, 375, 182,
124, 12, 13, 604, 176, 83, 79, 10, 394, 325,
407, 336, 82, 351, 352, 10, 378, 177, 380, 414,
227, 227, 601, 408, 574, 409, 608, 10, 568, 558,
227, 183, 48, 228, 228, 465, 10, 464, 410, 391,
323, 329, 67, 228, 331, 348, 443, 656, 442, 412,
293, 163, 170, 605, 77, 436, 12, 13, 12, 13,
175, 424, 423, 234, 12, 13, 388, 383, 370, 366,
359, 114, 435, 333, 655, 227, 12, 13, 100, 129,
441, 99, 10, 490, 227, 12, 13, 439, 228, 84,
454, 20, 453, 429, 432, 480, 491, 228, 492, 654,
173, 10, 508, 473, 176, 10, 653, 645, 511, 619,
188, 493, 483, 494, 616, 607, 227, 177, 221, 282,
514, 606, 227, 597, 282, 519, 520, 340, 340, 228,
596, 12, 13, 227, 595, 228, 110, 498, 340, 489,
107, 510, 502, 592, 525, 449, 228, 582, 517, 227,
12, 13, 562, 524, 12, 13, 470, 539, 528, 531,
175, 522, 228, 254, 513, 512, 255, 256, 257, 258,
259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
269, 270, 271, 272, 273, 274, 129, 129, 277, 554,
559, 227, 330, 173, 537, 294, 509, 557, 561, 227,
69, 564, 532, 538, 228, 534, 490, 490, 496, 495,
482, 572, 228, 300, 476, 475, 472, 176, 440, 491,
491, 492, 492, 567, 573, 340, 10, 340, 420, 553,
177, 577, 372, 340, 493, 493, 340, 590, 591, 579,
297, 585, 570, 540, 586, 542, 456, 551, 431, 438,
249, 555, 340, 571, 556, 354, 253, 129, 251, 180,
431, 102, 489, 489, 382, 323, 501, 530, 287, 129,
566, 117, 7, 175, 70, 12, 13, 329, 5, 197,
431, 227, 211, 433, 24, 16, 529, 19, 617, 430,
650, 455, 364, 533, 228, 428, 560, 480, 305, 335,
207, 206, 21, 93, 197, 623, 252, 629, 490, 197,
282, 630, 197, 635, 120, 197, 26, 386, 121, 125,
637, 491, 340, 492, 641, 639, 173, 340, 621, 402,
57, 565, 306, 76, 402, 618, 493, 158, 176, 642,
598, 387, 511, 340, 157, 602, 640, 665, 652, 581,
28, 177, 390, 643, 223, 644, 490, 159, 156, 235,
96, 657, 240, 661, 489, 497, 578, 417, 98, 491,
663, 492, 94, 664, 122, 122, 31, 22, 667, 666,
340, 15, 97, 95, 493, 553, 23, 201, 340, 49,
18, 197, 594, 129, 175, 3, 197, 197, 636, 197,
129, 282, 8, 551, 4, 2, 1, 450, 215, 543,
544, 547, 489, 548, 611, 92, 487, 129, 129, 189,
80, 81, 437, 72, 71, 237, 173, 615, 477, 316,
188, 220, 197, 326, 340, 244, 128, 340, 648, 628,
649, 311, 127, 17, 399, 319, 312, 313, 197, 315,
25, 197, 197, 27, 197, 36, 633, 634, 78, 37,
281, 66, 111, 638, 39, 38, 35, 124, 279, 278,
73, 217, 83, 79, 10, 113, 587, 149, 503, 82,
505, 87, 363, 0, 123, 0, 232, 150, 0, 0,
9, 151, 141, 142, 143, 144, 145, 146, 147, 148,
197, 377, 56, 196, 89, 0, 0, 0, 0, 231,
197, 197, 0, 0, 0, 105, 105, 112, 115, 0,
197, 77, 0, 12, 13, 426, 119, 119, 0, 0,
119, 0, 575, 576, 0, 0, 0, 0, 0, 173,
0, 0, 0, 275, 276, 0, 283, 0, 0, 402,
406, 588, 402, 402, 0, 0, 0, 0, 0, 0,
418, 419, 0, 0, 0, 197, 0, 0, 78, 0,
425, 89, 0, 197, 197, 0, 0, 124, 0, 0,
0, 0, 83, 79, 10, 0, 0, 105, 149, 82,
0, 0, 105, 0, 0, 112, 232, 0, 150, 247,
0, 0, 151, 0, 0, 0, 197, 145, 146, 147,
148, 0, 197, 196, 361, 406, 0, 188, 0, 231,
0, 0, 0, 197, 0, 236, 368, 78, 0, 0,
250, 77, 0, 12, 13, 225, 124, 0, 0, 197,
0, 83, 79, 10, 0, 0, 292, 0, 82, 0,
0, 0, 0, 0, 0, 232, 311, 0, 646, 647,
173, 0, 521, 402, 0, 0, 0, 0, 0, 56,
0, 0, 196, 526, 0, 0, 0, 0, 231, 0,
0, 197, 0, 0, 119, 119, 0, 0, 0, 197,
77, 0, 12, 13, 0, 0, 197, 197, 0, 0,
0, 0, 134, 149, 357, 152, 0, 135, 139, 140,
105, 0, 138, 150, 137, 136, 133, 151, 141, 142,
143, 144, 145, 146, 147, 148, 0, 56, 0, 0,
0, 569, 0, 0, 0, 0, 247, 56, 247, 0,
68, 0, 0, 0, 413, 78, 0, 0, 0, 78,
474, 0, 0, 0, 124, 0, 0, 481, 124, 83,
79, 10, 0, 83, 79, 10, 82, 0, 0, 0,
82, 197, 0, 65, 275, 276, 0, 232, 0, 0,
0, 0, 0, 0, 0, 0, 60, 61, 0, 64,
58, 0, 0, 59, 196, 0, 67, 0, 197, 421,
488, 0, 0, 0, 403, 0, 62, 63, 77, 0,
12, 13, 77, 0, 12, 13, 0, 68, 89, 0,
0, 0, 78, 0, 0, 0, 0, 0, 0, 0,
0, 124, 0, 347, 0, 462, 83, 79, 10, 357,
0, 0, 349, 82, 105, 0, 197, 345, 343, 341,
65, 105, 0, 0, 344, 112, 0, 485, 247, 0,
0, 348, 0, 60, 61, 0, 64, 58, 0, 0,
59, 0, 0, 67, 0, 0, 0, 78, 346, 0,
0, 589, 0, 62, 63, 77, 124, 12, 13, 0,
350, 83, 79, 10, 0, 0, 342, 0, 82, 13,
0, 56, 56, 0, 0, 232, 0, 0, 0, 119,
0, 119, 0, 0, 0, 0, 0, 0, 0, 535,
0, 119, 196, 247, 0, 0, 0, 0, 231, 0,
0, 0, 546, 550, 0, 0, 0, 0, 0, 0,
77, 357, 12, 13, 462, 0, 0, 0, 462, 0,
0, 0, 0, 563, 357, 0, 0, 0, 0, 0,
0, 0, 307, 0, 68, 0, 0, 41, 0, 78,
47, 42, 0, 247, 44, 0, 40, 50, 124, 43,
45, 53, 56, 83, 79, 10, 0, 0, 46, 52,
82, 51, 32, 30, 0, 0, 0, 65, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
60, 61, 0, 64, 58, 0, 0, 59, 0, 0,
67, 0, 0, 0, 0, 0, 0, 0, 308, 0,
62, 63, 77, 0, 12, 13, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 29, 105, 68, 247, 0, 41, 0, 78,
47, 42, 0, 56, 44, 0, 40, 50, 33, 43,
45, 53, 0, 83, 79, 10, 0, 0, 46, 52,
82, 51, 32, 30, 0, 0, 546, 65, 0, 550,
357, 0, 0, 462, 0, 0, 0, 357, 0, 357,
60, 61, 0, 64, 58, 0, 0, 59, 0, 68,
67, 0, 0, 0, 78, 0, 0, 0, 0, 0,
62, 63, 77, 124, 12, 13, 0, 0, 83, 79,
10, 0, 500, 0, 0, 82, 0, 0, 0, 0,
0, 0, 65, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 60, 61, 0, 64, 58,
0, 0, 59, 0, 68, 67, 0, 0, 0, 78,
0, 0, 0, 0, 0, 62, 63, 77, 124, 12,
13, 0, 0, 83, 79, 10, 0, 499, 0, 0,
82, 0, 0, 0, 0, 0, 0, 65, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
60, 61, 0, 64, 58, 0, 0, 59, 0, 68,
67, 0, 0, 0, 78, 0, 0, 0, 299, 0,
62, 63, 77, 124, 12, 13, 0, 124, 83, 79,
10, 0, 83, 79, 10, 82, 0, 395, 0, 82,
0, 0, 179, 0, 0, 0, 232, 0, 0, 0,
0, 0, 68, 0, 0, 60, 61, 78, 64, 178,
0, 0, 59, 196, 0, 67, 124, 0, 0, 231,
0, 83, 79, 10, 0, 62, 63, 77, 82, 12,
13, 77, 0, 12, 13, 179, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 60, 61,
0, 64, 178, 0, 0, 59, 0, 68, 67, 289,
0, 0, 78, 0, 0, 0, 0, 0, 62, 63,
77, 124, 12, 13, 0, 0, 83, 79, 10, 0,
284, 0, 0, 82, 0, 0, 0, 0, 0, 0,
65, 0, 0, 0, 0, 0, 0, 0, 0, 0,
68, 0, 0, 60, 61, 78, 64, 58, 187, 0,
59, 0, 0, 67, 124, 0, 0, 0, 0, 83,
79, 10, 0, 62, 63, 77, 82, 12, 13, 0,
0, 0, 0, 65, 0, 0, 0, 0, 0, 0,
0, 0, 0, 68, 0, 0, 60, 61, 78, 64,
58, 0, 0, 59, 0, 0, 67, 124, 0, 0,
0, 0, 83, 79, 10, 0, 62, 63, 77, 82,
12, 13, 0, 0, 0, 0, 65, 0, 0, 0,
0, 0, 0, 0, 0, 0, 68, 0, 0, 60,
61, 78, 64, 58, 0, 0, 59, 0, 0, 67,
124, 0, 0, 0, 0, 83, 79, 10, 0, 62,
63, 77, 82, 12, 13, 0, 0, 0, 0, 179,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 60, 61, 0, 64, 178, 0, 0, 59,
0, 0, 67, 0, 0, 0, 0, 0, 0, 0,
0, 0, 62, 63, 77, 0, 12, 13, 134, 149,
0, 152, 0, 135, 139, 140, 0, 0, 138, 150,
137, 136, 133, 151, 141, 142, 143, 144, 145, 146,
147, 148, 68, 0, 0, 0, 0, 299, 0, 0,
0, 0, 0, 0, 0, 0, 124, 396, 347, 0,
0, 83, 79, 10, 0, 0, 0, 349, 82, 78,
0, 0, 345, 343, 552, 65, 0, 0, 124, 344,
0, 0, 0, 83, 79, 10, 348, 0, 60, 61,
82, 64, 58, 0, 0, 59, 0, 232, 67, 0,
0, 0, 0, 346, 0, 0, 0, 0, 62, 63,
77, 0, 12, 13, 196, 0, 0, 0, 0, 0,
231, 342, 0, 12, 13, 0, 224, 0, 0, 0,
0, 0, 77, 0, 12, 13, 225, 134, 149, 0,
152, 0, 135, 139, 140, 0, 0, 138, 150, 137,
136, 133, 151, 141, 142, 143, 144, 145, 146, 147,
148, 134, 149, 0, 152, 0, 135, 139, 140, 0,
659, 138, 150, 137, 136, 133, 151, 141, 142, 143,
144, 145, 146, 147, 148, 134, 149, 0, 152, 0,
135, 139, 140, 0, 658, 138, 150, 137, 136, 133,
151, 141, 142, 143, 144, 145, 146, 147, 148, 0,
78, 0, 0, 0, 78, 0, 0, 0, 518, 124,
0, 0, 0, 124, 83, 79, 10, 0, 83, 79,
10, 82, 0, 0, 0, 82, 347, 0, 405, 0,
0, 0, 190, 0, 0, 349, 0, 0, 0, 0,
345, 343, 341, 0, 0, 196, 0, 344, 0, 196,
0, 411, 0, 0, 348, 195, 0, 0, 0, 347,
0, 0, 471, 77, 0, 12, 13, 77, 349, 12,
13, 346, 0, 345, 343, 341, 0, 612, 0, 347,
344, 0, 0, 0, 0, 0, 0, 348, 349, 342,
0, 0, 13, 345, 343, 341, 0, 0, 0, 347,
344, 0, 0, 0, 346, 0, 0, 452, 349, 0,
0, 0, 0, 345, 343, 341, 0, 0, 0, 0,
344, 0, 342, 0, 346, 13, 0, 348, 0, 0,
451, 0, 0, 0, 130, 0, 0, 0, 0, 0,
0, 0, 342, 0, 346, 13, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 342, 134, 149, 13, 152, 132, 135, 139,
140, 0, 131, 138, 150, 137, 136, 133, 151, 141,
142, 143, 144, 145, 146, 147, 148, 134, 149, 0,
152, 0, 135, 139, 140, 0, 0, 138, 150, 137,
136, 133, 151, 141, 142, 143, 144, 145, 146, 147,
148, 134, 149, 0, 0, 0, 135, 139, 140, 0,
0, 138, 150, 137, 136, 133, 151, 141, 142, 143,
144, 145, 146, 147, 148, 134, 149, 0, 0, 0,
135, 139, 140, 0, 0, 138, 150, 137, 136, 0,
151, 141, 142, 143, 144, 145, 146, 147, 148, 149,
0, 0, 0, 135, 139, 140, 0, 0, 138, 150,
137, 136, 0, 151, 141, 142, 143, 144, 145, 146,
147, 148,
}
var yyPact = [...]int{
-1000, -1000, 542, 536, -1000, 164, -1000, 550, 555, 318,
-1000, -1000, -1000, 588, -1000, -1000, 549, 1340, 316, 155,
-1000, 214, 640, 308, -1000, 305, -1000, -1000, -1000, -1000,
491, 370, 366, 301, -1000, -1000, -1000, -1000, -1000, 186,
-1000, 164, 164, 272, 272, 164, 1689, -1000, 2129, 171,
-1000, -1000, -1000, -1000, -1000, -1000, -1000, 25, 1689, 1689,
1689, 1689, 1689, 1689, 1689, 1689, 173, 1732, -1000, -1000,
-1000, 489, 200, -1000, -1000, -1000, 253, 1646, 1995, 26,
-1000, -1000, 200, 200, -1000, -1000, 96, 536, -1000, 587,
586, 42, 205, -1000, 547, -9, -9, -9, 5, -1000,
-1000, -1000, 347, 1850, -1000, -1000, -1000, 292, 849, -1000,
44, 1158, -1000, 172, 908, 488, -1000, -1000, -1000, -1000,
-1000, -1000, 25, -1000, 486, -1000, -1000, -1000, -23, 2153,
1689, -1000, -1000, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
1689, 1689, 1689, 1689, 1689, 1689, 1603, 1689, 522, 1689,
1548, 280, 1689, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
-1000, -1000, 469, 2153, -1000, -1000, -1000, -1000, 1732, 1828,
1689, -1000, -1000, -1000, 1250, -1000, 17, 13, 2153, -1000,
1158, -1000, -1000, -1000, -1000, 1158, 1158, 211, 1158, 39,
27, 300, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
-1000, 585, 2090, -1000, 1114, 2090, -1000, 172, 485, 164,
297, -1000, -1000, 194, 1689, 164, -1000, -1000, -1000, -1000,
-1000, 1158, 573, 296, -1000, 191, 1689, 295, -1000, -1000,
-1000, -1000, 1250, 461, -14, -1000, -1000, 908, -1000, -1000,
1158, 908, 1250, 908, 2153, 2201, 2224, 732, 732, 732,
732, 732, 732, 843, 843, 843, 843, -1000, -1000, -1000,
-1000, -1000, -1000, -1000, 2177, -23, -23, 2153, -1000, 518,
294, -1000, -1000, 69, 1689, -1000, 293, -1000, -1000, -1000,
51, -1000, -1000, 1505, 1774, 176, 1026, 130, -1000, 1991,
958, 1026, 181, -1000, -1000, -1000, -1000, -1000, -1000, 1158,
1158, -1000, 457, -1000, 164, 11, 288, -1000, -1000, 739,
581, 525, 513, -1000, -1000, 210, 282, -1000, -1000, 479,
-1000, 545, 447, 139, -1000, 275, 273, -1000, -1000, -1000,
-1000, -1000, 129, 19, 52, 43, 2090, 2070, 572, 476,
78, 192, 264, 262, 164, -3, -1000, 2050, 445, 164,
1689, -23, -1000, 444, 1158, 443, 164, 1689, -23, 439,
164, 132, 1030, 908, -1000, -1000, -1000, -1000, 438, -1000,
437, -1000, -1000, 1689, 1450, 1395, 2153, 520, 1689, 203,
518, 425, -16, 1732, 394, 393, -1000, 1689, 165, -17,
-1000, -1000, 1941, -1000, -1000, 1509, -1000, -1000, -1000, -1000,
-1000, 1158, 390, -1000, 162, -1000, 1250, 1250, -1000, -1000,
-1000, -1000, 1158, 149, 217, 581, 164, -1000, -1000, 388,
545, 210, 581, 545, 164, 137, 274, -1000, 908, 386,
-1000, -1000, -1000, -1000, 2090, 10, 2090, 164, 1839, -1000,
-1000, 298, 2090, -1000, -1000, 2090, 164, 256, -1000, 133,
-1000, 582, -1000, 78, -1000, -1000, 381, -21, 164, 164,
581, 2090, -1000, -1000, -23, -1000, -1000, 255, -1000, -1000,
849, -23, -1000, -1000, -1000, 472, -1000, -1000, 908, -1000,
-1000, -1000, -1000, -1000, -1000, 1030, 1030, 1250, 251, 1689,
1689, -1000, -1000, -1000, -1000, -1000, 1732, 166, -1000, -1000,
376, -1000, -1000, -1000, 4, -1000, 1026, -1000, 1103, 1026,
1026, 372, -1000, -1000, -1000, 125, -1000, -1000, -1000, -1000,
-1000, 581, 363, -1000, 359, -1000, -1000, -1000, 352, -1000,
-1000, 2090, 3, 121, 249, -1000, 2090, 117, 230, -1000,
283, -1000, -1000, -1000, 350, -1000, -1000, 344, -1000, 266,
-1000, 221, 2017, 220, -1000, -1000, 581, 343, 164, 191,
908, 338, -1000, 118, 1689, 2153, 2153, 136, 1250, 89,
-1000, -1000, -1000, -1000, 1689, -1000, -1000, -1000, 2153, -1000,
82, 41, -1000, -1000, -1000, 581, 581, 1030, -1000, 2090,
-1000, 164, 581, -1000, 1839, 164, -1000, 2017, 133, -1000,
-1000, -1000, 164, -1000, 164, -1000, -1000, -1000, 336, -1000,
-1000, -1000, -1000, 219, -1000, 1689, 1689, 1732, 565, 1,
1026, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
335, -1000, 328, 303, 276, 1030, 1917, 1893, -1000, -1000,
110, -1000, 37, 2017, -1000, -1000, 2017, -1000, -1000, -1000,
-1000, -1000, -1000, -1000, -1000, 1689, 518, -1000,
}
var yyPgo = [...]int{
0, 57, 771, 774, 45, 150, 26, 540, 29, 770,
768, 2, 28, 61, 322, 766, 17, 4, 765, 761,
760, 759, 758, 756, 3, 755, 622, 47, 14, 754,
490, 40, 41, 130, 37, 12, 752, 561, 43, 620,
751, 564, 750, 749, 25, 745, 162, 743, 31, 11,
740, 48, 5, 1, 18, 735, 679, 734, 7, 22,
733, 732, 19, 730, 729, 728, 16, 54, 725, 723,
33, 721, 23, 719, 588, 46, 9, 718, 715, 714,
713, 39, 712, 711, 710, 15, 56, 709, 13, 706,
0, 70, 49, 24, 20, 21, 10, 8, 704, 6,
42, 30, 703, 701, 700, 699, 88, 34, 698, 32,
27, 697, 696, 695, 694, 692, 685, 51, 44, 680,
36, 677, 35, 676, 671, 667, 666, 657, 656, 655,
648, 647, 642, 639, 637, 634, 631, 627, 38, 623,
596, 593,
}
var yyR1 = [...]int{
0, 112, 114, 114, 116, 113, 115, 115, 119, 119,
119, 120, 120, 121, 121, 2, 2, 2, 117, 123,
123, 124, 118, 50, 50, 50, 50, 50, 74, 74,
74, 74, 74, 74, 74, 74, 74, 74, 126, 70,
70, 70, 75, 75, 76, 76, 76, 36, 48, 44,
44, 44, 44, 44, 44, 9, 9, 9, 9, 127,
11, 128, 10, 62, 62, 129, 53, 42, 42, 42,
22, 22, 22, 21, 130, 23, 24, 24, 131, 132,
133, 25, 134, 63, 64, 64, 65, 65, 135, 136,
45, 137, 43, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 46, 46, 46, 46, 46, 46,
46, 46, 46, 41, 41, 41, 40, 40, 40, 40,
40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
49, 28, 16, 16, 15, 15, 39, 39, 17, 17,
31, 1, 1, 33, 34, 37, 37, 3, 3, 3,
91, 91, 30, 29, 81, 81, 7, 7, 7, 7,
7, 7, 32, 32, 32, 32, 87, 87, 87, 87,
87, 79, 79, 80, 89, 89, 89, 89, 89, 12,
12, 88, 88, 88, 88, 88, 88, 88, 85, 86,
84, 84, 83, 83, 47, 18, 18, 19, 19, 90,
51, 51, 52, 52, 52, 139, 20, 20, 60, 60,
71, 71, 77, 77, 78, 78, 73, 73, 69, 69,
72, 72, 72, 72, 72, 72, 4, 4, 13, 27,
27, 27, 82, 8, 8, 8, 8, 68, 68, 67,
67, 6, 6, 6, 6, 6, 26, 26, 26, 26,
26, 140, 26, 26, 26, 26, 26, 26, 26, 26,
66, 66, 55, 55, 54, 54, 56, 56, 59, 59,
57, 57, 57, 57, 58, 58, 122, 122, 138, 138,
35, 35, 61, 61, 38, 38, 101, 101, 105, 105,
103, 103, 5, 5, 141, 141, 141, 141, 141, 141,
92, 108, 106, 106, 106, 111, 111, 107, 107, 107,
107, 107, 107, 107, 107, 107, 107, 107, 110, 109,
95, 95, 97, 96, 96, 99, 99, 98, 98, 94,
94, 94, 93, 93, 125, 125, 100, 100, 104, 104,
102, 102,
}
var yyR2 = [...]int{
0, 4, 0, 3, 0, 3, 0, 3, 2, 5,
3, 3, 2, 1, 3, 1, 2, 2, 4, 0,
1, 0, 4, 0, 1, 1, 1, 1, 2, 5,
3, 2, 5, 7, 3, 2, 5, 3, 1, 2,
4, 3, 4, 3, 1, 2, 1, 1, 2, 1,
3, 3, 3, 2, 2, 3, 5, 5, 2, 0,
4, 0, 3, 0, 2, 0, 4, 4, 4, 2,
5, 1, 1, 2, 0, 3, 1, 3, 0, 0,
0, 8, 0, 5, 0, 2, 0, 2, 0, 0,
7, 0, 5, 1, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 1, 2, 2, 2, 2, 2,
2, 2, 2, 3, 5, 6, 1, 1, 3, 5,
5, 4, 6, 8, 1, 5, 5, 5, 7, 1,
0, 3, 1, 4, 1, 4, 1, 3, 1, 1,
1, 1, 1, 1, 1, 0, 1, 1, 1, 1,
4, 4, 1, 1, 1, 2, 1, 1, 1, 1,
1, 3, 1, 1, 1, 2, 1, 1, 1, 1,
3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3, 4, 4, 2, 3, 5, 1, 1, 2, 3,
5, 3, 5, 3, 3, 5, 8, 5, 8, 5,
0, 3, 0, 1, 3, 1, 4, 2, 0, 3,
1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
3, 2, 4, 3, 5, 5, 1, 3, 1, 2,
1, 3, 4, 1, 2, 2, 1, 1, 3, 0,
2, 0, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 4, 1, 2, 2, 2, 2, 2, 2,
1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
1, 1, 3, 3, 0, 2, 0, 1, 0, 1,
0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
0, 1, 0, 1, 4, 4, 5, 6, 4, 4,
1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
4, 5, 4, 4, 2, 2, 4, 3, 3, 5,
3, 4, 3, 5, 1, 0, 1, 3, 1, 1,
2, 1, 1, 5, 0, 2, 1, 3, 1, 3,
1, 3,
}
var yyChk = [...]int{
-1000, -112, -113, -116, -114, 26, -117, 26, -115, -3,
25, -91, 74, 75, -118, -124, 25, -60, -119, 22,
63, 4, -125, -123, 25, -50, -74, -47, -26, 2,
33, -126, 32, 18, -44, -23, -45, -43, -25, -29,
16, 7, 11, 19, 14, 20, 28, 10, -14, -56,
17, 31, 29, 21, -33, -46, -3, -39, 54, 57,
50, 51, 70, 71, 53, 37, -40, 60, 4, -30,
-41, -79, -80, -20, -90, -88, -139, 72, 9, 24,
-84, -83, 30, 23, 63, -120, 60, -2, 4, -3,
64, 64, 65, -141, 22, 33, 10, 32, 18, 63,
63, -70, 60, -54, -34, -3, -75, 60, -54, -48,
60, -36, -3, -18, 60, -3, 67, -37, -33, -3,
-37, -41, -39, -3, 18, -41, -33, -61, -56, -14,
5, 43, 38, 48, 34, 39, 47, 46, 44, 40,
41, 50, 51, 52, 53, 54, 55, 56, 57, 35,
45, 49, 37, 66, 6, 76, -130, -135, -137, -131,
60, 64, 72, -46, -46, -46, -46, -46, -46, -46,
-46, 68, -17, -14, -32, -86, -90, -88, 54, 37,
60, -1, 36, 68, -1, 2, -35, 12, -14, -87,
37, -90, -88, -85, -12, 60, 54, -30, 72, -1,
-1, -121, 61, -120, -117, -118, 4, 4, 25, 74,
65, 25, -92, -91, -92, -108, -92, -19, -92, 60,
-71, 61, -70, -7, 66, 76, -86, -90, -88, -85,
-12, 60, 37, -75, 61, -7, 66, -78, 61, -48,
-7, -51, 68, -67, -68, -8, -31, -3, -81, -7,
12, 60, -140, 60, -14, -14, -14, -14, -14, -14,
-14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
-14, -14, -14, -14, -14, -56, -56, -14, -21, -22,
-38, -42, -44, -56, 27, -24, -38, 36, -24, 61,
-59, -17, -3, 60, -14, -35, -49, 61, -32, 9,
-14, -49, -66, -6, -11, -74, -26, 2, 68, 73,
73, -7, -7, -7, 64, -7, -73, 69, -72, -55,
-13, 60, 54, -33, -4, 25, -69, 69, -27, -33,
-4, 60, -122, 63, -118, 4, -106, -107, -110, -109,
-91, 25, 72, 24, 30, 23, 54, 9, 37, 18,
66, -106, -106, -51, 60, -100, -95, -3, -122, 63,
66, -56, -34, -7, 9, -122, 63, 66, -56, -122,
63, -66, 61, 76, -138, -31, -81, -7, -67, -6,
-67, -53, 36, 63, 66, 6, -14, -136, 63, -62,
-132, -138, 12, 76, -17, 32, 73, 67, -58, -57,
-28, -16, -14, 68, 68, 37, -7, -90, -88, -85,
-12, 60, -138, 76, -58, 69, 63, -127, -7, -7,
61, -3, 73, -122, 63, -7, 76, -5, 4, -13,
54, 25, -13, 60, 64, -122, 63, -82, 60, -4,
61, -120, 63, 63, 73, 4, 72, 68, 68, -106,
-111, 60, 37, -107, -109, 9, 60, -93, -94, 60,
4, 51, -3, 66, 63, 63, -101, -100, 61, 76,
-106, 12, 61, -70, -56, 61, 61, -77, -76, -75,
-54, -56, 61, -48, 69, -3, -52, -89, 60, -86,
-90, -88, -85, -12, -8, 61, 61, -129, -38, 27,
27, 36, -38, -10, 69, -9, 8, 13, -53, 61,
-138, -17, 61, 61, -35, 69, 76, -138, 67, -49,
-49, -7, 61, 69, -6, -66, -7, 69, -72, -5,
-33, 61, -13, -5, -13, -3, 69, -27, -67, 61,
-106, 73, -106, -105, -104, -97, -3, -103, -102, -96,
-3, -106, 25, -91, -110, -106, -106, -101, 63, -94,
4, -93, 61, -3, -95, -5, -106, -122, 63, -7,
60, -67, -52, -66, 63, -14, -14, -62, -128, -59,
67, -133, 61, 73, 67, -28, -16, -15, -14, 68,
-58, -58, 61, 69, -5, 61, 61, 61, -106, 73,
69, 63, -106, 69, 63, 60, 61, 61, 50, 63,
-99, -98, 60, -106, 60, -5, 61, -76, -67, 61,
69, -38, 69, -66, 67, 66, 6, 76, -64, -35,
-49, 69, 69, -5, -5, -52, -106, -97, -5, -96,
-101, -99, -94, -101, -101, 61, -14, -14, -65, -63,
15, 73, -58, 61, 61, 61, 61, -52, 67, 67,
21, -11, 69, -99, -99, -134, -24, -53,
}
var yyDef = [...]int{
4, -2, 2, 0, 6, 0, 21, 0, 218, 0,
157, 158, 159, 0, 5, 344, 19, -2, 0, 0,
3, 0, 0, 0, 20, 0, 24, 25, 26, 27,
0, 0, 0, 0, 256, 257, 258, 259, 260, 0,
263, 155, 155, 0, 0, 0, 292, 38, -2, 0,
74, 88, 91, 78, 163, 93, -2, 114, 0, 0,
0, 0, 0, 0, 0, 0, 146, 0, 126, 127,
134, 0, 0, 139, -2, -2, 0, 290, 0, 0,
196, 197, 0, 0, 7, 8, 0, 21, 15, 0,
0, 0, 0, 345, 0, 0, 0, 0, 0, 18,
219, 28, 0, 0, 274, 154, 31, 0, 0, 35,
0, 0, 47, 210, 249, 0, 261, 264, 156, 153,
265, -2, 0, 162, 0, -2, 268, 269, 293, 276,
0, 53, 54, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 294, 294, 0, 294,
0, 0, 290, 115, 116, 117, 118, 119, 120, 121,
122, 140, 0, 148, 149, 172, -2, -2, 0, 0,
0, 140, 151, 152, -2, 217, 0, 0, 291, 193,
0, 176, 177, 178, 179, 0, 0, 189, 0, 0,
0, 286, 10, 13, 21, 12, 16, 17, 160, 161,
22, 0, 0, 310, 0, 0, 311, 210, 0, 0,
286, 30, 220, 39, 0, 0, 166, 167, 168, 169,
170, 0, 0, 286, 34, 0, 0, 286, 37, 224,
48, 204, -2, 0, 288, 247, 243, 162, 246, 150,
164, 249, -2, 249, 50, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
109, 110, 111, 112, 113, 51, 52, 277, 75, 0,
71, 72, 295, 0, 0, 89, 76, 63, 79, 123,
288, 278, 128, 0, 291, 0, 284, 147, 175, 0,
288, 284, 0, 270, 252, 253, 254, 255, 59, 0,
0, 194, 0, 198, 0, 0, 286, 201, 226, 0,
302, 0, 0, 272, 238, -2, 286, 203, 228, 0,
240, 0, 0, 287, 11, 0, 0, 312, 313, 314,
317, 318, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 296, 0, 346, 0, 0, 287,
0, 41, 275, 0, 0, 0, 287, 0, 43, 0,
287, 0, 212, 289, 250, 244, 245, 165, 0, 262,
0, 73, 65, 294, 0, 0, 69, 0, 294, 0,
0, 0, 288, 289, 0, 0, 131, 290, 0, 288,
280, 281, 142, 140, 140, 0, 199, -2, -2, -2,
-2, 0, 0, 289, 0, 216, -2, -2, 191, 192,
180, 190, 0, 0, 287, 302, 0, 231, 303, 0,
0, 236, 302, 0, 0, 0, 287, 239, 249, 0,
9, 14, 304, 305, 0, 0, 0, 298, 300, 324,
325, 0, 0, 315, 316, 0, 296, 0, 342, 0,
339, 0, 341, 0, 308, 309, 0, 297, 0, 0,
302, 0, 29, 221, 40, 171, 32, 286, 222, 44,
46, 42, 36, 225, 211, 162, 209, 213, 249, 184,
185, 186, 187, 188, 248, 212, 212, -2, 0, 0,
0, 63, 77, 64, 92, 61, 0, 0, 80, 124,
0, 279, 129, 130, 0, 137, 289, 285, 0, 284,
284, 0, 135, 136, 271, 0, 195, 200, 227, 230,
273, 302, 0, 233, 0, 237, 202, 229, 0, 241,
319, 0, 0, 0, 299, 348, 0, 0, 301, 350,
0, 334, -2, -2, 0, 327, 328, 0, 306, 0,
340, 0, 335, 0, 347, 330, 302, 0, 287, 45,
249, 0, 205, 0, 294, 67, 68, 0, -2, 0,
58, 84, 125, 132, 290, 282, 283, 141, 144, 140,
0, 0, -2, 60, 232, 302, 302, 212, 320, 0,
322, 0, 302, 323, 0, 296, 326, 335, 0, 307,
207, 336, 296, 338, 296, 331, 33, 223, 0, 214,
66, 70, 90, 62, 55, 0, 0, 0, 86, 0,
284, 143, 138, 234, 235, 242, 321, 349, 332, 351,
0, 329, 0, 0, 0, 212, 0, 0, 81, 85,
0, 133, 0, 335, 343, 337, 335, 206, 56, 57,
82, 87, 145, 333, 208, 294, 0, 83,
}
var yyTok1 = [...]int{
1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 70, 3, 3, 65, 56, 57, 3,
60, 61, 54, 50, 76, 51, 64, 55, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 67, 63,
3, 66, 3, 74, 75, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 72, 3, 73, 53, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 68, 52, 69, 71,
}
var yyTok2 = [...]int{
2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49, 58, 59,
62,
}
var yyTok3 = [...]int{
0,
}
var yyErrorMessages = [...]struct {
state int
token int
msg string
}{
{332, 76, "unexpected comma during import block"},
{89, 63, "missing import path; require quoted string"},
{390, 63, "missing { after if clause"},
{387, 63, "missing { after switch clause"},
{279, 63, "missing { after for clause"},
{498, 36, "missing { after for clause"},
{17, 68, "unexpected semicolon or newline before {"},
{111, 63, "unexpected semicolon or newline in type declaration"},
{78, 69, "unexpected } in channel type"},
{78, 61, "unexpected ) in channel type"},
{78, 76, "unexpected comma in channel type"},
{416, 15, "unexpected semicolon or newline before else"},
{329, 76, "name list not allowed in interface type"},
{279, 33, "var declaration not allowed in for initializer"},
{25, 68, "unexpected { at end of statement"},
{371, 68, "unexpected { at end of statement"},
{122, 63, "argument to go/defer must be function call"},
{398, 63, "need trailing comma before newline in composite literal"},
{414, 63, "need trailing comma before newline in composite literal"},
{124, 25, "nested func not allowed"},
{650, 63, "else must be followed by if or statement block"},
}
//line yaccpar:1
/* parser for yacc output */
var (
yyDebug = 0
yyErrorVerbose = false
)
type yyLexer interface {
Lex(lval *yySymType) int
Error(s string)
}
type yyParser interface {
Parse(yyLexer) int
Lookahead() int
}
type yyParserImpl struct {
lookahead func() int
}
func (p *yyParserImpl) Lookahead() int {
return p.lookahead()
}
func yyNewParser() yyParser {
p := &yyParserImpl{
lookahead: func() int { return -1 },
}
return p
}
const yyFlag = -1000
func yyTokname(c int) string {
if c >= 1 && c-1 < len(yyToknames) {
if yyToknames[c-1] != "" {
return yyToknames[c-1]
}
}
return __yyfmt__.Sprintf("tok-%v", c)
}
func yyStatname(s int) string {
if s >= 0 && s < len(yyStatenames) {
if yyStatenames[s] != "" {
return yyStatenames[s]
}
}
return __yyfmt__.Sprintf("state-%v", s)
}
func yyErrorMessage(state, lookAhead int) string {
const TOKSTART = 4
if !yyErrorVerbose {
return "syntax error"
}
for _, e := range yyErrorMessages {
if e.state == state && e.token == lookAhead {
return "syntax error: " + e.msg
}
}
res := "syntax error: unexpected " + yyTokname(lookAhead)
// To match Bison, suggest at most four expected tokens.
expected := make([]int, 0, 4)
// Look for shiftable tokens.
base := yyPact[state]
for tok := TOKSTART; tok-1 < len(yyToknames); tok++ {
if n := base + tok; n >= 0 && n < yyLast && yyChk[yyAct[n]] == tok {
if len(expected) == cap(expected) {
return res
}
expected = append(expected, tok)
}
}
if yyDef[state] == -2 {
i := 0
for yyExca[i] != -1 || yyExca[i+1] != state {
i += 2
}
// Look for tokens that we accept or reduce.
for i += 2; yyExca[i] >= 0; i += 2 {
tok := yyExca[i]
if tok < TOKSTART || yyExca[i+1] == 0 {
continue
}
if len(expected) == cap(expected) {
return res
}
expected = append(expected, tok)
}
// If the default action is to accept or reduce, give up.
if yyExca[i+1] != 0 {
return res
}
}
for i, tok := range expected {
if i == 0 {
res += ", expecting "
} else {
res += " or "
}
res += yyTokname(tok)
}
return res
}
func yylex1(lex yyLexer, lval *yySymType) (char, token int) {
token = 0
char = lex.Lex(lval)
if char <= 0 {
token = yyTok1[0]
goto out
}
if char < len(yyTok1) {
token = yyTok1[char]
goto out
}
if char >= yyPrivate {
if char < yyPrivate+len(yyTok2) {
token = yyTok2[char-yyPrivate]
goto out
}
}
for i := 0; i < len(yyTok3); i += 2 {
token = yyTok3[i+0]
if token == char {
token = yyTok3[i+1]
goto out
}
}
out:
if token == 0 {
token = yyTok2[1] /* unknown char */
}
if yyDebug >= 3 {
__yyfmt__.Printf("lex %s(%d)\n", yyTokname(token), uint(char))
}
return char, token
}
func yyParse(yylex yyLexer) int {
return yyNewParser().Parse(yylex)
}
func (yyrcvr *yyParserImpl) Parse(yylex yyLexer) int {
var yyn int
var yylval yySymType
var yyVAL yySymType
var yyDollar []yySymType
yyS := make([]yySymType, yyMaxDepth)
Nerrs := 0 /* number of errors */
Errflag := 0 /* error recovery flag */
yystate := 0
yychar := -1
yytoken := -1 // yychar translated into internal numbering
yyrcvr.lookahead = func() int { return yychar }
defer func() {
// Make sure we report no lookahead when not parsing.
yystate = -1
yychar = -1
yytoken = -1
}()
yyp := -1
goto yystack
ret0:
return 0
ret1:
return 1
yystack:
/* put a state and value onto the stack */
if yyDebug >= 4 {
__yyfmt__.Printf("char %v in %v\n", yyTokname(yytoken), yyStatname(yystate))
}
yyp++
if yyp >= len(yyS) {
nyys := make([]yySymType, len(yyS)*2)
copy(nyys, yyS)
yyS = nyys
}
yyS[yyp] = yyVAL
yyS[yyp].yys = yystate
yynewstate:
yyn = yyPact[yystate]
if yyn <= yyFlag {
goto yydefault /* simple state */
}
if yychar < 0 {
yychar, yytoken = yylex1(yylex, &yylval)
}
yyn += yytoken
if yyn < 0 || yyn >= yyLast {
goto yydefault
}
yyn = yyAct[yyn]
if yyChk[yyn] == yytoken { /* valid shift */
yychar = -1
yytoken = -1
yyVAL = yylval
yystate = yyn
if Errflag > 0 {
Errflag--
}
goto yystack
}
yydefault:
/* default state action */
yyn = yyDef[yystate]
if yyn == -2 {
if yychar < 0 {
yychar, yytoken = yylex1(yylex, &yylval)
}
/* look through exception table */
xi := 0
for {
if yyExca[xi+0] == -1 && yyExca[xi+1] == yystate {
break
}
xi += 2
}
for xi += 2; ; xi += 2 {
yyn = yyExca[xi+0]
if yyn < 0 || yyn == yytoken {
break
}
}
yyn = yyExca[xi+1]
if yyn < 0 {
goto ret0
}
}
if yyn == 0 {
/* error ... attempt to resume parsing */
switch Errflag {
case 0: /* brand new error */
yylex.Error(yyErrorMessage(yystate, yytoken))
Nerrs++
if yyDebug >= 1 {
__yyfmt__.Printf("%s", yyStatname(yystate))
__yyfmt__.Printf(" saw %s\n", yyTokname(yytoken))
}
fallthrough
case 1, 2: /* incompletely recovered error ... try again */
Errflag = 3
/* find a state where "error" is a legal shift action */
for yyp >= 0 {
yyn = yyPact[yyS[yyp].yys] + yyErrCode
if yyn >= 0 && yyn < yyLast {
yystate = yyAct[yyn] /* simulate a shift of "error" */
if yyChk[yystate] == yyErrCode {
goto yystack
}
}
/* the current p has no shift on "error", pop stack */
if yyDebug >= 2 {
__yyfmt__.Printf("error recovery pops state %d\n", yyS[yyp].yys)
}
yyp--
}
/* there is no state on the stack with an error shift ... abort */
goto ret1
case 3: /* no shift yet; clobber input char */
if yyDebug >= 2 {
__yyfmt__.Printf("error recovery discards %s\n", yyTokname(yytoken))
}
if yytoken == yyEofCode {
goto ret1
}
yychar = -1
yytoken = -1
goto yynewstate /* try again in the same state */
}
}
/* reduction by production yyn */
if yyDebug >= 2 {
__yyfmt__.Printf("reduce %v in:\n\t%v\n", yyn, yyStatname(yystate))
}
yynt := yyn
yypt := yyp
_ = yypt // guard against "declared and not used"
yyp -= yyR2[yyn]
// yyp is now the index of $0. Perform the default action. Iff the
// reduced production is ε, $1 is possibly out of range.
if yyp+1 >= len(yyS) {
nyys := make([]yySymType, len(yyS)*2)
copy(nyys, yyS)
yyS = nyys
}
yyVAL = yyS[yyp+1]
/* consult goto table to find next state */
yyn = yyR1[yyn]
yyg := yyPgo[yyn]
yyj := yyg + yyS[yyp].yys + 1
if yyj >= yyLast {
yystate = yyAct[yyg]
} else {
yystate = yyAct[yyj]
if yyChk[yystate] != -yyn {
yystate = yyAct[yyg]
}
}
// dummy call; replaced with literal code
switch yynt {
case 1:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:189
{
xtop = concat(xtop, yyDollar[4].list)
}
case 2:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:195
{
prevlineno = lineno
Yyerror("package statement must be first")
errorexit()
}
case 3:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:201
{
mkpackage(yyDollar[2].sym.Name)
}
case 4:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:211
{
importpkg = Runtimepkg
if Debug['A'] != 0 {
cannedimports("runtime.Builtin", "package runtime\n\n$$\n\n")
} else {
cannedimports("runtime.Builtin", runtimeimport)
}
curio.importsafe = true
}
case 5:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:223
{
importpkg = nil
}
case 11:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:237
{
ipkg := importpkg
my := importmyname
importpkg = nil
importmyname = nil
if my == nil {
my = Lookup(ipkg.Name)
}
pack := Nod(OPACK, nil, nil)
pack.Sym = my
pack.Pkg = ipkg
pack.Lineno = int32(yyDollar[1].i)
if strings.HasPrefix(my.Name, ".") {
importdot(ipkg, pack)
break
}
if my.Name == "init" {
Yyerror("cannot import package as init - init must be a func")
break
}
if my.Name == "_" {
break
}
if my.Def != nil {
lineno = int32(yyDollar[1].i)
redeclare(my, "as imported package name")
}
my.Def = pack
my.Lastlineno = int32(yyDollar[1].i)
my.Block = 1 // at top level
}
case 12:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:272
{
// When an invalid import path is passed to importfile,
// it calls Yyerror and then sets up a fake import with
// no package statement. This allows us to test more
// than one invalid import statement in a single file.
if nerrors == 0 {
Fatal("phase error in import")
}
}
case 15:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:288
{
// import with original name
yyVAL.i = parserline()
importmyname = nil
importfile(&yyDollar[1].val, yyVAL.i)
}
case 16:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:295
{
// import with given name
yyVAL.i = parserline()
importmyname = yyDollar[1].sym
importfile(&yyDollar[2].val, yyVAL.i)
}
case 17:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:302
{
// import into my name space
yyVAL.i = parserline()
importmyname = Lookup(".")
importfile(&yyDollar[2].val, yyVAL.i)
}
case 18:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:311
{
if importpkg.Name == "" {
importpkg.Name = yyDollar[2].sym.Name
numImport[yyDollar[2].sym.Name]++
} else if importpkg.Name != yyDollar[2].sym.Name {
Yyerror("conflicting names %s and %s for package %q", importpkg.Name, yyDollar[2].sym.Name, importpkg.Path)
}
importpkg.Direct = 1
importpkg.Safe = curio.importsafe
if safemode != 0 && !curio.importsafe {
Yyerror("cannot import unsafe package %q", importpkg.Path)
}
}
case 20:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:328
{
if yyDollar[1].sym.Name == "safe" {
curio.importsafe = true
}
}
case 21:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:335
{
defercheckwidth()
}
case 22:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:339
{
resumecheckwidth()
unimportfile()
}
case 23:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:348
{
Yyerror("empty top-level declaration")
yyVAL.list = nil
}
case 25:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:354
{
yyVAL.list = list1(yyDollar[1].node)
}
case 26:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:358
{
Yyerror("non-declaration statement outside function body")
yyVAL.list = nil
}
case 27:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:363
{
yyVAL.list = nil
}
case 28:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:369
{
yyVAL.list = yyDollar[2].list
}
case 29:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:373
{
yyVAL.list = yyDollar[3].list
}
case 30:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:377
{
yyVAL.list = nil
}
case 31:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:381
{
yyVAL.list = yyDollar[2].list
iota_ = -100000
lastconst = nil
}
case 32:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:387
{
yyVAL.list = yyDollar[3].list
iota_ = -100000
lastconst = nil
}
case 33:
yyDollar = yyS[yypt-7 : yypt+1]
//line go.y:393
{
yyVAL.list = concat(yyDollar[3].list, yyDollar[5].list)
iota_ = -100000
lastconst = nil
}
case 34:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:399
{
yyVAL.list = nil
iota_ = -100000
}
case 35:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:404
{
yyVAL.list = list1(yyDollar[2].node)
}
case 36:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:408
{
yyVAL.list = yyDollar[3].list
}
case 37:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:412
{
yyVAL.list = nil
}
case 38:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:418
{
iota_ = 0
}
case 39:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:424
{
yyVAL.list = variter(yyDollar[1].list, yyDollar[2].node, nil)
}
case 40:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:428
{
yyVAL.list = variter(yyDollar[1].list, yyDollar[2].node, yyDollar[4].list)
}
case 41:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:432
{
yyVAL.list = variter(yyDollar[1].list, nil, yyDollar[3].list)
}
case 42:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:438
{
yyVAL.list = constiter(yyDollar[1].list, yyDollar[2].node, yyDollar[4].list)
}
case 43:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:442
{
yyVAL.list = constiter(yyDollar[1].list, nil, yyDollar[3].list)
}
case 45:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:449
{
yyVAL.list = constiter(yyDollar[1].list, yyDollar[2].node, nil)
}
case 46:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:453
{
yyVAL.list = constiter(yyDollar[1].list, nil, nil)
}
case 47:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:459
{
// different from dclname because the name
// becomes visible right here, not at the end
// of the declaration.
yyVAL.node = typedcl0(yyDollar[1].sym)
}
case 48:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:468
{
yyVAL.node = typedcl1(yyDollar[1].node, yyDollar[2].node, true)
}
case 49:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:474
{
yyVAL.node = yyDollar[1].node
// These nodes do not carry line numbers.
// Since a bare name used as an expression is an error,
// introduce a wrapper node to give the correct line.
switch yyVAL.node.Op {
case ONAME, ONONAME, OTYPE, OPACK, OLITERAL:
yyVAL.node = Nod(OPAREN, yyVAL.node, nil)
yyVAL.node.Implicit = true
break
}
}
case 50:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:488
{
yyVAL.node = Nod(OASOP, yyDollar[1].node, yyDollar[3].node)
yyVAL.node.Etype = uint8(yyDollar[2].i) // rathole to pass opcode
}
case 51:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:493
{
if yyDollar[1].list.Next == nil && yyDollar[3].list.Next == nil {
// simple
yyVAL.node = Nod(OAS, yyDollar[1].list.N, yyDollar[3].list.N)
break
}
// multiple
yyVAL.node = Nod(OAS2, nil, nil)
yyVAL.node.List = yyDollar[1].list
yyVAL.node.Rlist = yyDollar[3].list
}
case 52:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:505
{
if yyDollar[3].list.N.Op == OTYPESW {
yyVAL.node = Nod(OTYPESW, nil, yyDollar[3].list.N.Right)
if yyDollar[3].list.Next != nil {
Yyerror("expr.(type) must be alone in list")
}
if yyDollar[1].list.Next != nil {
Yyerror("argument count mismatch: %d = %d", count(yyDollar[1].list), 1)
} else if (yyDollar[1].list.N.Op != ONAME && yyDollar[1].list.N.Op != OTYPE && yyDollar[1].list.N.Op != ONONAME) || isblank(yyDollar[1].list.N) {
Yyerror("invalid variable name %s in type switch", yyDollar[1].list.N)
} else {
yyVAL.node.Left = dclname(yyDollar[1].list.N.Sym)
} // it's a colas, so must not re-use an oldname.
break
}
yyVAL.node = colas(yyDollar[1].list, yyDollar[3].list, int32(yyDollar[2].i))
}
case 53:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:523
{
yyVAL.node = Nod(OASOP, yyDollar[1].node, Nodintconst(1))
yyVAL.node.Implicit = true
yyVAL.node.Etype = OADD
}
case 54:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:529
{
yyVAL.node = Nod(OASOP, yyDollar[1].node, Nodintconst(1))
yyVAL.node.Implicit = true
yyVAL.node.Etype = OSUB
}
case 55:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:537
{
var n, nn *Node
// will be converted to OCASE
// right will point to next case
// done in casebody()
markdcl()
yyVAL.node = Nod(OXCASE, nil, nil)
yyVAL.node.List = yyDollar[2].list
if typesw != nil && typesw.Right != nil {
n = typesw.Right.Left
if n != nil {
// type switch - declare variable
nn = newname(n.Sym)
declare(nn, dclcontext)
yyVAL.node.Nname = nn
// keep track of the instances for reporting unused
nn.Defn = typesw.Right
}
}
}
case 56:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:560
{
var n *Node
// will be converted to OCASE
// right will point to next case
// done in casebody()
markdcl()
yyVAL.node = Nod(OXCASE, nil, nil)
if yyDollar[2].list.Next == nil {
n = Nod(OAS, yyDollar[2].list.N, yyDollar[4].node)
} else {
n = Nod(OAS2, nil, nil)
n.List = yyDollar[2].list
n.Rlist = list1(yyDollar[4].node)
}
yyVAL.node.List = list1(n)
}
case 57:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:578
{
// will be converted to OCASE
// right will point to next case
// done in casebody()
markdcl()
yyVAL.node = Nod(OXCASE, nil, nil)
yyVAL.node.List = list1(colas(yyDollar[2].list, list1(yyDollar[4].node), int32(yyDollar[3].i)))
}
case 58:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:587
{
var n, nn *Node
markdcl()
yyVAL.node = Nod(OXCASE, nil, nil)
if typesw != nil && typesw.Right != nil {
n = typesw.Right.Left
if n != nil {
// type switch - declare variable
nn = newname(n.Sym)
declare(nn, dclcontext)
yyVAL.node.Nname = nn
// keep track of the instances for reporting unused
nn.Defn = typesw.Right
}
}
}
case 59:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:608
{
markdcl()
}
case 60:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:612
{
if yyDollar[3].list == nil {
yyVAL.node = Nod(OEMPTY, nil, nil)
} else {
yyVAL.node = liststmt(yyDollar[3].list)
}
popdcl()
}
case 61:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:623
{
// If the last token read by the lexer was consumed
// as part of the case, clear it (parser has cleared yychar).
// If the last token read by the lexer was the lookahead
// leave it alone (parser has it cached in yychar).
// This is so that the stmt_list action doesn't look at
// the case tokens if the stmt_list is empty.
yylast = yychar
yyDollar[1].node.Xoffset = int64(block)
}
case 62:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:634
{
// This is the only place in the language where a statement
// list is not allowed to drop the final semicolon, because
// it's the only place where a statement list is not followed
// by a closing brace. Handle the error for pedantry.
// Find the final token of the statement list.
// yylast is lookahead; yyprev is last of stmt_list
last := yyprev
if last > 0 && last != ';' && yychar != '}' {
Yyerror("missing statement after label")
}
yyVAL.node = yyDollar[1].node
yyVAL.node.Nbody = yyDollar[3].list
popdcl()
}
case 63:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:653
{
yyVAL.list = nil
}
case 64:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:657
{
yyVAL.list = list(yyDollar[1].list, yyDollar[2].node)
}
case 65:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:663
{
markdcl()
}
case 66:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:667
{
yyVAL.list = yyDollar[3].list
popdcl()
}
case 67:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:674
{
yyVAL.node = Nod(ORANGE, nil, yyDollar[4].node)
yyVAL.node.List = yyDollar[1].list
yyVAL.node.Etype = 0 // := flag
}
case 68:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:680
{
yyVAL.node = Nod(ORANGE, nil, yyDollar[4].node)
yyVAL.node.List = yyDollar[1].list
yyVAL.node.Colas = true
colasdefn(yyDollar[1].list, yyVAL.node)
}
case 69:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:687
{
yyVAL.node = Nod(ORANGE, nil, yyDollar[2].node)
yyVAL.node.Etype = 0 // := flag
}
case 70:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:694
{
// init ; test ; incr
if yyDollar[5].node != nil && yyDollar[5].node.Colas {
Yyerror("cannot declare in the for-increment")
}
yyVAL.node = Nod(OFOR, nil, nil)
if yyDollar[1].node != nil {
yyVAL.node.Ninit = list1(yyDollar[1].node)
}
yyVAL.node.Ntest = yyDollar[3].node
yyVAL.node.Nincr = yyDollar[5].node
}
case 71:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:707
{
// normal test
yyVAL.node = Nod(OFOR, nil, nil)
yyVAL.node.Ntest = yyDollar[1].node
}
case 73:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:716
{
yyVAL.node = yyDollar[1].node
yyVAL.node.Nbody = concat(yyVAL.node.Nbody, yyDollar[2].list)
}
case 74:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:723
{
markdcl()
}
case 75:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:727
{
yyVAL.node = yyDollar[3].node
popdcl()
}
case 76:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:734
{
// test
yyVAL.node = Nod(OIF, nil, nil)
yyVAL.node.Ntest = yyDollar[1].node
}
case 77:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:740
{
// init ; test
yyVAL.node = Nod(OIF, nil, nil)
if yyDollar[1].node != nil {
yyVAL.node.Ninit = list1(yyDollar[1].node)
}
yyVAL.node.Ntest = yyDollar[3].node
}
case 78:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:752
{
markdcl()
}
case 79:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:756
{
if yyDollar[3].node.Ntest == nil {
Yyerror("missing condition in if statement")
}
}
case 80:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:762
{
yyDollar[3].node.Nbody = yyDollar[5].list
}
case 81:
yyDollar = yyS[yypt-8 : yypt+1]
//line go.y:766
{
var n *Node
var nn *NodeList
yyVAL.node = yyDollar[3].node
n = yyDollar[3].node
popdcl()
for nn = concat(yyDollar[7].list, yyDollar[8].list); nn != nil; nn = nn.Next {
if nn.N.Op == OIF {
popdcl()
}
n.Nelse = list1(nn.N)
n = nn.N
}
}
case 82:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:784
{
markdcl()
}
case 83:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:788
{
if yyDollar[4].node.Ntest == nil {
Yyerror("missing condition in if statement")
}
yyDollar[4].node.Nbody = yyDollar[5].list
yyVAL.list = list1(yyDollar[4].node)
}
case 84:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:797
{
yyVAL.list = nil
}
case 85:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:801
{
yyVAL.list = concat(yyDollar[1].list, yyDollar[2].list)
}
case 86:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:806
{
yyVAL.list = nil
}
case 87:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:810
{
l := &NodeList{N: yyDollar[2].node}
l.End = l
yyVAL.list = l
}
case 88:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:818
{
markdcl()
}
case 89:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:822
{
var n *Node
n = yyDollar[3].node.Ntest
if n != nil && n.Op != OTYPESW {
n = nil
}
typesw = Nod(OXXX, typesw, n)
}
case 90:
yyDollar = yyS[yypt-7 : yypt+1]
//line go.y:831
{
yyVAL.node = yyDollar[3].node
yyVAL.node.Op = OSWITCH
yyVAL.node.List = yyDollar[6].list
typesw = typesw.Left
popdcl()
}
case 91:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:841
{
typesw = Nod(OXXX, typesw, nil)
}
case 92:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:845
{
yyVAL.node = Nod(OSELECT, nil, nil)
yyVAL.node.Lineno = typesw.Lineno
yyVAL.node.List = yyDollar[4].list
typesw = typesw.Left
}
case 94:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:858
{
yyVAL.node = Nod(OOROR, yyDollar[1].node, yyDollar[3].node)
}
case 95:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:862
{
yyVAL.node = Nod(OANDAND, yyDollar[1].node, yyDollar[3].node)
}
case 96:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:866
{
yyVAL.node = Nod(OEQ, yyDollar[1].node, yyDollar[3].node)
}
case 97:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:870
{
yyVAL.node = Nod(ONE, yyDollar[1].node, yyDollar[3].node)
}
case 98:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:874
{
yyVAL.node = Nod(OLT, yyDollar[1].node, yyDollar[3].node)
}
case 99:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:878
{
yyVAL.node = Nod(OLE, yyDollar[1].node, yyDollar[3].node)
}
case 100:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:882
{
yyVAL.node = Nod(OGE, yyDollar[1].node, yyDollar[3].node)
}
case 101:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:886
{
yyVAL.node = Nod(OGT, yyDollar[1].node, yyDollar[3].node)
}
case 102:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:890
{
yyVAL.node = Nod(OADD, yyDollar[1].node, yyDollar[3].node)
}
case 103:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:894
{
yyVAL.node = Nod(OSUB, yyDollar[1].node, yyDollar[3].node)
}
case 104:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:898
{
yyVAL.node = Nod(OOR, yyDollar[1].node, yyDollar[3].node)
}
case 105:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:902
{
yyVAL.node = Nod(OXOR, yyDollar[1].node, yyDollar[3].node)
}
case 106:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:906
{
yyVAL.node = Nod(OMUL, yyDollar[1].node, yyDollar[3].node)
}
case 107:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:910
{
yyVAL.node = Nod(ODIV, yyDollar[1].node, yyDollar[3].node)
}
case 108:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:914
{
yyVAL.node = Nod(OMOD, yyDollar[1].node, yyDollar[3].node)
}
case 109:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:918
{
yyVAL.node = Nod(OAND, yyDollar[1].node, yyDollar[3].node)
}
case 110:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:922
{
yyVAL.node = Nod(OANDNOT, yyDollar[1].node, yyDollar[3].node)
}
case 111:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:926
{
yyVAL.node = Nod(OLSH, yyDollar[1].node, yyDollar[3].node)
}
case 112:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:930
{
yyVAL.node = Nod(ORSH, yyDollar[1].node, yyDollar[3].node)
}
case 113:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:935
{
yyVAL.node = Nod(OSEND, yyDollar[1].node, yyDollar[3].node)
}
case 115:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:942
{
yyVAL.node = Nod(OIND, yyDollar[2].node, nil)
}
case 116:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:946
{
if yyDollar[2].node.Op == OCOMPLIT {
// Special case for &T{...}: turn into (*T){...}.
yyVAL.node = yyDollar[2].node
yyVAL.node.Right = Nod(OIND, yyVAL.node.Right, nil)
yyVAL.node.Right.Implicit = true
} else {
yyVAL.node = Nod(OADDR, yyDollar[2].node, nil)
}
}
case 117:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:957
{
yyVAL.node = Nod(OPLUS, yyDollar[2].node, nil)
}
case 118:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:961
{
yyVAL.node = Nod(OMINUS, yyDollar[2].node, nil)
}
case 119:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:965
{
yyVAL.node = Nod(ONOT, yyDollar[2].node, nil)
}
case 120:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:969
{
Yyerror("the bitwise complement operator is ^")
yyVAL.node = Nod(OCOM, yyDollar[2].node, nil)
}
case 121:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:974
{
yyVAL.node = Nod(OCOM, yyDollar[2].node, nil)
}
case 122:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:978
{
yyVAL.node = Nod(ORECV, yyDollar[2].node, nil)
}
case 123:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:988
{
yyVAL.node = Nod(OCALL, yyDollar[1].node, nil)
}
case 124:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:992
{
yyVAL.node = Nod(OCALL, yyDollar[1].node, nil)
yyVAL.node.List = yyDollar[3].list
}
case 125:
yyDollar = yyS[yypt-6 : yypt+1]
//line go.y:997
{
yyVAL.node = Nod(OCALL, yyDollar[1].node, nil)
yyVAL.node.List = yyDollar[3].list
yyVAL.node.Isddd = true
}
case 126:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1005
{
yyVAL.node = nodlit(yyDollar[1].val)
}
case 128:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1010
{
if yyDollar[1].node.Op == OPACK {
var s *Sym
s = restrictlookup(yyDollar[3].sym.Name, yyDollar[1].node.Pkg)
yyDollar[1].node.Used = true
yyVAL.node = oldname(s)
break
}
yyVAL.node = Nod(OXDOT, yyDollar[1].node, newname(yyDollar[3].sym))
}
case 129:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1021
{
yyVAL.node = Nod(ODOTTYPE, yyDollar[1].node, yyDollar[4].node)
}
case 130:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1025
{
yyVAL.node = Nod(OTYPESW, nil, yyDollar[1].node)
}
case 131:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1029
{
yyVAL.node = Nod(OINDEX, yyDollar[1].node, yyDollar[3].node)
}
case 132:
yyDollar = yyS[yypt-6 : yypt+1]
//line go.y:1033
{
yyVAL.node = Nod(OSLICE, yyDollar[1].node, Nod(OKEY, yyDollar[3].node, yyDollar[5].node))
}
case 133:
yyDollar = yyS[yypt-8 : yypt+1]
//line go.y:1037
{
if yyDollar[5].node == nil {
Yyerror("middle index required in 3-index slice")
}
if yyDollar[7].node == nil {
Yyerror("final index required in 3-index slice")
}
yyVAL.node = Nod(OSLICE3, yyDollar[1].node, Nod(OKEY, yyDollar[3].node, Nod(OKEY, yyDollar[5].node, yyDollar[7].node)))
}
case 135:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1048
{
// conversion
yyVAL.node = Nod(OCALL, yyDollar[1].node, nil)
yyVAL.node.List = list1(yyDollar[3].node)
}
case 136:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1054
{
yyVAL.node = yyDollar[3].node
yyVAL.node.Right = yyDollar[1].node
yyVAL.node.List = yyDollar[4].list
fixlbrace(yyDollar[2].i)
}
case 137:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1061
{
yyVAL.node = yyDollar[3].node
yyVAL.node.Right = yyDollar[1].node
yyVAL.node.List = yyDollar[4].list
}
case 138:
yyDollar = yyS[yypt-7 : yypt+1]
//line go.y:1067
{
Yyerror("cannot parenthesize type in composite literal")
yyVAL.node = yyDollar[5].node
yyVAL.node.Right = yyDollar[2].node
yyVAL.node.List = yyDollar[6].list
}
case 140:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1076
{
// composite expression.
// make node early so we get the right line number.
yyVAL.node = Nod(OCOMPLIT, nil, nil)
}
case 141:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1084
{
yyVAL.node = Nod(OKEY, yyDollar[1].node, yyDollar[3].node)
}
case 142:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1090
{
// These nodes do not carry line numbers.
// Since a composite literal commonly spans several lines,
// the line number on errors may be misleading.
// Introduce a wrapper node to give the correct line.
yyVAL.node = yyDollar[1].node
switch yyVAL.node.Op {
case ONAME, ONONAME, OTYPE, OPACK, OLITERAL:
yyVAL.node = Nod(OPAREN, yyVAL.node, nil)
yyVAL.node.Implicit = true
}
}
case 143:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1103
{
yyVAL.node = yyDollar[2].node
yyVAL.node.List = yyDollar[3].list
}
case 145:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1111
{
yyVAL.node = yyDollar[2].node
yyVAL.node.List = yyDollar[3].list
}
case 147:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1119
{
yyVAL.node = yyDollar[2].node
// Need to know on lhs of := whether there are ( ).
// Don't bother with the OPAREN in other cases:
// it's just a waste of memory and time.
switch yyVAL.node.Op {
case ONAME, ONONAME, OPACK, OTYPE, OLITERAL, OTYPESW:
yyVAL.node = Nod(OPAREN, yyVAL.node, nil)
}
}
case 151:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1140
{
yyVAL.i = LBODY
}
case 152:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1144
{
yyVAL.i = '{'
}
case 153:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1155
{
if yyDollar[1].sym == nil {
yyVAL.node = nil
} else {
yyVAL.node = newname(yyDollar[1].sym)
}
}
case 154:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1165
{
yyVAL.node = dclname(yyDollar[1].sym)
}
case 155:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1170
{
yyVAL.node = nil
}
case 157:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1177
{
yyVAL.sym = yyDollar[1].sym
// during imports, unqualified non-exported identifiers are from builtinpkg
if importpkg != nil && !exportname(yyDollar[1].sym.Name) {
yyVAL.sym = Pkglookup(yyDollar[1].sym.Name, builtinpkg)
}
}
case 159:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1186
{
yyVAL.sym = nil
}
case 160:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1192
{
var p *Pkg
if yyDollar[2].val.U.(string) == "" {
p = importpkg
} else {
if isbadimport(yyDollar[2].val.U.(string)) {
errorexit()
}
p = mkpkg(yyDollar[2].val.U.(string))
}
yyVAL.sym = Pkglookup(yyDollar[4].sym.Name, p)
}
case 161:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1206
{
var p *Pkg
if yyDollar[2].val.U.(string) == "" {
p = importpkg
} else {
if isbadimport(yyDollar[2].val.U.(string)) {
errorexit()
}
p = mkpkg(yyDollar[2].val.U.(string))
}
yyVAL.sym = Pkglookup("?", p)
}
case 162:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1222
{
yyVAL.node = oldname(yyDollar[1].sym)
if yyVAL.node.Pack != nil {
yyVAL.node.Pack.Used = true
}
}
case 164:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1243
{
Yyerror("final argument in variadic function missing type")
yyVAL.node = Nod(ODDD, typenod(typ(TINTER)), nil)
}
case 165:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1248
{
yyVAL.node = Nod(ODDD, yyDollar[2].node, nil)
}
case 171:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1259
{
yyVAL.node = yyDollar[2].node
}
case 175:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1268
{
yyVAL.node = Nod(OIND, yyDollar[2].node, nil)
}
case 180:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1278
{
yyVAL.node = yyDollar[2].node
}
case 190:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1299
{
if yyDollar[1].node.Op == OPACK {
var s *Sym
s = restrictlookup(yyDollar[3].sym.Name, yyDollar[1].node.Pkg)
yyDollar[1].node.Used = true
yyVAL.node = oldname(s)
break
}
yyVAL.node = Nod(OXDOT, yyDollar[1].node, newname(yyDollar[3].sym))
}
case 191:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1312
{
yyVAL.node = Nod(OTARRAY, yyDollar[2].node, yyDollar[4].node)
}
case 192:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1316
{
// array literal of nelem
yyVAL.node = Nod(OTARRAY, Nod(ODDD, nil, nil), yyDollar[4].node)
}
case 193:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1321
{
yyVAL.node = Nod(OTCHAN, yyDollar[2].node, nil)
yyVAL.node.Etype = Cboth
}
case 194:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1326
{
yyVAL.node = Nod(OTCHAN, yyDollar[3].node, nil)
yyVAL.node.Etype = Csend
}
case 195:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1331
{
yyVAL.node = Nod(OTMAP, yyDollar[3].node, yyDollar[5].node)
}
case 198:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1339
{
yyVAL.node = Nod(OIND, yyDollar[2].node, nil)
}
case 199:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1345
{
yyVAL.node = Nod(OTCHAN, yyDollar[3].node, nil)
yyVAL.node.Etype = Crecv
}
case 200:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1352
{
yyVAL.node = Nod(OTSTRUCT, nil, nil)
yyVAL.node.List = yyDollar[3].list
fixlbrace(yyDollar[2].i)
}
case 201:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1358
{
yyVAL.node = Nod(OTSTRUCT, nil, nil)
fixlbrace(yyDollar[2].i)
}
case 202:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1365
{
yyVAL.node = Nod(OTINTER, nil, nil)
yyVAL.node.List = yyDollar[3].list
fixlbrace(yyDollar[2].i)
}
case 203:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1371
{
yyVAL.node = Nod(OTINTER, nil, nil)
fixlbrace(yyDollar[2].i)
}
case 204:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1382
{
yyVAL.node = yyDollar[2].node
if yyVAL.node == nil {
break
}
if noescape && yyDollar[3].list != nil {
Yyerror("can only use //go:noescape with external func implementations")
}
yyVAL.node.Nbody = yyDollar[3].list
yyVAL.node.Func.Endlineno = lineno
yyVAL.node.Noescape = noescape
yyVAL.node.Func.Nosplit = nosplit
yyVAL.node.Func.Nowritebarrier = nowritebarrier
funcbody(yyVAL.node)
}
case 205:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1400
{
var t *Node
yyVAL.node = nil
yyDollar[3].list = checkarglist(yyDollar[3].list, 1)
if yyDollar[1].sym.Name == "init" {
yyDollar[1].sym = renameinit()
if yyDollar[3].list != nil || yyDollar[5].list != nil {
Yyerror("func init must have no arguments and no return values")
}
}
if localpkg.Name == "main" && yyDollar[1].sym.Name == "main" {
if yyDollar[3].list != nil || yyDollar[5].list != nil {
Yyerror("func main must have no arguments and no return values")
}
}
t = Nod(OTFUNC, nil, nil)
t.List = yyDollar[3].list
t.Rlist = yyDollar[5].list
yyVAL.node = Nod(ODCLFUNC, nil, nil)
yyVAL.node.Nname = newfuncname(yyDollar[1].sym)
yyVAL.node.Nname.Defn = yyVAL.node
yyVAL.node.Nname.Ntype = t // TODO: check if nname already has an ntype
declare(yyVAL.node.Nname, PFUNC)
funchdr(yyVAL.node)
}
case 206:
yyDollar = yyS[yypt-8 : yypt+1]
//line go.y:1431
{
var rcvr, t *Node
yyVAL.node = nil
yyDollar[2].list = checkarglist(yyDollar[2].list, 0)
yyDollar[6].list = checkarglist(yyDollar[6].list, 1)
if yyDollar[2].list == nil {
Yyerror("method has no receiver")
break
}
if yyDollar[2].list.Next != nil {
Yyerror("method has multiple receivers")
break
}
rcvr = yyDollar[2].list.N
if rcvr.Op != ODCLFIELD {
Yyerror("bad receiver in method")
break
}
t = Nod(OTFUNC, rcvr, nil)
t.List = yyDollar[6].list
t.Rlist = yyDollar[8].list
yyVAL.node = Nod(ODCLFUNC, nil, nil)
yyVAL.node.Func.Shortname = newfuncname(yyDollar[4].sym)
yyVAL.node.Nname = methodname1(yyVAL.node.Func.Shortname, rcvr.Right)
yyVAL.node.Nname.Defn = yyVAL.node
yyVAL.node.Nname.Ntype = t
yyVAL.node.Nname.Nointerface = nointerface
declare(yyVAL.node.Nname, PFUNC)
funchdr(yyVAL.node)
}
case 207:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1469
{
var s *Sym
var t *Type
yyVAL.node = nil
s = yyDollar[1].sym
t = functype(nil, yyDollar[3].list, yyDollar[5].list)
importsym(s, ONAME)
if s.Def != nil && s.Def.Op == ONAME {
if Eqtype(t, s.Def.Type) {
dclcontext = PDISCARD // since we skip funchdr below
break
}
Yyerror("inconsistent definition for func %v during import\n\t%v\n\t%v", s, s.Def.Type, t)
}
yyVAL.node = newfuncname(s)
yyVAL.node.Type = t
declare(yyVAL.node, PFUNC)
funchdr(yyVAL.node)
}
case 208:
yyDollar = yyS[yypt-8 : yypt+1]
//line go.y:1494
{
yyVAL.node = methodname1(newname(yyDollar[4].sym), yyDollar[2].list.N.Right)
yyVAL.node.Type = functype(yyDollar[2].list.N, yyDollar[6].list, yyDollar[8].list)
checkwidth(yyVAL.node.Type)
addmethod(yyDollar[4].sym, yyVAL.node.Type, false, nointerface)
nointerface = false
funchdr(yyVAL.node)
// inl.C's inlnode in on a dotmeth node expects to find the inlineable body as
// (dotmeth's type).Nname.Inl, and dotmeth's type has been pulled
// out by typecheck's lookdot as this $$.ttype. So by providing
// this back link here we avoid special casing there.
yyVAL.node.Type.Nname = yyVAL.node
}
case 209:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1512
{
yyDollar[3].list = checkarglist(yyDollar[3].list, 1)
yyVAL.node = Nod(OTFUNC, nil, nil)
yyVAL.node.List = yyDollar[3].list
yyVAL.node.Rlist = yyDollar[5].list
}
case 210:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1520
{
yyVAL.list = nil
}
case 211:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1524
{
yyVAL.list = yyDollar[2].list
if yyVAL.list == nil {
yyVAL.list = list1(Nod(OEMPTY, nil, nil))
}
}
case 212:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1533
{
yyVAL.list = nil
}
case 213:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1537
{
yyVAL.list = list1(Nod(ODCLFIELD, nil, yyDollar[1].node))
}
case 214:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1541
{
yyDollar[2].list = checkarglist(yyDollar[2].list, 0)
yyVAL.list = yyDollar[2].list
}
case 215:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1548
{
closurehdr(yyDollar[1].node)
}
case 216:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1554
{
yyVAL.node = closurebody(yyDollar[3].list)
fixlbrace(yyDollar[2].i)
}
case 217:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1559
{
yyVAL.node = closurebody(nil)
}
case 218:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1570
{
yyVAL.list = nil
}
case 219:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1574
{
yyVAL.list = concat(yyDollar[1].list, yyDollar[2].list)
if nsyntaxerrors == 0 {
testdclstack()
}
nointerface = false
noescape = false
nosplit = false
nowritebarrier = false
}
case 221:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1588
{
yyVAL.list = concat(yyDollar[1].list, yyDollar[3].list)
}
case 223:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1595
{
yyVAL.list = concat(yyDollar[1].list, yyDollar[3].list)
}
case 224:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1601
{
yyVAL.list = list1(yyDollar[1].node)
}
case 225:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1605
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 227:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1612
{
yyVAL.list = concat(yyDollar[1].list, yyDollar[3].list)
}
case 228:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1618
{
yyVAL.list = list1(yyDollar[1].node)
}
case 229:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1622
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 230:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1628
{
var l *NodeList
var n *Node
l = yyDollar[1].list
if l == nil {
// ? symbol, during import (list1(nil) == nil)
n = yyDollar[2].node
if n.Op == OIND {
n = n.Left
}
n = embedded(n.Sym, importpkg)
n.Right = yyDollar[2].node
n.Val = yyDollar[3].val
yyVAL.list = list1(n)
break
}
for l = yyDollar[1].list; l != nil; l = l.Next {
l.N = Nod(ODCLFIELD, l.N, yyDollar[2].node)
l.N.Val = yyDollar[3].val
}
}
case 231:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1652
{
yyDollar[1].node.Val = yyDollar[2].val
yyVAL.list = list1(yyDollar[1].node)
}
case 232:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1657
{
yyDollar[2].node.Val = yyDollar[4].val
yyVAL.list = list1(yyDollar[2].node)
Yyerror("cannot parenthesize embedded type")
}
case 233:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1663
{
yyDollar[2].node.Right = Nod(OIND, yyDollar[2].node.Right, nil)
yyDollar[2].node.Val = yyDollar[3].val
yyVAL.list = list1(yyDollar[2].node)
}
case 234:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1669
{
yyDollar[3].node.Right = Nod(OIND, yyDollar[3].node.Right, nil)
yyDollar[3].node.Val = yyDollar[5].val
yyVAL.list = list1(yyDollar[3].node)
Yyerror("cannot parenthesize embedded type")
}
case 235:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:1676
{
yyDollar[3].node.Right = Nod(OIND, yyDollar[3].node.Right, nil)
yyDollar[3].node.Val = yyDollar[5].val
yyVAL.list = list1(yyDollar[3].node)
Yyerror("cannot parenthesize embedded type")
}
case 236:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1685
{
var n *Node
yyVAL.sym = yyDollar[1].sym
n = oldname(yyDollar[1].sym)
if n.Pack != nil {
n.Pack.Used = true
}
}
case 237:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1695
{
var pkg *Pkg
if yyDollar[1].sym.Def == nil || yyDollar[1].sym.Def.Op != OPACK {
Yyerror("%v is not a package", yyDollar[1].sym)
pkg = localpkg
} else {
yyDollar[1].sym.Def.Used = true
pkg = yyDollar[1].sym.Def.Pkg
}
yyVAL.sym = restrictlookup(yyDollar[3].sym.Name, pkg)
}
case 238:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1710
{
yyVAL.node = embedded(yyDollar[1].sym, localpkg)
}
case 239:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1716
{
yyVAL.node = Nod(ODCLFIELD, yyDollar[1].node, yyDollar[2].node)
ifacedcl(yyVAL.node)
}
case 240:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1721
{
yyVAL.node = Nod(ODCLFIELD, nil, oldname(yyDollar[1].sym))
}
case 241:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1725
{
yyVAL.node = Nod(ODCLFIELD, nil, oldname(yyDollar[2].sym))
Yyerror("cannot parenthesize embedded type")
}
case 242:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1732
{
// without func keyword
yyDollar[2].list = checkarglist(yyDollar[2].list, 1)
yyVAL.node = Nod(OTFUNC, fakethis(), nil)
yyVAL.node.List = yyDollar[2].list
yyVAL.node.Rlist = yyDollar[4].list
}
case 244:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1746
{
yyVAL.node = Nod(ONONAME, nil, nil)
yyVAL.node.Sym = yyDollar[1].sym
yyVAL.node = Nod(OKEY, yyVAL.node, yyDollar[2].node)
}
case 245:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1752
{
yyVAL.node = Nod(ONONAME, nil, nil)
yyVAL.node.Sym = yyDollar[1].sym
yyVAL.node = Nod(OKEY, yyVAL.node, yyDollar[2].node)
}
case 247:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1761
{
yyVAL.list = list1(yyDollar[1].node)
}
case 248:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1765
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 249:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1770
{
yyVAL.list = nil
}
case 250:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1774
{
yyVAL.list = yyDollar[1].list
}
case 251:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1782
{
yyVAL.node = nil
}
case 253:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1787
{
yyVAL.node = liststmt(yyDollar[1].list)
}
case 255:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1792
{
yyVAL.node = nil
}
case 261:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1803
{
yyDollar[1].node = Nod(OLABEL, yyDollar[1].node, nil)
yyDollar[1].node.Sym = dclstack // context, for goto restrictions
}
case 262:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:1808
{
var l *NodeList
yyDollar[1].node.Defn = yyDollar[4].node
l = list1(yyDollar[1].node)
if yyDollar[4].node != nil {
l = list(l, yyDollar[4].node)
}
yyVAL.node = liststmt(l)
}
case 263:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1819
{
// will be converted to OFALL
yyVAL.node = Nod(OXFALL, nil, nil)
yyVAL.node.Xoffset = int64(block)
}
case 264:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1825
{
yyVAL.node = Nod(OBREAK, yyDollar[2].node, nil)
}
case 265:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1829
{
yyVAL.node = Nod(OCONTINUE, yyDollar[2].node, nil)
}
case 266:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1833
{
yyVAL.node = Nod(OPROC, yyDollar[2].node, nil)
}
case 267:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1837
{
yyVAL.node = Nod(ODEFER, yyDollar[2].node, nil)
}
case 268:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1841
{
yyVAL.node = Nod(OGOTO, yyDollar[2].node, nil)
yyVAL.node.Sym = dclstack // context, for goto restrictions
}
case 269:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1846
{
yyVAL.node = Nod(ORETURN, nil, nil)
yyVAL.node.List = yyDollar[2].list
if yyVAL.node.List == nil && Curfn != nil {
var l *NodeList
for l = Curfn.Func.Dcl; l != nil; l = l.Next {
if l.N.Class == PPARAM {
continue
}
if l.N.Class != PPARAMOUT {
break
}
if l.N.Sym.Def != l.N {
Yyerror("%s is shadowed during return", l.N.Sym.Name)
}
}
}
}
case 270:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1868
{
yyVAL.list = nil
if yyDollar[1].node != nil {
yyVAL.list = list1(yyDollar[1].node)
}
}
case 271:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1875
{
yyVAL.list = yyDollar[1].list
if yyDollar[3].node != nil {
yyVAL.list = list(yyVAL.list, yyDollar[3].node)
}
}
case 272:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1884
{
yyVAL.list = list1(yyDollar[1].node)
}
case 273:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1888
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 274:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1894
{
yyVAL.list = list1(yyDollar[1].node)
}
case 275:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1898
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 276:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1904
{
yyVAL.list = list1(yyDollar[1].node)
}
case 277:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1908
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 278:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1914
{
yyVAL.list = list1(yyDollar[1].node)
}
case 279:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1918
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 280:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1927
{
yyVAL.list = list1(yyDollar[1].node)
}
case 281:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:1931
{
yyVAL.list = list1(yyDollar[1].node)
}
case 282:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1935
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 283:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:1939
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 284:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1944
{
yyVAL.list = nil
}
case 285:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:1948
{
yyVAL.list = yyDollar[1].list
}
case 290:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1962
{
yyVAL.node = nil
}
case 292:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1968
{
yyVAL.list = nil
}
case 294:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1974
{
yyVAL.node = nil
}
case 296:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1980
{
yyVAL.list = nil
}
case 298:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1986
{
yyVAL.list = nil
}
case 300:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1992
{
yyVAL.list = nil
}
case 302:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:1998
{
yyVAL.val.Ctype = CTxxx
}
case 304:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:2008
{
importimport(yyDollar[2].sym, yyDollar[3].val.U.(string))
}
case 305:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:2012
{
importvar(yyDollar[2].sym, yyDollar[3].typ)
}
case 306:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:2016
{
importconst(yyDollar[2].sym, Types[TIDEAL], yyDollar[4].node)
}
case 307:
yyDollar = yyS[yypt-6 : yypt+1]
//line go.y:2020
{
importconst(yyDollar[2].sym, yyDollar[3].typ, yyDollar[5].node)
}
case 308:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:2024
{
importtype(yyDollar[2].typ, yyDollar[3].typ)
}
case 309:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:2028
{
if yyDollar[2].node == nil {
dclcontext = PEXTERN // since we skip the funcbody below
break
}
yyDollar[2].node.Func.Inl = yyDollar[3].list
funcbody(yyDollar[2].node)
importlist = list(importlist, yyDollar[2].node)
if Debug['E'] > 0 {
fmt.Printf("import [%q] func %v \n", importpkg.Path, yyDollar[2].node)
if Debug['m'] > 2 && yyDollar[2].node.Func.Inl != nil {
fmt.Printf("inl body:%v\n", yyDollar[2].node.Func.Inl)
}
}
}
case 310:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2049
{
yyVAL.sym = yyDollar[1].sym
structpkg = yyVAL.sym.Pkg
}
case 311:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2056
{
yyVAL.typ = pkgtype(yyDollar[1].sym)
importsym(yyDollar[1].sym, OTYPE)
}
case 317:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2076
{
yyVAL.typ = pkgtype(yyDollar[1].sym)
}
case 318:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2080
{
// predefined name like uint8
yyDollar[1].sym = Pkglookup(yyDollar[1].sym.Name, builtinpkg)
if yyDollar[1].sym.Def == nil || yyDollar[1].sym.Def.Op != OTYPE {
Yyerror("%s is not a type", yyDollar[1].sym.Name)
yyVAL.typ = nil
} else {
yyVAL.typ = yyDollar[1].sym.Def.Type
}
}
case 319:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:2091
{
yyVAL.typ = aindex(nil, yyDollar[3].typ)
}
case 320:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:2095
{
yyVAL.typ = aindex(nodlit(yyDollar[2].val), yyDollar[4].typ)
}
case 321:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:2099
{
yyVAL.typ = maptype(yyDollar[3].typ, yyDollar[5].typ)
}
case 322:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:2103
{
yyVAL.typ = tostruct(yyDollar[3].list)
}
case 323:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:2107
{
yyVAL.typ = tointerface(yyDollar[3].list)
}
case 324:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:2111
{
yyVAL.typ = Ptrto(yyDollar[2].typ)
}
case 325:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:2115
{
yyVAL.typ = typ(TCHAN)
yyVAL.typ.Type = yyDollar[2].typ
yyVAL.typ.Chan = Cboth
}
case 326:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:2121
{
yyVAL.typ = typ(TCHAN)
yyVAL.typ.Type = yyDollar[3].typ
yyVAL.typ.Chan = Cboth
}
case 327:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:2127
{
yyVAL.typ = typ(TCHAN)
yyVAL.typ.Type = yyDollar[3].typ
yyVAL.typ.Chan = Csend
}
case 328:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:2135
{
yyVAL.typ = typ(TCHAN)
yyVAL.typ.Type = yyDollar[3].typ
yyVAL.typ.Chan = Crecv
}
case 329:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:2143
{
yyVAL.typ = functype(nil, yyDollar[3].list, yyDollar[5].list)
}
case 330:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:2149
{
yyVAL.node = Nod(ODCLFIELD, nil, typenod(yyDollar[2].typ))
if yyDollar[1].sym != nil {
yyVAL.node.Left = newname(yyDollar[1].sym)
}
yyVAL.node.Val = yyDollar[3].val
}
case 331:
yyDollar = yyS[yypt-4 : yypt+1]
//line go.y:2157
{
var t *Type
t = typ(TARRAY)
t.Bound = -1
t.Type = yyDollar[3].typ
yyVAL.node = Nod(ODCLFIELD, nil, typenod(t))
if yyDollar[1].sym != nil {
yyVAL.node.Left = newname(yyDollar[1].sym)
}
yyVAL.node.Isddd = true
yyVAL.node.Val = yyDollar[4].val
}
case 332:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:2174
{
var s *Sym
var p *Pkg
if yyDollar[1].sym != nil && yyDollar[1].sym.Name != "?" {
yyVAL.node = Nod(ODCLFIELD, newname(yyDollar[1].sym), typenod(yyDollar[2].typ))
yyVAL.node.Val = yyDollar[3].val
} else {
s = yyDollar[2].typ.Sym
if s == nil && Isptr[yyDollar[2].typ.Etype] {
s = yyDollar[2].typ.Type.Sym
}
p = importpkg
if yyDollar[1].sym != nil {
p = yyDollar[1].sym.Pkg
}
yyVAL.node = embedded(s, p)
yyVAL.node.Right = typenod(yyDollar[2].typ)
yyVAL.node.Val = yyDollar[3].val
}
}
case 333:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:2198
{
yyVAL.node = Nod(ODCLFIELD, newname(yyDollar[1].sym), typenod(functype(fakethis(), yyDollar[3].list, yyDollar[5].list)))
}
case 334:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2202
{
yyVAL.node = Nod(ODCLFIELD, nil, typenod(yyDollar[1].typ))
}
case 335:
yyDollar = yyS[yypt-0 : yypt+1]
//line go.y:2207
{
yyVAL.list = nil
}
case 337:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:2214
{
yyVAL.list = yyDollar[2].list
}
case 338:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2218
{
yyVAL.list = list1(Nod(ODCLFIELD, nil, typenod(yyDollar[1].typ)))
}
case 339:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2228
{
yyVAL.node = nodlit(yyDollar[1].val)
}
case 340:
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:2232
{
yyVAL.node = nodlit(yyDollar[2].val)
switch yyVAL.node.Val.Ctype {
case CTINT, CTRUNE:
mpnegfix(yyVAL.node.Val.U.(*Mpint))
break
case CTFLT:
mpnegflt(yyVAL.node.Val.U.(*Mpflt))
break
case CTCPLX:
mpnegflt(&yyVAL.node.Val.U.(*Mpcplx).Real)
mpnegflt(&yyVAL.node.Val.U.(*Mpcplx).Imag)
break
default:
Yyerror("bad negated constant")
}
}
case 341:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2250
{
yyVAL.node = oldname(Pkglookup(yyDollar[1].sym.Name, builtinpkg))
if yyVAL.node.Op != OLITERAL {
Yyerror("bad constant %v", yyVAL.node.Sym)
}
}
case 343:
yyDollar = yyS[yypt-5 : yypt+1]
//line go.y:2260
{
if yyDollar[2].node.Val.Ctype == CTRUNE && yyDollar[4].node.Val.Ctype == CTINT {
yyVAL.node = yyDollar[2].node
mpaddfixfix(yyDollar[2].node.Val.U.(*Mpint), yyDollar[4].node.Val.U.(*Mpint), 0)
break
}
yyDollar[4].node.Val.U.(*Mpcplx).Real = yyDollar[4].node.Val.U.(*Mpcplx).Imag
Mpmovecflt(&yyDollar[4].node.Val.U.(*Mpcplx).Imag, 0.0)
yyVAL.node = nodcplxlit(yyDollar[2].node.Val, yyDollar[4].node.Val)
}
case 346:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2276
{
yyVAL.list = list1(yyDollar[1].node)
}
case 347:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:2280
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 348:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2286
{
yyVAL.list = list1(yyDollar[1].node)
}
case 349:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:2290
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
case 350:
yyDollar = yyS[yypt-1 : yypt+1]
//line go.y:2296
{
yyVAL.list = list1(yyDollar[1].node)
}
case 351:
yyDollar = yyS[yypt-3 : yypt+1]
//line go.y:2300
{
yyVAL.list = list(yyDollar[1].list, yyDollar[3].node)
}
}
goto yystack /* stack new state and value */
}