File: parse.cc

package info (click to toggle)
bisonc%2B%2B 6.09.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,984 kB
  • sloc: cpp: 9,375; ansic: 1,505; fortran: 1,134; makefile: 1,062; sh: 526; yacc: 84; lex: 60
file content (2747 lines) | stat: -rw-r--r-- 65,641 bytes parent folder | download
1
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
// Generated by Bisonc++ V6.09.02 on Tue, 03 Jun 2025 14:17:32 +0200

// base/comment

// $insert class.ih
#include "parser.ih"

// The FIRST element of SR arrays shown below uses `d_type', defining the
// state's type, and `d_lastIdx' containing the last element's index. If
// d_lastIdx contains the REQ_TOKEN bitflag (see below) then the state needs
// a token: if in this state d_token is Reserved_::UNDETERMINED_, nextToken() will be
// called

// The LAST element of SR arrays uses `d_token' containing the last retrieved
// token to speed up the (linear) seach.  Except for the first element of SR
// arrays, the field `d_action' is used to determine what to do next. If
// positive, it represents the next state (used with SHIFT); if zero, it
// indicates `ACCEPT', if negative, -d_action represents the number of the
// rule to reduce to.

// `lookup()' tries to find d_token in the current SR array. If it fails, and
// there is no default reduction UNEXPECTED_TOKEN_ is thrown, which is then
// caught by the error-recovery function.

// The error-recovery function will pop elements off the stack until a state
// having bit flag ERR_ITEM is found. This state has a transition on errTok_
// which is applied. In this errTok_ state, while the current token is not a
// proper continuation, new tokens are obtained by nextToken(). If such a
// token is found, error recovery is successful and the token is
// handled according to the error state's SR table and parsing continues.
// During error recovery semantic actions are ignored.

// A state flagged with the DEF_RED flag will perform a default
// reduction if no other continuations are available for the current token.

// The ACCEPT STATE never shows a default reduction: when it is reached the
// parser returns ACCEPT(). During the grammar
// analysis phase a default reduction may have been defined, but it is
// removed during the state-definition phase.

// So:
//      s_x[] = 
//      {
//                  [_field_1_]         [_field_2_]
//
// First element:   {state-type,        idx of last element},
// Other elements:  {required token,    action to perform},
//                                      ( < 0: reduce, 
//                                          0: ACCEPT,
//                                        > 0: next state)
//      }

// base/declarations

namespace // anonymous
{
    char const author[] = "Frank B. Brokken (f.b.brokken@rug.nl)";

    enum Reserved_
    {
        UNDETERMINED_   = -2,
        EOF_            = -1,
        errTok_         = 256
    };
    enum StateType       // modify statetype/data.cc when this enum changes
    {
        NORMAL,
        ERR_ITEM,
        REQ_TOKEN,
        ERR_REQ,    // ERR_ITEM | REQ_TOKEN
        DEF_RED,    // state having default reduction
        ERR_DEF,    // ERR_ITEM | DEF_RED
        REQ_DEF,    // REQ_TOKEN | DEF_RED
        ERR_REQ_DEF // ERR_ITEM | REQ_TOKEN | DEF_RED
    };    
    inline bool operator&(StateType lhs, StateType rhs)
    {
        return (static_cast<int>(lhs) & rhs) != 0;
    }
    enum StateTransition
    {
        ACCEPT_   = 0,     // `ACCEPT' TRANSITION
    };

    struct PI_     // Production Info
    {
        size_t d_nonTerm; // identification number of this production's
                            // non-terminal 
        size_t d_size;    // number of elements in this production 
    };

    struct SR_     // Shift Reduce info, see its description above
    {
        union
        {
            int _field_1_;      // initializer, allowing initializations 
                                // of the SR s_[] arrays
            StateType d_type;
            int       d_token;
        };
        union
        {
            int _field_2_;

            int d_lastIdx;          // if negative, the state uses SHIFT
            int d_action;           // may be negative (reduce), 
                                    // postive (shift), or 0 (accept)
        };
    };

    // $insert staticdata
    
