| 1 | package parser |
| 2 | |
| 3 | import "github.com/goccmack/gocc/internal/ast" |
| 4 | |
| 5 | const ( |
| 6 | NUM_STATES = 120 |
| 7 | NUM_TOKENS = 22 |
| 8 | ) |
| 9 | |
| 10 | type ( |
| 11 | ActionTabU [NUM_STATES]ActionRowU |
| 12 | ActionRowU [NUM_TOKENS]Action |
| 13 | ) |
| 14 | |
| 15 | type ( |
| 16 | CanRecover [NUM_STATES]bool |
| 17 | ) |
| 18 | |
| 19 | func getActionTableUncompressed() (act *ActionTabU) { |
| 20 | act = new(ActionTabU) |
| 21 | // S0 |
| 22 | act[0][2] = Shift(6) // tokId |
| 23 | act[0][5] = Shift(7) // regDefId |
| 24 | act[0][6] = Shift(8) // ignoredTokId |
| 25 | act[0][17] = Shift(12) // prodId |
| 26 | act[0][18] = Shift(13) // g_sdt_lit |
| 27 | // S1 |
| 28 | act[1][0] = Accept(0) // $ |
| 29 | // S2 |
| 30 | act[2][0] = Reduce(2) // $ |
| 31 | act[2][17] = Shift(12) // prodId |
| 32 | act[2][18] = Shift(13) // g_sdt_lit |
| 33 | // S3 |
| 34 | act[3][0] = Reduce(3) // $ |
| 35 | // S4 |
| 36 | act[4][0] = Reduce(4) // $ |
| 37 | act[4][2] = Shift(6) // tokId |
| 38 | act[4][5] = Shift(7) // regDefId |
| 39 | act[4][6] = Shift(8) // ignoredTokId |
| 40 | act[4][17] = Reduce(4) // prodId |
| 41 | act[4][18] = Reduce(4) // g_sdt_lit |
| 42 | // S5 |
| 43 | act[5][0] = Reduce(5) // $ |
| 44 | act[5][2] = Reduce(5) // tokId |
| 45 | act[5][5] = Reduce(5) // regDefId |
| 46 | act[5][6] = Reduce(5) // ignoredTokId |
| 47 | act[5][17] = Reduce(5) // prodId |
| 48 | act[5][18] = Reduce(5) // g_sdt_lit |
| 49 | // S6 |
| 50 | act[6][3] = Shift(16) // : |
| 51 | // S7 |
| 52 | act[7][3] = Shift(17) // : |
| 53 | // S8 |
| 54 | act[8][3] = Shift(18) // : |
| 55 | // S9 |
| 56 | act[9][17] = Shift(12) // prodId |
| 57 | // S10 |
| 58 | act[10][0] = Reduce(22) // $ |
| 59 | act[10][17] = Shift(12) // prodId |
| 60 | // S11 |
| 61 | act[11][0] = Reduce(23) // $ |
| 62 | act[11][17] = Reduce(23) // prodId |
| 63 | // S12 |
| 64 | act[12][3] = Shift(21) // : |
| 65 | // S13 |
| 66 | act[13][17] = Reduce(39) // prodId |
| 67 | // S14 |
| 68 | act[14][0] = Reduce(1) // $ |
| 69 | // S15 |
| 70 | act[15][0] = Reduce(6) // $ |
| 71 | act[15][2] = Reduce(6) // tokId |
| 72 | act[15][5] = Reduce(6) // regDefId |
| 73 | act[15][6] = Reduce(6) // ignoredTokId |
| 74 | act[15][17] = Reduce(6) // prodId |
| 75 | act[15][18] = Reduce(6) // g_sdt_lit |
| 76 | // S16 |
| 77 | act[16][5] = Shift(23) // regDefId |
| 78 | act[16][8] = Shift(26) // . |
| 79 | act[16][9] = Shift(27) // char_lit |
| 80 | act[16][11] = Shift(28) // [ |
| 81 | act[16][13] = Shift(29) // { |
| 82 | act[16][15] = Shift(30) // ( |
| 83 | // S17 |
| 84 | act[17][5] = Shift(23) // regDefId |
| 85 | act[17][8] = Shift(26) // . |
| 86 | act[17][9] = Shift(27) // char_lit |
| 87 | act[17][11] = Shift(28) // [ |
| 88 | act[17][13] = Shift(29) // { |
| 89 | act[17][15] = Shift(30) // ( |
| 90 | // S18 |
| 91 | act[18][5] = Shift(23) // regDefId |
| 92 | act[18][8] = Shift(26) // . |
| 93 | act[18][9] = Shift(27) // char_lit |
| 94 | act[18][11] = Shift(28) // [ |
| 95 | act[18][13] = Shift(29) // { |
| 96 | act[18][15] = Shift(30) // ( |
| 97 | // S19 |
| 98 | act[19][0] = Reduce(21) // $ |
| 99 | act[19][17] = Shift(12) // prodId |
| 100 | // S20 |
| 101 | act[20][0] = Reduce(24) // $ |
| 102 | act[20][17] = Reduce(24) // prodId |
| 103 | // S21 |
| 104 | act[21][2] = Shift(33) // tokId |
| 105 | act[21][17] = Shift(34) // prodId |
| 106 | act[21][19] = Shift(38) // error |
| 107 | act[21][20] = Shift(39) // empty |
| 108 | act[21][21] = Shift(41) // string_lit |
| 109 | // S22 |
| 110 | act[22][4] = Shift(42) // ; |
| 111 | act[22][7] = Shift(43) // | |
| 112 | // S23 |
| 113 | act[23][4] = Reduce(17) // ; |
| 114 | act[23][5] = Reduce(17) // regDefId |
| 115 | act[23][7] = Reduce(17) // | |
| 116 | act[23][8] = Reduce(17) // . |
| 117 | act[23][9] = Reduce(17) // char_lit |
| 118 | act[23][11] = Reduce(17) // [ |
| 119 | act[23][13] = Reduce(17) // { |
| 120 | act[23][15] = Reduce(17) // ( |
| 121 | // S24 |
| 122 | act[24][4] = Reduce(10) // ; |
| 123 | act[24][5] = Shift(23) // regDefId |
| 124 | act[24][7] = Reduce(10) // | |
| 125 | act[24][8] = Shift(26) // . |
| 126 | act[24][9] = Shift(27) // char_lit |
| 127 | act[24][11] = Shift(28) // [ |
| 128 | act[24][13] = Shift(29) // { |
| 129 | act[24][15] = Shift(30) // ( |
| 130 | // S25 |
| 131 | act[25][4] = Reduce(12) // ; |
| 132 | act[25][5] = Reduce(12) // regDefId |
| 133 | act[25][7] = Reduce(12) // | |
| 134 | act[25][8] = Reduce(12) // . |
| 135 | act[25][9] = Reduce(12) // char_lit |
| 136 | act[25][11] = Reduce(12) // [ |
| 137 | act[25][13] = Reduce(12) // { |
| 138 | act[25][15] = Reduce(12) // ( |
| 139 | // S26 |
| 140 | act[26][4] = Reduce(14) // ; |
| 141 | act[26][5] = Reduce(14) // regDefId |
| 142 | act[26][7] = Reduce(14) // | |
| 143 | act[26][8] = Reduce(14) // . |
| 144 | act[26][9] = Reduce(14) // char_lit |
| 145 | act[26][11] = Reduce(14) // [ |
| 146 | act[26][13] = Reduce(14) // { |
| 147 | act[26][15] = Reduce(14) // ( |
| 148 | // S27 |
| 149 | act[27][4] = Reduce(15) // ; |
| 150 | act[27][5] = Reduce(15) // regDefId |
| 151 | act[27][7] = Reduce(15) // | |
| 152 | act[27][8] = Reduce(15) // . |
| 153 | act[27][9] = Reduce(15) // char_lit |
| 154 | act[27][10] = Shift(45) // - |
| 155 | act[27][11] = Reduce(15) // [ |
| 156 | act[27][13] = Reduce(15) // { |
| 157 | act[27][15] = Reduce(15) // ( |
| 158 | // S28 |
| 159 | act[28][5] = Shift(47) // regDefId |
| 160 | act[28][8] = Shift(50) // . |
| 161 | act[28][9] = Shift(51) // char_lit |
| 162 | act[28][11] = Shift(52) // [ |
| 163 | act[28][13] = Shift(53) // { |
| 164 | act[28][15] = Shift(54) // ( |
| 165 | // S29 |
| 166 | act[29][5] = Shift(56) // regDefId |
| 167 | act[29][8] = Shift(59) // . |
| 168 | act[29][9] = Shift(60) // char_lit |
| 169 | act[29][11] = Shift(61) // [ |
| 170 | act[29][13] = Shift(62) // { |
| 171 | act[29][15] = Shift(63) // ( |
| 172 | // S30 |
| 173 | act[30][5] = Shift(65) // regDefId |
| 174 | act[30][8] = Shift(68) // . |
| 175 | act[30][9] = Shift(69) // char_lit |
| 176 | act[30][11] = Shift(70) // [ |
| 177 | act[30][13] = Shift(71) // { |
| 178 | act[30][15] = Shift(72) // ( |
| 179 | // S31 |
| 180 | act[31][4] = Shift(73) // ; |
| 181 | act[31][7] = Shift(43) // | |
| 182 | // S32 |
| 183 | act[32][4] = Shift(74) // ; |
| 184 | act[32][7] = Shift(43) // | |
| 185 | // S33 |
| 186 | act[33][2] = Reduce(37) // tokId |
| 187 | act[33][4] = Reduce(37) // ; |
| 188 | act[33][7] = Reduce(37) // | |
| 189 | act[33][17] = Reduce(37) // prodId |
| 190 | act[33][18] = Reduce(37) // g_sdt_lit |
| 191 | act[33][21] = Reduce(37) // string_lit |
| 192 | // S34 |
| 193 | act[34][2] = Reduce(36) // tokId |
| 194 | act[34][4] = Reduce(36) // ; |
| 195 | act[34][7] = Reduce(36) // | |
| 196 | act[34][17] = Reduce(36) // prodId |
| 197 | act[34][18] = Reduce(36) // g_sdt_lit |
| 198 | act[34][21] = Reduce(36) // string_lit |
| 199 | // S35 |
| 200 | act[35][4] = Shift(75) // ; |
| 201 | act[35][7] = Shift(76) // | |
| 202 | // S36 |
| 203 | act[36][4] = Reduce(26) // ; |
| 204 | act[36][7] = Reduce(26) // | |
| 205 | // S37 |
| 206 | act[37][2] = Shift(33) // tokId |
| 207 | act[37][4] = Reduce(28) // ; |
| 208 | act[37][7] = Reduce(28) // | |
| 209 | act[37][17] = Shift(34) // prodId |
| 210 | act[37][18] = Shift(77) // g_sdt_lit |
| 211 | act[37][21] = Shift(41) // string_lit |
| 212 | // S38 |
| 213 | act[38][2] = Shift(33) // tokId |
| 214 | act[38][4] = Reduce(30) // ; |
| 215 | act[38][7] = Reduce(30) // | |
| 216 | act[38][17] = Shift(34) // prodId |
| 217 | act[38][21] = Shift(41) // string_lit |
| 218 | // S39 |
| 219 | act[39][4] = Reduce(33) // ; |
| 220 | act[39][7] = Reduce(33) // | |
| 221 | // S40 |
| 222 | act[40][2] = Reduce(34) // tokId |
| 223 | act[40][4] = Reduce(34) // ; |
| 224 | act[40][7] = Reduce(34) // | |
| 225 | act[40][17] = Reduce(34) // prodId |
| 226 | act[40][18] = Reduce(34) // g_sdt_lit |
| 227 | act[40][21] = Reduce(34) // string_lit |
| 228 | // S41 |
| 229 | act[41][2] = Reduce(38) // tokId |
| 230 | act[41][4] = Reduce(38) // ; |
| 231 | act[41][7] = Reduce(38) // | |
| 232 | act[41][17] = Reduce(38) // prodId |
| 233 | act[41][18] = Reduce(38) // g_sdt_lit |
| 234 | act[41][21] = Reduce(38) // string_lit |
| 235 | // S42 |
| 236 | act[42][0] = Reduce(7) // $ |
| 237 | act[42][2] = Reduce(7) // tokId |
| 238 | act[42][5] = Reduce(7) // regDefId |
| 239 | act[42][6] = Reduce(7) // ignoredTokId |
| 240 | act[42][17] = Reduce(7) // prodId |
| 241 | act[42][18] = Reduce(7) // g_sdt_lit |
| 242 | // S43 |
| 243 | act[43][5] = Shift(23) // regDefId |
| 244 | act[43][8] = Shift(26) // . |
| 245 | act[43][9] = Shift(27) // char_lit |
| 246 | act[43][11] = Shift(28) // [ |
| 247 | act[43][13] = Shift(29) // { |
| 248 | act[43][15] = Shift(30) // ( |
| 249 | // S44 |
| 250 | act[44][4] = Reduce(13) // ; |
| 251 | act[44][5] = Reduce(13) // regDefId |
| 252 | act[44][7] = Reduce(13) // | |
| 253 | act[44][8] = Reduce(13) // . |
| 254 | act[44][9] = Reduce(13) // char_lit |
| 255 | act[44][11] = Reduce(13) // [ |
| 256 | act[44][13] = Reduce(13) // { |
| 257 | act[44][15] = Reduce(13) // ( |
| 258 | // S45 |
| 259 | act[45][9] = Shift(81) // char_lit |
| 260 | // S46 |
| 261 | act[46][7] = Shift(82) // | |
| 262 | act[46][12] = Shift(83) // ] |
| 263 | // S47 |
| 264 | act[47][5] = Reduce(17) // regDefId |
| 265 | act[47][7] = Reduce(17) // | |
| 266 | act[47][8] = Reduce(17) // . |
| 267 | act[47][9] = Reduce(17) // char_lit |
| 268 | act[47][11] = Reduce(17) // [ |
| 269 | act[47][12] = Reduce(17) // ] |
| 270 | act[47][13] = Reduce(17) // { |
| 271 | act[47][15] = Reduce(17) // ( |
| 272 | // S48 |
| 273 | act[48][5] = Shift(47) // regDefId |
| 274 | act[48][7] = Reduce(10) // | |
| 275 | act[48][8] = Shift(50) // . |
| 276 | act[48][9] = Shift(51) // char_lit |
| 277 | act[48][11] = Shift(52) // [ |
| 278 | act[48][12] = Reduce(10) // ] |
| 279 | act[48][13] = Shift(53) // { |
| 280 | act[48][15] = Shift(54) // ( |
| 281 | // S49 |
| 282 | act[49][5] = Reduce(12) // regDefId |
| 283 | act[49][7] = Reduce(12) // | |
| 284 | act[49][8] = Reduce(12) // . |
| 285 | act[49][9] = Reduce(12) // char_lit |
| 286 | act[49][11] = Reduce(12) // [ |
| 287 | act[49][12] = Reduce(12) // ] |
| 288 | act[49][13] = Reduce(12) // { |
| 289 | act[49][15] = Reduce(12) // ( |
| 290 | // S50 |
| 291 | act[50][5] = Reduce(14) // regDefId |
| 292 | act[50][7] = Reduce(14) // | |
| 293 | act[50][8] = Reduce(14) // . |
| 294 | act[50][9] = Reduce(14) // char_lit |
| 295 | act[50][11] = Reduce(14) // [ |
| 296 | act[50][12] = Reduce(14) // ] |
| 297 | act[50][13] = Reduce(14) // { |
| 298 | act[50][15] = Reduce(14) // ( |
| 299 | // S51 |
| 300 | act[51][5] = Reduce(15) // regDefId |
| 301 | act[51][7] = Reduce(15) // | |
| 302 | act[51][8] = Reduce(15) // . |
| 303 | act[51][9] = Reduce(15) // char_lit |
| 304 | act[51][10] = Shift(85) // - |
| 305 | act[51][11] = Reduce(15) // [ |
| 306 | act[51][12] = Reduce(15) // ] |
| 307 | act[51][13] = Reduce(15) // { |
| 308 | act[51][15] = Reduce(15) // ( |
| 309 | // S52 |
| 310 | act[52][5] = Shift(47) // regDefId |
| 311 | act[52][8] = Shift(50) // . |
| 312 | act[52][9] = Shift(51) // char_lit |
| 313 | act[52][11] = Shift(52) // [ |
| 314 | act[52][13] = Shift(53) // { |
| 315 | act[52][15] = Shift(54) // ( |
| 316 | // S53 |
| 317 | act[53][5] = Shift(56) // regDefId |
| 318 | act[53][8] = Shift(59) // . |
| 319 | act[53][9] = Shift(60) // char_lit |
| 320 | act[53][11] = Shift(61) // [ |
| 321 | act[53][13] = Shift(62) // { |
| 322 | act[53][15] = Shift(63) // ( |
| 323 | // S54 |
| 324 | act[54][5] = Shift(65) // regDefId |
| 325 | act[54][8] = Shift(68) // . |
| 326 | act[54][9] = Shift(69) // char_lit |
| 327 | act[54][11] = Shift(70) // [ |
| 328 | act[54][13] = Shift(71) // { |
| 329 | act[54][15] = Shift(72) // ( |
| 330 | // S55 |
| 331 | act[55][7] = Shift(89) // | |
| 332 | act[55][14] = Shift(90) // } |
| 333 | // S56 |
| 334 | act[56][5] = Reduce(17) // regDefId |
| 335 | act[56][7] = Reduce(17) // | |
| 336 | act[56][8] = Reduce(17) // . |
| 337 | act[56][9] = Reduce(17) // char_lit |
| 338 | act[56][11] = Reduce(17) // [ |
| 339 | act[56][13] = Reduce(17) // { |
| 340 | act[56][14] = Reduce(17) // } |
| 341 | act[56][15] = Reduce(17) // ( |
| 342 | // S57 |
| 343 | act[57][5] = Shift(56) // regDefId |
| 344 | act[57][7] = Reduce(10) // | |
| 345 | act[57][8] = Shift(59) // . |
| 346 | act[57][9] = Shift(60) // char_lit |
| 347 | act[57][11] = Shift(61) // [ |
| 348 | act[57][13] = Shift(62) // { |
| 349 | act[57][14] = Reduce(10) // } |
| 350 | act[57][15] = Shift(63) // ( |
| 351 | // S58 |
| 352 | act[58][5] = Reduce(12) // regDefId |
| 353 | act[58][7] = Reduce(12) // | |
| 354 | act[58][8] = Reduce(12) // . |
| 355 | act[58][9] = Reduce(12) // char_lit |
| 356 | act[58][11] = Reduce(12) // [ |
| 357 | act[58][13] = Reduce(12) // { |
| 358 | act[58][14] = Reduce(12) // } |
| 359 | act[58][15] = Reduce(12) // ( |
| 360 | // S59 |
| 361 | act[59][5] = Reduce(14) // regDefId |
| 362 | act[59][7] = Reduce(14) // | |
| 363 | act[59][8] = Reduce(14) // . |
| 364 | act[59][9] = Reduce(14) // char_lit |
| 365 | act[59][11] = Reduce(14) // [ |
| 366 | act[59][13] = Reduce(14) // { |
| 367 | act[59][14] = Reduce(14) // } |
| 368 | act[59][15] = Reduce(14) // ( |
| 369 | // S60 |
| 370 | act[60][5] = Reduce(15) // regDefId |
| 371 | act[60][7] = Reduce(15) // | |
| 372 | act[60][8] = Reduce(15) // . |
| 373 | act[60][9] = Reduce(15) // char_lit |
| 374 | act[60][10] = Shift(92) // - |
| 375 | act[60][11] = Reduce(15) // [ |
| 376 | act[60][13] = Reduce(15) // { |
| 377 | act[60][14] = Reduce(15) // } |
| 378 | act[60][15] = Reduce(15) // ( |
| 379 | // S61 |
| 380 | act[61][5] = Shift(47) // regDefId |
| 381 | act[61][8] = Shift(50) // . |
| 382 | act[61][9] = Shift(51) // char_lit |
| 383 | act[61][11] = Shift(52) // [ |
| 384 | act[61][13] = Shift(53) // { |
| 385 | act[61][15] = Shift(54) // ( |
| 386 | // S62 |
| 387 | act[62][5] = Shift(56) // regDefId |
| 388 | act[62][8] = Shift(59) // . |
| 389 | act[62][9] = Shift(60) // char_lit |
| 390 | act[62][11] = Shift(61) // [ |
| 391 | act[62][13] = Shift(62) // { |
| 392 | act[62][15] = Shift(63) // ( |
| 393 | // S63 |
| 394 | act[63][5] = Shift(65) // regDefId |
| 395 | act[63][8] = Shift(68) // . |
| 396 | act[63][9] = Shift(69) // char_lit |
| 397 | act[63][11] = Shift(70) // [ |
| 398 | act[63][13] = Shift(71) // { |
| 399 | act[63][15] = Shift(72) // ( |
| 400 | // S64 |
| 401 | act[64][7] = Shift(96) // | |
| 402 | act[64][16] = Shift(97) // ) |
| 403 | // S65 |
| 404 | act[65][5] = Reduce(17) // regDefId |
| 405 | act[65][7] = Reduce(17) // | |
| 406 | act[65][8] = Reduce(17) // . |
| 407 | act[65][9] = Reduce(17) // char_lit |
| 408 | act[65][11] = Reduce(17) // [ |
| 409 | act[65][13] = Reduce(17) // { |
| 410 | act[65][15] = Reduce(17) // ( |
| 411 | act[65][16] = Reduce(17) // ) |
| 412 | // S66 |
| 413 | act[66][5] = Shift(65) // regDefId |
| 414 | act[66][7] = Reduce(10) // | |
| 415 | act[66][8] = Shift(68) // . |
| 416 | act[66][9] = Shift(69) // char_lit |
| 417 | act[66][11] = Shift(70) // [ |
| 418 | act[66][13] = Shift(71) // { |
| 419 | act[66][15] = Shift(72) // ( |
| 420 | act[66][16] = Reduce(10) // ) |
| 421 | // S67 |
| 422 | act[67][5] = Reduce(12) // regDefId |
| 423 | act[67][7] = Reduce(12) // | |
| 424 | act[67][8] = Reduce(12) // . |
| 425 | act[67][9] = Reduce(12) // char_lit |
| 426 | act[67][11] = Reduce(12) // [ |
| 427 | act[67][13] = Reduce(12) // { |
| 428 | act[67][15] = Reduce(12) // ( |
| 429 | act[67][16] = Reduce(12) // ) |
| 430 | // S68 |
| 431 | act[68][5] = Reduce(14) // regDefId |
| 432 | act[68][7] = Reduce(14) // | |
| 433 | act[68][8] = Reduce(14) // . |
| 434 | act[68][9] = Reduce(14) // char_lit |
| 435 | act[68][11] = Reduce(14) // [ |
| 436 | act[68][13] = Reduce(14) // { |
| 437 | act[68][15] = Reduce(14) // ( |
| 438 | act[68][16] = Reduce(14) // ) |
| 439 | // S69 |
| 440 | act[69][5] = Reduce(15) // regDefId |
| 441 | act[69][7] = Reduce(15) // | |
| 442 | act[69][8] = Reduce(15) // . |
| 443 | act[69][9] = Reduce(15) // char_lit |
| 444 | act[69][10] = Shift(99) // - |
| 445 | act[69][11] = Reduce(15) // [ |
| 446 | act[69][13] = Reduce(15) // { |
| 447 | act[69][15] = Reduce(15) // ( |
| 448 | act[69][16] = Reduce(15) // ) |
| 449 | // S70 |
| 450 | act[70][5] = Shift(47) // regDefId |
| 451 | act[70][8] = Shift(50) // . |
| 452 | act[70][9] = Shift(51) // char_lit |
| 453 | act[70][11] = Shift(52) // [ |
| 454 | act[70][13] = Shift(53) // { |
| 455 | act[70][15] = Shift(54) // ( |
| 456 | // S71 |
| 457 | act[71][5] = Shift(56) // regDefId |
| 458 | act[71][8] = Shift(59) // . |
| 459 | act[71][9] = Shift(60) // char_lit |
| 460 | act[71][11] = Shift(61) // [ |
| 461 | act[71][13] = Shift(62) // { |
| 462 | act[71][15] = Shift(63) // ( |
| 463 | // S72 |
| 464 | act[72][5] = Shift(65) // regDefId |
| 465 | act[72][8] = Shift(68) // . |
| 466 | act[72][9] = Shift(69) // char_lit |
| 467 | act[72][11] = Shift(70) // [ |
| 468 | act[72][13] = Shift(71) // { |
| 469 | act[72][15] = Shift(72) // ( |
| 470 | // S73 |
| 471 | act[73][0] = Reduce(8) // $ |
| 472 | act[73][2] = Reduce(8) // tokId |
| 473 | act[73][5] = Reduce(8) // regDefId |
| 474 | act[73][6] = Reduce(8) // ignoredTokId |
| 475 | act[73][17] = Reduce(8) // prodId |
| 476 | act[73][18] = Reduce(8) // g_sdt_lit |
| 477 | // S74 |
| 478 | act[74][0] = Reduce(9) // $ |
| 479 | act[74][2] = Reduce(9) // tokId |
| 480 | act[74][5] = Reduce(9) // regDefId |
| 481 | act[74][6] = Reduce(9) // ignoredTokId |
| 482 | act[74][17] = Reduce(9) // prodId |
| 483 | act[74][18] = Reduce(9) // g_sdt_lit |
| 484 | // S75 |
| 485 | act[75][0] = Reduce(25) // $ |
| 486 | act[75][17] = Reduce(25) // prodId |
| 487 | // S76 |
| 488 | act[76][2] = Shift(33) // tokId |
| 489 | act[76][17] = Shift(34) // prodId |
| 490 | act[76][19] = Shift(38) // error |
| 491 | act[76][20] = Shift(39) // empty |
| 492 | act[76][21] = Shift(41) // string_lit |
| 493 | // S77 |
| 494 | act[77][4] = Reduce(29) // ; |
| 495 | act[77][7] = Reduce(29) // | |
| 496 | // S78 |
| 497 | act[78][2] = Reduce(35) // tokId |
| 498 | act[78][4] = Reduce(35) // ; |
| 499 | act[78][7] = Reduce(35) // | |
| 500 | act[78][17] = Reduce(35) // prodId |
| 501 | act[78][18] = Reduce(35) // g_sdt_lit |
| 502 | act[78][21] = Reduce(35) // string_lit |
| 503 | // S79 |
| 504 | act[79][2] = Shift(33) // tokId |
| 505 | act[79][4] = Reduce(31) // ; |
| 506 | act[79][7] = Reduce(31) // | |
| 507 | act[79][17] = Shift(34) // prodId |
| 508 | act[79][18] = Shift(104) // g_sdt_lit |
| 509 | act[79][21] = Shift(41) // string_lit |
| 510 | // S80 |
| 511 | act[80][4] = Reduce(11) // ; |
| 512 | act[80][5] = Shift(23) // regDefId |
| 513 | act[80][7] = Reduce(11) // | |
| 514 | act[80][8] = Shift(26) // . |
| 515 | act[80][9] = Shift(27) // char_lit |
| 516 | act[80][11] = Shift(28) // [ |
| 517 | act[80][13] = Shift(29) // { |
| 518 | act[80][15] = Shift(30) // ( |
| 519 | // S81 |
| 520 | act[81][4] = Reduce(16) // ; |
| 521 | act[81][5] = Reduce(16) // regDefId |
| 522 | act[81][7] = Reduce(16) // | |
| 523 | act[81][8] = Reduce(16) // . |
| 524 | act[81][9] = Reduce(16) // char_lit |
| 525 | act[81][11] = Reduce(16) // [ |
| 526 | act[81][13] = Reduce(16) // { |
| 527 | act[81][15] = Reduce(16) // ( |
| 528 | // S82 |
| 529 | act[82][5] = Shift(47) // regDefId |
| 530 | act[82][8] = Shift(50) // . |
| 531 | act[82][9] = Shift(51) // char_lit |
| 532 | act[82][11] = Shift(52) // [ |
| 533 | act[82][13] = Shift(53) // { |
| 534 | act[82][15] = Shift(54) // ( |
| 535 | // S83 |
| 536 | act[83][4] = Reduce(18) // ; |
| 537 | act[83][5] = Reduce(18) // regDefId |
| 538 | act[83][7] = Reduce(18) // | |
| 539 | act[83][8] = Reduce(18) // . |
| 540 | act[83][9] = Reduce(18) // char_lit |
| 541 | act[83][11] = Reduce(18) // [ |
| 542 | act[83][13] = Reduce(18) // { |
| 543 | act[83][15] = Reduce(18) // ( |
| 544 | // S84 |
| 545 | act[84][5] = Reduce(13) // regDefId |
| 546 | act[84][7] = Reduce(13) // | |
| 547 | act[84][8] = Reduce(13) // . |
| 548 | act[84][9] = Reduce(13) // char_lit |
| 549 | act[84][11] = Reduce(13) // [ |
| 550 | act[84][12] = Reduce(13) // ] |
| 551 | act[84][13] = Reduce(13) // { |
| 552 | act[84][15] = Reduce(13) // ( |
| 553 | // S85 |
| 554 | act[85][9] = Shift(106) // char_lit |
| 555 | // S86 |
| 556 | act[86][7] = Shift(82) // | |
| 557 | act[86][12] = Shift(107) // ] |
| 558 | // S87 |
| 559 | act[87][7] = Shift(89) // | |
| 560 | act[87][14] = Shift(108) // } |
| 561 | // S88 |
| 562 | act[88][7] = Shift(96) // | |
| 563 | act[88][16] = Shift(109) // ) |
| 564 | // S89 |
| 565 | act[89][5] = Shift(56) // regDefId |
| 566 | act[89][8] = Shift(59) // . |
| 567 | act[89][9] = Shift(60) // char_lit |
| 568 | act[89][11] = Shift(61) // [ |
| 569 | act[89][13] = Shift(62) // { |
| 570 | act[89][15] = Shift(63) // ( |
| 571 | // S90 |
| 572 | act[90][4] = Reduce(19) // ; |
| 573 | act[90][5] = Reduce(19) // regDefId |
| 574 | act[90][7] = Reduce(19) // | |
| 575 | act[90][8] = Reduce(19) // . |
| 576 | act[90][9] = Reduce(19) // char_lit |
| 577 | act[90][11] = Reduce(19) // [ |
| 578 | act[90][13] = Reduce(19) // { |
| 579 | act[90][15] = Reduce(19) // ( |
| 580 | // S91 |
| 581 | act[91][5] = Reduce(13) // regDefId |
| 582 | act[91][7] = Reduce(13) // | |
| 583 | act[91][8] = Reduce(13) // . |
| 584 | act[91][9] = Reduce(13) // char_lit |
| 585 | act[91][11] = Reduce(13) // [ |
| 586 | act[91][13] = Reduce(13) // { |
| 587 | act[91][14] = Reduce(13) // } |
| 588 | act[91][15] = Reduce(13) // ( |
| 589 | // S92 |
| 590 | act[92][9] = Shift(111) // char_lit |
| 591 | // S93 |
| 592 | act[93][7] = Shift(82) // | |
| 593 | act[93][12] = Shift(112) // ] |
| 594 | // S94 |
| 595 | act[94][7] = Shift(89) // | |
| 596 | act[94][14] = Shift(113) // } |
| 597 | // S95 |
| 598 | act[95][7] = Shift(96) // | |
| 599 | act[95][16] = Shift(114) // ) |
| 600 | // S96 |
| 601 | act[96][5] = Shift(65) // regDefId |
| 602 | act[96][8] = Shift(68) // . |
| 603 | act[96][9] = Shift(69) // char_lit |
| 604 | act[96][11] = Shift(70) // [ |
| 605 | act[96][13] = Shift(71) // { |
| 606 | act[96][15] = Shift(72) // ( |
| 607 | // S97 |
| 608 | act[97][4] = Reduce(20) // ; |
| 609 | act[97][5] = Reduce(20) // regDefId |
| 610 | act[97][7] = Reduce(20) // | |
| 611 | act[97][8] = Reduce(20) // . |
| 612 | act[97][9] = Reduce(20) // char_lit |
| 613 | act[97][11] = Reduce(20) // [ |
| 614 | act[97][13] = Reduce(20) // { |
| 615 | act[97][15] = Reduce(20) // ( |
| 616 | // S98 |
| 617 | act[98][5] = Reduce(13) // regDefId |
| 618 | act[98][7] = Reduce(13) // | |
| 619 | act[98][8] = Reduce(13) // . |
| 620 | act[98][9] = Reduce(13) // char_lit |
| 621 | act[98][11] = Reduce(13) // [ |
| 622 | act[98][13] = Reduce(13) // { |
| 623 | act[98][15] = Reduce(13) // ( |
| 624 | act[98][16] = Reduce(13) // ) |
| 625 | // S99 |
| 626 | act[99][9] = Shift(116) // char_lit |
| 627 | // S100 |
| 628 | act[100][7] = Shift(82) // | |
| 629 | act[100][12] = Shift(117) // ] |
| 630 | // S101 |
| 631 | act[101][7] = Shift(89) // | |
| 632 | act[101][14] = Shift(118) // } |
| 633 | // S102 |
| 634 | act[102][7] = Shift(96) // | |
| 635 | act[102][16] = Shift(119) // ) |
| 636 | // S103 |
| 637 | act[103][4] = Reduce(27) // ; |
| 638 | act[103][7] = Reduce(27) // | |
| 639 | // S104 |
| 640 | act[104][4] = Reduce(32) // ; |
| 641 | act[104][7] = Reduce(32) // | |
| 642 | // S105 |
| 643 | act[105][5] = Shift(47) // regDefId |
| 644 | act[105][7] = Reduce(11) // | |
| 645 | act[105][8] = Shift(50) // . |
| 646 | act[105][9] = Shift(51) // char_lit |
| 647 | act[105][11] = Shift(52) // [ |
| 648 | act[105][12] = Reduce(11) // ] |
| 649 | act[105][13] = Shift(53) // { |
| 650 | act[105][15] = Shift(54) // ( |
| 651 | // S106 |
| 652 | act[106][5] = Reduce(16) // regDefId |
| 653 | act[106][7] = Reduce(16) // | |
| 654 | act[106][8] = Reduce(16) // . |
| 655 | act[106][9] = Reduce(16) // char_lit |
| 656 | act[106][11] = Reduce(16) // [ |
| 657 | act[106][12] = Reduce(16) // ] |
| 658 | act[106][13] = Reduce(16) // { |
| 659 | act[106][15] = Reduce(16) // ( |
| 660 | // S107 |
| 661 | act[107][5] = Reduce(18) // regDefId |
| 662 | act[107][7] = Reduce(18) // | |
| 663 | act[107][8] = Reduce(18) // . |
| 664 | act[107][9] = Reduce(18) // char_lit |
| 665 | act[107][11] = Reduce(18) // [ |
| 666 | act[107][12] = Reduce(18) // ] |
| 667 | act[107][13] = Reduce(18) // { |
| 668 | act[107][15] = Reduce(18) // ( |
| 669 | // S108 |
| 670 | act[108][5] = Reduce(19) // regDefId |
| 671 | act[108][7] = Reduce(19) // | |
| 672 | act[108][8] = Reduce(19) // . |
| 673 | act[108][9] = Reduce(19) // char_lit |
| 674 | act[108][11] = Reduce(19) // [ |
| 675 | act[108][12] = Reduce(19) // ] |
| 676 | act[108][13] = Reduce(19) // { |
| 677 | act[108][15] = Reduce(19) // ( |
| 678 | // S109 |
| 679 | act[109][5] = Reduce(20) // regDefId |
| 680 | act[109][7] = Reduce(20) // | |
| 681 | act[109][8] = Reduce(20) // . |
| 682 | act[109][9] = Reduce(20) // char_lit |
| 683 | act[109][11] = Reduce(20) // [ |
| 684 | act[109][12] = Reduce(20) // ] |
| 685 | act[109][13] = Reduce(20) // { |
| 686 | act[109][15] = Reduce(20) // ( |
| 687 | // S110 |
| 688 | act[110][5] = Shift(56) // regDefId |
| 689 | act[110][7] = Reduce(11) // | |
| 690 | act[110][8] = Shift(59) // . |
| 691 | act[110][9] = Shift(60) // char_lit |
| 692 | act[110][11] = Shift(61) // [ |
| 693 | act[110][13] = Shift(62) // { |
| 694 | act[110][14] = Reduce(11) // } |
| 695 | act[110][15] = Shift(63) // ( |
| 696 | // S111 |
| 697 | act[111][5] = Reduce(16) // regDefId |
| 698 | act[111][7] = Reduce(16) // | |
| 699 | act[111][8] = Reduce(16) // . |
| 700 | act[111][9] = Reduce(16) // char_lit |
| 701 | act[111][11] = Reduce(16) // [ |
| 702 | act[111][13] = Reduce(16) // { |
| 703 | act[111][14] = Reduce(16) // } |
| 704 | act[111][15] = Reduce(16) // ( |
| 705 | // S112 |
| 706 | act[112][5] = Reduce(18) // regDefId |
| 707 | act[112][7] = Reduce(18) // | |
| 708 | act[112][8] = Reduce(18) // . |
| 709 | act[112][9] = Reduce(18) // char_lit |
| 710 | act[112][11] = Reduce(18) // [ |
| 711 | act[112][13] = Reduce(18) // { |
| 712 | act[112][14] = Reduce(18) // } |
| 713 | act[112][15] = Reduce(18) // ( |
| 714 | // S113 |
| 715 | act[113][5] = Reduce(19) // regDefId |
| 716 | act[113][7] = Reduce(19) // | |
| 717 | act[113][8] = Reduce(19) // . |
| 718 | act[113][9] = Reduce(19) // char_lit |
| 719 | act[113][11] = Reduce(19) // [ |
| 720 | act[113][13] = Reduce(19) // { |
| 721 | act[113][14] = Reduce(19) // } |
| 722 | act[113][15] = Reduce(19) // ( |
| 723 | // S114 |
| 724 | act[114][5] = Reduce(20) // regDefId |
| 725 | act[114][7] = Reduce(20) // | |
| 726 | act[114][8] = Reduce(20) // . |
| 727 | act[114][9] = Reduce(20) // char_lit |
| 728 | act[114][11] = Reduce(20) // [ |
| 729 | act[114][13] = Reduce(20) // { |
| 730 | act[114][14] = Reduce(20) // } |
| 731 | act[114][15] = Reduce(20) // ( |
| 732 | // S115 |
| 733 | act[115][5] = Shift(65) // regDefId |
| 734 | act[115][7] = Reduce(11) // | |
| 735 | act[115][8] = Shift(68) // . |
| 736 | act[115][9] = Shift(69) // char_lit |
| 737 | act[115][11] = Shift(70) // [ |
| 738 | act[115][13] = Shift(71) // { |
| 739 | act[115][15] = Shift(72) // ( |
| 740 | act[115][16] = Reduce(11) // ) |
| 741 | // S116 |
| 742 | act[116][5] = Reduce(16) // regDefId |
| 743 | act[116][7] = Reduce(16) // | |
| 744 | act[116][8] = Reduce(16) // . |
| 745 | act[116][9] = Reduce(16) // char_lit |
| 746 | act[116][11] = Reduce(16) // [ |
| 747 | act[116][13] = Reduce(16) // { |
| 748 | act[116][15] = Reduce(16) // ( |
| 749 | act[116][16] = Reduce(16) // ) |
| 750 | // S117 |
| 751 | act[117][5] = Reduce(18) // regDefId |
| 752 | act[117][7] = Reduce(18) // | |
| 753 | act[117][8] = Reduce(18) // . |
| 754 | act[117][9] = Reduce(18) // char_lit |
| 755 | act[117][11] = Reduce(18) // [ |
| 756 | act[117][13] = Reduce(18) // { |
| 757 | act[117][15] = Reduce(18) // ( |
| 758 | act[117][16] = Reduce(18) // ) |
| 759 | // S118 |
| 760 | act[118][5] = Reduce(19) // regDefId |
| 761 | act[118][7] = Reduce(19) // | |
| 762 | act[118][8] = Reduce(19) // . |
| 763 | act[118][9] = Reduce(19) // char_lit |
| 764 | act[118][11] = Reduce(19) // [ |
| 765 | act[118][13] = Reduce(19) // { |
| 766 | act[118][15] = Reduce(19) // ( |
| 767 | act[118][16] = Reduce(19) // ) |
| 768 | // S119 |
| 769 | act[119][5] = Reduce(20) // regDefId |
| 770 | act[119][7] = Reduce(20) // | |
| 771 | act[119][8] = Reduce(20) // . |
| 772 | act[119][9] = Reduce(20) // char_lit |
| 773 | act[119][11] = Reduce(20) // [ |
| 774 | act[119][13] = Reduce(20) // { |
| 775 | act[119][15] = Reduce(20) // ( |
| 776 | act[119][16] = Reduce(20) // ) |
| 777 | return |
| 778 | } |
| 779 | |
| 780 | func getCanRecoverTableUncompressed() (cr *CanRecover) { |
| 781 | cr = new(CanRecover) |
| 782 | return |
| 783 | } |
| 784 | |
| 785 | // NUM_NT is the set of non-terminal symbols of the target grammar. |
| 786 | const ( |
| 787 | NUM_NT = 15 |
| 788 | ) |
| 789 | |
| 790 | type ( |
| 791 | GotoTabU [NUM_STATES]GotoRowU |
| 792 | GotoRowU [NUM_NT]State |
| 793 | ) |
| 794 | |
| 795 | const ( |
| 796 | NT_Grammar = 0 |
| 797 | NT_LexicalPart = 1 |
| 798 | NT_LexProductions = 2 |
| 799 | NT_LexProduction = 3 |
| 800 | NT_LexPattern = 4 |
| 801 | NT_LexAlt = 5 |
| 802 | NT_LexTerm = 6 |
| 803 | NT_SyntaxPart = 7 |
| 804 | NT_SyntaxProdList = 8 |
| 805 | NT_SyntaxProduction = 9 |
| 806 | NT_Alternatives = 10 |
| 807 | NT_SyntaxBody = 11 |
| 808 | NT_Symbols = 12 |
| 809 | NT_Symbol = 13 |
| 810 | NT_FileHeader = 14 |
| 811 | ) |
| 812 | |
| 813 | func getGotoTableUncompressed() (gto *GotoTabU) { |
| 814 | gto = new(GotoTabU) |
| 815 | gto[0][NT_Grammar] = 1 |
| 816 | gto[0][NT_LexicalPart] = 2 |
| 817 | gto[0][NT_LexProductions] = 4 |
| 818 | gto[0][NT_LexProduction] = 5 |
| 819 | gto[0][NT_SyntaxPart] = 3 |
| 820 | gto[0][NT_SyntaxProdList] = 10 |
| 821 | gto[0][NT_SyntaxProduction] = 11 |
| 822 | gto[0][NT_FileHeader] = 9 |
| 823 | gto[2][NT_SyntaxPart] = 14 |
| 824 | gto[2][NT_SyntaxProdList] = 10 |
| 825 | gto[2][NT_SyntaxProduction] = 11 |
| 826 | gto[2][NT_FileHeader] = 9 |
| 827 | gto[4][NT_LexProduction] = 15 |
| 828 | gto[9][NT_SyntaxProdList] = 19 |
| 829 | gto[9][NT_SyntaxProduction] = 11 |
| 830 | gto[10][NT_SyntaxProduction] = 20 |
| 831 | gto[16][NT_LexPattern] = 22 |
| 832 | gto[16][NT_LexAlt] = 24 |
| 833 | gto[16][NT_LexTerm] = 25 |
| 834 | gto[17][NT_LexPattern] = 31 |
| 835 | gto[17][NT_LexAlt] = 24 |
| 836 | gto[17][NT_LexTerm] = 25 |
| 837 | gto[18][NT_LexPattern] = 32 |
| 838 | gto[18][NT_LexAlt] = 24 |
| 839 | gto[18][NT_LexTerm] = 25 |
| 840 | gto[19][NT_SyntaxProduction] = 20 |
| 841 | gto[21][NT_Alternatives] = 35 |
| 842 | gto[21][NT_SyntaxBody] = 36 |
| 843 | gto[21][NT_Symbols] = 37 |
| 844 | gto[21][NT_Symbol] = 40 |
| 845 | gto[24][NT_LexTerm] = 44 |
| 846 | gto[28][NT_LexPattern] = 46 |
| 847 | gto[28][NT_LexAlt] = 48 |
| 848 | gto[28][NT_LexTerm] = 49 |
| 849 | gto[29][NT_LexPattern] = 55 |
| 850 | gto[29][NT_LexAlt] = 57 |
| 851 | gto[29][NT_LexTerm] = 58 |
| 852 | gto[30][NT_LexPattern] = 64 |
| 853 | gto[30][NT_LexAlt] = 66 |
| 854 | gto[30][NT_LexTerm] = 67 |
| 855 | gto[37][NT_Symbol] = 78 |
| 856 | gto[38][NT_Symbols] = 79 |
| 857 | gto[38][NT_Symbol] = 40 |
| 858 | gto[43][NT_LexAlt] = 80 |
| 859 | gto[43][NT_LexTerm] = 25 |
| 860 | gto[48][NT_LexTerm] = 84 |
| 861 | gto[52][NT_LexPattern] = 86 |
| 862 | gto[52][NT_LexAlt] = 48 |
| 863 | gto[52][NT_LexTerm] = 49 |
| 864 | gto[53][NT_LexPattern] = 87 |
| 865 | gto[53][NT_LexAlt] = 57 |
| 866 | gto[53][NT_LexTerm] = 58 |
| 867 | gto[54][NT_LexPattern] = 88 |
| 868 | gto[54][NT_LexAlt] = 66 |
| 869 | gto[54][NT_LexTerm] = 67 |
| 870 | gto[57][NT_LexTerm] = 91 |
| 871 | gto[61][NT_LexPattern] = 93 |
| 872 | gto[61][NT_LexAlt] = 48 |
| 873 | gto[61][NT_LexTerm] = 49 |
| 874 | gto[62][NT_LexPattern] = 94 |
| 875 | gto[62][NT_LexAlt] = 57 |
| 876 | gto[62][NT_LexTerm] = 58 |
| 877 | gto[63][NT_LexPattern] = 95 |
| 878 | gto[63][NT_LexAlt] = 66 |
| 879 | gto[63][NT_LexTerm] = 67 |
| 880 | gto[66][NT_LexTerm] = 98 |
| 881 | gto[70][NT_LexPattern] = 100 |
| 882 | gto[70][NT_LexAlt] = 48 |
| 883 | gto[70][NT_LexTerm] = 49 |
| 884 | gto[71][NT_LexPattern] = 101 |
| 885 | gto[71][NT_LexAlt] = 57 |
| 886 | gto[71][NT_LexTerm] = 58 |
| 887 | gto[72][NT_LexPattern] = 102 |
| 888 | gto[72][NT_LexAlt] = 66 |
| 889 | gto[72][NT_LexTerm] = 67 |
| 890 | gto[76][NT_SyntaxBody] = 103 |
| 891 | gto[76][NT_Symbols] = 37 |
| 892 | gto[76][NT_Symbol] = 40 |
| 893 | gto[79][NT_Symbol] = 78 |
| 894 | gto[80][NT_LexTerm] = 44 |
| 895 | gto[82][NT_LexAlt] = 105 |
| 896 | gto[82][NT_LexTerm] = 49 |
| 897 | gto[89][NT_LexAlt] = 110 |
| 898 | gto[89][NT_LexTerm] = 58 |
| 899 | gto[96][NT_LexAlt] = 115 |
| 900 | gto[96][NT_LexTerm] = 67 |
| 901 | gto[105][NT_LexTerm] = 84 |
| 902 | gto[110][NT_LexTerm] = 91 |
| 903 | gto[115][NT_LexTerm] = 98 |
| 904 | return |
| 905 | } |
| 906 | |
| 907 | const NUM_PRODS = 40 |
| 908 | |
| 909 | type ( |
| 910 | ProdTabU [NUM_PRODS]*ProdTabUEntry |
| 911 | ProdTabUEntry struct { |
| 912 | String string |
| 913 | Head NT |
| 914 | HeadIndex int |
| 915 | NumSymbols int |
| 916 | ReduceFunc func([]Attrib) (Attrib, error) |
| 917 | } |
| 918 | ) |
| 919 | |
| 920 | func getProductionsTableUncompressed() (pt *ProdTabU) { |
| 921 | pt = new(ProdTabU) |
| 922 | pt[0] = &ProdTabUEntry{ |
| 923 | String: "S! : Grammar ;", |
| 924 | Head: "S!", |
| 925 | HeadIndex: -1, |
| 926 | NumSymbols: 1, |
| 927 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 928 | return X[0], nil |
| 929 | }, |
| 930 | } |
| 931 | pt[1] = &ProdTabUEntry{ |
| 932 | String: "Grammar : LexicalPart SyntaxPart << ast.NewGrammar(X[0], X[1]) >> ;", |
| 933 | Head: "Grammar", |
| 934 | HeadIndex: NT_Grammar, |
| 935 | NumSymbols: 2, |
| 936 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 937 | return ast.NewGrammar(X[0], X[1]) |
| 938 | }, |
| 939 | } |
| 940 | pt[2] = &ProdTabUEntry{ |
| 941 | String: "Grammar : LexicalPart << ast.NewGrammar(X[0], nil) >> ;", |
| 942 | Head: "Grammar", |
| 943 | HeadIndex: NT_Grammar, |
| 944 | NumSymbols: 1, |
| 945 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 946 | return ast.NewGrammar(X[0], nil) |
| 947 | }, |
| 948 | } |
| 949 | pt[3] = &ProdTabUEntry{ |
| 950 | String: "Grammar : SyntaxPart << ast.NewGrammar(nil, X[0]) >> ;", |
| 951 | Head: "Grammar", |
| 952 | HeadIndex: NT_Grammar, |
| 953 | NumSymbols: 1, |
| 954 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 955 | return ast.NewGrammar(nil, X[0]) |
| 956 | }, |
| 957 | } |
| 958 | pt[4] = &ProdTabUEntry{ |
| 959 | String: "LexicalPart : LexProductions << ast.NewLexPart(nil, nil, X[0]) >> ;", |
| 960 | Head: "LexicalPart", |
| 961 | HeadIndex: NT_LexicalPart, |
| 962 | NumSymbols: 1, |
| 963 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 964 | return ast.NewLexPart(nil, nil, X[0]) |
| 965 | }, |
| 966 | } |
| 967 | pt[5] = &ProdTabUEntry{ |
| 968 | String: "LexProductions : LexProduction << ast.NewLexProductions(X[0]) >> ;", |
| 969 | Head: "LexProductions", |
| 970 | HeadIndex: NT_LexProductions, |
| 971 | NumSymbols: 1, |
| 972 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 973 | return ast.NewLexProductions(X[0]) |
| 974 | }, |
| 975 | } |
| 976 | pt[6] = &ProdTabUEntry{ |
| 977 | String: "LexProductions : LexProductions LexProduction << ast.AppendLexProduction(X[0], X[1]) >> ;", |
| 978 | Head: "LexProductions", |
| 979 | HeadIndex: NT_LexProductions, |
| 980 | NumSymbols: 2, |
| 981 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 982 | return ast.AppendLexProduction(X[0], X[1]) |
| 983 | }, |
| 984 | } |
| 985 | pt[7] = &ProdTabUEntry{ |
| 986 | String: "LexProduction : tokId : LexPattern ; << ast.NewLexTokDef(X[0], X[2]) >> ;", |
| 987 | Head: "LexProduction", |
| 988 | HeadIndex: NT_LexProduction, |
| 989 | NumSymbols: 4, |
| 990 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 991 | return ast.NewLexTokDef(X[0], X[2]) |
| 992 | }, |
| 993 | } |
| 994 | pt[8] = &ProdTabUEntry{ |
| 995 | String: "LexProduction : regDefId : LexPattern ; << ast.NewLexRegDef(X[0], X[2]) >> ;", |
| 996 | Head: "LexProduction", |
| 997 | HeadIndex: NT_LexProduction, |
| 998 | NumSymbols: 4, |
| 999 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1000 | return ast.NewLexRegDef(X[0], X[2]) |
| 1001 | }, |
| 1002 | } |
| 1003 | pt[9] = &ProdTabUEntry{ |
| 1004 | String: "LexProduction : ignoredTokId : LexPattern ; << ast.NewLexIgnoredTokDef(X[0], X[2]) >> ;", |
| 1005 | Head: "LexProduction", |
| 1006 | HeadIndex: NT_LexProduction, |
| 1007 | NumSymbols: 4, |
| 1008 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1009 | return ast.NewLexIgnoredTokDef(X[0], X[2]) |
| 1010 | }, |
| 1011 | } |
| 1012 | pt[10] = &ProdTabUEntry{ |
| 1013 | String: "LexPattern : LexAlt << ast.NewLexPattern(X[0]) >> ;", |
| 1014 | Head: "LexPattern", |
| 1015 | HeadIndex: NT_LexPattern, |
| 1016 | NumSymbols: 1, |
| 1017 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1018 | return ast.NewLexPattern(X[0]) |
| 1019 | }, |
| 1020 | } |
| 1021 | pt[11] = &ProdTabUEntry{ |
| 1022 | String: "LexPattern : LexPattern | LexAlt << ast.AppendLexAlt(X[0], X[2]) >> ;", |
| 1023 | Head: "LexPattern", |
| 1024 | HeadIndex: NT_LexPattern, |
| 1025 | NumSymbols: 3, |
| 1026 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1027 | return ast.AppendLexAlt(X[0], X[2]) |
| 1028 | }, |
| 1029 | } |
| 1030 | pt[12] = &ProdTabUEntry{ |
| 1031 | String: "LexAlt : LexTerm << ast.NewLexAlt(X[0]) >> ;", |
| 1032 | Head: "LexAlt", |
| 1033 | HeadIndex: NT_LexAlt, |
| 1034 | NumSymbols: 1, |
| 1035 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1036 | return ast.NewLexAlt(X[0]) |
| 1037 | }, |
| 1038 | } |
| 1039 | pt[13] = &ProdTabUEntry{ |
| 1040 | String: "LexAlt : LexAlt LexTerm << ast.AppendLexTerm(X[0], X[1]) >> ;", |
| 1041 | Head: "LexAlt", |
| 1042 | HeadIndex: NT_LexAlt, |
| 1043 | NumSymbols: 2, |
| 1044 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1045 | return ast.AppendLexTerm(X[0], X[1]) |
| 1046 | }, |
| 1047 | } |
| 1048 | pt[14] = &ProdTabUEntry{ |
| 1049 | String: "LexTerm : . << ast.LexDOT, nil >> ;", |
| 1050 | Head: "LexTerm", |
| 1051 | HeadIndex: NT_LexTerm, |
| 1052 | NumSymbols: 1, |
| 1053 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1054 | return ast.LexDOT, nil |
| 1055 | }, |
| 1056 | } |
| 1057 | pt[15] = &ProdTabUEntry{ |
| 1058 | String: "LexTerm : char_lit << ast.NewLexCharLit(X[0]) >> ;", |
| 1059 | Head: "LexTerm", |
| 1060 | HeadIndex: NT_LexTerm, |
| 1061 | NumSymbols: 1, |
| 1062 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1063 | return ast.NewLexCharLit(X[0]) |
| 1064 | }, |
| 1065 | } |
| 1066 | pt[16] = &ProdTabUEntry{ |
| 1067 | String: "LexTerm : char_lit - char_lit << ast.NewLexCharRange(X[0], X[2]) >> ;", |
| 1068 | Head: "LexTerm", |
| 1069 | HeadIndex: NT_LexTerm, |
| 1070 | NumSymbols: 3, |
| 1071 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1072 | return ast.NewLexCharRange(X[0], X[2]) |
| 1073 | }, |
| 1074 | } |
| 1075 | pt[17] = &ProdTabUEntry{ |
| 1076 | String: "LexTerm : regDefId << ast.NewLexRegDefId(X[0]) >> ;", |
| 1077 | Head: "LexTerm", |
| 1078 | HeadIndex: NT_LexTerm, |
| 1079 | NumSymbols: 1, |
| 1080 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1081 | return ast.NewLexRegDefId(X[0]) |
| 1082 | }, |
| 1083 | } |
| 1084 | pt[18] = &ProdTabUEntry{ |
| 1085 | String: "LexTerm : [ LexPattern ] << ast.NewLexOptPattern(X[1]) >> ;", |
| 1086 | Head: "LexTerm", |
| 1087 | HeadIndex: NT_LexTerm, |
| 1088 | NumSymbols: 3, |
| 1089 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1090 | return ast.NewLexOptPattern(X[1]) |
| 1091 | }, |
| 1092 | } |
| 1093 | pt[19] = &ProdTabUEntry{ |
| 1094 | String: "LexTerm : { LexPattern } << ast.NewLexRepPattern(X[1]) >> ;", |
| 1095 | Head: "LexTerm", |
| 1096 | HeadIndex: NT_LexTerm, |
| 1097 | NumSymbols: 3, |
| 1098 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1099 | return ast.NewLexRepPattern(X[1]) |
| 1100 | }, |
| 1101 | } |
| 1102 | pt[20] = &ProdTabUEntry{ |
| 1103 | String: "LexTerm : ( LexPattern ) << ast.NewLexGroupPattern(X[1]) >> ;", |
| 1104 | Head: "LexTerm", |
| 1105 | HeadIndex: NT_LexTerm, |
| 1106 | NumSymbols: 3, |
| 1107 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1108 | return ast.NewLexGroupPattern(X[1]) |
| 1109 | }, |
| 1110 | } |
| 1111 | pt[21] = &ProdTabUEntry{ |
| 1112 | String: "SyntaxPart : FileHeader SyntaxProdList << ast.NewSyntaxPart(X[0], X[1]) >> ;", |
| 1113 | Head: "SyntaxPart", |
| 1114 | HeadIndex: NT_SyntaxPart, |
| 1115 | NumSymbols: 2, |
| 1116 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1117 | return ast.NewSyntaxPart(X[0], X[1]) |
| 1118 | }, |
| 1119 | } |
| 1120 | pt[22] = &ProdTabUEntry{ |
| 1121 | String: "SyntaxPart : SyntaxProdList << ast.NewSyntaxPart(nil, X[0]) >> ;", |
| 1122 | Head: "SyntaxPart", |
| 1123 | HeadIndex: NT_SyntaxPart, |
| 1124 | NumSymbols: 1, |
| 1125 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1126 | return ast.NewSyntaxPart(nil, X[0]) |
| 1127 | }, |
| 1128 | } |
| 1129 | pt[23] = &ProdTabUEntry{ |
| 1130 | String: "SyntaxProdList : SyntaxProduction << ast.NewSyntaxProdList(X[0]) >> ;", |
| 1131 | Head: "SyntaxProdList", |
| 1132 | HeadIndex: NT_SyntaxProdList, |
| 1133 | NumSymbols: 1, |
| 1134 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1135 | return ast.NewSyntaxProdList(X[0]) |
| 1136 | }, |
| 1137 | } |
| 1138 | pt[24] = &ProdTabUEntry{ |
| 1139 | String: "SyntaxProdList : SyntaxProdList SyntaxProduction << ast.AddSyntaxProds(X[0], X[1]) >> ;", |
| 1140 | Head: "SyntaxProdList", |
| 1141 | HeadIndex: NT_SyntaxProdList, |
| 1142 | NumSymbols: 2, |
| 1143 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1144 | return ast.AddSyntaxProds(X[0], X[1]) |
| 1145 | }, |
| 1146 | } |
| 1147 | pt[25] = &ProdTabUEntry{ |
| 1148 | String: "SyntaxProduction : prodId : Alternatives ; << ast.NewSyntaxProd(X[0], X[2]) >> ;", |
| 1149 | Head: "SyntaxProduction", |
| 1150 | HeadIndex: NT_SyntaxProduction, |
| 1151 | NumSymbols: 4, |
| 1152 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1153 | return ast.NewSyntaxProd(X[0], X[2]) |
| 1154 | }, |
| 1155 | } |
| 1156 | pt[26] = &ProdTabUEntry{ |
| 1157 | String: "Alternatives : SyntaxBody << ast.NewSyntaxAlts(X[0]) >> ;", |
| 1158 | Head: "Alternatives", |
| 1159 | HeadIndex: NT_Alternatives, |
| 1160 | NumSymbols: 1, |
| 1161 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1162 | return ast.NewSyntaxAlts(X[0]) |
| 1163 | }, |
| 1164 | } |
| 1165 | pt[27] = &ProdTabUEntry{ |
| 1166 | String: "Alternatives : Alternatives | SyntaxBody << ast.AddSyntaxAlt(X[0], X[2]) >> ;", |
| 1167 | Head: "Alternatives", |
| 1168 | HeadIndex: NT_Alternatives, |
| 1169 | NumSymbols: 3, |
| 1170 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1171 | return ast.AddSyntaxAlt(X[0], X[2]) |
| 1172 | }, |
| 1173 | } |
| 1174 | pt[28] = &ProdTabUEntry{ |
| 1175 | String: "SyntaxBody : Symbols << ast.NewSyntaxBody(X[0], nil) >> ;", |
| 1176 | Head: "SyntaxBody", |
| 1177 | HeadIndex: NT_SyntaxBody, |
| 1178 | NumSymbols: 1, |
| 1179 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1180 | return ast.NewSyntaxBody(X[0], nil) |
| 1181 | }, |
| 1182 | } |
| 1183 | pt[29] = &ProdTabUEntry{ |
| 1184 | String: "SyntaxBody : Symbols g_sdt_lit << ast.NewSyntaxBody(X[0], X[1]) >> ;", |
| 1185 | Head: "SyntaxBody", |
| 1186 | HeadIndex: NT_SyntaxBody, |
| 1187 | NumSymbols: 2, |
| 1188 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1189 | return ast.NewSyntaxBody(X[0], X[1]) |
| 1190 | }, |
| 1191 | } |
| 1192 | pt[30] = &ProdTabUEntry{ |
| 1193 | String: "SyntaxBody : error << ast.NewErrorBody(nil, nil) >> ;", |
| 1194 | Head: "SyntaxBody", |
| 1195 | HeadIndex: NT_SyntaxBody, |
| 1196 | NumSymbols: 1, |
| 1197 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1198 | return ast.NewErrorBody(nil, nil) |
| 1199 | }, |
| 1200 | } |
| 1201 | pt[31] = &ProdTabUEntry{ |
| 1202 | String: "SyntaxBody : error Symbols << ast.NewErrorBody(X[1], nil) >> ;", |
| 1203 | Head: "SyntaxBody", |
| 1204 | HeadIndex: NT_SyntaxBody, |
| 1205 | NumSymbols: 2, |
| 1206 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1207 | return ast.NewErrorBody(X[1], nil) |
| 1208 | }, |
| 1209 | } |
| 1210 | pt[32] = &ProdTabUEntry{ |
| 1211 | String: "SyntaxBody : error Symbols g_sdt_lit << ast.NewErrorBody(X[1], X[2]) >> ;", |
| 1212 | Head: "SyntaxBody", |
| 1213 | HeadIndex: NT_SyntaxBody, |
| 1214 | NumSymbols: 3, |
| 1215 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1216 | return ast.NewErrorBody(X[1], X[2]) |
| 1217 | }, |
| 1218 | } |
| 1219 | pt[33] = &ProdTabUEntry{ |
| 1220 | String: "SyntaxBody : empty << ast.NewEmptyBody() >> ;", |
| 1221 | Head: "SyntaxBody", |
| 1222 | HeadIndex: NT_SyntaxBody, |
| 1223 | NumSymbols: 1, |
| 1224 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1225 | return ast.NewEmptyBody() |
| 1226 | }, |
| 1227 | } |
| 1228 | pt[34] = &ProdTabUEntry{ |
| 1229 | String: "Symbols : Symbol << ast.NewSyntaxSymbols(X[0]) >> ;", |
| 1230 | Head: "Symbols", |
| 1231 | HeadIndex: NT_Symbols, |
| 1232 | NumSymbols: 1, |
| 1233 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1234 | return ast.NewSyntaxSymbols(X[0]) |
| 1235 | }, |
| 1236 | } |
| 1237 | pt[35] = &ProdTabUEntry{ |
| 1238 | String: "Symbols : Symbols Symbol << ast.AddSyntaxSymbol(X[0], X[1]) >> ;", |
| 1239 | Head: "Symbols", |
| 1240 | HeadIndex: NT_Symbols, |
| 1241 | NumSymbols: 2, |
| 1242 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1243 | return ast.AddSyntaxSymbol(X[0], X[1]) |
| 1244 | }, |
| 1245 | } |
| 1246 | pt[36] = &ProdTabUEntry{ |
| 1247 | String: "Symbol : prodId << ast.NewSyntaxProdId(X[0]) >> ;", |
| 1248 | Head: "Symbol", |
| 1249 | HeadIndex: NT_Symbol, |
| 1250 | NumSymbols: 1, |
| 1251 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1252 | return ast.NewSyntaxProdId(X[0]) |
| 1253 | }, |
| 1254 | } |
| 1255 | pt[37] = &ProdTabUEntry{ |
| 1256 | String: "Symbol : tokId << ast.NewTokId(X[0]) >> ;", |
| 1257 | Head: "Symbol", |
| 1258 | HeadIndex: NT_Symbol, |
| 1259 | NumSymbols: 1, |
| 1260 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1261 | return ast.NewTokId(X[0]) |
| 1262 | }, |
| 1263 | } |
| 1264 | pt[38] = &ProdTabUEntry{ |
| 1265 | String: "Symbol : string_lit << ast.NewStringLit(X[0]) >> ;", |
| 1266 | Head: "Symbol", |
| 1267 | HeadIndex: NT_Symbol, |
| 1268 | NumSymbols: 1, |
| 1269 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1270 | return ast.NewStringLit(X[0]) |
| 1271 | }, |
| 1272 | } |
| 1273 | pt[39] = &ProdTabUEntry{ |
| 1274 | String: "FileHeader : g_sdt_lit << ast.NewFileHeader(X[0]) >> ;", |
| 1275 | Head: "FileHeader", |
| 1276 | HeadIndex: NT_FileHeader, |
| 1277 | NumSymbols: 1, |
| 1278 | ReduceFunc: func(X []Attrib) (Attrib, error) { |
| 1279 | return ast.NewFileHeader(X[0]) |
| 1280 | }, |
| 1281 | } |
| 1282 | return |
| 1283 | } |