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
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
|
// A Bison parser, made by GNU Bison 3.8.2.
// Skeleton implementation for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
// under terms of your choice, so long as that work isn't itself a
// parser generator using the skeleton or a modified version thereof
// as a parser skeleton. Alternatively, if you modify or redistribute
// the parser skeleton itself, you may (at your option) remove this
// special exception, which will cause the skeleton and the resulting
// Bison output files to be licensed under the GNU General Public
// License without this special exception.
// This special exception was added by the Free Software Foundation in
// version 2.2 of Bison.
// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
// especially those whose name start with YY_ or yy_. They are
// private implementation details that can be changed or removed.
// Take the name prefix into account.
#define yylex d2_parser_lex
#include "d2_parser.h"
// Unqualified %code blocks.
#line 34 "d2_parser.yy"
#include <d2/parser_context.h>
// Avoid warnings with the error counter.
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#line 57 "d2_parser.cc"
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif
# endif
# ifndef YY_
# define YY_(msgid) msgid
# endif
#endif
// Whether we are compiled with exception support.
#ifndef YY_EXCEPTIONS
# if defined __GNUC__ && !defined __EXCEPTIONS
# define YY_EXCEPTIONS 0
# else
# define YY_EXCEPTIONS 1
# endif
#endif
#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
# ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
(Current).end = YYRHSLOC (Rhs, N).end; \
} \
else \
{ \
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
} \
while (false)
# endif
// Enable debugging if requested.
#if D2_PARSER_DEBUG
// A pseudo ostream that takes yydebug_ into account.
# define YYCDEBUG if (yydebug_) (*yycdebug_)
# define YY_SYMBOL_PRINT(Title, Symbol) \
do { \
if (yydebug_) \
{ \
*yycdebug_ << Title << ' '; \
yy_print_ (*yycdebug_, Symbol); \
*yycdebug_ << '\n'; \
} \
} while (false)
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug_) \
yy_reduce_print_ (Rule); \
} while (false)
# define YY_STACK_PRINT() \
do { \
if (yydebug_) \
yy_stack_print_ (); \
} while (false)
#else // !D2_PARSER_DEBUG
# define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol)
# define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
# define YY_STACK_PRINT() static_cast<void> (0)
#endif // !D2_PARSER_DEBUG
#define yyerrok (yyerrstatus_ = 0)
#define yyclearin (yyla.clear ())
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrorlab
#define YYRECOVERING() (!!yyerrstatus_)
#line 14 "d2_parser.yy"
namespace isc { namespace d2 {
#line 150 "d2_parser.cc"
/// Build a parser object.
D2Parser::D2Parser (isc::d2::D2ParserContext& ctx_yyarg)
#if D2_PARSER_DEBUG
: yydebug_ (false),
yycdebug_ (&std::cerr),
#else
:
#endif
ctx (ctx_yyarg)
{}
D2Parser::~D2Parser ()
{}
D2Parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
{}
/*---------.
| symbol. |
`---------*/
// by_state.
D2Parser::by_state::by_state () YY_NOEXCEPT
: state (empty_state)
{}
D2Parser::by_state::by_state (const by_state& that) YY_NOEXCEPT
: state (that.state)
{}
void
D2Parser::by_state::clear () YY_NOEXCEPT
{
state = empty_state;
}
void
D2Parser::by_state::move (by_state& that)
{
state = that.state;
that.clear ();
}
D2Parser::by_state::by_state (state_type s) YY_NOEXCEPT
: state (s)
{}
D2Parser::symbol_kind_type
D2Parser::by_state::kind () const YY_NOEXCEPT
{
if (state == empty_state)
return symbol_kind::S_YYEMPTY;
else
return YY_CAST (symbol_kind_type, yystos_[+state]);
}
D2Parser::stack_symbol_type::stack_symbol_type ()
{}
D2Parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
: super_type (YY_MOVE (that.state), YY_MOVE (that.location))
{
switch (that.kind ())
{
case symbol_kind::S_value: // value
case symbol_kind::S_map_value: // map_value
case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
case symbol_kind::S_control_socket_type_value: // control_socket_type_value
case symbol_kind::S_auth_type_value: // auth_type_value
value.YY_MOVE_OR_COPY< ElementPtr > (YY_MOVE (that.value));
break;
case symbol_kind::S_BOOLEAN: // "boolean"
value.YY_MOVE_OR_COPY< bool > (YY_MOVE (that.value));
break;
case symbol_kind::S_FLOAT: // "floating point"
value.YY_MOVE_OR_COPY< double > (YY_MOVE (that.value));
break;
case symbol_kind::S_INTEGER: // "integer"
value.YY_MOVE_OR_COPY< int64_t > (YY_MOVE (that.value));
break;
case symbol_kind::S_STRING: // "constant string"
value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value));
break;
default:
break;
}
#if 201103L <= YY_CPLUSPLUS
// that is emptied.
that.state = empty_state;
#endif
}
D2Parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
: super_type (s, YY_MOVE (that.location))
{
switch (that.kind ())
{
case symbol_kind::S_value: // value
case symbol_kind::S_map_value: // map_value
case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
case symbol_kind::S_control_socket_type_value: // control_socket_type_value
case symbol_kind::S_auth_type_value: // auth_type_value
value.move< ElementPtr > (YY_MOVE (that.value));
break;
case symbol_kind::S_BOOLEAN: // "boolean"
value.move< bool > (YY_MOVE (that.value));
break;
case symbol_kind::S_FLOAT: // "floating point"
value.move< double > (YY_MOVE (that.value));
break;
case symbol_kind::S_INTEGER: // "integer"
value.move< int64_t > (YY_MOVE (that.value));
break;
case symbol_kind::S_STRING: // "constant string"
value.move< std::string > (YY_MOVE (that.value));
break;
default:
break;
}
// that is emptied.
that.kind_ = symbol_kind::S_YYEMPTY;
}
#if YY_CPLUSPLUS < 201103L
D2Parser::stack_symbol_type&
D2Parser::stack_symbol_type::operator= (const stack_symbol_type& that)
{
state = that.state;
switch (that.kind ())
{
case symbol_kind::S_value: // value
case symbol_kind::S_map_value: // map_value
case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
case symbol_kind::S_control_socket_type_value: // control_socket_type_value
case symbol_kind::S_auth_type_value: // auth_type_value
value.copy< ElementPtr > (that.value);
break;
case symbol_kind::S_BOOLEAN: // "boolean"
value.copy< bool > (that.value);
break;
case symbol_kind::S_FLOAT: // "floating point"
value.copy< double > (that.value);
break;
case symbol_kind::S_INTEGER: // "integer"
value.copy< int64_t > (that.value);
break;
case symbol_kind::S_STRING: // "constant string"
value.copy< std::string > (that.value);
break;
default:
break;
}
location = that.location;
return *this;
}
D2Parser::stack_symbol_type&
D2Parser::stack_symbol_type::operator= (stack_symbol_type& that)
{
state = that.state;
switch (that.kind ())
{
case symbol_kind::S_value: // value
case symbol_kind::S_map_value: // map_value
case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
case symbol_kind::S_control_socket_type_value: // control_socket_type_value
case symbol_kind::S_auth_type_value: // auth_type_value
value.move< ElementPtr > (that.value);
break;
case symbol_kind::S_BOOLEAN: // "boolean"
value.move< bool > (that.value);
break;
case symbol_kind::S_FLOAT: // "floating point"
value.move< double > (that.value);
break;
case symbol_kind::S_INTEGER: // "integer"
value.move< int64_t > (that.value);
break;
case symbol_kind::S_STRING: // "constant string"
value.move< std::string > (that.value);
break;
default:
break;
}
location = that.location;
// that is emptied.
that.state = empty_state;
return *this;
}
#endif
template <typename Base>
void
D2Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
{
if (yymsg)
YY_SYMBOL_PRINT (yymsg, yysym);
}
#if D2_PARSER_DEBUG
template <typename Base>
void
D2Parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
{
std::ostream& yyoutput = yyo;
YY_USE (yyoutput);
if (yysym.empty ())
yyo << "empty symbol";
else
{
symbol_kind_type yykind = yysym.kind ();
yyo << (yykind < YYNTOKENS ? "token" : "nterm")
<< ' ' << yysym.name () << " ("
<< yysym.location << ": ";
switch (yykind)
{
case symbol_kind::S_STRING: // "constant string"
#line 144 "d2_parser.yy"
{ yyoutput << yysym.value.template as < std::string > (); }
#line 397 "d2_parser.cc"
break;
case symbol_kind::S_INTEGER: // "integer"
#line 144 "d2_parser.yy"
{ yyoutput << yysym.value.template as < int64_t > (); }
#line 403 "d2_parser.cc"
break;
case symbol_kind::S_FLOAT: // "floating point"
#line 144 "d2_parser.yy"
{ yyoutput << yysym.value.template as < double > (); }
#line 409 "d2_parser.cc"
break;
case symbol_kind::S_BOOLEAN: // "boolean"
#line 144 "d2_parser.yy"
{ yyoutput << yysym.value.template as < bool > (); }
#line 415 "d2_parser.cc"
break;
case symbol_kind::S_value: // value
#line 144 "d2_parser.yy"
{ yyoutput << yysym.value.template as < ElementPtr > (); }
#line 421 "d2_parser.cc"
break;
case symbol_kind::S_map_value: // map_value
#line 144 "d2_parser.yy"
{ yyoutput << yysym.value.template as < ElementPtr > (); }
#line 427 "d2_parser.cc"
break;
case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
#line 144 "d2_parser.yy"
{ yyoutput << yysym.value.template as < ElementPtr > (); }
#line 433 "d2_parser.cc"
break;
case symbol_kind::S_control_socket_type_value: // control_socket_type_value
#line 144 "d2_parser.yy"
{ yyoutput << yysym.value.template as < ElementPtr > (); }
#line 439 "d2_parser.cc"
break;
case symbol_kind::S_auth_type_value: // auth_type_value
#line 144 "d2_parser.yy"
{ yyoutput << yysym.value.template as < ElementPtr > (); }
#line 445 "d2_parser.cc"
break;
default:
break;
}
yyo << ')';
}
}
#endif
void
D2Parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
{
if (m)
YY_SYMBOL_PRINT (m, sym);
yystack_.push (YY_MOVE (sym));
}
void
D2Parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
{
#if 201103L <= YY_CPLUSPLUS
yypush_ (m, stack_symbol_type (s, std::move (sym)));
#else
stack_symbol_type ss (s, sym);
yypush_ (m, ss);
#endif
}
void
D2Parser::yypop_ (int n) YY_NOEXCEPT
{
yystack_.pop (n);
}
#if D2_PARSER_DEBUG
std::ostream&
D2Parser::debug_stream () const
{
return *yycdebug_;
}
void
D2Parser::set_debug_stream (std::ostream& o)
{
yycdebug_ = &o;
}
D2Parser::debug_level_type
D2Parser::debug_level () const
{
return yydebug_;
}
void
D2Parser::set_debug_level (debug_level_type l)
{
yydebug_ = l;
}
#endif // D2_PARSER_DEBUG
D2Parser::state_type
D2Parser::yy_lr_goto_state_ (state_type yystate, int yysym)
{
int yyr = yypgoto_[yysym - YYNTOKENS] + yystate;
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
return yytable_[yyr];
else
return yydefgoto_[yysym - YYNTOKENS];
}
bool
D2Parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT
{
return yyvalue == yypact_ninf_;
}
bool
D2Parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT
{
return yyvalue == yytable_ninf_;
}
int
D2Parser::operator() ()
{
return parse ();
}
int
D2Parser::parse ()
{
int yyn;
/// Length of the RHS of the rule being reduced.
int yylen = 0;
// Error handling.
int yynerrs_ = 0;
int yyerrstatus_ = 0;
/// The lookahead symbol.
symbol_type yyla;
/// The locations where the error started and ended.
stack_symbol_type yyerror_range[3];
/// The return value of parse ().
int yyresult;
#if YY_EXCEPTIONS
try
#endif // YY_EXCEPTIONS
{
YYCDEBUG << "Starting parse\n";
/* Initialize the stack. The initial state will be set in
yynewstate, since the latter expects the semantical and the
location values to have been already stored, initialize these
stacks with a primary value. */
yystack_.clear ();
yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
/*-----------------------------------------------.
| yynewstate -- push a new symbol on the stack. |
`-----------------------------------------------*/
yynewstate:
YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n';
YY_STACK_PRINT ();
// Accept?
if (yystack_[0].state == yyfinal_)
YYACCEPT;
goto yybackup;
/*-----------.
| yybackup. |
`-----------*/
yybackup:
// Try to take a decision without lookahead.
yyn = yypact_[+yystack_[0].state];
if (yy_pact_value_is_default_ (yyn))
goto yydefault;
// Read a lookahead token.
if (yyla.empty ())
{
YYCDEBUG << "Reading a token\n";
#if YY_EXCEPTIONS
try
#endif // YY_EXCEPTIONS
{
symbol_type yylookahead (yylex (ctx));
yyla.move (yylookahead);
}
#if YY_EXCEPTIONS
catch (const syntax_error& yyexc)
{
YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
error (yyexc);
goto yyerrlab1;
}
#endif // YY_EXCEPTIONS
}
YY_SYMBOL_PRINT ("Next token is", yyla);
if (yyla.kind () == symbol_kind::S_YYerror)
{
// The scanner already issued an error message, process directly
// to error recovery. But do not keep the error token as
// lookahead, it is too special and may lead us to an endless
// loop in error recovery. */
yyla.kind_ = symbol_kind::S_YYUNDEF;
goto yyerrlab1;
}
/* If the proper action on seeing token YYLA.TYPE is to reduce or
to detect an error, take that action. */
yyn += yyla.kind ();
if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ())
{
goto yydefault;
}
// Reduce or error.
yyn = yytable_[yyn];
if (yyn <= 0)
{
if (yy_table_value_is_error_ (yyn))
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
// Count tokens shifted since error; after three, turn off error status.
if (yyerrstatus_)
--yyerrstatus_;
// Shift the lookahead token.
yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla));
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
yydefault:
yyn = yydefact_[+yystack_[0].state];
if (yyn == 0)
goto yyerrlab;
goto yyreduce;
/*-----------------------------.
| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
yylen = yyr2_[yyn];
{
stack_symbol_type yylhs;
yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
/* Variants are always initialized to an empty instance of the
correct type. The default '$$ = $1' action is NOT applied
when using variants. */
switch (yyr1_[yyn])
{
case symbol_kind::S_value: // value
case symbol_kind::S_map_value: // map_value
case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
case symbol_kind::S_control_socket_type_value: // control_socket_type_value
case symbol_kind::S_auth_type_value: // auth_type_value
yylhs.value.emplace< ElementPtr > ();
break;
case symbol_kind::S_BOOLEAN: // "boolean"
yylhs.value.emplace< bool > ();
break;
case symbol_kind::S_FLOAT: // "floating point"
yylhs.value.emplace< double > ();
break;
case symbol_kind::S_INTEGER: // "integer"
yylhs.value.emplace< int64_t > ();
break;
case symbol_kind::S_STRING: // "constant string"
yylhs.value.emplace< std::string > ();
break;
default:
break;
}
// Default location.
{
stack_type::slice range (yystack_, yylen);
YYLLOC_DEFAULT (yylhs.location, range, yylen);
yyerror_range[1].location = yylhs.location;
}
// Perform the reduction.
YY_REDUCE_PRINT (yyn);
#if YY_EXCEPTIONS
try
#endif // YY_EXCEPTIONS
{
switch (yyn)
{
case 2: // $@1: %empty
#line 153 "d2_parser.yy"
{ ctx.ctx_ = ctx.NO_KEYWORD; }
#line 722 "d2_parser.cc"
break;
case 4: // $@2: %empty
#line 154 "d2_parser.yy"
{ ctx.ctx_ = ctx.CONFIG; }
#line 728 "d2_parser.cc"
break;
case 6: // $@3: %empty
#line 155 "d2_parser.yy"
{ ctx.ctx_ = ctx.DHCPDDNS; }
#line 734 "d2_parser.cc"
break;
case 8: // $@4: %empty
#line 156 "d2_parser.yy"
{ ctx.ctx_ = ctx.TSIG_KEY; }
#line 740 "d2_parser.cc"
break;
case 10: // $@5: %empty
#line 157 "d2_parser.yy"
{ ctx.ctx_ = ctx.TSIG_KEYS; }
#line 746 "d2_parser.cc"
break;
case 12: // $@6: %empty
#line 158 "d2_parser.yy"
{ ctx.ctx_ = ctx.DDNS_DOMAIN; }
#line 752 "d2_parser.cc"
break;
case 14: // $@7: %empty
#line 159 "d2_parser.yy"
{ ctx.ctx_ = ctx.DDNS_DOMAINS; }
#line 758 "d2_parser.cc"
break;
case 16: // $@8: %empty
#line 160 "d2_parser.yy"
{ ctx.ctx_ = ctx.DNS_SERVERS; }
#line 764 "d2_parser.cc"
break;
case 18: // $@9: %empty
#line 161 "d2_parser.yy"
{ ctx.ctx_ = ctx.DNS_SERVERS; }
#line 770 "d2_parser.cc"
break;
case 20: // $@10: %empty
#line 162 "d2_parser.yy"
{ ctx.ctx_ = ctx.HOOKS_LIBRARIES; }
#line 776 "d2_parser.cc"
break;
case 22: // value: "integer"
#line 170 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location))); }
#line 782 "d2_parser.cc"
break;
case 23: // value: "floating point"
#line 171 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as < double > (), ctx.loc2pos(yystack_[0].location))); }
#line 788 "d2_parser.cc"
break;
case 24: // value: "boolean"
#line 172 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location))); }
#line 794 "d2_parser.cc"
break;
case 25: // value: "constant string"
#line 173 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); }
#line 800 "d2_parser.cc"
break;
case 26: // value: "null"
#line 174 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); }
#line 806 "d2_parser.cc"
break;
case 27: // value: map2
#line 175 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
#line 812 "d2_parser.cc"
break;
case 28: // value: list_generic
#line 176 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
#line 818 "d2_parser.cc"
break;
case 29: // sub_json: value
#line 179 "d2_parser.yy"
{
// Push back the JSON value on the stack
ctx.stack_.push_back(yystack_[0].value.as < ElementPtr > ());
}
#line 827 "d2_parser.cc"
break;
case 30: // $@11: %empty
#line 184 "d2_parser.yy"
{
// This code is executed when we're about to start parsing
// the content of the map
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(m);
}
#line 838 "d2_parser.cc"
break;
case 31: // map2: "{" $@11 map_content "}"
#line 189 "d2_parser.yy"
{
// map parsing completed. If we ever want to do any wrap up
// (maybe some sanity checking), this would be the best place
// for it.
}
#line 848 "d2_parser.cc"
break;
case 32: // map_value: map2
#line 195 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
#line 854 "d2_parser.cc"
break;
case 35: // not_empty_map: "constant string" ":" value
#line 202 "d2_parser.yy"
{
// map containing a single entry
ctx.unique(yystack_[2].value.as < std::string > (), ctx.loc2pos(yystack_[2].location));
ctx.stack_.back()->set(yystack_[2].value.as < std::string > (), yystack_[0].value.as < ElementPtr > ());
}
#line 864 "d2_parser.cc"
break;
case 36: // not_empty_map: not_empty_map "," "constant string" ":" value
#line 207 "d2_parser.yy"
{
// map consisting of a shorter map followed by
// comma and string:value
ctx.unique(yystack_[2].value.as < std::string > (), ctx.loc2pos(yystack_[2].location));
ctx.stack_.back()->set(yystack_[2].value.as < std::string > (), yystack_[0].value.as < ElementPtr > ());
}
#line 875 "d2_parser.cc"
break;
case 37: // not_empty_map: not_empty_map ","
#line 213 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 883 "d2_parser.cc"
break;
case 38: // $@12: %empty
#line 218 "d2_parser.yy"
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(l);
}
#line 892 "d2_parser.cc"
break;
case 39: // list_generic: "[" $@12 list_content "]"
#line 221 "d2_parser.yy"
{
// list parsing complete. Put any sanity checking here
}
#line 900 "d2_parser.cc"
break;
case 42: // not_empty_list: value
#line 229 "d2_parser.yy"
{
// List consisting of a single element.
ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ());
}
#line 909 "d2_parser.cc"
break;
case 43: // not_empty_list: not_empty_list "," value
#line 233 "d2_parser.yy"
{
// List ending with , and a value.
ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ());
}
#line 918 "d2_parser.cc"
break;
case 44: // not_empty_list: not_empty_list ","
#line 237 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 926 "d2_parser.cc"
break;
case 45: // unknown_map_entry: "constant string" ":"
#line 247 "d2_parser.yy"
{
const std::string& where = ctx.contextName();
const std::string& keyword = yystack_[1].value.as < std::string > ();
error(yystack_[1].location,
"got unexpected keyword \"" + keyword + "\" in " + where + " map.");
}
#line 937 "d2_parser.cc"
break;
case 46: // $@13: %empty
#line 256 "d2_parser.yy"
{
// This code is executed when we're about to start parsing
// the content of the map
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(m);
}
#line 948 "d2_parser.cc"
break;
case 47: // syntax_map: "{" $@13 global_object "}"
#line 261 "d2_parser.yy"
{
// map parsing completed. If we ever want to do any wrap up
// (maybe some sanity checking), this would be the best place
// for it.
}
#line 958 "d2_parser.cc"
break;
case 48: // $@14: %empty
#line 269 "d2_parser.yy"
{
ctx.unique("DhcpDdns", ctx.loc2pos(yystack_[0].location));
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("DhcpDdns", m);
ctx.stack_.push_back(m);
ctx.enter(ctx.DHCPDDNS);
}
#line 970 "d2_parser.cc"
break;
case 49: // global_object: "DhcpDdns" $@14 ":" "{" dhcpddns_params "}"
#line 275 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 979 "d2_parser.cc"
break;
case 51: // global_object_comma: global_object ","
#line 282 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 987 "d2_parser.cc"
break;
case 52: // $@15: %empty
#line 286 "d2_parser.yy"
{
// Parse the dhcpddns map
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(m);
}
#line 997 "d2_parser.cc"
break;
case 53: // sub_dhcpddns: "{" $@15 dhcpddns_params "}"
#line 290 "d2_parser.yy"
{
// parsing completed
}
#line 1005 "d2_parser.cc"
break;
case 56: // dhcpddns_params: dhcpddns_params ","
#line 296 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1013 "d2_parser.cc"
break;
case 72: // $@16: %empty
#line 319 "d2_parser.yy"
{
ctx.unique("ip-address", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1022 "d2_parser.cc"
break;
case 73: // ip_address: "ip-address" $@16 ":" "constant string"
#line 322 "d2_parser.yy"
{
ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("ip-address", s);
ctx.leave();
}
#line 1032 "d2_parser.cc"
break;
case 74: // port: "port" ":" "integer"
#line 328 "d2_parser.yy"
{
ctx.unique("port", ctx.loc2pos(yystack_[2].location));
if (yystack_[0].value.as < int64_t > () <= 0 || yystack_[0].value.as < int64_t > () >= 65536 ) {
error(yystack_[0].location, "port must be greater than zero but less than 65536");
}
ElementPtr i(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("port", i);
}
#line 1045 "d2_parser.cc"
break;
case 75: // dns_server_timeout: "dns-server-timeout" ":" "integer"
#line 337 "d2_parser.yy"
{
ctx.unique("dns-server-timeout", ctx.loc2pos(yystack_[2].location));
if (yystack_[0].value.as < int64_t > () <= 0) {
error(yystack_[0].location, "dns-server-timeout must be greater than zero");
} else {
ElementPtr i(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("dns-server-timeout", i);
}
}
#line 1059 "d2_parser.cc"
break;
case 76: // $@17: %empty
#line 347 "d2_parser.yy"
{
ctx.unique("ncr-protocol", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NCR_PROTOCOL);
}
#line 1068 "d2_parser.cc"
break;
case 77: // ncr_protocol: "ncr-protocol" $@17 ":" ncr_protocol_value
#line 350 "d2_parser.yy"
{
ctx.stack_.back()->set("ncr-protocol", yystack_[0].value.as < ElementPtr > ());
ctx.leave();
}
#line 1077 "d2_parser.cc"
break;
case 78: // ncr_protocol_value: "UDP"
#line 356 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("UDP", ctx.loc2pos(yystack_[0].location))); }
#line 1083 "d2_parser.cc"
break;
case 79: // ncr_protocol_value: "TCP"
#line 357 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("TCP", ctx.loc2pos(yystack_[0].location))); }
#line 1089 "d2_parser.cc"
break;
case 80: // $@18: %empty
#line 360 "d2_parser.yy"
{
ctx.unique("ncr-format", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NCR_FORMAT);
}
#line 1098 "d2_parser.cc"
break;
case 81: // ncr_format: "ncr-format" $@18 ":" "JSON"
#line 363 "d2_parser.yy"
{
ElementPtr json(new StringElement("JSON", ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("ncr-format", json);
ctx.leave();
}
#line 1108 "d2_parser.cc"
break;
case 82: // $@19: %empty
#line 369 "d2_parser.yy"
{
ctx.enter(ctx.NO_KEYWORD);
}
#line 1116 "d2_parser.cc"
break;
case 83: // user_context: "user-context" $@19 ":" map_value
#line 371 "d2_parser.yy"
{
ElementPtr parent = ctx.stack_.back();
ElementPtr user_context = yystack_[0].value.as < ElementPtr > ();
ConstElementPtr old = parent->get("user-context");
// Handle already existing user context
if (old) {
// Check if it was a comment or a duplicate
if ((old->size() != 1) || !old->contains("comment")) {
std::stringstream msg;
msg << "duplicate user-context entries (previous at "
<< old->getPosition().str() << ")";
error(yystack_[3].location, msg.str());
}
// Merge the comment
user_context->set("comment", old->get("comment"));
}
// Set the user context
parent->set("user-context", user_context);
ctx.leave();
}
#line 1143 "d2_parser.cc"
break;
case 84: // $@20: %empty
#line 394 "d2_parser.yy"
{
ctx.enter(ctx.NO_KEYWORD);
}
#line 1151 "d2_parser.cc"
break;
case 85: // comment: "comment" $@20 ":" "constant string"
#line 396 "d2_parser.yy"
{
ElementPtr parent = ctx.stack_.back();
ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location)));
ElementPtr comment(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
user_context->set("comment", comment);
// Handle already existing user context
ConstElementPtr old = parent->get("user-context");
if (old) {
// Check for duplicate comment
if (old->contains("comment")) {
std::stringstream msg;
msg << "duplicate user-context/comment entries (previous at "
<< old->getPosition().str() << ")";
error(yystack_[3].location, msg.str());
}
// Merge the user context in the comment
merge(user_context, old);
}
// Set the user context
parent->set("user-context", user_context);
ctx.leave();
}
#line 1180 "d2_parser.cc"
break;
case 86: // $@21: %empty
#line 421 "d2_parser.yy"
{
ctx.unique("forward-ddns", ctx.loc2pos(yystack_[0].location));
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("forward-ddns", m);
ctx.stack_.push_back(m);
ctx.enter(ctx.FORWARD_DDNS);
}
#line 1192 "d2_parser.cc"
break;
case 87: // forward_ddns: "forward-ddns" $@21 ":" "{" ddns_mgr_params "}"
#line 427 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 1201 "d2_parser.cc"
break;
case 88: // $@22: %empty
#line 432 "d2_parser.yy"
{
ctx.unique("reverse-ddns", ctx.loc2pos(yystack_[0].location));
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("reverse-ddns", m);
ctx.stack_.push_back(m);
ctx.enter(ctx.REVERSE_DDNS);
}
#line 1213 "d2_parser.cc"
break;
case 89: // reverse_ddns: "reverse-ddns" $@22 ":" "{" ddns_mgr_params "}"
#line 438 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 1222 "d2_parser.cc"
break;
case 94: // not_empty_ddns_mgr_params: ddns_mgr_params ","
#line 449 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1230 "d2_parser.cc"
break;
case 97: // $@23: %empty
#line 460 "d2_parser.yy"
{
ctx.unique("ddns-domains", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("ddns-domains", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.DDNS_DOMAINS);
}
#line 1242 "d2_parser.cc"
break;
case 98: // ddns_domains: "ddns-domains" $@23 ":" "[" ddns_domain_list "]"
#line 466 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 1251 "d2_parser.cc"
break;
case 99: // $@24: %empty
#line 471 "d2_parser.yy"
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(l);
}
#line 1260 "d2_parser.cc"
break;
case 100: // sub_ddns_domains: "[" $@24 ddns_domain_list "]"
#line 474 "d2_parser.yy"
{
// parsing completed
}
#line 1268 "d2_parser.cc"
break;
case 105: // not_empty_ddns_domain_list: not_empty_ddns_domain_list ","
#line 484 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1276 "d2_parser.cc"
break;
case 106: // $@25: %empty
#line 489 "d2_parser.yy"
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
ctx.stack_.push_back(m);
}
#line 1286 "d2_parser.cc"
break;
case 107: // ddns_domain: "{" $@25 ddns_domain_params "}"
#line 493 "d2_parser.yy"
{
ctx.stack_.pop_back();
}
#line 1294 "d2_parser.cc"
break;
case 108: // $@26: %empty
#line 497 "d2_parser.yy"
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(m);
}
#line 1303 "d2_parser.cc"
break;
case 109: // sub_ddns_domain: "{" $@26 ddns_domain_params "}"
#line 500 "d2_parser.yy"
{
// parsing completed
}
#line 1311 "d2_parser.cc"
break;
case 112: // ddns_domain_params: ddns_domain_params ","
#line 506 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1319 "d2_parser.cc"
break;
case 119: // $@27: %empty
#line 520 "d2_parser.yy"
{
ctx.unique("name", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1328 "d2_parser.cc"
break;
case 120: // ddns_domain_name: "name" $@27 ":" "constant string"
#line 523 "d2_parser.yy"
{
if (yystack_[0].value.as < std::string > () == "") {
error(yystack_[1].location, "Ddns domain name cannot be blank");
}
ElementPtr elem(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("name", name);
ctx.leave();
}
#line 1342 "d2_parser.cc"
break;
case 121: // $@28: %empty
#line 533 "d2_parser.yy"
{
ctx.unique("key-name", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1351 "d2_parser.cc"
break;
case 122: // ddns_key_name: "key-name" $@28 ":" "constant string"
#line 536 "d2_parser.yy"
{
ElementPtr elem(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("key-name", name);
ctx.leave();
}
#line 1362 "d2_parser.cc"
break;
case 123: // $@29: %empty
#line 546 "d2_parser.yy"
{
ctx.unique("dns-servers", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("dns-servers", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.DNS_SERVERS);
}
#line 1374 "d2_parser.cc"
break;
case 124: // dns_servers: "dns-servers" $@29 ":" "[" dns_server_list "]"
#line 552 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 1383 "d2_parser.cc"
break;
case 125: // $@30: %empty
#line 557 "d2_parser.yy"
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(l);
}
#line 1392 "d2_parser.cc"
break;
case 126: // sub_dns_servers: "[" $@30 dns_server_list "]"
#line 560 "d2_parser.yy"
{
// parsing completed
}
#line 1400 "d2_parser.cc"
break;
case 129: // dns_server_list: dns_server_list ","
#line 566 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1408 "d2_parser.cc"
break;
case 130: // $@31: %empty
#line 571 "d2_parser.yy"
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
ctx.stack_.push_back(m);
}
#line 1418 "d2_parser.cc"
break;
case 131: // dns_server: "{" $@31 dns_server_params "}"
#line 575 "d2_parser.yy"
{
ctx.stack_.pop_back();
}
#line 1426 "d2_parser.cc"
break;
case 132: // $@32: %empty
#line 579 "d2_parser.yy"
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(m);
}
#line 1435 "d2_parser.cc"
break;
case 133: // sub_dns_server: "{" $@32 dns_server_params "}"
#line 582 "d2_parser.yy"
{
// parsing completed
}
#line 1443 "d2_parser.cc"
break;
case 136: // dns_server_params: dns_server_params ","
#line 588 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1451 "d2_parser.cc"
break;
case 144: // $@33: %empty
#line 602 "d2_parser.yy"
{
ctx.unique("hostname", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1460 "d2_parser.cc"
break;
case 145: // dns_server_hostname: "hostname" $@33 ":" "constant string"
#line 605 "d2_parser.yy"
{
if (yystack_[0].value.as < std::string > () != "") {
error(yystack_[1].location, "hostname is not yet supported");
}
ElementPtr elem(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("hostname", name);
ctx.leave();
}
#line 1474 "d2_parser.cc"
break;
case 146: // $@34: %empty
#line 615 "d2_parser.yy"
{
ctx.unique("ip-address", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1483 "d2_parser.cc"
break;
case 147: // dns_server_ip_address: "ip-address" $@34 ":" "constant string"
#line 618 "d2_parser.yy"
{
ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("ip-address", s);
ctx.leave();
}
#line 1493 "d2_parser.cc"
break;
case 148: // dns_server_port: "port" ":" "integer"
#line 624 "d2_parser.yy"
{
ctx.unique("port", ctx.loc2pos(yystack_[2].location));
if (yystack_[0].value.as < int64_t > () <= 0 || yystack_[0].value.as < int64_t > () >= 65536 ) {
error(yystack_[0].location, "port must be greater than zero but less than 65536");
}
ElementPtr i(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("port", i);
}
#line 1506 "d2_parser.cc"
break;
case 149: // $@35: %empty
#line 639 "d2_parser.yy"
{
ctx.unique("tsig-keys", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("tsig-keys", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.TSIG_KEYS);
}
#line 1518 "d2_parser.cc"
break;
case 150: // tsig_keys: "tsig-keys" $@35 ":" "[" tsig_keys_list "]"
#line 645 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 1527 "d2_parser.cc"
break;
case 151: // $@36: %empty
#line 650 "d2_parser.yy"
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(l);
}
#line 1536 "d2_parser.cc"
break;
case 152: // sub_tsig_keys: "[" $@36 tsig_keys_list "]"
#line 653 "d2_parser.yy"
{
// parsing completed
}
#line 1544 "d2_parser.cc"
break;
case 157: // not_empty_tsig_keys_list: not_empty_tsig_keys_list ","
#line 663 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1552 "d2_parser.cc"
break;
case 158: // $@37: %empty
#line 668 "d2_parser.yy"
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
ctx.stack_.push_back(m);
}
#line 1562 "d2_parser.cc"
break;
case 159: // tsig_key: "{" $@37 tsig_key_params "}"
#line 672 "d2_parser.yy"
{
ctx.stack_.pop_back();
}
#line 1570 "d2_parser.cc"
break;
case 160: // $@38: %empty
#line 676 "d2_parser.yy"
{
// Parse tsig key list entry map
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(m);
}
#line 1580 "d2_parser.cc"
break;
case 161: // sub_tsig_key: "{" $@38 tsig_key_params "}"
#line 680 "d2_parser.yy"
{
// parsing completed
}
#line 1588 "d2_parser.cc"
break;
case 164: // tsig_key_params: tsig_key_params ","
#line 687 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1596 "d2_parser.cc"
break;
case 173: // $@39: %empty
#line 702 "d2_parser.yy"
{
ctx.unique("name", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1605 "d2_parser.cc"
break;
case 174: // tsig_key_name: "name" $@39 ":" "constant string"
#line 705 "d2_parser.yy"
{
if (yystack_[0].value.as < std::string > () == "") {
error(yystack_[1].location, "TSIG key name cannot be blank");
}
ElementPtr elem(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("name", name);
ctx.leave();
}
#line 1619 "d2_parser.cc"
break;
case 175: // $@40: %empty
#line 715 "d2_parser.yy"
{
ctx.unique("algorithm", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1628 "d2_parser.cc"
break;
case 176: // tsig_key_algorithm: "algorithm" $@40 ":" "constant string"
#line 718 "d2_parser.yy"
{
if (yystack_[0].value.as < std::string > () == "") {
error(yystack_[1].location, "TSIG key algorithm cannot be blank");
}
ElementPtr elem(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("algorithm", elem);
ctx.leave();
}
#line 1641 "d2_parser.cc"
break;
case 177: // tsig_key_digest_bits: "digest-bits" ":" "integer"
#line 727 "d2_parser.yy"
{
ctx.unique("digest-bits", ctx.loc2pos(yystack_[2].location));
if (yystack_[0].value.as < int64_t > () < 0 || (yystack_[0].value.as < int64_t > () > 0 && (yystack_[0].value.as < int64_t > () % 8 != 0))) {
error(yystack_[0].location, "TSIG key digest-bits must either be zero or a positive, multiple of eight");
}
ElementPtr elem(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("digest-bits", elem);
}
#line 1654 "d2_parser.cc"
break;
case 178: // $@41: %empty
#line 736 "d2_parser.yy"
{
ctx.unique("secret", ctx.loc2pos(yystack_[0].location));
ctx.unique("secret-file", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1664 "d2_parser.cc"
break;
case 179: // tsig_key_secret: "secret" $@41 ":" "constant string"
#line 740 "d2_parser.yy"
{
if (yystack_[0].value.as < std::string > () == "") {
error(yystack_[1].location, "TSIG key secret cannot be blank");
}
ElementPtr elem(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("secret", elem);
ctx.leave();
}
#line 1677 "d2_parser.cc"
break;
case 180: // $@42: %empty
#line 749 "d2_parser.yy"
{
ctx.unique("secret", ctx.loc2pos(yystack_[0].location));
ctx.unique("secret-file", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1687 "d2_parser.cc"
break;
case 181: // tsig_key_secret_file: "secret-file" $@42 ":" "constant string"
#line 753 "d2_parser.yy"
{
if (yystack_[0].value.as < std::string > () == "") {
error(yystack_[1].location, "TSIG key secret file name cannot be blank");
}
ElementPtr elem(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("secret-file", elem);
ctx.leave();
}
#line 1700 "d2_parser.cc"
break;
case 182: // $@43: %empty
#line 767 "d2_parser.yy"
{
ctx.unique("control-socket", ctx.loc2pos(yystack_[0].location));
ctx.unique("control-sockets", ctx.loc2pos(yystack_[0].location));
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("control-socket", m);
ctx.stack_.push_back(m);
ctx.enter(ctx.CONTROL_SOCKET);
}
#line 1713 "d2_parser.cc"
break;
case 183: // control_socket: "control-socket" $@43 ":" "{" control_socket_params "}"
#line 774 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 1722 "d2_parser.cc"
break;
case 184: // $@44: %empty
#line 779 "d2_parser.yy"
{
ctx.unique("control-sockets", ctx.loc2pos(yystack_[0].location));
ctx.unique("control-socket", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("control-sockets", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.CONTROL_SOCKET);
}
#line 1735 "d2_parser.cc"
break;
case 185: // control_sockets: "control-sockets" $@44 ":" "[" control_socket_list "]"
#line 786 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 1744 "d2_parser.cc"
break;
case 190: // not_empty_control_socket_list: not_empty_control_socket_list ","
#line 797 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1752 "d2_parser.cc"
break;
case 191: // $@45: %empty
#line 802 "d2_parser.yy"
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
ctx.stack_.push_back(m);
}
#line 1762 "d2_parser.cc"
break;
case 192: // control_socket_entry: "{" $@45 control_socket_params "}"
#line 806 "d2_parser.yy"
{
ctx.stack_.pop_back();
}
#line 1770 "d2_parser.cc"
break;
case 195: // control_socket_params: control_socket_params ","
#line 812 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1778 "d2_parser.cc"
break;
case 208: // $@46: %empty
#line 831 "d2_parser.yy"
{
ctx.unique("socket-type", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.CONTROL_SOCKET_TYPE);
}
#line 1787 "d2_parser.cc"
break;
case 209: // control_socket_type: "socket-type" $@46 ":" control_socket_type_value
#line 834 "d2_parser.yy"
{
ctx.stack_.back()->set("socket-type", yystack_[0].value.as < ElementPtr > ());
ctx.leave();
}
#line 1796 "d2_parser.cc"
break;
case 210: // control_socket_type_value: "unix"
#line 840 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); }
#line 1802 "d2_parser.cc"
break;
case 211: // control_socket_type_value: "http"
#line 841 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("http", ctx.loc2pos(yystack_[0].location))); }
#line 1808 "d2_parser.cc"
break;
case 212: // control_socket_type_value: "https"
#line 842 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("https", ctx.loc2pos(yystack_[0].location))); }
#line 1814 "d2_parser.cc"
break;
case 213: // $@47: %empty
#line 845 "d2_parser.yy"
{
ctx.unique("socket-name", ctx.loc2pos(yystack_[0].location));
ctx.unique("socket-address", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1824 "d2_parser.cc"
break;
case 214: // control_socket_name: "socket-name" $@47 ":" "constant string"
#line 849 "d2_parser.yy"
{
ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("socket-name", name);
ctx.leave();
}
#line 1834 "d2_parser.cc"
break;
case 215: // $@48: %empty
#line 855 "d2_parser.yy"
{
ctx.unique("socket-address", ctx.loc2pos(yystack_[0].location));
ctx.unique("socket-name", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1844 "d2_parser.cc"
break;
case 216: // control_socket_address: "socket-address" $@48 ":" "constant string"
#line 859 "d2_parser.yy"
{
ElementPtr address(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("socket-address", address);
ctx.leave();
}
#line 1854 "d2_parser.cc"
break;
case 217: // control_socket_port: "socket-port" ":" "integer"
#line 865 "d2_parser.yy"
{
ctx.unique("socket-port", ctx.loc2pos(yystack_[2].location));
ElementPtr port(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("socket-port", port);
}
#line 1864 "d2_parser.cc"
break;
case 218: // $@49: %empty
#line 871 "d2_parser.yy"
{
ctx.unique("trust-anchor", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1873 "d2_parser.cc"
break;
case 219: // trust_anchor: "trust-anchor" $@49 ":" "constant string"
#line 874 "d2_parser.yy"
{
ElementPtr ca(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("trust-anchor", ca);
ctx.leave();
}
#line 1883 "d2_parser.cc"
break;
case 220: // $@50: %empty
#line 880 "d2_parser.yy"
{
ctx.unique("cert-file", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1892 "d2_parser.cc"
break;
case 221: // cert_file: "cert-file" $@50 ":" "constant string"
#line 883 "d2_parser.yy"
{
ElementPtr cert(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("cert-file", cert);
ctx.leave();
}
#line 1902 "d2_parser.cc"
break;
case 222: // $@51: %empty
#line 889 "d2_parser.yy"
{
ctx.unique("key-file", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1911 "d2_parser.cc"
break;
case 223: // key_file: "key-file" $@51 ":" "constant string"
#line 892 "d2_parser.yy"
{
ElementPtr key(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("key-file", key);
ctx.leave();
}
#line 1921 "d2_parser.cc"
break;
case 224: // cert_required: "cert-required" ":" "boolean"
#line 898 "d2_parser.yy"
{
ctx.unique("cert-required", ctx.loc2pos(yystack_[2].location));
ElementPtr req(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("cert-required", req);
}
#line 1931 "d2_parser.cc"
break;
case 225: // $@52: %empty
#line 906 "d2_parser.yy"
{
ctx.unique("authentication", ctx.loc2pos(yystack_[0].location));
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("authentication", m);
ctx.stack_.push_back(m);
ctx.enter(ctx.AUTHENTICATION);
}
#line 1943 "d2_parser.cc"
break;
case 226: // authentication: "authentication" $@52 ":" "{" auth_params "}"
#line 912 "d2_parser.yy"
{
// The type parameter is required
ctx.require("type", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
ctx.stack_.pop_back();
ctx.leave();
}
#line 1954 "d2_parser.cc"
break;
case 229: // auth_params: auth_params ","
#line 921 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 1962 "d2_parser.cc"
break;
case 237: // $@53: %empty
#line 935 "d2_parser.yy"
{
ctx.unique("type", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.AUTH_TYPE);
}
#line 1971 "d2_parser.cc"
break;
case 238: // auth_type: "type" $@53 ":" auth_type_value
#line 938 "d2_parser.yy"
{
ctx.stack_.back()->set("type", yystack_[0].value.as < ElementPtr > ());
ctx.leave();
}
#line 1980 "d2_parser.cc"
break;
case 239: // auth_type_value: "basic"
#line 943 "d2_parser.yy"
{ yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("basic", ctx.loc2pos(yystack_[0].location))); }
#line 1986 "d2_parser.cc"
break;
case 240: // $@54: %empty
#line 946 "d2_parser.yy"
{
ctx.unique("realm", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 1995 "d2_parser.cc"
break;
case 241: // realm: "realm" $@54 ":" "constant string"
#line 949 "d2_parser.yy"
{
ElementPtr realm(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("realm", realm);
ctx.leave();
}
#line 2005 "d2_parser.cc"
break;
case 242: // $@55: %empty
#line 955 "d2_parser.yy"
{
ctx.unique("directory", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2014 "d2_parser.cc"
break;
case 243: // directory: "directory" $@55 ":" "constant string"
#line 958 "d2_parser.yy"
{
ElementPtr directory(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("directory", directory);
ctx.leave();
}
#line 2024 "d2_parser.cc"
break;
case 244: // $@56: %empty
#line 964 "d2_parser.yy"
{
ctx.unique("clients", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("clients", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.CLIENTS);
}
#line 2036 "d2_parser.cc"
break;
case 245: // clients: "clients" $@56 ":" "[" clients_list "]"
#line 970 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 2045 "d2_parser.cc"
break;
case 250: // not_empty_clients_list: not_empty_clients_list ","
#line 981 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 2053 "d2_parser.cc"
break;
case 251: // $@57: %empty
#line 986 "d2_parser.yy"
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
ctx.stack_.push_back(m);
}
#line 2063 "d2_parser.cc"
break;
case 252: // basic_auth: "{" $@57 clients_params "}"
#line 990 "d2_parser.yy"
{
ctx.stack_.pop_back();
}
#line 2071 "d2_parser.cc"
break;
case 255: // clients_params: clients_params ","
#line 996 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 2079 "d2_parser.cc"
break;
case 263: // $@58: %empty
#line 1010 "d2_parser.yy"
{
ctx.unique("user", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2088 "d2_parser.cc"
break;
case 264: // user: "user" $@58 ":" "constant string"
#line 1013 "d2_parser.yy"
{
ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("user", user);
ctx.leave();
}
#line 2098 "d2_parser.cc"
break;
case 265: // $@59: %empty
#line 1019 "d2_parser.yy"
{
ctx.unique("user-file", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2107 "d2_parser.cc"
break;
case 266: // user_file: "user-file" $@59 ":" "constant string"
#line 1022 "d2_parser.yy"
{
ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("user-file", user);
ctx.leave();
}
#line 2117 "d2_parser.cc"
break;
case 267: // $@60: %empty
#line 1028 "d2_parser.yy"
{
ctx.unique("password", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2126 "d2_parser.cc"
break;
case 268: // password: "password" $@60 ":" "constant string"
#line 1031 "d2_parser.yy"
{
ElementPtr pwd(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("password", pwd);
ctx.leave();
}
#line 2136 "d2_parser.cc"
break;
case 269: // $@61: %empty
#line 1037 "d2_parser.yy"
{
ctx.unique("password-file", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2145 "d2_parser.cc"
break;
case 270: // password_file: "password-file" $@61 ":" "constant string"
#line 1040 "d2_parser.yy"
{
ElementPtr password(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("password-file", password);
ctx.leave();
}
#line 2155 "d2_parser.cc"
break;
case 271: // $@62: %empty
#line 1048 "d2_parser.yy"
{
ctx.unique("hooks-libraries", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("hooks-libraries", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.HOOKS_LIBRARIES);
}
#line 2167 "d2_parser.cc"
break;
case 272: // hooks_libraries: "hooks-libraries" $@62 ":" "[" hooks_libraries_list "]"
#line 1054 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 2176 "d2_parser.cc"
break;
case 277: // not_empty_hooks_libraries_list: not_empty_hooks_libraries_list ","
#line 1065 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 2184 "d2_parser.cc"
break;
case 278: // $@63: %empty
#line 1070 "d2_parser.yy"
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
ctx.stack_.push_back(m);
}
#line 2194 "d2_parser.cc"
break;
case 279: // hooks_library: "{" $@63 hooks_params "}"
#line 1074 "d2_parser.yy"
{
// The library hooks parameter is required
ctx.require("library", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
ctx.stack_.pop_back();
}
#line 2204 "d2_parser.cc"
break;
case 280: // $@64: %empty
#line 1080 "d2_parser.yy"
{
// Parse the hooks-libraries list entry map
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(m);
}
#line 2214 "d2_parser.cc"
break;
case 281: // sub_hooks_library: "{" $@64 hooks_params "}"
#line 1084 "d2_parser.yy"
{
// The library hooks parameter is required
ctx.require("library", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
// parsing completed
}
#line 2224 "d2_parser.cc"
break;
case 284: // hooks_params: hooks_params ","
#line 1092 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 2232 "d2_parser.cc"
break;
case 288: // $@65: %empty
#line 1102 "d2_parser.yy"
{
ctx.unique("library", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2241 "d2_parser.cc"
break;
case 289: // library: "library" $@65 ":" "constant string"
#line 1105 "d2_parser.yy"
{
ElementPtr lib(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("library", lib);
ctx.leave();
}
#line 2251 "d2_parser.cc"
break;
case 290: // $@66: %empty
#line 1111 "d2_parser.yy"
{
ctx.unique("parameters", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2260 "d2_parser.cc"
break;
case 291: // parameters: "parameters" $@66 ":" map_value
#line 1114 "d2_parser.yy"
{
ctx.stack_.back()->set("parameters", yystack_[0].value.as < ElementPtr > ());
ctx.leave();
}
#line 2269 "d2_parser.cc"
break;
case 292: // $@67: %empty
#line 1121 "d2_parser.yy"
{
ctx.unique("loggers", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("loggers", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.LOGGERS);
}
#line 2281 "d2_parser.cc"
break;
case 293: // loggers: "loggers" $@67 ":" "[" loggers_entries "]"
#line 1127 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 2290 "d2_parser.cc"
break;
case 296: // loggers_entries: loggers_entries ","
#line 1136 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 2298 "d2_parser.cc"
break;
case 297: // $@68: %empty
#line 1142 "d2_parser.yy"
{
ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(l);
ctx.stack_.push_back(l);
}
#line 2308 "d2_parser.cc"
break;
case 298: // logger_entry: "{" $@68 logger_params "}"
#line 1146 "d2_parser.yy"
{
ctx.stack_.pop_back();
}
#line 2316 "d2_parser.cc"
break;
case 301: // logger_params: logger_params ","
#line 1152 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 2324 "d2_parser.cc"
break;
case 309: // $@69: %empty
#line 1166 "d2_parser.yy"
{
ctx.unique("name", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2333 "d2_parser.cc"
break;
case 310: // name: "name" $@69 ":" "constant string"
#line 1169 "d2_parser.yy"
{
ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("name", name);
ctx.leave();
}
#line 2343 "d2_parser.cc"
break;
case 311: // debuglevel: "debuglevel" ":" "integer"
#line 1175 "d2_parser.yy"
{
ctx.unique("debuglevel", ctx.loc2pos(yystack_[2].location));
ElementPtr dl(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("debuglevel", dl);
}
#line 2353 "d2_parser.cc"
break;
case 312: // $@70: %empty
#line 1181 "d2_parser.yy"
{
ctx.unique("severity", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2362 "d2_parser.cc"
break;
case 313: // severity: "severity" $@70 ":" "constant string"
#line 1184 "d2_parser.yy"
{
ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("severity", sev);
ctx.leave();
}
#line 2372 "d2_parser.cc"
break;
case 314: // $@71: %empty
#line 1190 "d2_parser.yy"
{
ctx.unique("output-options", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
}
#line 2384 "d2_parser.cc"
break;
case 315: // output_options_list: "output-options" $@71 ":" "[" output_options_list_content "]"
#line 1196 "d2_parser.yy"
{
ctx.stack_.pop_back();
ctx.leave();
}
#line 2393 "d2_parser.cc"
break;
case 318: // output_options_list_content: output_options_list_content ","
#line 1203 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 2401 "d2_parser.cc"
break;
case 319: // $@72: %empty
#line 1208 "d2_parser.yy"
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
ctx.stack_.push_back(m);
}
#line 2411 "d2_parser.cc"
break;
case 320: // output_entry: "{" $@72 output_params_list "}"
#line 1212 "d2_parser.yy"
{
ctx.stack_.pop_back();
}
#line 2419 "d2_parser.cc"
break;
case 323: // output_params_list: output_params_list ","
#line 1218 "d2_parser.yy"
{
ctx.warnAboutExtraCommas(yystack_[0].location);
}
#line 2427 "d2_parser.cc"
break;
case 329: // $@73: %empty
#line 1230 "d2_parser.yy"
{
ctx.unique("output", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2436 "d2_parser.cc"
break;
case 330: // output: "output" $@73 ":" "constant string"
#line 1233 "d2_parser.yy"
{
ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("output", sev);
ctx.leave();
}
#line 2446 "d2_parser.cc"
break;
case 331: // flush: "flush" ":" "boolean"
#line 1239 "d2_parser.yy"
{
ctx.unique("flush", ctx.loc2pos(yystack_[2].location));
ElementPtr flush(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("flush", flush);
}
#line 2456 "d2_parser.cc"
break;
case 332: // maxsize: "maxsize" ":" "integer"
#line 1245 "d2_parser.yy"
{
ctx.unique("maxsize", ctx.loc2pos(yystack_[2].location));
ElementPtr maxsize(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("maxsize", maxsize);
}
#line 2466 "d2_parser.cc"
break;
case 333: // maxver: "maxver" ":" "integer"
#line 1251 "d2_parser.yy"
{
ctx.unique("maxver", ctx.loc2pos(yystack_[2].location));
ElementPtr maxver(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("maxver", maxver);
}
#line 2476 "d2_parser.cc"
break;
case 334: // $@74: %empty
#line 1257 "d2_parser.yy"
{
ctx.unique("pattern", ctx.loc2pos(yystack_[0].location));
ctx.enter(ctx.NO_KEYWORD);
}
#line 2485 "d2_parser.cc"
break;
case 335: // pattern: "pattern" $@74 ":" "constant string"
#line 1260 "d2_parser.yy"
{
ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("pattern", sev);
ctx.leave();
}
#line 2495 "d2_parser.cc"
break;
#line 2499 "d2_parser.cc"
default:
break;
}
}
#if YY_EXCEPTIONS
catch (const syntax_error& yyexc)
{
YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
error (yyexc);
YYERROR;
}
#endif // YY_EXCEPTIONS
YY_SYMBOL_PRINT ("-> $$ =", yylhs);
yypop_ (yylen);
yylen = 0;
// Shift the result of the reduction.
yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
}
goto yynewstate;
/*--------------------------------------.
| yyerrlab -- here on detecting error. |
`--------------------------------------*/
yyerrlab:
// If not already recovering from an error, report this error.
if (!yyerrstatus_)
{
++yynerrs_;
context yyctx (*this, yyla);
std::string msg = yysyntax_error_ (yyctx);
error (yyla.location, YY_MOVE (msg));
}
yyerror_range[1].location = yyla.location;
if (yyerrstatus_ == 3)
{
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
// Return failure if at end of input.
if (yyla.kind () == symbol_kind::S_YYEOF)
YYABORT;
else if (!yyla.empty ())
{
yy_destroy_ ("Error: discarding", yyla);
yyla.clear ();
}
}
// Else will try to reuse lookahead token after shifting the error token.
goto yyerrlab1;
/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
/* Pacify compilers when the user code never invokes YYERROR and
the label yyerrorlab therefore never appears in user code. */
if (false)
YYERROR;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
yypop_ (yylen);
yylen = 0;
YY_STACK_PRINT ();
goto yyerrlab1;
/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
yyerrlab1:
yyerrstatus_ = 3; // Each real token shifted decrements this.
// Pop stack until we find a state that shifts the error token.
for (;;)
{
yyn = yypact_[+yystack_[0].state];
if (!yy_pact_value_is_default_ (yyn))
{
yyn += symbol_kind::S_YYerror;
if (0 <= yyn && yyn <= yylast_
&& yycheck_[yyn] == symbol_kind::S_YYerror)
{
yyn = yytable_[yyn];
if (0 < yyn)
break;
}
}
// Pop the current state because it cannot handle the error token.
if (yystack_.size () == 1)
YYABORT;
yyerror_range[1].location = yystack_[0].location;
yy_destroy_ ("Error: popping", yystack_[0]);
yypop_ ();
YY_STACK_PRINT ();
}
{
stack_symbol_type error_token;
yyerror_range[2].location = yyla.location;
YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
// Shift the error token.
error_token.state = state_type (yyn);
yypush_ ("Shifting", YY_MOVE (error_token));
}
goto yynewstate;
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
/*-----------------------------------------------------.
| yyreturn -- parsing is finished, return the result. |
`-----------------------------------------------------*/
yyreturn:
if (!yyla.empty ())
yy_destroy_ ("Cleanup: discarding lookahead", yyla);
/* Do not reclaim the symbols of the rule whose action triggered
this YYABORT or YYACCEPT. */
yypop_ (yylen);
YY_STACK_PRINT ();
while (1 < yystack_.size ())
{
yy_destroy_ ("Cleanup: popping", yystack_[0]);
yypop_ ();
}
return yyresult;
}
#if YY_EXCEPTIONS
catch (...)
{
YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
// Do not try to display the values of the reclaimed symbols,
// as their printers might throw an exception.
if (!yyla.empty ())
yy_destroy_ (YY_NULLPTR, yyla);
while (1 < yystack_.size ())
{
yy_destroy_ (YY_NULLPTR, yystack_[0]);
yypop_ ();
}
throw;
}
#endif // YY_EXCEPTIONS
}
void
D2Parser::error (const syntax_error& yyexc)
{
error (yyexc.location, yyexc.what ());
}
/* Return YYSTR after stripping away unnecessary quotes and
backslashes, so that it's suitable for yyerror. The heuristic is
that double-quoting is unnecessary unless the string contains an
apostrophe, a comma, or backslash (other than backslash-backslash).
YYSTR is taken from yytname. */
std::string
D2Parser::yytnamerr_ (const char *yystr)
{
if (*yystr == '"')
{
std::string yyr;
char const *yyp = yystr;
for (;;)
switch (*++yyp)
{
case '\'':
case ',':
goto do_not_strip_quotes;
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
else
goto append;
append:
default:
yyr += *yyp;
break;
case '"':
return yyr;
}
do_not_strip_quotes: ;
}
return yystr;
}
std::string
D2Parser::symbol_name (symbol_kind_type yysymbol)
{
return yytnamerr_ (yytname_[yysymbol]);
}
// D2Parser::context.
D2Parser::context::context (const D2Parser& yyparser, const symbol_type& yyla)
: yyparser_ (yyparser)
, yyla_ (yyla)
{}
int
D2Parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const
{
// Actual number of expected tokens
int yycount = 0;
const int yyn = yypact_[+yyparser_.yystack_[0].state];
if (!yy_pact_value_is_default_ (yyn))
{
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. In other words, skip the first -YYN actions for
this state because they are default actions. */
const int yyxbegin = yyn < 0 ? -yyn : 0;
// Stay within bounds of both yycheck and yytname.
const int yychecklim = yylast_ - yyn + 1;
const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
{
if (!yyarg)
++yycount;
else if (yycount == yyargn)
return 0;
else
yyarg[yycount++] = YY_CAST (symbol_kind_type, yyx);
}
}
if (yyarg && yycount == 0 && 0 < yyargn)
yyarg[0] = symbol_kind::S_YYEMPTY;
return yycount;
}
int
D2Parser::yy_syntax_error_arguments_ (const context& yyctx,
symbol_kind_type yyarg[], int yyargn) const
{
/* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then
the only way this function was invoked is if the default action
is an error action. In that case, don't check for expected
tokens because there are none.
- The only way there can be no lookahead present (in yyla) is
if this state is a consistent state with a default action.
Thus, detecting the absence of a lookahead is sufficient to
determine that there is no unexpected or expected token to
report. In that case, just report a simple "syntax error".
- Don't assume there isn't a lookahead just because this state is
a consistent state with a default action. There might have
been a previous inconsistent state, consistent state with a
non-default action, or user semantic action that manipulated
yyla. (However, yyla is currently not documented for users.)
- Of course, the expected token list depends on states to have
correct lookahead information, and it depends on the parser not
to perform extra reductions after fetching a lookahead from the
scanner and before detecting a syntax error. Thus, state merging
(from LALR or IELR) and default reductions corrupt the expected
token list. However, the list is correct for canonical LR with
one exception: it will still contain any token that will not be
accepted due to an error action in a later state.
*/
if (!yyctx.lookahead ().empty ())
{
if (yyarg)
yyarg[0] = yyctx.token ();
int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1);
return yyn + 1;
}
return 0;
}
// Generate an error message.
std::string
D2Parser::yysyntax_error_ (const context& yyctx) const
{
// Its maximum.
enum { YYARGS_MAX = 5 };
// Arguments of yyformat.
symbol_kind_type yyarg[YYARGS_MAX];
int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX);
char const* yyformat = YY_NULLPTR;
switch (yycount)
{
#define YYCASE_(N, S) \
case N: \
yyformat = S; \
break
default: // Avoid compiler warnings.
YYCASE_ (0, YY_("syntax error"));
YYCASE_ (1, YY_("syntax error, unexpected %s"));
YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
#undef YYCASE_
}
std::string yyres;
// Argument number.
std::ptrdiff_t yyi = 0;
for (char const* yyp = yyformat; *yyp; ++yyp)
if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
{
yyres += symbol_name (yyarg[yyi++]);
++yyp;
}
else
yyres += *yyp;
return yyres;
}
const short D2Parser::yypact_ninf_ = -215;
const signed char D2Parser::yytable_ninf_ = -1;
const short
D2Parser::yypact_[] =
{
99, -215, -215, -215, -215, -215, -215, -215, -215, -215,
-215, 33, 8, 0, 38, 42, 55, 73, 105, 96,
107, 125, -215, -215, -215, -215, -215, -215, -215, -215,
-215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
-215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
-215, -215, 8, 44, 129, 7, 47, 133, 141, 140,
24, 142, -25, -215, 153, 160, 197, 194, 200, -215,
22, -215, -215, 201, 202, -215, -215, -215, -215, -215,
-215, -215, -215, -215, -215, -215, 203, -215, 39, -215,
-215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
-215, -215, -215, -215, -215, 204, -215, -215, -215, -215,
-215, -215, 43, -215, -215, -215, -215, -215, -215, -215,
198, 206, -215, -215, -215, -215, -215, -215, -215, 65,
-215, -215, -215, -215, -215, 207, 214, -215, -215, 216,
-215, -215, -215, -215, -215, 71, -215, -215, -215, -215,
-215, 58, -215, -215, -215, -215, 115, -215, -215, -215,
-215, 8, 8, -215, 132, 217, -215, -215, 218, 139,
144, 220, 221, 223, 224, 225, 226, 227, 228, 229,
230, 231, -215, 7, -215, 232, 158, 234, 235, 236,
47, -215, 47, -215, 133, 237, 238, 239, 141, -215,
141, -215, 140, 240, 166, 242, 24, -215, 24, 142,
-215, 243, 244, -34, -215, -215, -215, 245, 246, 172,
-215, -215, 76, 233, 247, 179, 248, 249, 253, 252,
255, 256, 257, -215, 189, -215, 190, 191, 192, -215,
116, -215, 193, 258, 195, -215, 123, -215, 196, -215,
199, -215, 130, -215, 205, 247, -215, 8, 7, -215,
-215, -215, -215, -215, -215, -215, -215, -15, -15, 133,
18, 259, 265, 268, -215, -215, -215, -215, -215, -215,
142, -215, -215, -215, -215, -215, -215, -215, -215, 174,
-215, -215, 175, -215, -215, -215, 176, 270, -215, -215,
-215, 260, -215, -215, -215, -215, 261, -215, -215, -215,
177, -215, -215, -215, -215, -215, -215, -215, -215, -215,
-215, -215, 272, 277, -215, -215, 275, 279, -215, -215,
78, -215, 87, -215, 280, -15, -215, -215, -215, 281,
282, 283, 173, 284, 285, 286, 287, 215, 18, -215,
18, -215, 259, -25, -215, 265, 35, 268, -215, -215,
293, -215, 162, 241, 250, -215, 292, 251, 254, 262,
-215, -215, 178, -215, 184, -215, -215, -215, 298, -215,
-215, -215, -215, 185, -215, -215, -215, -215, -215, -215,
140, -215, -215, -215, -215, -215, -215, 63, -215, -215,
-215, -215, -215, 299, 301, 264, 303, 35, -215, 302,
-215, -215, -215, -215, -215, -215, -215, 186, -215, -215,
-215, -215, -215, 266, 304, -215, 267, -215, -215, 306,
307, 309, 310, 63, -215, -215, 308, -215, 273, 269,
271, 312, -215, -215, 98, -215, -215, -215, -215, -215,
311, 50, 308, -215, -215, 314, 318, -215, -215, 319,
320, 321, -215, 187, -215, -215, -215, -215, -215, -215,
-215, 80, -215, 311, 322, 274, 278, 288, 323, 50,
-215, -215, -215, -215, -215, -215, -215, -215, 188, -215,
-215, -215, -215, -215, -215, 276, -215, -215, -215, 290,
-215, 326, 327, 329, 330, 80, -215, -215, -215, 291,
294, 295, 296, -215, -215, -215, -215, -215
};
const short
D2Parser::yydefact_[] =
{
0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 38, 30, 26, 25, 22, 23, 24,
29, 3, 27, 28, 46, 5, 52, 7, 160, 9,
151, 11, 108, 13, 99, 15, 132, 17, 125, 19,
280, 21, 40, 33, 0, 0, 0, 153, 0, 101,
0, 0, 0, 42, 0, 41, 0, 0, 34, 48,
0, 50, 72, 0, 0, 76, 80, 82, 84, 86,
88, 149, 182, 184, 271, 292, 0, 71, 0, 54,
57, 58, 59, 60, 61, 69, 70, 62, 63, 64,
65, 66, 67, 68, 175, 0, 178, 180, 173, 172,
170, 171, 0, 162, 165, 166, 167, 168, 169, 158,
0, 154, 155, 121, 123, 119, 118, 116, 117, 0,
110, 113, 114, 115, 106, 0, 102, 103, 146, 0,
144, 143, 141, 142, 140, 0, 134, 137, 138, 139,
130, 0, 127, 288, 290, 285, 0, 282, 286, 287,
39, 44, 0, 31, 37, 0, 51, 47, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 45, 56, 53, 0, 0, 0, 0, 0,
164, 161, 0, 152, 157, 0, 0, 0, 112, 109,
0, 100, 105, 0, 0, 0, 136, 133, 0, 129,
126, 0, 0, 284, 281, 43, 35, 0, 0, 0,
74, 75, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 55, 0, 177, 0, 0, 0, 163,
0, 156, 0, 0, 0, 111, 0, 104, 0, 148,
0, 135, 0, 128, 0, 0, 283, 0, 0, 73,
78, 79, 77, 81, 32, 83, 85, 90, 90, 153,
0, 186, 273, 0, 176, 179, 181, 174, 159, 122,
0, 120, 107, 147, 145, 131, 289, 291, 36, 0,
97, 96, 0, 91, 92, 95, 0, 0, 208, 213,
215, 0, 225, 218, 220, 222, 0, 207, 205, 206,
0, 193, 196, 197, 198, 199, 201, 202, 203, 204,
200, 191, 0, 187, 188, 278, 0, 274, 275, 297,
0, 294, 0, 49, 0, 94, 87, 89, 150, 0,
0, 0, 0, 0, 0, 0, 0, 0, 195, 183,
0, 185, 190, 0, 272, 277, 0, 296, 293, 124,
0, 93, 0, 0, 0, 217, 0, 0, 0, 0,
224, 194, 0, 189, 0, 276, 309, 314, 0, 312,
308, 306, 307, 0, 299, 302, 304, 305, 303, 295,
101, 210, 211, 212, 209, 214, 216, 0, 219, 221,
223, 192, 279, 0, 0, 0, 0, 301, 298, 0,
237, 240, 242, 244, 236, 235, 234, 0, 227, 230,
231, 232, 233, 0, 0, 311, 0, 300, 98, 0,
0, 0, 0, 229, 226, 310, 0, 313, 0, 0,
0, 0, 228, 319, 0, 316, 239, 238, 241, 243,
246, 0, 318, 315, 251, 0, 247, 248, 329, 0,
0, 0, 334, 0, 321, 324, 325, 326, 327, 328,
317, 0, 245, 250, 0, 0, 0, 0, 0, 323,
320, 263, 265, 267, 269, 262, 260, 261, 0, 253,
256, 257, 258, 259, 249, 0, 331, 332, 333, 0,
322, 0, 0, 0, 0, 255, 252, 330, 335, 0,
0, 0, 0, 254, 264, 266, 268, 270
};
const short
D2Parser::yypgoto_[] =
{
-215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
-215, -215, -41, -215, -214, -215, 67, -215, -215, -215,
-215, -215, -215, -56, -215, -215, -215, -215, -215, -215,
-215, 77, 154, -215, -215, -215, -215, -215, -215, -215,
-215, -215, -55, -215, -44, -215, -215, -215, -215, -215,
68, -215, 3, -215, -215, -215, -215, -42, -215, 137,
-215, -215, -215, 146, 152, -215, -215, -51, -215, -215,
-215, -215, -215, 79, 147, -215, -215, -215, 150, 155,
-215, -215, -215, -215, -215, -215, -215, -215, -215, 91,
-215, 168, -215, -215, -215, 183, 180, -215, -215, -215,
-215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
-215, -215, 12, -215, 15, 23, -215, -215, -215, -215,
-215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
-215, -215, -215, -215, -67, -215, -215, -215, -215, -215,
-215, -215, -215, -215, -215, -215, -97, -215, -215, -126,
-215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
-215, -215, 25, -215, -215, -215, 28, 169, -215, -215,
-215, -215, -215, -215, -215, 26, -215, -215, -23, -215,
-215, -215, -215, -215, -215, -215, -215, -66, -215, -215,
-94, -215, -215, -215, -215, -215, -215, -215
};
const short
D2Parser::yydefgoto_[] =
{
0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 30, 31, 32, 53, 265, 67, 68, 33,
52, 64, 65, 87, 35, 54, 70, 165, 71, 37,
55, 88, 89, 90, 168, 91, 92, 93, 171, 262,
94, 172, 95, 173, 96, 174, 97, 175, 98, 176,
292, 293, 294, 295, 334, 45, 59, 135, 136, 137,
200, 43, 58, 129, 130, 131, 197, 132, 195, 133,
196, 49, 61, 151, 152, 208, 47, 60, 145, 146,
147, 205, 148, 203, 149, 99, 177, 41, 57, 120,
121, 122, 192, 39, 56, 112, 113, 114, 189, 115,
185, 116, 117, 187, 118, 188, 100, 178, 101, 179,
322, 323, 324, 350, 310, 311, 312, 339, 394, 313,
340, 314, 341, 315, 316, 344, 317, 345, 318, 346,
319, 320, 343, 417, 418, 419, 429, 447, 420, 430,
421, 431, 422, 432, 455, 456, 457, 471, 488, 489,
490, 501, 491, 502, 492, 503, 493, 504, 102, 180,
326, 327, 328, 353, 51, 62, 156, 157, 158, 211,
159, 212, 103, 181, 330, 331, 356, 383, 384, 385,
403, 386, 387, 406, 388, 404, 444, 445, 451, 463,
464, 465, 474, 466, 467, 468, 469, 478
};
const short
D2Parser::yytable_[] =
{
109, 110, 126, 127, 141, 142, 155, 34, 290, 144,
264, 63, 111, 23, 128, 24, 143, 25, 72, 73,
74, 75, 153, 154, 76, 166, 77, 78, 79, 80,
167, 153, 154, 22, 81, 138, 139, 77, 78, 82,
83, 264, 183, 77, 78, 36, 190, 184, 123, 38,
140, 191, 298, 86, 77, 78, 299, 300, 301, 302,
40, 209, 84, 86, 210, 85, 77, 78, 198, 303,
304, 305, 306, 199, 206, 104, 105, 106, 107, 207,
42, 357, 77, 78, 358, 86, 26, 27, 28, 29,
209, 260, 261, 359, 376, 377, 86, 378, 379, 77,
78, 452, 86, 46, 453, 410, 108, 411, 412, 413,
44, 458, 48, 86, 459, 460, 461, 462, 213, 190,
215, 216, 66, 214, 278, 86, 198, 481, 482, 483,
484, 282, 50, 206, 109, 110, 109, 110, 285, 69,
119, 86, 126, 127, 126, 127, 111, 134, 111, 150,
141, 142, 141, 142, 128, 144, 128, 144, 86, 160,
77, 78, 143, 161, 143, 123, 124, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 183, 335, 335,
348, 348, 333, 336, 337, 349, 401, 213, 407, 433,
479, 505, 402, 408, 434, 480, 506, 391, 392, 393,
125, 162, 163, 164, 193, 169, 170, 182, 186, 194,
217, 291, 291, 201, 307, 308, 288, 202, 220, 86,
204, 218, 219, 221, 222, 223, 309, 224, 225, 226,
227, 228, 229, 230, 231, 232, 234, 235, 236, 237,
238, 242, 243, 244, 248, 249, 250, 254, 255, 257,
259, 263, 365, 258, 24, 267, 268, 266, 269, 270,
271, 272, 273, 280, 342, 347, 321, 274, 275, 276,
277, 279, 325, 281, 283, 329, 338, 284, 351, 291,
352, 354, 355, 286, 360, 362, 363, 364, 366, 367,
368, 369, 307, 308, 307, 308, 370, 155, 390, 397,
380, 381, 405, 423, 309, 424, 309, 426, 428, 436,
438, 439, 382, 440, 441, 443, 446, 450, 454, 395,
472, 473, 287, 475, 476, 477, 495, 499, 396, 398,
509, 510, 399, 511, 512, 289, 296, 233, 361, 247,
400, 414, 415, 425, 435, 437, 246, 448, 409, 449,
245, 380, 381, 416, 507, 496, 253, 497, 252, 332,
297, 251, 241, 382, 373, 372, 442, 498, 508, 514,
239, 371, 515, 516, 517, 240, 494, 414, 415, 513,
375, 374, 256, 389, 427, 500, 470, 0, 0, 416,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 485, 486, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 487, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 485,
486, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 487
};
const short
D2Parser::yycheck_[] =
{
56, 56, 58, 58, 60, 60, 62, 7, 23, 60,
224, 52, 56, 5, 58, 7, 60, 9, 11, 12,
13, 14, 56, 57, 17, 3, 19, 20, 21, 22,
8, 56, 57, 0, 27, 11, 12, 19, 20, 32,
33, 255, 3, 19, 20, 7, 3, 8, 24, 7,
26, 8, 34, 78, 19, 20, 38, 39, 40, 41,
5, 3, 55, 78, 6, 58, 19, 20, 3, 51,
52, 53, 54, 8, 3, 28, 29, 30, 31, 8,
7, 3, 19, 20, 6, 78, 78, 79, 80, 81,
3, 15, 16, 6, 59, 60, 78, 62, 63, 19,
20, 3, 78, 7, 6, 42, 59, 44, 45, 46,
5, 61, 5, 78, 64, 65, 66, 67, 3, 3,
161, 162, 78, 8, 8, 78, 3, 47, 48, 49,
50, 8, 7, 3, 190, 190, 192, 192, 8, 10,
7, 78, 198, 198, 200, 200, 190, 7, 192, 7,
206, 206, 208, 208, 198, 206, 200, 208, 78, 6,
19, 20, 206, 3, 208, 24, 25, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 3, 3, 3,
3, 3, 8, 8, 8, 8, 8, 3, 3, 3,
3, 3, 8, 8, 8, 8, 8, 35, 36, 37,
59, 4, 8, 3, 6, 4, 4, 4, 4, 3,
78, 267, 268, 6, 270, 270, 257, 3, 79, 78,
4, 4, 4, 79, 4, 4, 270, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 79, 4, 4,
4, 4, 4, 4, 4, 79, 4, 4, 4, 4,
78, 18, 79, 7, 7, 7, 7, 78, 5, 7,
5, 5, 5, 5, 4, 4, 7, 78, 78, 78,
78, 78, 7, 78, 78, 7, 6, 78, 6, 335,
3, 6, 3, 78, 4, 4, 4, 4, 4, 4,
4, 4, 348, 348, 350, 350, 81, 353, 5, 7,
356, 356, 4, 4, 348, 4, 350, 4, 6, 5,
4, 4, 356, 4, 4, 7, 43, 5, 7, 78,
6, 3, 255, 4, 4, 4, 4, 4, 78, 78,
4, 4, 78, 4, 4, 258, 268, 183, 335, 202,
78, 397, 397, 79, 78, 78, 200, 78, 390, 78,
198, 407, 407, 397, 78, 81, 209, 79, 208, 280,
269, 206, 194, 407, 352, 350, 433, 79, 78, 78,
190, 348, 78, 78, 78, 192, 473, 433, 433, 505,
355, 353, 213, 357, 407, 479, 452, -1, -1, 433,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 471, 471, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 471, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 505,
505, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 505
};
const short
D2Parser::yystos_[] =
{
0, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 83, 84, 85, 86, 87, 88, 89, 90, 91,
92, 93, 0, 5, 7, 9, 78, 79, 80, 81,
94, 95, 96, 101, 7, 106, 7, 111, 7, 175,
5, 169, 7, 143, 5, 137, 7, 158, 5, 153,
7, 246, 102, 97, 107, 112, 176, 170, 144, 138,
159, 154, 247, 94, 103, 104, 78, 99, 100, 10,
108, 110, 11, 12, 13, 14, 17, 19, 20, 21,
22, 27, 32, 33, 55, 58, 78, 105, 113, 114,
115, 117, 118, 119, 122, 124, 126, 128, 130, 167,
188, 190, 240, 254, 28, 29, 30, 31, 59, 105,
124, 126, 177, 178, 179, 181, 183, 184, 186, 7,
171, 172, 173, 24, 25, 59, 105, 124, 126, 145,
146, 147, 149, 151, 7, 139, 140, 141, 11, 12,
26, 105, 124, 126, 149, 160, 161, 162, 164, 166,
7, 155, 156, 56, 57, 105, 248, 249, 250, 252,
6, 3, 4, 8, 3, 109, 3, 8, 116, 4,
4, 120, 123, 125, 127, 129, 131, 168, 189, 191,
241, 255, 4, 3, 8, 182, 4, 185, 187, 180,
3, 8, 174, 6, 3, 150, 152, 148, 3, 8,
142, 6, 3, 165, 4, 163, 3, 8, 157, 3,
6, 251, 253, 3, 8, 94, 94, 78, 4, 4,
79, 79, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 114, 4, 79, 4, 4, 4, 178,
177, 173, 4, 4, 4, 146, 145, 141, 4, 79,
4, 161, 160, 156, 4, 4, 249, 4, 7, 78,
15, 16, 121, 18, 96, 98, 78, 7, 7, 5,
7, 5, 5, 5, 78, 78, 78, 78, 8, 78,
5, 78, 8, 78, 78, 8, 78, 98, 94, 113,
23, 105, 132, 133, 134, 135, 132, 171, 34, 38,
39, 40, 41, 51, 52, 53, 54, 105, 124, 126,
196, 197, 198, 201, 203, 205, 206, 208, 210, 212,
213, 7, 192, 193, 194, 7, 242, 243, 244, 7,
256, 257, 155, 8, 136, 3, 8, 8, 6, 199,
202, 204, 4, 214, 207, 209, 211, 4, 3, 8,
195, 6, 3, 245, 6, 3, 258, 3, 6, 6,
4, 134, 4, 4, 4, 79, 4, 4, 4, 4,
81, 197, 196, 194, 248, 244, 59, 60, 62, 63,
105, 124, 126, 259, 260, 261, 263, 264, 266, 257,
5, 35, 36, 37, 200, 78, 78, 7, 78, 78,
78, 8, 8, 262, 267, 4, 265, 3, 8, 139,
42, 44, 45, 46, 105, 124, 126, 215, 216, 217,
220, 222, 224, 4, 4, 79, 4, 260, 6, 218,
221, 223, 225, 3, 8, 78, 5, 78, 4, 4,
4, 4, 216, 7, 268, 269, 43, 219, 78, 78,
5, 270, 3, 6, 7, 226, 227, 228, 61, 64,
65, 66, 67, 271, 272, 273, 275, 276, 277, 278,
269, 229, 6, 3, 274, 4, 4, 4, 279, 3,
8, 47, 48, 49, 50, 105, 124, 126, 230, 231,
232, 234, 236, 238, 228, 4, 81, 79, 79, 4,
272, 233, 235, 237, 239, 3, 8, 78, 78, 4,
4, 4, 4, 231, 78, 78, 78, 78
};
const short
D2Parser::yyr1_[] =
{
0, 82, 84, 83, 85, 83, 86, 83, 87, 83,
88, 83, 89, 83, 90, 83, 91, 83, 92, 83,
93, 83, 94, 94, 94, 94, 94, 94, 94, 95,
97, 96, 98, 99, 99, 100, 100, 100, 102, 101,
103, 103, 104, 104, 104, 105, 107, 106, 109, 108,
108, 110, 112, 111, 113, 113, 113, 114, 114, 114,
114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
114, 114, 116, 115, 117, 118, 120, 119, 121, 121,
123, 122, 125, 124, 127, 126, 129, 128, 131, 130,
132, 132, 133, 133, 133, 134, 134, 136, 135, 138,
137, 139, 139, 140, 140, 140, 142, 141, 144, 143,
145, 145, 145, 146, 146, 146, 146, 146, 146, 148,
147, 150, 149, 152, 151, 154, 153, 155, 155, 155,
157, 156, 159, 158, 160, 160, 160, 161, 161, 161,
161, 161, 161, 161, 163, 162, 165, 164, 166, 168,
167, 170, 169, 171, 171, 172, 172, 172, 174, 173,
176, 175, 177, 177, 177, 178, 178, 178, 178, 178,
178, 178, 178, 180, 179, 182, 181, 183, 185, 184,
187, 186, 189, 188, 191, 190, 192, 192, 193, 193,
193, 195, 194, 196, 196, 196, 197, 197, 197, 197,
197, 197, 197, 197, 197, 197, 197, 197, 199, 198,
200, 200, 200, 202, 201, 204, 203, 205, 207, 206,
209, 208, 211, 210, 212, 214, 213, 215, 215, 215,
216, 216, 216, 216, 216, 216, 216, 218, 217, 219,
221, 220, 223, 222, 225, 224, 226, 226, 227, 227,
227, 229, 228, 230, 230, 230, 231, 231, 231, 231,
231, 231, 231, 233, 232, 235, 234, 237, 236, 239,
238, 241, 240, 242, 242, 243, 243, 243, 245, 244,
247, 246, 248, 248, 248, 248, 249, 249, 251, 250,
253, 252, 255, 254, 256, 256, 256, 258, 257, 259,
259, 259, 260, 260, 260, 260, 260, 260, 260, 262,
261, 263, 265, 264, 267, 266, 268, 268, 268, 270,
269, 271, 271, 271, 272, 272, 272, 272, 272, 274,
273, 275, 276, 277, 279, 278
};
const signed char
D2Parser::yyr2_[] =
{
0, 2, 0, 3, 0, 3, 0, 3, 0, 3,
0, 3, 0, 3, 0, 3, 0, 3, 0, 3,
0, 3, 1, 1, 1, 1, 1, 1, 1, 1,
0, 4, 1, 0, 1, 3, 5, 2, 0, 4,
0, 1, 1, 3, 2, 2, 0, 4, 0, 6,
1, 2, 0, 4, 1, 3, 2, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0, 4, 3, 3, 0, 4, 1, 1,
0, 4, 0, 4, 0, 4, 0, 6, 0, 6,
0, 1, 1, 3, 2, 1, 1, 0, 6, 0,
4, 0, 1, 1, 3, 2, 0, 4, 0, 4,
1, 3, 2, 1, 1, 1, 1, 1, 1, 0,
4, 0, 4, 0, 6, 0, 4, 1, 3, 2,
0, 4, 0, 4, 1, 3, 2, 1, 1, 1,
1, 1, 1, 1, 0, 4, 0, 4, 3, 0,
6, 0, 4, 0, 1, 1, 3, 2, 0, 4,
0, 4, 1, 3, 2, 1, 1, 1, 1, 1,
1, 1, 1, 0, 4, 0, 4, 3, 0, 4,
0, 4, 0, 6, 0, 6, 0, 1, 1, 3,
2, 0, 4, 1, 3, 2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0, 4,
1, 1, 1, 0, 4, 0, 4, 3, 0, 4,
0, 4, 0, 4, 3, 0, 6, 1, 3, 2,
1, 1, 1, 1, 1, 1, 1, 0, 4, 1,
0, 4, 0, 4, 0, 6, 0, 1, 1, 3,
2, 0, 4, 1, 3, 2, 1, 1, 1, 1,
1, 1, 1, 0, 4, 0, 4, 0, 4, 0,
4, 0, 6, 0, 1, 1, 3, 2, 0, 4,
0, 4, 1, 3, 2, 1, 1, 1, 0, 4,
0, 4, 0, 6, 1, 3, 2, 0, 4, 1,
3, 2, 1, 1, 1, 1, 1, 1, 1, 0,
4, 3, 0, 4, 0, 6, 1, 3, 2, 0,
4, 1, 3, 2, 1, 1, 1, 1, 1, 0,
4, 3, 3, 3, 0, 4
};
#if D2_PARSER_DEBUG || 1
// YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
// First, the terminals, then, starting at \a YYNTOKENS, nonterminals.
const char*
const D2Parser::yytname_[] =
{
"\"end of file\"", "error", "\"invalid token\"", "\",\"", "\":\"",
"\"[\"", "\"]\"", "\"{\"", "\"}\"", "\"null\"", "\"DhcpDdns\"",
"\"ip-address\"", "\"port\"", "\"dns-server-timeout\"",
"\"ncr-protocol\"", "\"UDP\"", "\"TCP\"", "\"ncr-format\"", "\"JSON\"",
"\"user-context\"", "\"comment\"", "\"forward-ddns\"",
"\"reverse-ddns\"", "\"ddns-domains\"", "\"key-name\"",
"\"dns-servers\"", "\"hostname\"", "\"tsig-keys\"", "\"algorithm\"",
"\"digest-bits\"", "\"secret\"", "\"secret-file\"", "\"control-socket\"",
"\"control-sockets\"", "\"socket-type\"", "\"unix\"", "\"http\"",
"\"https\"", "\"socket-name\"", "\"socket-address\"", "\"socket-port\"",
"\"authentication\"", "\"type\"", "\"basic\"", "\"realm\"",
"\"directory\"", "\"clients\"", "\"user\"", "\"user-file\"",
"\"password\"", "\"password-file\"", "\"trust-anchor\"", "\"cert-file\"",
"\"key-file\"", "\"cert-required\"", "\"hooks-libraries\"",
"\"library\"", "\"parameters\"", "\"loggers\"", "\"name\"",
"\"output-options\"", "\"output\"", "\"debuglevel\"", "\"severity\"",
"\"flush\"", "\"maxsize\"", "\"maxver\"", "\"pattern\"", "TOPLEVEL_JSON",
"TOPLEVEL_DHCPDDNS", "SUB_DHCPDDNS", "SUB_TSIG_KEY", "SUB_TSIG_KEYS",
"SUB_DDNS_DOMAIN", "SUB_DDNS_DOMAINS", "SUB_DNS_SERVER",
"SUB_DNS_SERVERS", "SUB_HOOKS_LIBRARY", "\"constant string\"",
"\"integer\"", "\"floating point\"", "\"boolean\"", "$accept", "start",
"$@1", "$@2", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "$@10",
"value", "sub_json", "map2", "$@11", "map_value", "map_content",
"not_empty_map", "list_generic", "$@12", "list_content",
"not_empty_list", "unknown_map_entry", "syntax_map", "$@13",
"global_object", "$@14", "global_object_comma", "sub_dhcpddns", "$@15",
"dhcpddns_params", "dhcpddns_param", "ip_address", "$@16", "port",
"dns_server_timeout", "ncr_protocol", "$@17", "ncr_protocol_value",
"ncr_format", "$@18", "user_context", "$@19", "comment", "$@20",
"forward_ddns", "$@21", "reverse_ddns", "$@22", "ddns_mgr_params",
"not_empty_ddns_mgr_params", "ddns_mgr_param", "ddns_domains", "$@23",
"sub_ddns_domains", "$@24", "ddns_domain_list",
"not_empty_ddns_domain_list", "ddns_domain", "$@25", "sub_ddns_domain",
"$@26", "ddns_domain_params", "ddns_domain_param", "ddns_domain_name",
"$@27", "ddns_key_name", "$@28", "dns_servers", "$@29",
"sub_dns_servers", "$@30", "dns_server_list", "dns_server", "$@31",
"sub_dns_server", "$@32", "dns_server_params", "dns_server_param",
"dns_server_hostname", "$@33", "dns_server_ip_address", "$@34",
"dns_server_port", "tsig_keys", "$@35", "sub_tsig_keys", "$@36",
"tsig_keys_list", "not_empty_tsig_keys_list", "tsig_key", "$@37",
"sub_tsig_key", "$@38", "tsig_key_params", "tsig_key_param",
"tsig_key_name", "$@39", "tsig_key_algorithm", "$@40",
"tsig_key_digest_bits", "tsig_key_secret", "$@41",
"tsig_key_secret_file", "$@42", "control_socket", "$@43",
"control_sockets", "$@44", "control_socket_list",
"not_empty_control_socket_list", "control_socket_entry", "$@45",
"control_socket_params", "control_socket_param", "control_socket_type",
"$@46", "control_socket_type_value", "control_socket_name", "$@47",
"control_socket_address", "$@48", "control_socket_port", "trust_anchor",
"$@49", "cert_file", "$@50", "key_file", "$@51", "cert_required",
"authentication", "$@52", "auth_params", "auth_param", "auth_type",
"$@53", "auth_type_value", "realm", "$@54", "directory", "$@55",
"clients", "$@56", "clients_list", "not_empty_clients_list",
"basic_auth", "$@57", "clients_params", "clients_param", "user", "$@58",
"user_file", "$@59", "password", "$@60", "password_file", "$@61",
"hooks_libraries", "$@62", "hooks_libraries_list",
"not_empty_hooks_libraries_list", "hooks_library", "$@63",
"sub_hooks_library", "$@64", "hooks_params", "hooks_param", "library",
"$@65", "parameters", "$@66", "loggers", "$@67", "loggers_entries",
"logger_entry", "$@68", "logger_params", "logger_param", "name", "$@69",
"debuglevel", "severity", "$@70", "output_options_list", "$@71",
"output_options_list_content", "output_entry", "$@72",
"output_params_list", "output_params", "output", "$@73", "flush",
"maxsize", "maxver", "pattern", "$@74", YY_NULLPTR
};
#endif
#if D2_PARSER_DEBUG
const short
D2Parser::yyrline_[] =
{
0, 153, 153, 153, 154, 154, 155, 155, 156, 156,
157, 157, 158, 158, 159, 159, 160, 160, 161, 161,
162, 162, 170, 171, 172, 173, 174, 175, 176, 179,
184, 184, 195, 198, 199, 202, 207, 213, 218, 218,
225, 226, 229, 233, 237, 247, 256, 256, 269, 269,
279, 282, 286, 286, 294, 295, 296, 302, 303, 304,
305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
315, 316, 319, 319, 328, 337, 347, 347, 356, 357,
360, 360, 369, 369, 394, 394, 421, 421, 432, 432,
443, 444, 447, 448, 449, 454, 455, 460, 460, 471,
471, 478, 479, 482, 483, 484, 489, 489, 497, 497,
504, 505, 506, 511, 512, 513, 514, 515, 516, 520,
520, 533, 533, 546, 546, 557, 557, 564, 565, 566,
571, 571, 579, 579, 586, 587, 588, 593, 594, 595,
596, 597, 598, 599, 602, 602, 615, 615, 624, 639,
639, 650, 650, 657, 658, 661, 662, 663, 668, 668,
676, 676, 685, 686, 687, 692, 693, 694, 695, 696,
697, 698, 699, 702, 702, 715, 715, 727, 736, 736,
749, 749, 767, 767, 779, 779, 791, 792, 795, 796,
797, 802, 802, 810, 811, 812, 817, 818, 819, 820,
821, 822, 823, 824, 825, 826, 827, 828, 831, 831,
840, 841, 842, 845, 845, 855, 855, 865, 871, 871,
880, 880, 889, 889, 898, 906, 906, 919, 920, 921,
926, 927, 928, 929, 930, 931, 932, 935, 935, 943,
946, 946, 955, 955, 964, 964, 975, 976, 979, 980,
981, 986, 986, 994, 995, 996, 1001, 1002, 1003, 1004,
1005, 1006, 1007, 1010, 1010, 1019, 1019, 1028, 1028, 1037,
1037, 1048, 1048, 1059, 1060, 1063, 1064, 1065, 1070, 1070,
1080, 1080, 1090, 1091, 1092, 1095, 1098, 1099, 1102, 1102,
1111, 1111, 1121, 1121, 1134, 1135, 1136, 1142, 1142, 1150,
1151, 1152, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1166,
1166, 1175, 1181, 1181, 1190, 1190, 1201, 1202, 1203, 1208,
1208, 1216, 1217, 1218, 1223, 1224, 1225, 1226, 1227, 1230,
1230, 1239, 1245, 1251, 1257, 1257
};
void
D2Parser::yy_stack_print_ () const
{
*yycdebug_ << "Stack now";
for (stack_type::const_iterator
i = yystack_.begin (),
i_end = yystack_.end ();
i != i_end; ++i)
*yycdebug_ << ' ' << int (i->state);
*yycdebug_ << '\n';
}
void
D2Parser::yy_reduce_print_ (int yyrule) const
{
int yylno = yyrline_[yyrule];
int yynrhs = yyr2_[yyrule];
// Print the symbols being reduced, and their result.
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
<< " (line " << yylno << "):\n";
// The symbols being reduced.
for (int yyi = 0; yyi < yynrhs; yyi++)
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
yystack_[(yynrhs) - (yyi + 1)]);
}
#endif // D2_PARSER_DEBUG
#line 14 "d2_parser.yy"
} } // isc::d2
#line 3403 "d2_parser.cc"
#line 1266 "d2_parser.yy"
void
isc::d2::D2Parser::error(const location_type& loc,
const std::string& what)
{
ctx.error(loc, what);
}
|