    enum                        // size to expand the state-stack with when
    {                           // full
        STACK_EXPANSION_ = 10
    };

// Productions Info Records:
PI_ const s_productionInfo[] = 
{
     {0, 0}, // not used: reduction values are negative
     {313, 4}, // 1: input ->  directives _two_percents rules optTwo_percents
     {315, 1}, // 2: _two_percents (TWO_PERCENTS) ->  TWO_PERCENTS
     {318, 1}, // 3: identifier (IDENTIFIER) ->  IDENTIFIER
     {319, 3}, // 4: typename ('<') ->  '<' identifier '>'
     {320, 1}, // 5: optComma (',') ->  ','
     {320, 0}, // 6: optComma ->  <empty>
     {321, 1}, // 7: optNumber (NUMBER) ->  NUMBER
     {321, 0}, // 8: optNumber ->  <empty>
     {322, 1}, // 9: optSemiCol (';') ->  ';'
     {322, 0}, // 10: optSemiCol ->  <empty>
     {323, 0}, // 11: _tokenname ->  <empty>
     {324, 2}, // 12: optTypename ->  typename _tokenname
     {324, 1}, // 13: optTypename ->  _tokenname
     {317, 1}, // 14: optTwo_percents (TWO_PERCENTS) ->  TWO_PERCENTS
     {317, 0}, // 15: optTwo_percents ->  <empty>
     {325, 1}, // 16: _baseclass_header (BASECLASS_HEADER) ->  BASECLASS_HEADER
     {326, 1}, // 17: _baseclass_preinclude (BASECLASS_PREINCLUDE) ->  BASECLASS_PREINCLUDE
     {327, 1}, // 18: _class_header (CLASS_HEADER) ->  CLASS_HEADER
     {328, 1}, // 19: _class_name (CLASS_NAME) ->  CLASS_NAME
     {329, 1}, // 20: _expect (EXPECT) ->  EXPECT
     {330, 1}, // 21: _filenames (FILENAMES) ->  FILENAMES
     {331, 1}, // 22: _implementation_header (IMPLEMENTATION_HEADER) ->  IMPLEMENTATION_HEADER
     {332, 0}, // 23: _incrementPrecedence ->  <empty>
     {333, 2}, // 24: _left (LEFT) ->  LEFT _typesymbol
     {335, 1}, // 25: _locationstruct (LOCATIONSTRUCT) ->  LOCATIONSTRUCT
     {336, 1}, // 26: _ltype (LTYPE) ->  LTYPE
     {337, 1}, // 27: _namespace (NAMESPACE) ->  NAMESPACE
     {338, 2}, // 28: _nonassoc (NONASSOC) ->  NONASSOC _typesymbol
     {339, 1}, // 29: _parsefun_source (PARSEFUN_SOURCE) ->  PARSEFUN_SOURCE
     {340, 0}, // 30: _pushPrecedence ->  <empty>
     {341, 1}, // 31: _required (REQUIRED) ->  REQUIRED
     {342, 2}, // 32: _right (RIGHT) ->  RIGHT _typesymbol
     {343, 1}, // 33: _scanner (SCANNER) ->  SCANNER
     {344, 1}, // 34: _scanner_class_name (SCANNER_CLASS_NAME) ->  SCANNER_CLASS_NAME
     {345, 1}, // 35: _scanner_token_function (SCANNER_TOKEN_FUNCTION) ->  SCANNER_TOKEN_FUNCTION
     {346, 1}, // 36: _scanner_matched_text_function (SCANNER_MATCHED_TEXT_FUNCTION) ->  SCANNER_MATCHED_TEXT_FUNCTION
     {347, 1}, // 37: _stack_expansion (STACK_EXPANSION) ->  STACK_EXPANSION
     {348, 1}, // 38: _start (START) ->  START
     {349, 0}, // 39: _symbol_exp ->  <empty>
     {350, 1}, // 40: _symbol (QUOTE) ->  QUOTE
     {350, 2}, // 41: _symbol ->  identifier optNumber
     {351, 3}, // 42: _symbolList ->  _symbolList optComma _symbol
     {351, 1}, // 43: _symbolList ->  _symbol
     {352, 3}, // 44: _symbols ->  _symbol_exp _symbolList optSemiCol
     {353, 1}, // 45: _target_directory (TARGET_DIRECTORY) ->  TARGET_DIRECTORY
     {354, 1}, // 46: _type (TYPE) ->  TYPE
     {355, 1}, // 47: _stype (STYPE) ->  STYPE
     {334, 0}, // 48: _typesymbol ->  <empty>
     {356, 2}, // 49: _token (TOKEN) ->  TOKEN _typesymbol
     {357, 1}, // 50: _token_class (TOKEN_CLASS) ->  TOKEN_CLASS
     {358, 1}, // 51: _token_namespace (TOKEN_NAMESPACE) ->  TOKEN_NAMESPACE
     {359, 1}, // 52: _token_path (TOKEN_PATH) ->  TOKEN_PATH
     {360, 1}, // 53: _union (UNION) ->  UNION
     {361, 1}, // 54: _default_actions (DEFAULT_ACTIONS) ->  DEFAULT_ACTIONS
     {362, 1}, // 55: _constructor_checks (CONSTRUCTOR_CHECKS) ->  CONSTRUCTOR_CHECKS
     {363, 1}, // 56: _tag_mismatches (WARN_TAGS) ->  WARN_TAGS
     {364, 1}, // 57: _polymorphic (POLYMORPHIC) ->  POLYMORPHIC
     {365, 1}, // 58: _typespec (':') ->  ':'
     {366, 3}, // 59: _polyspec ->  identifier _typespec identifier
     {367, 3}, // 60: _polyspecs (';') ->  _polyspecs ';' _polyspec
     {367, 1}, // 61: _polyspecs ->  _polyspec
     {368, 2}, // 62: _directiveSpec (STRING) ->  _baseclass_header STRING
     {368, 2}, // 63: _directiveSpec (STRING) ->  _baseclass_preinclude STRING
     {368, 2}, // 64: _directiveSpec (STRING) ->  _class_header STRING
     {368, 2}, // 65: _directiveSpec (IDENTIFIER) ->  _class_name IDENTIFIER
     {368, 1}, // 66: _directiveSpec (DEBUGFLAG) ->  DEBUGFLAG
     {368, 1}, // 67: _directiveSpec (PROMPT) ->  PROMPT
     {368, 1}, // 68: _directiveSpec (THREAD_SAFE) ->  THREAD_SAFE
     {368, 1}, // 69: _directiveSpec (ERROR_VERBOSE) ->  ERROR_VERBOSE
     {368, 2}, // 70: _directiveSpec (NUMBER) ->  _expect NUMBER
     {368, 2}, // 71: _directiveSpec (STRING) ->  _filenames STRING
     {368, 1}, // 72: _directiveSpec (FLEX) ->  FLEX
     {368, 2}, // 73: _directiveSpec (STRING) ->  _implementation_header STRING
     {368, 4}, // 74: _directiveSpec ->  _left _incrementPrecedence optTypename _symbols
     {368, 3}, // 75: _directiveSpec (BLOCK) ->  _locationstruct BLOCK optSemiCol
     {368, 1}, // 76: _directiveSpec (LSP_NEEDED) ->  LSP_NEEDED
     {368, 2}, // 77: _directiveSpec (STRING) ->  _ltype STRING
     {368, 2}, // 78: _directiveSpec (IDENTIFIER) ->  _namespace IDENTIFIER
     {368, 1}, // 79: _directiveSpec (NEG_DOLLAR) ->  NEG_DOLLAR
     {368, 1}, // 80: _directiveSpec (NOLINES) ->  NOLINES
     {368, 4}, // 81: _directiveSpec ->  _nonassoc _incrementPrecedence optTypename _symbols
     {368, 2}, // 82: _directiveSpec (STRING) ->  _parsefun_source STRING
     {368, 1}, // 83: _directiveSpec (PRINT_TOKENS) ->  PRINT_TOKENS
     {368, 2}, // 84: _directiveSpec (NUMBER) ->  _required NUMBER
     {368, 4}, // 85: _directiveSpec ->  _right _incrementPrecedence optTypename _symbols
     {368, 2}, // 86: _directiveSpec (STRING) ->  _scanner STRING
     {368, 2}, // 87: _directiveSpec (STRING) ->  _scanner_class_name STRING
     {368, 2}, // 88: _directiveSpec (STRING) ->  _scanner_token_function STRING
     {368, 2}, // 89: _directiveSpec (STRING) ->  _scanner_matched_text_function STRING
     {368, 2}, // 90: _directiveSpec (NUMBER) ->  _stack_expansion NUMBER
     {368, 2}, // 91: _directiveSpec (IDENTIFIER) ->  _start IDENTIFIER
     {368, 2}, // 92: _directiveSpec (STRING) ->  _stype STRING
     {368, 2}, // 93: _directiveSpec (STRING) ->  _target_directory STRING
     {368, 4}, // 94: _directiveSpec ->  _token optTypename _pushPrecedence _symbols
     {368, 2}, // 95: _directiveSpec (IDENTIFIER) ->  _token_class IDENTIFIER
     {368, 2}, // 96: _directiveSpec (IDENTIFIER) ->  _token_namespace IDENTIFIER
     {368, 2}, // 97: _directiveSpec (STRING) ->  _token_path STRING
     {368, 3}, // 98: _directiveSpec ->  _type typename _symbols
     {368, 3}, // 99: _directiveSpec (BLOCK) ->  _union BLOCK optSemiCol
     {368, 2}, // 100: _directiveSpec (IDENTIFIER) ->  _default_actions IDENTIFIER
     {368, 2}, // 101: _directiveSpec (IDENTIFIER) ->  _constructor_checks IDENTIFIER
     {368, 3}, // 102: _directiveSpec ->  _polymorphic _polyspecs optSemiCol
     {368, 1}, // 103: _directiveSpec (WEAK_TAGS) ->  WEAK_TAGS
     {368, 2}, // 104: _directiveSpec (IDENTIFIER) ->  _tag_mismatches IDENTIFIER
     {368, 1}, // 105: _directiveSpec (errTok_) ->  errTok_
     {369, 1}, // 106: _directive ->  _directiveSpec
     {314, 2}, // 107: directives ->  directives _directive
     {314, 0}, // 108: directives ->  <empty>
     {370, 1}, // 109: _precSpec (IDENTIFIER) ->  IDENTIFIER
     {370, 1}, // 110: _precSpec (QUOTE) ->  QUOTE
     {371, 1}, // 111: _productionElement (QUOTE) ->  QUOTE
     {371, 1}, // 112: _productionElement (IDENTIFIER) ->  IDENTIFIER
     {371, 1}, // 113: _productionElement (BLOCK) ->  BLOCK
     {371, 2}, // 114: _productionElement (PREC) ->  PREC _precSpec
     {372, 2}, // 115: _productionElements ->  _productionElements _productionElement
     {372, 1}, // 116: _productionElements ->  _productionElement
     {373, 1}, // 117: _production ->  _productionElements
     {373, 0}, // 118: _production ->  <empty>
     {374, 1}, // 119: _productionSeparator ('|') ->  '|'
     {375, 3}, // 120: _productionList ->  _productionList _productionSeparator _production
     {375, 1}, // 121: _productionList ->  _production
     {376, 2}, // 122: _ruleName (':') ->  identifier ':'
     {377, 3}, // 123: _rule (';') ->  _ruleName _productionList ';'
     {316, 2}, // 124: rules ->  rules _rule
     {316, 0}, // 125: rules ->  <empty>
     {378, 1}, // 126: input_$ ->  input
};

// State info and SR_ transitions for each state.


SR_ s_0[] =
{
    { { DEF_RED}, {    3} },              
    { {     313}, {    1} }, // input     
    { {     314}, {    2} }, // directives
    { {       0}, { -108} },              
};

SR_ s_1[] =
{
    { { REQ_TOKEN}, {       2} }, 
    { {      EOF_}, { ACCEPT_} }, 
    { {         0}, {       0} }, 
};

SR_ s_2[] =
{
    { { ERR_REQ}, { 82} },                                  
    { {     315}, {  3} }, // _two_percents                 
    { {     369}, {  4} }, // _directive                    
    { {     297}, {  5} }, // TWO_PERCENTS                  
    { {     368}, {  6} }, // _directiveSpec                
    { {     325}, {  7} }, // _baseclass_header             
    { {     326}, {  8} }, // _baseclass_preinclude         
    { {     327}, {  9} }, // _class_header                 
    { {     328}, { 10} }, // _class_name                   
    { {     263}, { 11} }, // DEBUGFLAG                     
    { {     302}, { 12} }, // PROMPT                        
    { {     303}, { 13} }, // THREAD_SAFE                   
    { {     265}, { 14} }, // ERROR_VERBOSE                 
    { {     329}, { 15} }, // _expect                       
    { {     330}, { 16} }, // _filenames                    
    { {     268}, { 17} }, // FLEX                          
    { {     331}, { 18} }, // _implementation_header        
    { {     333}, { 19} }, // _left                         
    { {     335}, { 20} }, // _locationstruct               
    { {     273}, { 21} }, // LSP_NEEDED                    
    { {     336}, { 22} }, // _ltype                        
    { {     337}, { 23} }, // _namespace                    
    { {     276}, { 24} }, // NEG_DOLLAR                    
    { {     277}, { 25} }, // NOLINES                       
    { {     338}, { 26} }, // _nonassoc                     
    { {     339}, { 27} }, // _parsefun_source              
    { {     283}, { 28} }, // PRINT_TOKENS                  
    { {     341}, { 29} }, // _required                     
    { {     342}, { 30} }, // _right                        
    { {     343}, { 31} }, // _scanner                      
    { {     344}, { 32} }, // _scanner_class_name           
    { {     345}, { 33} }, // _scanner_token_function       
    { {     346}, { 34} }, // _scanner_matched_text_function
    { {     347}, { 35} }, // _stack_expansion              
    { {     348}, { 36} }, // _start                        
    { {     355}, { 37} }, // _stype                        
    { {     353}, { 38} }, // _target_directory             
    { {     356}, { 39} }, // _token                        
    { {     357}, { 40} }, // _token_class                  
    { {     358}, { 41} }, // _token_namespace              
    { {     359}, { 42} }, // _token_path                   
    { {     354}, { 43} }, // _type                         
    { {     360}, { 44} }, // _union                        
    { {     361}, { 45} }, // _default_actions              
    { {     362}, { 46} }, // _constructor_checks           
    { {     364}, { 47} }, // _polymorphic                  
    { {     301}, { 48} }, // WEAK_TAGS                     
    { {     363}, { 49} }, // _tag_mismatches               
    { { errTok_}, { 50} }, // errTok_                       
    { {     257}, { 51} }, // BASECLASS_HEADER              
    { {     258}, { 52} }, // BASECLASS_PREINCLUDE          
    { {     260}, { 53} }, // CLASS_HEADER                  
    { {     261}, { 54} }, // CLASS_NAME                    
    { {     266}, { 55} }, // EXPECT                        
    { {     267}, { 56} }, // FILENAMES                     
    { {     270}, { 57} }, // IMPLEMENTATION_HEADER         
    { {     271}, { 58} }, // LEFT                          
    { {     272}, { 59} }, // LOCATIONSTRUCT                
    { {     274}, { 60} }, // LTYPE                         
    { {     275}, { 61} }, // NAMESPACE                     
    { {     278}, { 62} }, // NONASSOC                      
    { {     280}, { 63} }, // PARSEFUN_SOURCE               
    { {     285}, { 64} }, // REQUIRED                      
    { {     286}, { 65} }, // RIGHT                         
    { {     287}, { 66} }, // SCANNER                       
    { {     288}, { 67} }, // SCANNER_CLASS_NAME            
    { {     290}, { 68} }, // SCANNER_TOKEN_FUNCTION        
    { {     289}, { 69} }, // SCANNER_MATCHED_TEXT_FUNCTION 
    { {     291}, { 70} }, // STACK_EXPANSION               
    { {     292}, { 71} }, // START                         
    { {     294}, { 72} }, // STYPE                         
    { {     295}, { 73} }, // TARGET_DIRECTORY              
    { {     296}, { 74} }, // TOKEN                         
    { {     304}, { 75} }, // TOKEN_CLASS                   
    { {     305}, { 76} }, // TOKEN_NAMESPACE               
    { {     306}, { 77} }, // TOKEN_PATH                    
    { {     298}, { 78} }, // TYPE                          
    { {     299}, { 79} }, // UNION                         
    { {     264}, { 80} }, // DEFAULT_ACTIONS               
    { {     262}, { 81} }, // CONSTRUCTOR_CHECKS            
    { {     281}, { 82} }, // POLYMORPHIC                   
    { {     300}, { 83} }, // WARN_TAGS                     
    { {       0}, {  0} },                                  
};

SR_ s_3[] =
{
    { { DEF_RED}, {    2} },         
    { {     316}, {   84} }, // rules
    { {       0}, { -125} },         
};

SR_ s_4[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -107} }, 
};

SR_ s_5[] =
{
    { { DEF_RED}, {  1} }, 
    { {       0}, { -2} }, 
};

SR_ s_6[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -106} }, 
};

SR_ s_7[] =
{
    { { REQ_TOKEN}, {  2} },          
    { {       293}, { 85} }, // STRING
    { {         0}, {  0} },          
};

SR_ s_8[] =
{
    { { REQ_TOKEN}, {  2} },          
    { {       293}, { 86} }, // STRING
    { {         0}, {  0} },          
};

SR_ s_9[] =
{
    { { REQ_TOKEN}, {  2} },          
    { {       293}, { 87} }, // STRING
    { {         0}, {  0} },          
};

SR_ s_10[] =
{
    { { REQ_TOKEN}, {  2} },              
    { {       269}, { 88} }, // IDENTIFIER
    { {         0}, {  0} },              
};

SR_ s_11[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -66} }, 
};

SR_ s_12[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -67} }, 
};

SR_ s_13[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -68} }, 
};

SR_ s_14[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -69} }, 
};

SR_ s_15[] =
{
    { { REQ_TOKEN}, {  2} },          
    { {       279}, { 89} }, // NUMBER
    { {         0}, {  0} },          
};

SR_ s_16[] =
{
    { { REQ_TOKEN}, {  2} },          
    { {       293}, { 90} }, // STRING
    { {         0}, {  0} },          
};

SR_ s_17[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -72} }, 
};

SR_ s_18[] =
{
    { { REQ_TOKEN}, {  2} },          
    { {       293}, { 91} }, // STRING
    { {         0}, {  0} },          
};

SR_ s_19[] =
{
    { { DEF_RED}, {   2} },                        
    { {     332}, {  92} }, // _incrementPrecedence
    { {       0}, { -23} },                        
};

SR_ s_20[] =
{
    { { REQ_TOKEN}, {  2} },         
    { {       259}, { 93} }, // BLOCK
    { {         0}, {  0} },         
};

SR_ s_21[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -76} }, 
};

SR_ s_22[] =
{
    { { REQ_TOKEN}, {  2} },          
    { {       293}, { 94} }, // STRING
    { {         0}, {  0} },          
};

SR_ s_23[] =
{
    { { REQ_TOKEN}, {  2} },              
    { {       269}, { 95} }, // IDENTIFIER
    { {         0}, {  0} },              
};

SR_ s_24[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -79} }, 
};

SR_ s_25[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -80} }, 
};

SR_ s_26[] =
{
    { { DEF_RED}, {   2} },                        
    { {     332}, {  96} }, // _incrementPrecedence
    { {       0}, { -23} },                        
};

SR_ s_27[] =
{
    { { REQ_TOKEN}, {  2} },          
    { {       293}, { 97} }, // STRING
    { {         0}, {  0} },          
};

SR_ s_28[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -83} }, 
};

SR_ s_29[] =
{
    { { REQ_TOKEN}, {  2} },          
    { {       279}, { 98} }, // NUMBER
    { {         0}, {  0} },          
};

SR_ s_30[] =
{
    { { DEF_RED}, {   2} },                        
    { {     332}, {  99} }, // _incrementPrecedence
    { {       0}, { -23} },                        
};

SR_ s_31[] =
{
    { { REQ_TOKEN}, {   2} },          
    { {       293}, { 100} }, // STRING
    { {         0}, {   0} },          
};

SR_ s_32[] =
{
    { { REQ_TOKEN}, {   2} },          
    { {       293}, { 101} }, // STRING
    { {         0}, {   0} },          
};

SR_ s_33[] =
{
    { { REQ_TOKEN}, {   2} },          
    { {       293}, { 102} }, // STRING
    { {         0}, {   0} },          
};

SR_ s_34[] =
{
    { { REQ_TOKEN}, {   2} },          
    { {       293}, { 103} }, // STRING
    { {         0}, {   0} },          
};

SR_ s_35[] =
{
    { { REQ_TOKEN}, {   2} },          
    { {       279}, { 104} }, // NUMBER
    { {         0}, {   0} },          
};

SR_ s_36[] =
{
    { { REQ_TOKEN}, {   2} },              
    { {       269}, { 105} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_37[] =
{
    { { REQ_TOKEN}, {   2} },          
    { {       293}, { 106} }, // STRING
    { {         0}, {   0} },          
};

SR_ s_38[] =
{
    { { REQ_TOKEN}, {   2} },          
    { {       293}, { 107} }, // STRING
    { {         0}, {   0} },          
};

SR_ s_39[] =
{
    { { REQ_DEF}, {   5} },               
    { {     324}, { 108} }, // optTypename
    { {     319}, { 109} }, // typename   
    { {     323}, { 110} }, // _tokenname 
    { {      60}, { 111} }, // '<'        
    { {       0}, { -11} },               
};

SR_ s_40[] =
{
    { { REQ_TOKEN}, {   2} },              
    { {       269}, { 112} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_41[] =
{
    { { REQ_TOKEN}, {   2} },              
    { {       269}, { 113} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_42[] =
{
    { { REQ_TOKEN}, {   2} },          
    { {       293}, { 114} }, // STRING
    { {         0}, {   0} },          
};

SR_ s_43[] =
{
    { { REQ_TOKEN}, {   3} },            
    { {       319}, { 115} }, // typename
    { {        60}, { 111} }, // '<'     
    { {         0}, {   0} },            
};

SR_ s_44[] =
{
    { { REQ_TOKEN}, {   2} },         
    { {       259}, { 116} }, // BLOCK
    { {         0}, {   0} },         
};

SR_ s_45[] =
{
    { { REQ_TOKEN}, {   2} },              
    { {       269}, { 117} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_46[] =
{
    { { REQ_TOKEN}, {   2} },              
    { {       269}, { 118} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_47[] =
{
    { { REQ_TOKEN}, {   5} },              
    { {       367}, { 119} }, // _polyspecs
    { {       366}, { 120} }, // _polyspec 
    { {       318}, { 121} }, // identifier
    { {       269}, { 122} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_48[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -103} }, 
};

SR_ s_49[] =
{
    { { REQ_TOKEN}, {   2} },              
    { {       269}, { 123} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_50[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -105} }, 
};

SR_ s_51[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -16} }, 
};

SR_ s_52[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -17} }, 
};

SR_ s_53[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -18} }, 
};

SR_ s_54[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -19} }, 
};

SR_ s_55[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -20} }, 
};

SR_ s_56[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -21} }, 
};

SR_ s_57[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -22} }, 
};

SR_ s_58[] =
{
    { { DEF_RED}, {   2} },               
    { {     334}, { 124} }, // _typesymbol
    { {       0}, { -48} },               
};

SR_ s_59[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -25} }, 
};

SR_ s_60[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -26} }, 
};

SR_ s_61[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -27} }, 
};

SR_ s_62[] =
{
    { { DEF_RED}, {   2} },               
    { {     334}, { 125} }, // _typesymbol
    { {       0}, { -48} },               
};

SR_ s_63[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -29} }, 
};

SR_ s_64[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -31} }, 
};

SR_ s_65[] =
{
    { { DEF_RED}, {   2} },               
    { {     334}, { 126} }, // _typesymbol
    { {       0}, { -48} },               
};

SR_ s_66[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -33} }, 
};

SR_ s_67[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -34} }, 
};

SR_ s_68[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -35} }, 
};

SR_ s_69[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -36} }, 
};

SR_ s_70[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -37} }, 
};

SR_ s_71[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -38} }, 
};

SR_ s_72[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -47} }, 
};

SR_ s_73[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -45} }, 
};

SR_ s_74[] =
{
    { { DEF_RED}, {   2} },               
    { {     334}, { 127} }, // _typesymbol
    { {       0}, { -48} },               
};

SR_ s_75[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -50} }, 
};

SR_ s_76[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -51} }, 
};

SR_ s_77[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -52} }, 
};

SR_ s_78[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -46} }, 
};

SR_ s_79[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -53} }, 
};

SR_ s_80[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -54} }, 
};

SR_ s_81[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -55} }, 
};

SR_ s_82[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -57} }, 
};

SR_ s_83[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -56} }, 
};

SR_ s_84[] =
{
    { { REQ_DEF}, {   7} },                   
    { {     317}, { 128} }, // optTwo_percents
    { {     377}, { 129} }, // _rule          
    { {     297}, { 130} }, // TWO_PERCENTS   
    { {     376}, { 131} }, // _ruleName      
    { {     318}, { 132} }, // identifier     
    { {     269}, { 122} }, // IDENTIFIER     
    { {       0}, { -15} },                   
};

SR_ s_85[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -62} }, 
};

SR_ s_86[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -63} }, 
};

SR_ s_87[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -64} }, 
};

SR_ s_88[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -65} }, 
};

SR_ s_89[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -70} }, 
};

SR_ s_90[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -71} }, 
};

SR_ s_91[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -73} }, 
};

SR_ s_92[] =
{
    { { REQ_DEF}, {   5} },               
    { {     324}, { 133} }, // optTypename
    { {     319}, { 109} }, // typename   
    { {     323}, { 110} }, // _tokenname 
    { {      60}, { 111} }, // '<'        
    { {       0}, { -11} },               
};

SR_ s_93[] =
{
    { { REQ_DEF}, {   3} },              
    { {     322}, { 134} }, // optSemiCol
    { {      59}, { 135} }, // ';'       
    { {       0}, { -10} },              
};

SR_ s_94[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -77} }, 
};

SR_ s_95[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -78} }, 
};

SR_ s_96[] =
{
    { { REQ_DEF}, {   5} },               
    { {     324}, { 136} }, // optTypename
    { {     319}, { 109} }, // typename   
    { {     323}, { 110} }, // _tokenname 
    { {      60}, { 111} }, // '<'        
    { {       0}, { -11} },               
};

SR_ s_97[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -82} }, 
};

SR_ s_98[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -84} }, 
};

SR_ s_99[] =
{
    { { REQ_DEF}, {   5} },               
    { {     324}, { 137} }, // optTypename
    { {     319}, { 109} }, // typename   
    { {     323}, { 110} }, // _tokenname 
    { {      60}, { 111} }, // '<'        
    { {       0}, { -11} },               
};

SR_ s_100[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -86} }, 
};

SR_ s_101[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -87} }, 
};

SR_ s_102[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -88} }, 
};

SR_ s_103[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -89} }, 
};

SR_ s_104[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -90} }, 
};

SR_ s_105[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -91} }, 
};

SR_ s_106[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -92} }, 
};

SR_ s_107[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -93} }, 
};

SR_ s_108[] =
{
    { { DEF_RED}, {   2} },                   
    { {     340}, { 138} }, // _pushPrecedence
    { {       0}, { -30} },                   
};

SR_ s_109[] =
{
    { { DEF_RED}, {   2} },              
    { {     323}, { 139} }, // _tokenname
    { {       0}, { -11} },              
};

SR_ s_110[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -13} }, 
};

SR_ s_111[] =
{
    { { REQ_TOKEN}, {   3} },              
    { {       318}, { 140} }, // identifier
    { {       269}, { 122} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_112[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -95} }, 
};

SR_ s_113[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -96} }, 
};

SR_ s_114[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -97} }, 
};

SR_ s_115[] =
{
    { { DEF_RED}, {   3} },               
    { {     352}, { 141} }, // _symbols   
    { {     349}, { 142} }, // _symbol_exp
    { {       0}, { -39} },               
};

SR_ s_116[] =
{
    { { REQ_DEF}, {   3} },              
    { {     322}, { 143} }, // optSemiCol
    { {      59}, { 135} }, // ';'       
    { {       0}, { -10} },              
};

SR_ s_117[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -100} }, 
};

SR_ s_118[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -101} }, 
};

SR_ s_119[] =
{
    { { REQ_DEF}, {   3} },              
    { {     322}, { 144} }, // optSemiCol
    { {      59}, { 145} }, // ';'       
    { {       0}, { -10} },              
};

SR_ s_120[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -61} }, 
};

SR_ s_121[] =
{
    { { REQ_TOKEN}, {   3} },             
    { {       365}, { 146} }, // _typespec
    { {        58}, { 147} }, // ':'      
    { {         0}, {   0} },             
};

SR_ s_122[] =
{
    { { DEF_RED}, {  1} }, 
    { {       0}, { -3} }, 
};

SR_ s_123[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -104} }, 
};

SR_ s_124[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -24} }, 
};

SR_ s_125[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -28} }, 
};

SR_ s_126[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -32} }, 
};

SR_ s_127[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -49} }, 
};

SR_ s_128[] =
{
    { { DEF_RED}, {  1} }, 
    { {       0}, { -1} }, 
};

SR_ s_129[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -124} }, 
};

SR_ s_130[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -14} }, 
};

SR_ s_131[] =
{
    { { REQ_DEF}, {    9} },                       
    { {     375}, {  148} }, // _productionList    
    { {     373}, {  149} }, // _production        
    { {     372}, {  150} }, // _productionElements
    { {     371}, {  151} }, // _productionElement 
    { {     284}, {  152} }, // QUOTE              
    { {     269}, {  153} }, // IDENTIFIER         
    { {     259}, {  154} }, // BLOCK              
    { {     282}, {  155} }, // PREC               
    { {       0}, { -118} },                       
};

SR_ s_132[] =
{
    { { REQ_TOKEN}, {   2} },       
    { {        58}, { 156} }, // ':'
    { {         0}, {   0} },       
};

SR_ s_133[] =
{
    { { DEF_RED}, {   3} },               
    { {     352}, { 157} }, // _symbols   
    { {     349}, { 142} }, // _symbol_exp
    { {       0}, { -39} },               
};

SR_ s_134[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -75} }, 
};

SR_ s_135[] =
{
    { { DEF_RED}, {  1} }, 
    { {       0}, { -9} }, 
};

SR_ s_136[] =
{
    { { DEF_RED}, {   3} },               
    { {     352}, { 158} }, // _symbols   
    { {     349}, { 142} }, // _symbol_exp
    { {       0}, { -39} },               
};

SR_ s_137[] =
{
    { { DEF_RED}, {   3} },               
    { {     352}, { 159} }, // _symbols   
    { {     349}, { 142} }, // _symbol_exp
    { {       0}, { -39} },               
};

SR_ s_138[] =
{
    { { DEF_RED}, {   3} },               
    { {     352}, { 160} }, // _symbols   
    { {     349}, { 142} }, // _symbol_exp
    { {       0}, { -39} },               
};

SR_ s_139[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -12} }, 
};

SR_ s_140[] =
{
    { { REQ_TOKEN}, {   2} },       
    { {        62}, { 161} }, // '>'
    { {         0}, {   0} },       
};

SR_ s_141[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -98} }, 
};

SR_ s_142[] =
{
    { { REQ_TOKEN}, {   6} },               
    { {       351}, { 162} }, // _symbolList
    { {       350}, { 163} }, // _symbol    
    { {       284}, { 164} }, // QUOTE      
    { {       318}, { 165} }, // identifier 
    { {       269}, { 122} }, // IDENTIFIER 
    { {         0}, {   0} },               
};

SR_ s_143[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -99} }, 
};

SR_ s_144[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -102} }, 
};

SR_ s_145[] =
{
    { { REQ_DEF}, {   4} },              
    { {     366}, { 166} }, // _polyspec 
    { {     318}, { 121} }, // identifier
    { {     269}, { 122} }, // IDENTIFIER
    { {       0}, {  -9} },              
};

SR_ s_146[] =
{
    { { REQ_TOKEN}, {   3} },              
    { {       318}, { 167} }, // identifier
    { {       269}, { 122} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_147[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -58} }, 
};

SR_ s_148[] =
{
    { { REQ_TOKEN}, {   4} },                        
    { {        59}, { 168} }, // ';'                 
    { {       374}, { 169} }, // _productionSeparator
    { {       124}, { 170} }, // '|'                 
    { {         0}, {   0} },                        
};

SR_ s_149[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -121} }, 
};

SR_ s_150[] =
{
    { { REQ_DEF}, {    6} },                      
    { {     371}, {  171} }, // _productionElement
    { {     284}, {  152} }, // QUOTE             
    { {     269}, {  153} }, // IDENTIFIER        
    { {     259}, {  154} }, // BLOCK             
    { {     282}, {  155} }, // PREC              
    { {       0}, { -117} },                      
};

SR_ s_151[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -116} }, 
};

SR_ s_152[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -111} }, 
};

SR_ s_153[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -112} }, 
};

SR_ s_154[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -113} }, 
};

SR_ s_155[] =
{
    { { REQ_TOKEN}, {   4} },              
    { {       370}, { 172} }, // _precSpec 
    { {       269}, { 173} }, // IDENTIFIER
    { {       284}, { 174} }, // QUOTE     
    { {         0}, {   0} },              
};

SR_ s_156[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -122} }, 
};

SR_ s_157[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -74} }, 
};

SR_ s_158[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -81} }, 
};

SR_ s_159[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -85} }, 
};

SR_ s_160[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -94} }, 
};

SR_ s_161[] =
{
    { { DEF_RED}, {  1} }, 
    { {       0}, { -4} }, 
};

SR_ s_162[] =
{
    { { REQ_DEF}, {  50} },                                 
    { {     322}, { 175} }, // optSemiCol                   
    { {     320}, { 176} }, // optComma                     
    { {      59}, { 135} }, // ';'                          
    { {      44}, { 177} }, // ','                          
    { { errTok_}, { -10} }, // errTok_                      
    { {     257}, { -10} }, // BASECLASS_HEADER             
    { {     258}, { -10} }, // BASECLASS_PREINCLUDE         
    { {     260}, { -10} }, // CLASS_HEADER                 
    { {     261}, { -10} }, // CLASS_NAME                   
    { {     262}, { -10} }, // CONSTRUCTOR_CHECKS           
    { {     263}, { -10} }, // DEBUGFLAG                    
    { {     264}, { -10} }, // DEFAULT_ACTIONS              
    { {     265}, { -10} }, // ERROR_VERBOSE                
    { {     266}, { -10} }, // EXPECT                       
    { {     267}, { -10} }, // FILENAMES                    
    { {     268}, { -10} }, // FLEX                         
    { {     285}, { -10} }, // REQUIRED                     
    { {     270}, { -10} }, // IMPLEMENTATION_HEADER        
    { {     271}, { -10} }, // LEFT                         
    { {     272}, { -10} }, // LOCATIONSTRUCT               
    { {     273}, { -10} }, // LSP_NEEDED                   
    { {     274}, { -10} }, // LTYPE                        
    { {     275}, { -10} }, // NAMESPACE                    
    { {     276}, { -10} }, // NEG_DOLLAR                   
    { {     277}, { -10} }, // NOLINES                      
    { {     278}, { -10} }, // NONASSOC                     
    { {     280}, { -10} }, // PARSEFUN_SOURCE              
    { {     281}, { -10} }, // POLYMORPHIC                  
    { {     283}, { -10} }, // PRINT_TOKENS                 
    { {     286}, { -10} }, // RIGHT                        
    { {     287}, { -10} }, // SCANNER                      
    { {     288}, { -10} }, // SCANNER_CLASS_NAME           
    { {     289}, { -10} }, // SCANNER_MATCHED_TEXT_FUNCTION
    { {     290}, { -10} }, // SCANNER_TOKEN_FUNCTION       
    { {     291}, { -10} }, // STACK_EXPANSION              
    { {     292}, { -10} }, // START                        
    { {     294}, { -10} }, // STYPE                        
    { {     295}, { -10} }, // TARGET_DIRECTORY             
    { {     296}, { -10} }, // TOKEN                        
    { {     297}, { -10} }, // TWO_PERCENTS                 
    { {     298}, { -10} }, // TYPE                         
    { {     299}, { -10} }, // UNION                        
    { {     300}, { -10} }, // WARN_TAGS                    
    { {     301}, { -10} }, // WEAK_TAGS                    
    { {     302}, { -10} }, // PROMPT                       
    { {     303}, { -10} }, // THREAD_SAFE                  
    { {     304}, { -10} }, // TOKEN_CLASS                  
    { {     305}, { -10} }, // TOKEN_NAMESPACE              
    { {     306}, { -10} }, // TOKEN_PATH                   
    { {       0}, {  -6} },                                 
};

SR_ s_163[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -43} }, 
};

SR_ s_164[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -40} }, 
};

SR_ s_165[] =
{
    { { REQ_DEF}, {   3} },             
    { {     321}, { 178} }, // optNumber
    { {     279}, { 179} }, // NUMBER   
    { {       0}, {  -8} },             
};

SR_ s_166[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -60} }, 
};

SR_ s_167[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -59} }, 
};

SR_ s_168[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -123} }, 
};

SR_ s_169[] =
{
    { { REQ_DEF}, {    8} },                       
    { {     373}, {  180} }, // _production        
    { {     372}, {  150} }, // _productionElements
    { {     371}, {  151} }, // _productionElement 
    { {     284}, {  152} }, // QUOTE              
    { {     269}, {  153} }, // IDENTIFIER         
    { {     259}, {  154} }, // BLOCK              
    { {     282}, {  155} }, // PREC               
    { {       0}, { -118} },                       
};

SR_ s_170[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -119} }, 
};

SR_ s_171[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -115} }, 
};

SR_ s_172[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -114} }, 
};

SR_ s_173[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -109} }, 
};

SR_ s_174[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -110} }, 
};

SR_ s_175[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -44} }, 
};

SR_ s_176[] =
{
    { { REQ_TOKEN}, {   5} },              
    { {       350}, { 181} }, // _symbol   
    { {       284}, { 164} }, // QUOTE     
    { {       318}, { 165} }, // identifier
    { {       269}, { 122} }, // IDENTIFIER
    { {         0}, {   0} },              
};

SR_ s_177[] =
{
    { { DEF_RED}, {  1} }, 
    { {       0}, { -5} }, 
};

SR_ s_178[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -41} }, 
};

SR_ s_179[] =
{
    { { DEF_RED}, {  1} }, 
    { {       0}, { -7} }, 
};

SR_ s_180[] =
{
    { { DEF_RED}, {    1} }, 
    { {       0}, { -120} }, 
};

SR_ s_181[] =
{
    { { DEF_RED}, {   1} }, 
    { {       0}, { -42} }, 
};


// State array:
SR_ *s_state[] =
{
  s_0,  s_1,  s_2,  s_3,  s_4,  s_5,  s_6,  s_7,  s_8,  s_9,
  s_10,  s_11,  s_12,  s_13,  s_14,  s_15,  s_16,  s_17,  s_18,  s_19,
  s_20,  s_21,  s_22,  s_23,  s_24,  s_25,  s_26,  s_27,  s_28,  s_29,
  s_30,  s_31,  s_32,  s_33,  s_34,  s_35,  s_36,  s_37,  s_38,  s_39,
  s_40,  s_41,  s_42,  s_43,  s_44,  s_45,  s_46,  s_47,  s_48,  s_49,
  s_50,  s_51,  s_52,  s_53,  s_54,  s_55,  s_56,  s_57,  s_58,  s_59,
  s_60,  s_61,  s_62,  s_63,  s_64,  s_65,  s_66,  s_67,  s_68,  s_69,
  s_70,  s_71,  s_72,  s_73,  s_74,  s_75,  s_76,  s_77,  s_78,  s_79,
  s_80,  s_81,  s_82,  s_83,  s_84,  s_85,  s_86,  s_87,  s_88,  s_89,
  s_90,  s_91,  s_92,  s_93,  s_94,  s_95,  s_96,  s_97,  s_98,  s_99,
  s_100,  s_101,  s_102,  s_103,  s_104,  s_105,  s_106,  s_107,  s_108,  s_109,
  s_110,  s_111,  s_112,  s_113,  s_114,  s_115,  s_116,  s_117,  s_118,  s_119,
  s_120,  s_121,  s_122,  s_123,  s_124,  s_125,  s_126,  s_127,  s_128,  s_129,
  s_130,  s_131,  s_132,  s_133,  s_134,  s_135,  s_136,  s_137,  s_138,  s_139,
  s_140,  s_141,  s_142,  s_143,  s_144,  s_145,  s_146,  s_147,  s_148,  s_149,
  s_150,  s_151,  s_152,  s_153,  s_154,  s_155,  s_156,  s_157,  s_158,  s_159,
  s_160,  s_161,  s_162,  s_163,  s_164,  s_165,  s_166,  s_167,  s_168,  s_169,
  s_170,  s_171,  s_172,  s_173,  s_174,  s_175,  s_176,  s_177,  s_178,  s_179,
  s_180,  s_181,
};

} // anonymous namespace ends



// $insert polymorphicCode
namespace Meta_
{

size_t const *t_nErrors;
// $insert idoftag
char const *idOfTag_[] = {
    "SYMBOL",
    "TERMINAL",
    "BLOCK",
    "TEXT",
    "SIZE_T",
    "BOOL",
    "EndPolyType_"
};

size_t const *s_nErrors_;

Base::~Base()
{}

}   // namespace Meta_

// If the parsing function call (i.e., parse()' needs arguments, then provide
// an overloaded function.  The code below doesn't rely on parameters, so no
// arguments are required.  Furthermore, parse uses a function try block to
// allow us to do ACCEPT and ABORT from anywhere, even from within members
// called by actions, simply throwing the appropriate exceptions.


// base/base1
ParserBase::ParserBase()
:
    d_token(Reserved_::UNDETERMINED_),
    // $insert baseclasscode
    d_requiredTokens_(0)
{
    Meta_::t_nErrors = &d_nErrors_;
}

// base/clearin
void ParserBase::clearin_()
{
    d_nErrors_ = 0;
    d_stackIdx = -1;
    d_stateStack.clear();
    d_token = Reserved_::UNDETERMINED_;
    d_next = TokenPair{ Reserved_::UNDETERMINED_, STYPE_{} };
    d_recovery = false;
    d_acceptedTokens_ = d_requiredTokens_;
    d_val_ = STYPE_{};

    push_(0);
}

// base/debugfunctions

void ParserBase::setDebug(bool mode)
{
    d_actionCases_ = false;
    d_debug_ = mode;
}

void ParserBase::setDebug(DebugMode_ mode)
{
    d_actionCases_ = mode & ACTIONCASES;
    d_debug_ =       mode & ON;
}

// base/lex
void ParserBase::lex_(int token)
{
    d_token = token;

    if (d_token <= 0)
        d_token = Reserved_::EOF_;

    d_terminalToken = true;
}

// base/lookup
int ParserBase::lookup_() const
{
    // if the final transition is negative, then we should reduce by the rule
    // given by its positive value.

    SR_ const *sr = s_state[d_state];
    SR_ const *last = sr + sr->d_lastIdx;

    for ( ; ++sr != last; )           // visit all but the last SR entries
    {
        if (sr->d_token == d_token)
            return sr->d_action;
    }

    if (sr == last)   // reached the last element
    {
        if (sr->d_action < 0)   // default reduction
        {
            return sr->d_action;                
        }

        // No default reduction, so token not found, so error.
        throw UNEXPECTED_TOKEN_;
    }

    // not at the last element: inspect the nature of the action
    // (< 0: reduce, 0: ACCEPT, > 0: shift)

    int action = sr->d_action;


    return action;
}

// base/pop
void ParserBase::pop_(size_t count)
{
    if (d_stackIdx < static_cast<int>(count))
    {
        ABORT();
    }

    d_stackIdx -= count;
    d_state = d_stateStack[d_stackIdx].first;
    d_vsp = &d_stateStack[d_stackIdx];

}

// base/poptoken
void ParserBase::popToken_()
{
    d_token = d_next.first;
    d_val_ = d_token >= 0 ? std::move(d_next.second) : STYPE_{};

    d_next.first = Reserved_::UNDETERMINED_;
}

// base/push
void ParserBase::push_(size_t state)
{
    size_t currentSize = d_stateStack.size();
    if (stackSize_() == currentSize)
    {
        size_t newSize = currentSize + STACK_EXPANSION_;
        d_stateStack.resize(newSize);
    }

    ++d_stackIdx;
    d_stateStack[d_stackIdx] = 
                    StatePair{ d_state = state, std::move(d_val_) };

    d_vsp = &d_stateStack[d_stackIdx];

    if (d_stackIdx == 0)
    {
    }
    else
    {
    }
}

// base/pushtoken
void ParserBase::pushToken_(int token)
{
    d_next = TokenPair{ d_token, std::move(d_val_) };
    d_token = token;
}

// base/redotoken
void ParserBase::redoToken_()
{
    if (d_token != Reserved_::UNDETERMINED_)
        pushToken_(d_token);
}

// base/reduce
void ParserBase::reduce_(int rule)
{
    PI_ const &pi = s_productionInfo[rule];

    d_token = pi.d_nonTerm;
    pop_(pi.d_size);

    d_terminalToken = false;
}

// base/shift
void ParserBase::shift_(int action)
{
    push_(action);
    popToken_();               // token processed

    if (d_recovery and d_terminalToken)
    {
        d_recovery = false;
        d_acceptedTokens_ = 0;
    }
}

// base/startrecovery
void ParserBase::startRecovery_()
{
    int lastToken = d_token;                // give the unexpected token a
                                            // chance to be processed
                                            // again.

    pushToken_(Reserved_::errTok_);      // specify errTok_ as next token
    push_(lookup_());                     // push the error state

    d_token = lastToken;                    // reactivate the unexpected
                                            // token (we're now in an
                                            // ERROR state).

    d_recovery = true;
}

// base/top
inline size_t ParserBase::top_() const
{
    return d_stateStack[d_stackIdx].first;
}

// derived/errorrecovery
void Parser::errorRecovery_()
{
    // When an error has occurred, pop elements off the stack until the top
    // state has an error-item. If none is found, the default recovery
    // mode (which is to abort) is activated. 
    //
    // If EOF is encountered without being appropriate for the current state,
    // then the error recovery will fall back to the default recovery mode.
    // (i.e., parsing terminates)



    if (d_acceptedTokens_ >= d_requiredTokens_)// only generate an error-
    {                                           // message if enough tokens 
        ++d_nErrors_;                          // were accepted. Otherwise
        error();                                // simply skip input
    }

    // get the error state
    while (not (s_state[top_()][0].d_type & ERR_ITEM))
    {
        pop_();
    }

    // In the error state, looking up a token allows us to proceed.
    // Continuation may be require multiple reductions, but eventually a
    // terminal-token shift is used. See nextCycle_ for details.

    startRecovery_();
}

// derived/executeaction
void Parser::executeAction_(int production)
try
{
    if (token_() != Reserved_::UNDETERMINED_)
        pushToken_(token_());     // save an already available token
    switch (production)
    {
        // $insert actioncases
        
        case 2:
#line 48 "grammar"
        {
         expectRules();
         }
        break;

        case 3:
#line 3 "inc/identifier"
        {
         d_val_ = d_matched;
         }
        break;

        case 4:
#line 5 "inc/typename"
        {
         checkField(vs_(-1).get<Tag_::TEXT>()); 
         }
        break;

        case 7:
#line 9 "inc/opt"
        {
         d_val_ = true;
         }
        break;

        case 8:
#line 13 "inc/opt"
        {
         d_val_ = false;
         }
        break;

        case 11:
#line 25 "inc/opt"
        {
         d_expect = "token name";
         }
        break;

        case 13:
#line 35 "inc/opt"
        {
         d_field.clear();
         }
        break;

        case 14:
#line 42 "inc/opt"
        {
         wmsg << 
         "Ignoring all input beyond the second %% token" << endl;
         ACCEPT();
         }
        break;

        case 16:
#line 3 "inc/directives"
        {
         d_expect = "baseclass header name";
         }
        break;

        case 17:
#line 10 "inc/directives"
        {
         d_expect = "baseclass pre-include name";
         }
        break;

        case 18:
#line 17 "inc/directives"
        {
         d_expect = "class header name";
         }
        break;

        case 19:
#line 24 "inc/directives"
        {
         d_expect = "class name";
         }
        break;

        case 20:
#line 31 "inc/directives"
        {
         d_expect = "number (of conflicts)";
         }
        break;

        case 21:
#line 38 "inc/directives"
        {
         d_expect = "generic name of files";
         }
        break;

        case 22:
#line 45 "inc/directives"
        {
         d_expect = "implementation header name";
         }
        break;

        case 23:
#line 51 "inc/directives"
        {
         Terminal::incrementPrecedence();
         }
        break;

        case 24:
#line 59 "inc/directives"
        {
         d_association = Terminal::LEFT;
         }
        break;

        case 25:
#line 66 "inc/directives"
        {
         d_expect = "Location struct definition";
         }
        break;

        case 26:
#line 73 "inc/directives"
        {
         d_expect = "Location type specification";
         }
        break;

        case 27:
#line 80 "inc/directives"
        {
         d_expect = "Namespace identifier";
         }
        break;

        case 28:
#line 88 "inc/directives"
        {
         d_association = Terminal::NONASSOC;
         }
        break;

        case 29:
#line 95 "inc/directives"
        {
         d_expect = "File name for the parse() member";
         }
        break;

        case 30:
#line 101 "inc/directives"
        {
         d_val_ = Terminal::sPrecedence();
         Terminal::resetPrecedence();
         }
        break;

        case 31:
#line 109 "inc/directives"
        {
         d_expect = "Required number of tokens between errors";
         }
        break;

        case 32:
#line 117 "inc/directives"
        {
         d_association = Terminal::RIGHT;
         }
        break;

        case 33:
#line 124 "inc/directives"
        {
         d_expect = "Path to the scanner header filename";
         }
        break;

        case 34:
#line 131 "inc/directives"
        {
         d_expect = "Name of the Scanner class";
         }
        break;

        case 35:
#line 138 "inc/directives"
        {
         d_expect = "Scanner function returning the next token";
         }
        break;

        case 36:
#line 145 "inc/directives"
        {
         d_expect = "Scanner function returning the matched text";
         }
        break;

        case 37:
#line 152 "inc/directives"
        {
         d_expect = "Stack expansion size";
         }
        break;

        case 38:
#line 159 "inc/directives"
        {
         d_expect = "Start rule" ;
         }
        break;

        case 39:
#line 165 "inc/directives"
        {
         d_expect = "identifier or character-constant";
         }
        break;

        case 40:
#line 172 "inc/directives"
        {
         defineTerminal(d_scanner.canonicalQuote(), Symbol::CHAR_TERMINAL);
         }
        break;

        case 41:
#line 178 "inc/directives"
        { 
         defineTokenName(vs_(-1).get<Tag_::TEXT>(), vs_(0).get<Tag_::BOOL>()); 
         }
        break;

        case 45:
#line 197 "inc/directives"
        {
         d_expect = "target directory";
         }
        break;

        case 46:
#line 204 "inc/directives"
        {
         d_expect = "type-name";
         d_typeDirective = true;
         }
        break;

        case 47:
#line 212 "inc/directives"
        {
         d_expect = "STYPE type name" ;
         }
        break;

        case 48:
#line 218 "inc/directives"
        {
         d_expect = "opt. <type> identifier(s) or char constant(s)";
         }
        break;

        case 49:
#line 226 "inc/directives"
        {
         d_association = Terminal::UNDEFINED;
         }
        break;

        case 50:
#line 233 "inc/directives"
        {
         d_expect = "token class name";
         }
        break;

        case 51:
#line 240 "inc/directives"
        {
         d_expect = "token namespace";
         }
        break;

        case 52:
#line 247 "inc/directives"
        {
         d_expect = "path to the token file";
         }
        break;

        case 53:
#line 254 "inc/directives"
        {
         d_expect = "Semantic value union definition";
         }
        break;

        case 54:
#line 261 "inc/directives"
        {
         d_expect = "%default-actions on/off specification";
         }
        break;

        case 55:
#line 268 "inc/directives"
        {
         d_expect = "%constructor-checks  on/off specification";
         }
        break;

        case 56:
#line 275 "inc/directives"
        {
         d_expect = "%tag-mismatches on/off specification";
         }
        break;

        case 57:
#line 282 "inc/directives"
        {
         setPolymorphicDecl();
         }
        break;

        case 58:
#line 289 "inc/directives"
        {
         d_scanner.beginTypeSpec();
         }
        break;

        case 59:
#line 296 "inc/directives"
        {
         addPolymorphic(vs_(-2).get<Tag_::TEXT>(), vs_(0).get<Tag_::TEXT>());
         }
        break;

        case 62:
#line 311 "inc/directives"
        {
         d_options.setBaseClassHeader(); 
         }
        break;

        case 63:
#line 317 "inc/directives"
        {
         d_options.setPreInclude();
         }
        break;

        case 64:
#line 323 "inc/directives"
        {
         d_options.setClassHeader();
         }
        break;

        case 65:
#line 329 "inc/directives"
        {
         d_options.setClassName();
         }
        break;

        case 66:
#line 334 "inc/directives"
        {
         d_options.setGenDebug();
         }
        break;

        case 67:
#line 339 "inc/directives"
        {
         d_options.setPrompt();
         }
        break;

        case 68:
#line 344 "inc/directives"
        {
         d_options.setThreadSafe();
         }
        break;

        case 69:
#line 349 "inc/directives"
        {
         d_options.setErrorVerbose();
         }
        break;

        case 70:
#line 355 "inc/directives"
        {
         setExpectedConflicts();
         }
        break;

        case 71:
#line 361 "inc/directives"
        {
         d_options.setGenericFilename();
         }
        break;

        case 72:
#line 366 "inc/directives"
        {
         d_options.setFlex();
         }
        break;

        case 73:
#line 372 "inc/directives"
        {
         d_options.setImplementationHeader();
         }
        break;

        case 75:
#line 384 "inc/directives"
        {
         d_options.setLocationDecl(d_scanner.block().str());
         }
        break;

        case 76:
#line 389 "inc/directives"
        {
         d_options.setLspNeeded();
         }
        break;

        case 77:
#line 395 "inc/directives"
        {
         d_options.setLtype();
         }
        break;

        case 78:
#line 401 "inc/directives"
        {
         d_options.setNamespace();
         }
        break;

        case 79:
#line 406 "inc/directives"
        {
         setNegativeDollarIndices();
         }
        break;

        case 80:
#line 411 "inc/directives"
        {
         d_options.unsetLines();
         }
        break;

        case 82:
#line 422 "inc/directives"
        {
         d_options.setParsefunSource();
         }
        break;

        case 83:
#line 427 "inc/directives"
        {
         d_options.setPrintTokens();
         }
        break;

        case 84:
#line 433 "inc/directives"
        {
         d_options.setRequiredTokens(d_scanner.number());
         }
        break;

        case 86:
#line 444 "inc/directives"
        {
         d_options.setScannerInclude();
         }
        break;

        case 87:
#line 450 "inc/directives"
        {
         d_options.setScannerClassName();
         }
        break;

        case 88:
#line 456 "inc/directives"
        {
         d_options.setScannerTokenFunction();
         }
        break;

        case 89:
#line 462 "inc/directives"
        {
         d_options.setScannerMatchedTextFunction();
         }
        break;

        case 90:
#line 468 "inc/directives"
        {
         d_options.setStackExpansion(d_scanner.number());
         }
        break;

        case 91:
#line 474 "inc/directives"
        {
         setStart();
         }
        break;

        case 92:
#line 480 "inc/directives"
        {
         d_options.setStype();
         }
        break;

        case 93:
#line 486 "inc/directives"
        {
         d_options.setTargetDirectory();
         }
        break;

        case 94:
#line 494 "inc/directives"
        {
         Terminal::set_sPrecedence(vs_(-1).get<Tag_::SIZE_T>());
         }
        break;

        case 95:
#line 500 "inc/directives"
        {
         d_options.setTokenClass();
         }
        break;

        case 96:
#line 506 "inc/directives"
        {
         d_options.setTokenNameSpace();
         }
        break;

        case 97:
#line 512 "inc/directives"
        {
         d_options.setTokenPath();
         }
        break;

        case 99:
#line 523 "inc/directives"
        {
         setUnionDecl();
         }
        break;

        case 100:
#line 529 "inc/directives"
        {
         defaultAction();
         }
        break;

        case 101:
#line 535 "inc/directives"
        {
         constructorChecks();
         }
        break;

        case 103:
#line 544 "inc/directives"
        {
         d_options.unsetStrongTags();
         }
        break;

        case 104:
#line 550 "inc/directives"
        {
         warnTagMismatches();
         }
        break;

        case 106:
#line 560 "inc/directives"
        {
         d_expect.erase();
         d_typeDirective = false;
         }
        break;

        case 109:
#line 3 "inc/rules"
        {
         d_val_.assign<Tag_::SIZE_T>(IDENTIFIER);
         }
        break;

        case 110:
#line 8 "inc/rules"
        {
         d_val_.assign<Tag_::SIZE_T>(QUOTE);
         }
        break;

        case 111:
#line 15 "inc/rules"
        {
         d_val_ = useTerminal();
         }
        break;

        case 112:
#line 20 "inc/rules"
        {
         d_val_ = useSymbol();
         }
        break;

        case 113:
#line 25 "inc/rules"
        {
         d_val_ = d_scanner.block();
         }
        break;

        case 114:
#line 31 "inc/rules"
        {
         d_val_ = setPrecedence(vs_(0).get<Tag_::SIZE_T>());
         }
        break;

        case 115:
#line 38 "inc/rules"
        {
         d_val_ = handleProductionElements(vs_(-1), vs_(0));
         
         
         }
        break;

        case 116:
#line 45 "inc/rules"
        {
         d_val_ = vs_(0);
         }
        break;

        case 117:
#line 52 "inc/rules"
        {
         handleProductionElement(vs_(0));
         
         
         }
        break;

        case 118:
#line 58 "inc/rules"
        {
         
         
         checkEmptyBlocktype();
         }
        break;

        case 119:
#line 67 "inc/rules"
        {
         d_rules.addProduction(d_scanner.lineNr());
         }
        break;

        case 122:
#line 81 "inc/rules"
        {
         openRule(vs_(-1).get<Tag_::TEXT>());
         }
        break;

        case 123:
#line 90 "inc/rules"
        {
         updateDefaultActionLineNr();
         }
        break;

    }
}
catch (std::exception const &exc)
{
    exceptionHandler(exc);
}

// derived/nextcycle
void Parser::nextCycle_()
try
{
    if (s_state[state_()]->d_type & REQ_TOKEN)
        nextToken_();              // obtain next token


    int action = lookup_();        // lookup d_token in d_state

    if (action > 0)                 // SHIFT: push a new state
    {
        shift_(action);
        return;
    }

    if (action < 0)            // REDUCE: execute and pop.
    {

        if (recovery_())
            redoToken_();
        else
            executeAction_(-action);
                                            // next token is the rule's LHS
        reduce_(-action); 
        return;
    }

    if (recovery_())
        ABORT();
    else 
        ACCEPT();
}
catch (ErrorRecovery_)
{
    if (not recovery_())
        errorRecovery_();
    else
    {
        if (token_() == Reserved_::EOF_)
            ABORT();
        popToken_();               // skip the failing token
    }
}


// derived/nexttoken
void Parser::nextToken_()
{ 
    // If d_token is Reserved_::UNDETERMINED_ then if savedToken_() is
    // Reserved_::UNDETERMINED_ another token is obtained from lex(). Then
    // savedToken_() is assigned to d_token.

                                    // no need for a token: got one already
    if (token_() != Reserved_::UNDETERMINED_) 
    {
        return;                             
    }

    if (savedToken_() != Reserved_::UNDETERMINED_)
    {
        popToken_();               // consume pending token
    }
    else
    {
        ++d_acceptedTokens_;       // accept another token (see
                                    // errorRecover())
        lex_(lex());
        print_();
    }
    print();
}

// derived/print
void Parser::print_()
{
// $insert print
}

// derived/parse
int Parser::parse()
try 
{
    // The parsing algorithm:
    // Initially, state 0 is pushed on the stack, and all relevant variables
    // are initialized by Base::clearin_.
    //
    // Then, in an eternal loop:
    //
    //  1. If a state is a REQ_TOKEN type, then the next token is obtained
    //     from nextToken().  This may very well be the currently available
    //     token. When retrieving a terminal token d_terminal is set to true.
    //
    //  2. lookup() is called, d_token is looked up in the current state's
    //     SR_ array.
    //
    //  4. Depending on the result of the lookup() function the next state is
    //     shifted on the parser's stack, a reduction by some rule is applied,
    //     or the parsing function returns ACCEPT(). When a reduction is
    //     called for, any action that may have been defined for that
    //     reduction is executed.
    //
    //  5. An error occurs if d_token is not found, and the state has no
    //     default reduction.

    clearin_();                            // initialize, push(0)

    while (true)
    {
// $insert prompt
        nextCycle_();
    }
}
catch (Return_ retValue)
{
    return retValue or d_nErrors_;
}


// derived/tail