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
  
3413
  
3414
  
3415
  
3416
  
3417
  
3418
  
3419
  
3420
  
3421
  
3422
  
3423
  
3424
  
3425
  
3426
  
3427
  
3428
  
3429
  
3430
  
3431
  
3432
  
3433
  
3434
  
3435
  
3436
  
3437
  
3438
  
3439
  
3440
  
3441
  
3442
  
3443
  
3444
  
3445
  
3446
  
3447
  
3448
  
3449
  
3450
  
3451
  
3452
  
3453
  
3454
  
3455
  
3456
  
3457
  
3458
  
3459
  
3460
  
3461
  
3462
  
3463
  
3464
  
3465
  
3466
  
3467
  
3468
  
3469
  
3470
  
3471
  
3472
  
3473
  
3474
  
3475
  
3476
  
3477
  
3478
  
3479
  
3480
  
3481
  
3482
  
3483
  
3484
  
3485
  
3486
  
3487
  
3488
  
3489
  
3490
  
3491
  
3492
  
3493
  
3494
  
3495
  
3496
  
3497
  
3498
  
3499
  
3500
  
3501
  
3502
  
3503
  
3504
  
3505
  
3506
  
3507
  
3508
  
3509
  
3510
  
3511
  
3512
  
3513
  
3514
  
3515
  
3516
  
3517
  
3518
  
3519
  
3520
  
3521
  
3522
  
3523
  
3524
  
3525
  
3526
  
3527
  
3528
  
3529
  
3530
  
3531
  
3532
  
3533
  
3534
  
3535
  
3536
  
3537
  
3538
  
3539
  
3540
  
3541
  
3542
  
3543
  
3544
  
3545
  
3546
  
3547
  
3548
  
3549
  
3550
  
3551
  
3552
  
3553
  
3554
  
3555
  
3556
  
3557
  
3558
  
3559
  
3560
  
3561
  
3562
  
3563
  
3564
  
3565
  
3566
  
3567
  
3568
  
3569
  
3570
  
3571
  
3572
  
3573
  
3574
  
3575
  
3576
  
3577
  
3578
  
3579
  
3580
  
3581
  
3582
  
3583
  
3584
  
3585
  
3586
  
3587
  
3588
  
3589
  
3590
  
3591
  
3592
  
3593
  
3594
  
3595
  
3596
  
3597
  
3598
  
3599
  
3600
  
3601
  
3602
  
3603
  
3604
  
3605
  
3606
  
3607
  
3608
  
3609
  
3610
  
3611
  
3612
  
3613
  
3614
  
3615
  
3616
  
3617
  
3618
  
3619
  
3620
  
3621
  
3622
  
3623
  
3624
  
3625
  
3626
  
3627
  
3628
  
3629
  
3630
  
3631
  
3632
  
3633
  
3634
  
3635
  
3636
  
3637
  
3638
  
3639
  
3640
  
3641
  
3642
  
3643
  
3644
  
3645
  
3646
  
3647
  
3648
  
3649
  
3650
  
3651
  
3652
  
3653
  
3654
  
3655
  
3656
  
3657
  
3658
  
3659
  
3660
  
3661
  
3662
  
3663
  
3664
  
3665
  
3666
  
3667
  
3668
  
3669
  
3670
  
3671
  
3672
  
3673
  
3674
  
3675
  
3676
  
3677
  
3678
  
3679
  
3680
  
3681
  
3682
  
3683
  
3684
  
3685
  
3686
  
3687
  
3688
  
3689
  
3690
  
3691
  
3692
  
3693
  
3694
  
3695
  
3696
  
3697
  
3698
  
3699
  
3700
  
3701
  
3702
  
3703
  
3704
  
3705
  
3706
  
3707
  
3708
  
3709
  
3710
  
3711
  
3712
  
3713
  
3714
  
3715
  
3716
  
3717
  
3718
  
3719
  
3720
  
3721
  
3722
  
3723
  
3724
  
3725
  
3726
  
3727
  
3728
  
3729
  
3730
  
3731
  
3732
  
3733
  
3734
  
3735
  
3736
  
3737
  
3738
  
3739
  
3740
  
3741
  
3742
  
3743
  
3744
  
3745
  
3746
  
3747
  
3748
  
3749
  
3750
  
3751
  
3752
  
3753
  
3754
  
3755
  
3756
  
3757
  
3758
  
3759
  
3760
  
3761
  
3762
  
3763
  
3764
  
3765
  
3766
  
3767
  
3768
  
3769
  
3770
  
3771
  
3772
  
3773
  
3774
  
3775
  
3776
  
3777
  
3778
  
3779
  
3780
  
3781
  
3782
  
3783
  
3784
  
3785
  
3786
  
3787
  
3788
  
3789
  
3790
  
3791
  
3792
  
3793
  
3794
  
3795
  
3796
  
3797
  
3798
  
3799
  
3800
  
3801
  
3802
  
3803
  
3804
  
3805
  
3806
  
3807
  
3808
  
3809
  
3810
  
3811
  
3812
  
3813
  
3814
  
3815
  
3816
  
3817
  
3818
  
3819
  
3820
  
3821
  
3822
  
3823
  
3824
  
3825
  
3826
  
3827
  
3828
  
3829
  
3830
  
3831
  
3832
  
3833
  
3834
  
3835
  
3836
  
3837
  
3838
  
3839
  
3840
  
3841
  
3842
  
3843
  
3844
  
3845
  
3846
  
3847
  
3848
  
3849
  
3850
  
3851
  
3852
  
3853
  
3854
  
3855
  
3856
  
3857
  
3858
  
3859
  
3860
  
3861
  
3862
  
3863
  
3864
  
3865
  
3866
  
3867
  
3868
  
3869
  
3870
  
3871
  
3872
  
3873
  
3874
  
3875
  
3876
  
3877
  
3878
  
3879
  
3880
  
3881
  
3882
  
3883
  
3884
  
3885
  
3886
  
3887
  
3888
  
3889
  
3890
  
3891
  
3892
  
3893
  
3894
  
3895
  
3896
  
3897
  
3898
  
3899
  
3900
  
3901
  
3902
  
3903
  
3904
  
3905
  
3906
  
3907
  
3908
  
3909
  
3910
  
3911
  
3912
  
3913
  
3914
  
3915
  
3916
  
3917
  
3918
  
3919
  
3920
  
3921
  
3922
  
3923
  
3924
  
3925
  
3926
  
3927
  
3928
  
3929
  
3930
  
3931
  
3932
  
3933
  
3934
  
3935
  
3936
  
3937
  
3938
  
3939
  
3940
  
3941
  
3942
  
3943
  
3944
  
3945
  
3946
  
3947
  
3948
  
3949
  
3950
  
3951
  
3952
  
3953
  
3954
  
3955
  
3956
  
3957
  
3958
  
3959
  
3960
  
3961
  
3962
  
3963
  
3964
  
3965
  
3966
  
3967
  
3968
  
3969
  
3970
  
3971
  
3972
  
3973
  
3974
  
3975
  
3976
  
3977
  
3978
  
3979
  
3980
  
3981
  
3982
  
3983
  
3984
  
3985
  
3986
  
3987
  
3988
  
3989
  
3990
  
3991
  
3992
  
3993
  
3994
  
3995
  
3996
  
3997
  
3998
  
3999
  
4000
  
4001
  
4002
  
4003
  
4004
  
4005
  
4006
  
4007
  
4008
  
4009
  
4010
  
4011
  
4012
  
4013
  
4014
  
4015
  
4016
  
4017
  
4018
  
4019
  
4020
  
4021
  
4022
  
4023
  
4024
  
4025
  
4026
  
4027
  
4028
  
4029
  
4030
  
4031
  
4032
  
4033
  
4034
  
4035
  
4036
  
4037
  
4038
  
4039
  
4040
  
4041
  
4042
  
4043
  
4044
  
4045
  
4046
  
4047
  
4048
  
4049
  
4050
  
4051
  
4052
  
4053
  
4054
  
4055
  
4056
  
4057
  
4058
  
4059
  
4060
  
4061
  
4062
  
4063
  
4064
  
4065
  
4066
  
4067
  
4068
  
4069
  
4070
  
4071
  
4072
  
4073
  
4074
  
4075
  
4076
  
4077
  
4078
  
4079
  
4080
  
4081
  
4082
  
4083
  
4084
  
4085
  
4086
  
4087
  
4088
  
4089
  
4090
  
4091
  
4092
  
4093
  
4094
  
4095
  
4096
  
4097
  
4098
  
4099
  
4100
  
4101
  
4102
  
4103
  
4104
  
4105
  
4106
  
4107
  
4108
  
4109
  
4110
  
4111
  
4112
  
4113
  
4114
  
4115
  
4116
  
4117
  
4118
  
4119
  
4120
  
4121
  
4122
  
4123
  
4124
  
4125
  
4126
  
4127
  
4128
  
4129
  
4130
  
4131
  
4132
  
4133
  
4134
  
4135
  
4136
  
4137
  
4138
  
4139
  
4140
  
4141
  
4142
  
4143
  
4144
  
4145
  
4146
  
4147
  
4148
  
4149
  
4150
  
4151
  
4152
  
4153
  
4154
  
4155
  
4156
  
4157
  
4158
  
4159
  
4160
  
4161
  
4162
  
4163
  
4164
  
4165
  
4166
  
4167
  
4168
  
4169
  
4170
  
4171
  
4172
  
4173
  
4174
  
4175
  
4176
  
4177
  
4178
  
4179
  
4180
  
4181
  
4182
  
4183
  
4184
  
4185
  
4186
  
4187
  
4188
  
4189
  
4190
  
4191
  
4192
  
4193
  
4194
  
4195
  
4196
  
4197
  
4198
  
4199
  
4200
  
4201
  
4202
  
4203
  
4204
  
4205
  
4206
  
4207
  
4208
  
4209
  
4210
  
4211
  
4212
  
4213
  
4214
  
4215
  
4216
  
4217
  
4218
  
4219
  
4220
  
4221
  
4222
  
4223
  
4224
  
4225
  
4226
  
4227
  
4228
  
4229
  
4230
  
4231
  
4232
  
4233
  
4234
  
4235
  
4236
  
4237
  
4238
  
4239
  
4240
  
4241
  
4242
  
4243
  
4244
  
4245
  
4246
  
4247
  
4248
  
4249
  
4250
  
4251
  
4252
  
4253
  
4254
  
4255
  
4256
  
4257
  
4258
  
4259
  
4260
  
4261
  
4262
  
4263
  
4264
  
4265
  
4266
  
4267
  
4268
  
4269
  
4270
  
4271
  
4272
  
4273
  
4274
  
4275
  
4276
  
4277
  
4278
  
4279
  
4280
  
4281
  
4282
  
4283
  
4284
  
4285
  
4286
  
4287
  
4288
  
4289
  
4290
  
4291
  
4292
  
4293
  
4294
  
4295
  
4296
  
4297
  
4298
  
4299
  
4300
  
4301
  
4302
  
4303
  
4304
  
4305
  
4306
  
4307
  
4308
  
4309
  
4310
  
4311
  
4312
  
4313
  
4314
  
4315
  
4316
  
4317
  
4318
  
4319
  
4320
  
4321
  
4322
  
4323
  
4324
  
4325
  
4326
  
4327
  
4328
  
4329
  
4330
  
4331
  
4332
  
4333
  
4334
  
4335
  
4336
  
4337
  
4338
  
4339
  
4340
  
4341
  
4342
  
4343
  
4344
  
4345
  
4346
  
4347
  
4348
  
4349
  
4350
  
4351
  
4352
  
4353
  
4354
  
4355
  
4356
  
4357
  
4358
  
4359
  
4360
  
4361
  
4362
  
4363
  
4364
  
4365
  
4366
  
4367
  
4368
  
4369
  
4370
  
4371
  
4372
  
4373
  
4374
  
4375
  
4376
  
4377
  
4378
  
4379
  
4380
  
4381
  
4382
  
4383
  
4384
  
4385
  
4386
  
4387
  
4388
  
4389
  
4390
  
4391
  
4392
  
4393
  
4394
  
4395
  
4396
  
4397
  
4398
  
4399
  
4400
  
4401
  
4402
  
4403
  
4404
  
4405
  
4406
  
4407
  
4408
  
4409
  
4410
  
4411
  
4412
  
4413
  
4414
  
4415
  
4416
  
4417
  
4418
  
4419
  
4420
  
4421
  
4422
  
4423
  
4424
  
4425
  
4426
  
4427
  
4428
  
4429
  
4430
  
4431
  
4432
  
4433
  
4434
  
4435
  
4436
  
4437
  
4438
  
4439
  
4440
  
4441
  
4442
  
4443
  
4444
  
4445
  
4446
  
4447
  
4448
  
4449
  
4450
  
4451
  
4452
  
4453
  
4454
  
4455
  
4456
  
4457
  
4458
  
4459
  
4460
  
4461
  
4462
  
4463
  
4464
  
4465
  
4466
  
4467
  
4468
  
4469
  
4470
  
4471
  
4472
  
4473
  
4474
  
4475
  
4476
  
4477
  
4478
  
4479
  
4480
  
4481
  
4482
  
4483
  
4484
  
4485
  
4486
  
4487
  
4488
  
4489
  
4490
  
4491
  
4492
  
4493
  
4494
  
4495
  
4496
  
4497
  
4498
  
4499
  
4500
  
4501
  
4502
  
4503
  
4504
  
4505
  
4506
  
4507
  
4508
  
4509
  
4510
  
4511
  
4512
  
4513
  
4514
  
4515
  
4516
  
4517
  
4518
  
4519
  
4520
  
4521
  
4522
  
4523
  
4524
  
4525
  
4526
  
4527
  
4528
  
4529
  
4530
  
4531
  
4532
  
4533
  
4534
  
4535
  
4536
  
4537
  
4538
  
4539
  
4540
  
4541
  
4542
  
4543
  
4544
  
4545
  
4546
  
4547
  
4548
  
4549
  
4550
  
4551
  
4552
  
4553
  
4554
  
4555
  
4556
  
4557
  
4558
  
4559
  
4560
  
4561
  
4562
  
4563
  
4564
  
4565
  
4566
  
4567
  
4568
  
4569
  
4570
  
4571
  
4572
  
4573
  
4574
  
4575
  
4576
  
4577
  
4578
  
4579
  
4580
  
4581
  
4582
  
4583
  
4584
  
4585
  
4586
  
4587
  
4588
  
4589
  
4590
  
4591
  
4592
  
4593
  
4594
  
4595
  
4596
  
4597
  
4598
  
4599
  
4600
  
4601
  
4602
  
4603
  
4604
  
4605
  
4606
  
4607
  
4608
  
4609
  
4610
  
4611
  
4612
  
4613
  
4614
  
4615
  
4616
  
4617
  
4618
  
4619
  
4620
  
4621
  
4622
  
4623
  
4624
  
4625
  
4626
  
4627
  
4628
  
4629
  
4630
  
4631
  
4632
  
4633
  
4634
  
4635
  
4636
  
4637
  
4638
  
4639
  
4640
  
4641
  
4642
  
4643
  
4644
  
4645
  
4646
  
4647
  
4648
  
4649
  
4650
  
4651
  
4652
  
4653
  
4654
  
4655
  
4656
  
4657
  
4658
  
4659
  
4660
  
4661
  
4662
  
4663
  
4664
  
4665
  
4666
  
4667
  
4668
  
4669
  
4670
  
4671
  
4672
  
4673
  
4674
  
4675
  
4676
  
4677
  
4678
  
4679
  
4680
  
4681
  
4682
  
4683
  
4684
  
4685
  
4686
  
4687
  
4688
  
4689
  
4690
  
4691
  
4692
  
4693
  
4694
  
4695
  
4696
  
4697
  
4698
  
4699
  
4700
  
4701
  
4702
  
4703
  
4704
  
4705
  
4706
  
4707
  
4708
  
4709
  
4710
  
4711
  
4712
  
4713
  
4714
  
4715
  
4716
  
4717
  
4718
  
4719
  
4720
  
4721
  
4722
  
4723
  
4724
  
4725
  
4726
  
4727
  
4728
  
4729
  
4730
  
4731
  
4732
  
4733
  
4734
  
4735
  
4736
  
4737
  
4738
  
4739
  
4740
  
4741
  
4742
  
4743
  
4744
  
4745
  
4746
  
4747
  
4748
  
4749
  
4750
  
4751
  
4752
  
4753
  
4754
  
4755
  
4756
  
4757
  
4758
  
4759
  
4760
  
4761
  
4762
  
4763
  
4764
  
4765
  
4766
  
4767
  
4768
  
4769
  
4770
  
4771
  
4772
  
4773
  
4774
  
4775
  
4776
  
4777
  
4778
  
4779
  
4780
  
4781
  
4782
  
4783
  
4784
  
4785
  
4786
  
4787
  
4788
  
4789
  
4790
  
4791
  
4792
  
4793
  
4794
  
4795
  
4796
  
4797
  
4798
  
4799
  
4800
  
4801
  
4802
  
4803
  
4804
  
4805
  
4806
  
4807
  
4808
  
4809
  
4810
  
4811
  
4812
  
4813
  
4814
  
4815
  
4816
  
4817
  
4818
  
4819
  
4820
  
4821
  
4822
  
4823
  
4824
  
4825
  
4826
  
4827
  
4828
  
4829
  
4830
  
4831
  
4832
  
4833
  
4834
  
4835
  
4836
  
4837
  
4838
  
4839
  
4840
  
4841
  
4842
  
4843
  
4844
  
4845
  
4846
  
4847
  
4848
  
4849
  
4850
  
4851
  
4852
  
4853
  
4854
  
4855
  
4856
  
4857
  
4858
  
4859
  
4860
  
4861
  
4862
  
4863
  
4864
  
4865
  
4866
  
4867
  
4868
  
4869
  
4870
  
4871
  
4872
  
4873
  
4874
  
4875
  
4876
  
4877
  
4878
  
4879
  
4880
  
4881
  
4882
  
4883
  
4884
  
4885
  
4886
  
4887
  
4888
  
4889
  
4890
  
4891
  
4892
  
4893
  
4894
  
4895
  
4896
  
4897
  
4898
  
4899
  
4900
  
4901
  
4902
  
4903
  
4904
  
4905
  
4906
  
4907
  
4908
  
4909
  
4910
  
4911
  
4912
  
4913
  
4914
  
4915
  
4916
  
4917
  
4918
  
4919
  
4920
  
4921
  
4922
  
4923
  
4924
  
4925
  
4926
  
4927
  
4928
  
4929
  
4930
  
4931
  
4932
  
4933
  
4934
  
4935
  
4936
  
4937
  
4938
  
4939
  
4940
  
4941
  
4942
  
4943
  
4944
  
4945
  
4946
  
4947
  
4948
  
4949
  
4950
  
4951
  
4952
  
4953
  
4954
  
4955
  
4956
  
4957
  
4958
  
4959
  
4960
  
4961
  
4962
  
4963
  
4964
  
4965
  
4966
  
4967
  
4968
  
4969
  
4970
  
4971
  
4972
  
4973
  
4974
  
4975
  
4976
  
4977
  
4978
  
4979
  
4980
  
4981
  
4982
  
4983
  
4984
  
4985
  
4986
  
4987
  
4988
  
4989
  
4990
  
4991
  
4992
  
4993
  
4994
  
4995
  
4996
  
4997
  
4998
  
4999
  
5000
  
5001
  
5002
  
5003
  
5004
  
5005
  
5006
  
5007
  
5008
  
5009
  
5010
  
5011
  
5012
  
5013
  
5014
  
5015
  
5016
  
5017
  
5018
  
5019
  
5020
  
5021
  
5022
  
5023
  
5024
  
5025
  
5026
  
5027
  
5028
  
5029
  
5030
  
5031
  
5032
  
5033
  
5034
  
5035
  
5036
  
5037
  
5038
  
5039
  
5040
  
5041
  
5042
  
5043
  
5044
  
5045
  
5046
  
5047
  
5048
  
5049
  
5050
  
5051
  
5052
  
5053
  
5054
  
5055
  
5056
  
5057
  
5058
  
5059
  
5060
  
5061
  
5062
  
5063
  
5064
  
5065
  
5066
  
5067
  
5068
  
5069
  
5070
  
5071
  
5072
  
5073
  
5074
  
5075
  
5076
  
5077
  
5078
  
5079
  
5080
  
5081
  
5082
  
5083
  
5084
  
5085
  
5086
  
5087
  
5088
  
5089
  
5090
  
5091
  
5092
  
5093
  
5094
  
5095
  
5096
  
5097
  
5098
  
5099
  
5100
  
/* -*- c -*- 
|| This file is part of Pike. For copyright information see COPYRIGHT. 
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING 
|| for more information. 
*/ 
 
%pure-parser 
 
/* Expect a single shift/reduce conflict (dangling else). */ 
%expect 1 
 
%token TOK_ARROW "->" 
 
/* 
 * Basic value pushing 
 */ 
%token TOK_CONSTANT "constant" 
%token TOK_FLOAT "float literal" 
%token TOK_STRING "string literal" 
%token TOK_NUMBER "integer literal" 
 
/* 
 * These are the predefined functions that can be accessed from Pike. 
 */ 
 
%token TOK_INC "++" 
%token TOK_DEC "--" 
%token TOK_RETURN "return" 
 
%token TOK_EQ "==" 
%token TOK_GE ">=" 
%token TOK_LE "<=" 
%token TOK_NE "!=" 
%token TOK_NOT "!" 
%token TOK_LSH "<<" 
%token TOK_RSH ">>" 
%token TOK_LAND "&&" 
%token TOK_LOR "||" 
 
%token TOK_SWITCH "switch" 
%token TOK_SSCANF "sscanf" 
%token TOK_CATCH "catch" 
%token TOK_FOREACH "foreach" 
 
/* This is the end of file marker used by the lexer 
 * to enable nicer EOF in error handling. 
 */ 
%token TOK_LEX_EOF "end of file" 
 
%token TOK_ADD_EQ "+=" 
%token TOK_AND_EQ "&=" 
%token TOK_ARRAY_ID "array" 
%token TOK_ATTRIBUTE_ID "__attribute__" 
%token TOK_BREAK "break" 
%token TOK_CASE "case" 
%token TOK_CLASS "class" 
%token TOK_COLON_COLON "::" 
%token TOK_CONTINUE "continue" 
%token TOK_DEFAULT "default" 
%token TOK_DEPRECATED_ID "__deprecated__" 
%token TOK_DIV_EQ "/=" 
%token TOK_DO "do" 
%token TOK_DOT_DOT ".." 
%token TOK_DOT_DOT_DOT "..." 
%token TOK_ELSE "else" 
%token TOK_ENUM "enum" 
%token TOK_EXTERN "extern" 
%token TOK_FLOAT_ID "float" 
%token TOK_FOR "for" 
%token TOK_FUNCTION_ID "function" 
%token TOK_GAUGE "gauge" 
%token TOK_GLOBAL "global" 
%token TOK_IDENTIFIER "identifier" 
%token TOK_RESERVED "reserved identifier" 
%token TOK_IF "if" 
%token TOK_IMPORT "import" 
%token TOK_INHERIT "inherit" 
%token TOK_INLINE "inline" 
%token TOK_LOCAL_ID "local" 
%token TOK_FINAL_ID "final" 
%token TOK_FUNCTION_NAME "__func__" 
%token TOK_INT_ID "int" 
%token TOK_LAMBDA "lambda" 
%token TOK_MULTISET_ID "multiset" 
%token TOK_MULTISET_END ">)" 
%token TOK_MULTISET_START "(<" 
%token TOK_LSH_EQ "<<=" 
%token TOK_MAPPING_ID "mapping" 
%token TOK_MIXED_ID "mixed" 
%token TOK_MOD_EQ "%=" 
%token TOK_MULT_EQ "*=" 
%token TOK_OBJECT_ID "object" 
%token TOK_OR_EQ "|=" 
%token TOK_POW "**" 
%token TOK_POW_EQ "**=" 
%token TOK_PRIVATE "private" 
%token TOK_PROGRAM_ID "program" 
%token TOK_PROTECTED "protected" 
%token TOK_PREDEF "predef" 
%token TOK_PUBLIC "public" 
%token TOK_RSH_EQ ">>=" 
%token TOK_STATIC "static" 
%token TOK_STRING_ID "string" 
%token TOK_SUB_EQ "-=" 
%token TOK_TYPEDEF "typedef" 
%token TOK_TYPEOF "typeof" 
%token TOK_VARIANT "variant" 
%token TOK_VERSION "version prefix" 
%token TOK_VOID_ID "void" 
%token TOK_WEAK "__weak__" 
%token TOK_WHILE "while" 
%token TOK_XOR_EQ "^=" 
%token TOK_OPTIONAL "optional" 
%token TOK_SAFE_INDEX "?->" 
%token TOK_SAFE_START_INDEX "[?" 
%token TOK_BITS "bits" 
%token TOK_AUTO_ID "auto" 
 
 
%right '=' 
%right '?' 
 
%left TOK_LOR 
%left TOK_LAND 
%left '|' 
%left '^' 
%left '&' 
%left TOK_EQ TOK_NE 
%left '>' TOK_GE '<' TOK_LE  /* nonassoc? */ 
%left TOK_LSH TOK_RSH 
%left '+' '-' 
%left '*' '%' '/' 
%right TOK_NOT '~' 
%right TOK_POW 
%nonassoc TOK_INC TOK_DEC 
 
%{ 
/* This is the grammar definition of Pike. */ 
 
#include "global.h" 
#ifdef HAVE_MEMORY_H 
#include <memory.h> 
#endif 
 
#include "interpret.h" 
#include "array.h" 
#include "object.h" 
#include "mapping.h" 
#include "stralloc.h" 
#include "las.h" 
#include "interpret.h" 
#include "program.h" 
#include "pike_types.h" 
#include "constants.h" 
#include "pike_macros.h" 
#include "pike_error.h" 
#include "docode.h" 
#include "pike_embed.h" 
#include "opcodes.h" 
#include "operators.h" 
#include "bignum.h" 
 
#define YYMAXDEPTH      1000 
 
#ifdef PIKE_DEBUG 
#ifndef YYDEBUG 
/* May also be defined by machine.h */ 
#define YYDEBUG 1 
#endif /* YYDEBUG */ 
#endif 
 
/* Get verbose parse error reporting. */ 
#define YYERROR_VERBOSE 1 
 
/* #define LAMBDA_DEBUG 1 */ 
 
static void yyerror_reserved(const char *keyword); 
static struct pike_string *get_new_name(struct pike_string *prefix); 
int add_local_name(struct pike_string *, struct pike_type *, node *); 
int low_add_local_name(struct compiler_frame *, 
                       struct pike_string *, struct pike_type *, node *); 
static void mark_lvalues_as_used(node *n); 
static node *lexical_islocal(struct pike_string *); 
static node *safe_inc_enum(node *n); 
static node *find_versioned_identifier(struct pike_string *identifier, 
                                       int major, int minor); 
static int call_handle_import(struct pike_string *s); 
static void update_current_type(); 
 
static int inherit_depth; 
static struct program_state *inherit_state = NULL; 
 
/* 
 * Kludge for Bison not using prototypes. 
 */ 
#ifndef __GNUC__ 
#ifndef __cplusplus 
static void __yy_memcpy(char *to, YY_FROM_CONST char *from, 
                        YY_COUNT_TYPE count); 
#endif /* !__cplusplus */ 
#endif /* !__GNUC__ */ 
 
%} 
 
%union 
{ 
  int number; 
  FLOAT_TYPE fnum; 
  struct node_s *n; 
  char *str; 
  void *ptr; 
} 
 
%{ 
/* Need to be included after YYSTYPE is defined. */ 
#define INCLUDED_FROM_LANGUAGE_YACC 
#include "lex.h" 
#include "pike_compiler.h" 
%} 
 
%{ 
/* Include <stdio.h> our selves, so that we can do our magic 
 * without being disturbed... */ 
#include <stdio.h> 
int yylex(YYSTYPE *yylval); 
/* Bison is stupid, and tries to optimize for space... */ 
#ifdef YYBISON 
#define short int 
#endif /* YYBISON */ 
 
%} 
 
%type <fnum> TOK_FLOAT 
 
%type <number> TOK_ARRAY_ID 
%type <number> TOK_BREAK 
%type <number> TOK_CASE 
%type <number> TOK_CATCH 
%type <number> TOK_CONTINUE 
%type <number> TOK_DEFAULT 
%type <number> TOK_DO 
%type <number> TOK_ELSE 
%type <number> TOK_FLOAT_ID 
%type <number> TOK_FOR 
%type <number> TOK_FOREACH 
%type <number> TOK_FUNCTION_ID 
%type <number> TOK_GAUGE 
%type <number> TOK_IF 
%type <number> TOK_INHERIT 
%type <number> TOK_INLINE 
%type <number> TOK_INT_ID 
%type <number> TOK_LAMBDA 
%type <number> TOK_LOCAL_ID 
%type <number> TOK_MAPPING_ID 
%type <number> TOK_MIXED_ID 
%type <number> TOK_MULTISET_ID 
%type <number> TOK_OBJECT_ID 
%type <number> TOK_PREDEF 
%type <number> TOK_PRIVATE 
%type <number> TOK_PROGRAM_ID 
%type <number> TOK_PROTECTED 
%type <number> TOK_PUBLIC 
%type <number> TOK_RETURN 
%type <number> TOK_SSCANF 
%type <number> TOK_STATIC 
%type <number> TOK_STRING_ID 
%type <number> TOK_AUTO_ID 
%type <number> TOK_SWITCH 
%type <number> TOK_VOID_ID 
%type <number> TOK_WHILE 
%type <number> arguments 
%type <number> arguments2 
%type <number> func_args 
%type <number> create_arguments 
%type <number> create_arguments2 
%type <number> create_arg 
%type <number> assign 
%type <number> modifier 
%type <number> modifier_list 
%type <number> modifiers 
%type <number> implicit_modifiers 
%type <number> inherit_specifier 
%type <number> function_type_list 
%type <number> function_type_list2 
%type <number> optional_dot_dot_dot 
%type <number> optional_comma 
%type <number> optional_constant 
%type <number> optional_create_arguments 
%type <number> save_block_level 
%type <number> save_locals 
 
%type <str> magic_identifiers 
%type <str> magic_identifiers1 
%type <str> magic_identifiers2 
%type <str> magic_identifiers3 
 
/* The following symbols return type information */ 
 
%type <n> number_or_minint 
%type <n> number_or_maxint 
%type <n> cast 
%type <n> soft_cast 
%type <n> real_string_constant 
%type <n> real_string_or_identifier 
%type <n> string_constant 
%type <n> string_or_identifier 
%type <n> string_segment 
%type <n> string 
%type <n> TOK_STRING 
%type <n> TOK_NUMBER 
%type <n> TOK_BITS 
%type <n> optional_rename_inherit 
%type <n> optional_identifier 
%type <n> implicit_identifier 
%type <n> TOK_IDENTIFIER 
%type <n> TOK_RESERVED 
%type <n> TOK_VERSION 
%type <n> attribute 
%type <n> assoc_pair 
%type <n> line_number_info 
%type <n> block 
%type <n> optional_block 
%type <n> failsafe_block 
%type <n> open_paren_with_line_info 
%type <n> close_paren_or_missing 
%type <n> open_bracket_with_line_info 
%type <n> block_or_semi 
%type <n> break 
%type <n> case 
%type <n> catch 
%type <n> catch_arg 
%type <n> anon_class 
%type <n> named_class 
%type <n> enum 
%type <n> enum_value 
%type <n> safe_comma_expr 
%type <n> comma_expr 
%type <n> comma_expr2 
%type <n> range_bound 
%type <n> cond 
%type <n> continue 
%type <n> default 
%type <n> do 
%type <n> safe_expr0 
%type <n> splice_expr 
%type <n> expr01 
%type <n> expr1 
%type <n> expr2 
%type <n> expr3 expr0 
%type <n> apply 
%type <n> expr4 
%type <n> expr5 
%type <n> expr_list 
%type <n> expr_list2 
%type <n> for 
%type <n> for_expr 
%type <n> foreach 
%type <n> gauge 
%type <n> idents 
%type <n> idents2 
%type <n> labeled_statement 
%type <n> lambda 
%type <n> literal_expr 
%type <n> local_name_list 
%type <n> low_idents 
%type <n> safe_lvalue 
%type <n> lvalue 
%type <n> lvalue_list 
%type <n> low_lvalue_list 
%type <n> m_expr_list 
%type <n> m_expr_list2 
%type <n> new_local_name 
%type <n> normal_label_statement 
%type <n> optional_else_part 
%type <n> optional_label 
%type <n> propagated_enum_value 
%type <n> return 
%type <n> sscanf 
%type <n> statement 
%type <n> statements 
%type <n> statement_with_semicolon 
%type <n> switch 
%type <n> typeof 
%type <n> unused 
%type <n> unused2 
%type <n> while 
%type <n> optional_comma_expr 
%type <n> low_program_ref 
%type <n> inherit_ref 
%type <n> local_function 
%type <n> magic_identifier 
%type <n> simple_identifier 
%type <n> foreach_lvalues 
%type <n> foreach_optional_lvalue 
 
%type <ptr> start_function 
%type <ptr> start_lambda 
%% 
 
all: program { YYACCEPT; } 
  | program TOK_LEX_EOF { YYACCEPT; } 
/*  | error TOK_LEX_EOF { YYABORT; } */ 
  ; 
 
program: program def 
  | program ';' 
  |  /* empty */ 
  ; 
 
real_string_or_identifier: TOK_IDENTIFIER 
  | real_string_constant 
  ; 
 
optional_rename_inherit: ':' real_string_or_identifier { $$=$2; } 
  | ':' bad_identifier { $$=0; } 
  | ':' error { $$=0; } 
  | { $$=0; } 
  ; 
 
/* NOTE: This rule pushes a string "name" on the stack in addition 
 * to resolving the program reference. 
 */ 
low_program_ref: string_constant 
  { 
    STACK_LEVEL_START(0); 
 
    ref_push_string($1->u.sval.u.string); 
    if (call_handle_inherit($1->u.sval.u.string)) { 
      STACK_LEVEL_CHECK(2); 
      $$=mksvaluenode(Pike_sp-1); 
      pop_stack(); 
    } 
    else 
      $$=mknewintnode(0); 
    STACK_LEVEL_CHECK(1); 
    if($$->name) free_string($$->name); 
#ifdef PIKE_DEBUG 
    if (TYPEOF(Pike_sp[-1]) != T_STRING) { 
      Pike_fatal("Compiler lost track of program name.\n"); 
    } 
#endif /* PIKE_DEBUG */ 
    /* FIXME: Why not use $1->u.sval.u.string here? */ 
    add_ref( $$->name=Pike_sp[-1].u.string ); 
    free_node($1); 
 
    STACK_LEVEL_DONE(1); 
  } 
  | idents 
  { 
    STACK_LEVEL_START(0); 
 
    if(Pike_compiler->last_identifier) 
    { 
      ref_push_string(Pike_compiler->last_identifier); 
    }else{ 
      push_empty_string(); 
    } 
    $$=$1; 
 
    STACK_LEVEL_DONE(1); 
  } 
  ; 
 
/* NOTE: Pushes the resolved program on the stack. */ 
program_ref: low_program_ref 
  { 
    STACK_LEVEL_START(0); 
 
    resolv_program($1); 
    free_node($1); 
 
    STACK_LEVEL_DONE(1); 
  } 
  ; 
 
inherit_ref: 
  { 
    SET_FORCE_RESOLVE($<number>$); 
  } 
  low_program_ref 
  { 
    UNSET_FORCE_RESOLVE($<number>1); 
    $$ = $2; 
  } 
  ; 
 
inheritance: modifiers TOK_INHERIT inherit_ref optional_rename_inherit ';' 
  { 
    if (($1 & ID_EXTERN) && (Pike_compiler->compiler_pass == 1)) { 
      yywarning("Extern declared inherit."); 
    } 
    if($3) 
    { 
      struct pike_string *s=Pike_sp[-1].u.string; 
      if($4) s=$4->u.sval.u.string; 
      compiler_do_inherit($3,$1,s); 
    } 
    if($4) free_node($4); 
    pop_stack(); 
    if ($3) free_node($3); 
  } 
  | modifiers TOK_INHERIT inherit_ref error ';' 
  { 
    if ($3) free_node($3); 
    pop_stack(); 
    yyerrok; 
  } 
  | modifiers TOK_INHERIT inherit_ref error TOK_LEX_EOF 
  { 
    if ($3) free_node($3); 
    pop_stack(); 
    yyerror("Missing ';'."); 
    yyerror("Unexpected end of file."); 
  } 
  | modifiers TOK_INHERIT inherit_ref error '}' 
  { 
    if ($3) free_node($3); 
    pop_stack(); 
    yyerror("Missing ';'."); 
  } 
  | modifiers TOK_INHERIT error ';' { yyerrok; } 
  | modifiers TOK_INHERIT error TOK_LEX_EOF 
  { 
    yyerror("Missing ';'."); 
    yyerror("Unexpected end of file."); 
  } 
  | modifiers TOK_INHERIT error '}' { yyerror("Missing ';'."); } 
  ; 
 
import: TOK_IMPORT idents ';' 
  { 
    resolv_constant($2); 
    free_node($2); 
    use_module(Pike_sp-1); 
    pop_stack(); 
  } 
  | TOK_IMPORT string ';' 
  { 
    if (call_handle_import($2->u.sval.u.string)) { 
      use_module(Pike_sp-1); 
      pop_stack(); 
    } 
    free_node($2); 
  } 
  | TOK_IMPORT error ';' { yyerrok; } 
  | TOK_IMPORT error TOK_LEX_EOF 
  { 
    yyerror("Missing ';'."); 
    yyerror("Unexpected end of file."); 
  } 
  | TOK_IMPORT error '}' { yyerror("Missing ';'."); } 
  ; 
 
constant_name: TOK_IDENTIFIER '=' safe_expr0 
  { 
    /* This can be made more lenient in the future */ 
 
    /* Ugly hack to make sure that $3 is optimized */ 
    { 
      int tmp=Pike_compiler->compiler_pass; 
      $3=mknode(F_COMMA_EXPR,$3,0); 
      Pike_compiler->compiler_pass=tmp; 
    } 
 
    if (Pike_compiler->current_modifiers & ID_EXTERN) { 
      int depth = 0; 
      struct program_state *state = Pike_compiler; 
      node *n = $3; 
      while (((n->token == F_COMMA_EXPR) || (n->token == F_ARG_LIST)) && 
             ((!CAR(n)) ^ (!CDR(n)))) { 
        if (CAR(n)) n = CAR(n); 
        else n = CDR(n); 
      } 
      if (n->token == F_EXTERNAL) { 
        while (state && (state->new_program->id != n->u.integer.a)) { 
          depth++; 
          state = state->previous; 
        } 
      } 
      if (depth && state) { 
        /* Alias for a symbol in a surrounding scope. */ 
        int id = really_low_reference_inherited_identifier(state, 0, 
                                                           n->u.integer.b); 
        define_alias($1->u.sval.u.string, n->type, 
                     Pike_compiler->current_modifiers & ~ID_EXTERN, 
                     depth, id); 
      } else if (Pike_compiler->compiler_pass == 1) { 
        yyerror("Invalid extern declared constant."); 
        add_constant($1->u.sval.u.string, &svalue_undefined, 
                     Pike_compiler->current_modifiers & ~ID_EXTERN); 
      } 
    } else { 
      if(!is_const($3)) { 
        if (Pike_compiler->compiler_pass == 2) { 
          yyerror("Constant definition is not constant."); 
        } 
        add_constant($1->u.sval.u.string, 0, 
                     Pike_compiler->current_modifiers & ~ID_EXTERN); 
      } else { 
        if(!Pike_compiler->num_parse_error) 
        { 
          ptrdiff_t tmp=eval_low($3,1); 
          if(tmp < 1) 
          { 
            yyerror("Error in constant definition."); 
            push_undefined(); 
          }else{ 
            pop_n_elems((INT32)(tmp - 1)); 
          } 
        } else { 
          push_undefined(); 
        } 
        add_constant($1->u.sval.u.string, Pike_sp-1, 
                     Pike_compiler->current_modifiers & ~ID_EXTERN); 
        pop_stack(); 
      } 
    } 
  const_def_ok: 
    if($3) free_node($3); 
    free_node($1); 
  } 
  | bad_identifier '=' safe_expr0 { if ($3) free_node($3); } 
  | error '=' safe_expr0 { if ($3) free_node($3); } 
  ; 
 
constant_list: constant_name 
  | constant_list ',' constant_name 
  ; 
 
constant: modifiers TOK_CONSTANT constant_list ';' {} 
  | modifiers TOK_CONSTANT error ';' { yyerrok; } 
  | modifiers TOK_CONSTANT error TOK_LEX_EOF 
  { 
    yyerror("Missing ';'."); 
    yyerror("Unexpected end of file."); 
  } 
  | modifiers TOK_CONSTANT error '}' { yyerror("Missing ';'."); } 
  ; 
 
block_or_semi: block 
  { 
    $$ = mknode(F_COMMA_EXPR,$1,mknode(F_RETURN,mkintnode(0),0)); 
    COPY_LINE_NUMBER_INFO($$, $1); 
  } 
  | ';' { $$ = NULL; } 
  | '=' safe_comma_expr expected_semicolon { $$=mknode(F_RETURN,$2,0); } 
  | TOK_LEX_EOF { yyerror("Expected ';'."); $$ = NULL; } 
  | error { $$ = NULL; } 
  ; 
 
 
open_paren_with_line_info: '(' 
  { 
    /* Used to hold line-number info */ 
    $$ = mkintnode(0); 
  } 
  ; 
 
close_paren_or_missing: ')' 
  { 
    /* Used to hold line-number info */ 
    $$ = mkintnode(0); 
  } 
  | /* empty */ 
  { 
    yyerror("Missing ')'."); 
    /* Used to hold line-number info */ 
    $$ = mkintnode(0); 
  } 
  ; 
 
close_brace_or_missing: '}' 
  | /* empty */ 
  { 
    yyerror("Missing '}'."); 
  } 
  ; 
 
close_brace_or_eof: '}' 
  | TOK_LEX_EOF 
  { 
    yyerror("Missing '}'."); 
  } 
  ; 
 
open_bracket_with_line_info: '[' 
  { 
    /* Used to hold line-number info */ 
    $$ = mkintnode(0); 
  } 
  ; 
 
close_bracket_or_missing: ']' 
  | /* empty */ 
  { 
    yyerror("Missing ']'."); 
  } 
  ; 
 
/* This variant is used to start a new compiler frame for functions 
 * with a declared return type. 
 * 
 * On entry the return type to be is taken from 
 * 
 *   compiler_frame->current_type 
 * 
 * in the current frame (stored there eg via simple_type). This is 
 * then copied to 
 * 
 *   compiler_frame->current_return_type 
 * 
 * for the new frame. 
 */ 
start_function: /* empty */ 
  { 
    push_compiler_frame(SCOPE_LOCAL); 
 
    if(!Pike_compiler->compiler_frame->previous || 
       !Pike_compiler->compiler_frame->previous->current_type) 
    { 
      yyerror("Internal compiler error (start_function)."); 
      copy_pike_type(Pike_compiler->compiler_frame->current_return_type, 
                     mixed_type_string); 
    }else{ 
      copy_pike_type(Pike_compiler->compiler_frame->current_return_type, 
                     Pike_compiler->compiler_frame->previous->current_type); 
    } 
 
    $$ = Pike_compiler->compiler_frame; 
  } 
  ; 
 
optional_constant: /* empty */ 
  { 
    $$ = OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT; 
  } 
  | TOK_CONSTANT 
  { 
    $$ = 0; 
  } 
  ; 
 
def: modifiers optional_attributes simple_type optional_constant 
     TOK_IDENTIFIER start_function 
  '(' 
  { 
    $<number>$ = 0; 
    /* Check for the (very special) case of create and create_args. */ 
    if (Pike_compiler->num_create_args) { 
      struct pike_string *create_string = NULL; 
      int e; 
      MAKE_CONST_STRING(create_string, "create"); 
      if ($5->u.sval.u.string == create_string) { 
        /* Prepend the create arguments. */ 
        if (Pike_compiler->num_create_args < 0) { 
          Pike_compiler->varargs = 1; 
          for (e = 0; e < -Pike_compiler->num_create_args; e++) { 
            struct identifier *id = 
              Pike_compiler->new_program->identifiers + e; 
            add_ref(id->type); 
            add_local_name(empty_pike_string, id->type, 0); 
            /* Note: add_local_name() above will return e. */ 
            Pike_compiler->compiler_frame->variable[e].flags |= 
              LOCAL_VAR_IS_USED; 
          } 
        } else { 
          for (e = 0; e < Pike_compiler->num_create_args; e++) { 
            struct identifier *id = 
              Pike_compiler->new_program->identifiers + e; 
            add_ref(id->type); 
            add_local_name(empty_pike_string, id->type, 0); 
            /* Note: add_local_name() above will return e. */ 
            Pike_compiler->compiler_frame->variable[e].flags |= 
              LOCAL_VAR_IS_USED; 
          } 
        } 
        $<number>$ = e; 
      } 
    } 
  } 
  arguments close_paren_or_missing 
  { 
    int e; 
 
    /* Adjust opt_flags in case we've got an optional_constant. */ 
    Pike_compiler->compiler_frame->opt_flags = $4; 
 
    /* construct the function type */ 
    push_finished_type(Pike_compiler->compiler_frame->current_return_type); 
 
    e = $<number>8 + $9 - 1; 
    if(Pike_compiler->varargs && 
       (!$<number>8 || (Pike_compiler->num_create_args >= 0))) 
    { 
      push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
      e--; 
      pop_type_stack(T_ARRAY); 
    }else{ 
      push_type(T_VOID); 
    } 
    push_type(T_MANY); 
    for(; e>=0; e--) 
    { 
      push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
      push_type(T_FUNCTION); 
    } 
 
    if (Pike_compiler->current_attributes) { 
      node *n = Pike_compiler->current_attributes; 
      while (n) { 
        push_type_attribute(CDR(n)->u.sval.u.string); 
        n = CAR(n); 
      } 
    } 
 
    { 
      struct pike_type *s=compiler_pop_type(); 
      int i = isidentifier($5->u.sval.u.string); 
 
      if (Pike_compiler->compiler_pass != 1) { 
        if (i < 0) { 
          my_yyerror("Identifier %S lost after first pass.", 
                     $5->u.sval.u.string); 
        } 
      } 
 
      $<n>$ = mktypenode(s); 
      free_type(s); 
    } 
 
 
/*    if(Pike_compiler->compiler_pass==1) */ 
    { 
      /* FIXME: 
       * set current_function_number for local functions as well 
       */ 
      Pike_compiler->compiler_frame->current_function_number= 
        define_function($5->u.sval.u.string, 
                        $<n>$->u.sval.u.type, 
                        $1 & (~ID_EXTERN), 
                        IDENTIFIER_PIKE_FUNCTION | 
                        (Pike_compiler->varargs?IDENTIFIER_VARARGS:0), 
                        0, 
                        $4); 
 
      Pike_compiler->varargs=0; 
    } 
  } 
  block_or_semi 
  { 
    int e; 
    if($12) 
    { 
      int f; 
      node *check_args = NULL; 
      struct compilation *c = THIS_COMPILATION; 
      struct pike_string *save_file = c->lex.current_file; 
      int save_line  = c->lex.current_line; 
      int num_required_args = 0; 
      struct identifier *i; 
      c->lex.current_file = $5->current_file; 
      c->lex.current_line = $5->line_number; 
 
      if (($1 & ID_EXTERN) && (Pike_compiler->compiler_pass == 1)) { 
        yywarning("Extern declared function definition."); 
      } 
 
      for(e=0; e<$<number>8+$9; e++) 
      { 
        if((e >= $<number>8) && 
           (!Pike_compiler->compiler_frame->variable[e].name || 
            !Pike_compiler->compiler_frame->variable[e].name->len)) 
        { 
          my_yyerror("Missing name for argument %d.", e - $<number>8); 
        } else { 
          if (Pike_compiler->compiler_pass == 2) { 
              /* FIXME: Should probably use some other flag. */ 
              if ((runtime_options & RUNTIME_CHECK_TYPES) && 
                  (Pike_compiler->compiler_frame->variable[e].type != 
                   mixed_type_string)) { 
                node *local_node; 
 
                /* fprintf(stderr, "Creating soft cast node for local #%d\n", e);*/ 
 
                local_node = mkcastnode(mixed_type_string, mklocalnode(e, 0)); 
 
                /* NOTE: The cast to mixed above is needed to avoid generating 
                 *       compilation errors, as well as avoiding optimizations 
                 *       in mksoftcastnode(). 
                 */ 
                check_args = 
                  mknode(F_COMMA_EXPR, check_args, 
                         mksoftcastnode(Pike_compiler->compiler_frame->variable[e].type, 
                                        local_node)); 
              } 
          } 
        } 
      } 
 
      if ($<number>8) { 
        /* Hook in the initializers for the create arguments. */ 
        for (e = $<number>8; e--;) { 
          $12 = mknode(F_COMMA_EXPR, 
                       mknode(F_POP_VALUE, 
                              mknode(F_ASSIGN, mkidentifiernode(e), 
                                     mklocalnode(e, 0)), NULL), 
                       $12); 
        } 
      } 
 
      { 
        int l = $12->line_number; 
        struct pike_string *f = $12->current_file; 
        if (check_args) { 
          /* Prepend the arg checking code. */ 
          $12 = mknode(F_COMMA_EXPR, mknode(F_POP_VALUE, check_args, NULL), $12); 
        } 
        c->lex.current_line = l; 
        c->lex.current_file = f; 
      } 
 
      f=dooptcode($5->u.sval.u.string, $12, $<n>11->u.sval.u.type, $1); 
 
      i = ID_FROM_INT(Pike_compiler->new_program, f); 
      i->opt_flags = Pike_compiler->compiler_frame->opt_flags; 
 
      if (Pike_compiler->compiler_pass == 2 && 
          Pike_compiler->compiler_frame->current_return_type->type == PIKE_T_AUTO) 
      { 
        /* Change "auto" return type to actual return type. */ 
        push_finished_type(Pike_compiler->compiler_frame->current_return_type->car); 
 
        e = $<number>8 + $9 - 1; 
        if(Pike_compiler->varargs && 
           (!$<number>8 || (Pike_compiler->num_create_args >= 0))) 
        { 
          push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
          e--; 
          pop_type_stack(T_ARRAY); 
        }else{ 
          push_type(T_VOID); 
        } 
        push_type(T_MANY); 
        for(; e>=0; e--) 
        { 
          push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
          push_type(T_FUNCTION); 
        } 
 
        if (Pike_compiler->current_attributes) 
        { 
          node *n = Pike_compiler->current_attributes; 
          while (n) { 
            push_type_attribute(CDR(n)->u.sval.u.string); 
            n = CAR(n); 
          } 
        } 
 
        free_type( i->type ); 
        i->type = compiler_pop_type(); 
      } 
 
#ifdef PIKE_DEBUG 
      if(Pike_interpreter.recoveries && 
         ((Pike_sp - Pike_interpreter.evaluator_stack) < 
          Pike_interpreter.recoveries->stack_pointer)) 
        Pike_fatal("Stack error (underflow)\n"); 
 
      if((Pike_compiler->compiler_pass == 1) && 
         (f != Pike_compiler->compiler_frame->current_function_number)) { 
        fprintf(stderr, "define_function()/do_opt_code() failed for symbol %s\n", 
                $5->u.sval.u.string->str); 
        dump_program_desc(Pike_compiler->new_program); 
        Pike_fatal("define_function screwed up! %d != %d\n", 
              f, Pike_compiler->compiler_frame->current_function_number); 
      } 
#endif 
 
      c->lex.current_line = save_line; 
      c->lex.current_file = save_file; 
    } else { 
      /* Prototype; don't warn about unused arguments. */ 
      for (e = Pike_compiler->compiler_frame->current_number_of_locals; e--;) { 
        Pike_compiler->compiler_frame->variable[e].flags |= LOCAL_VAR_IS_USED; 
      } 
      if( Pike_compiler->compiler_frame->current_return_type->type == PIKE_T_AUTO ) 
          yyerror("'auto' return type not allowed for prototypes\n"); 
    } 
#ifdef PIKE_DEBUG 
    if (Pike_compiler->compiler_frame != $6) { 
      Pike_fatal("Lost track of compiler_frame!\n" 
                 "  Got: %p (Expected: %p) Previous: %p\n", 
                 Pike_compiler->compiler_frame, $6, 
                 Pike_compiler->compiler_frame->previous); 
    } 
#endif 
    pop_compiler_frame(); 
    free_node($5); 
    free_node($10); 
    free_node($<n>11); 
  } 
  | modifiers optional_attributes simple_type 
  optional_constant TOK_IDENTIFIER start_function 
    error 
  { 
#ifdef PIKE_DEBUG 
    if (Pike_compiler->compiler_frame != $6) { 
      Pike_fatal("Lost track of compiler_frame!\n" 
                 "  Got: %p (Expected: %p) Previous: %p\n", 
                 Pike_compiler->compiler_frame, $6, 
                 Pike_compiler->compiler_frame->previous); 
    } 
#endif 
    pop_compiler_frame(); 
    free_node($5); 
  } 
  | modifiers optional_attributes simple_type optional_constant bad_identifier 
  { 
    compiler_discard_type(); 
  } 
    '(' arguments ')' block_or_semi 
  { 
    if ($10) free_node($10); 
  } 
  | modifiers optional_attributes simple_type optional_constant name_list ';' 
  | inheritance {} 
  | import {} 
  | constant {} 
  | modifiers named_class { free_node($2); } 
  | modifiers enum { free_node($2); } 
  | typedef {} 
  | error TOK_LEX_EOF 
  { 
    reset_type_stack(); 
    yyerror("Missing ';'."); 
    yyerror("Unexpected end of file"); 
  } 
  | error ';' 
  { 
    reset_type_stack(); 
    yyerrok; 
/*     if(Pike_compiler->num_parse_error>5) YYACCEPT; */ 
  } 
  | error '}' 
  { 
    reset_type_stack(); 
    yyerror("Missing ';'."); 
   /* yychar = '}';     */ /* Put the '}' back on the input stream */ 
  } 
  | modifiers 
   '{' 
    { 
      $<number>$=THIS_COMPILATION->lex.pragmas; 
      THIS_COMPILATION->lex.pragmas|=$1; 
    } 
      program 
   close_brace_or_eof 
    { 
      THIS_COMPILATION->lex.pragmas=$<number>3; 
    } 
  ; 
 
optional_dot_dot_dot: TOK_DOT_DOT_DOT { $$=1; } 
  | TOK_DOT_DOT 
  { 
    yyerror("Range indicator ('..') where elipsis ('...') expected."); 
    $$=1; 
  } 
  | /* empty */ { $$=0; } 
  ; 
 
optional_identifier: TOK_IDENTIFIER 
  | bad_identifier { $$=0; } 
  | /* empty */ { $$=0; } 
  ; 
 
new_arg_name: full_type optional_dot_dot_dot optional_identifier 
  { 
    int i; 
    if(Pike_compiler->varargs) yyerror("Can't define more arguments after ..."); 
 
    if($2) 
    { 
      push_type(T_ARRAY); 
      Pike_compiler->varargs=1; 
    } 
 
    if(!$3) 
    { 
      $3=mkstrnode(empty_pike_string); 
    } 
 
    if($3->u.sval.u.string->len && 
       islocal($3->u.sval.u.string) >= 0) 
      my_yyerror("Variable %S appears twice in argument list.", 
                 $3->u.sval.u.string); 
 
    i = add_local_name($3->u.sval.u.string, compiler_pop_type(),0); 
    if (i >= 0) { 
      /* Don't warn about unused arguments. */ 
      Pike_compiler->compiler_frame->variable[i].flags |= LOCAL_VAR_IS_USED; 
    } 
    free_node($3); 
  } 
  ; 
 
func_args: '(' arguments close_paren_or_missing 
  { 
    free_node($3); 
    $$=$2; 
  } 
  ; 
 
arguments: /* empty */ optional_comma { $$=0; } 
  | arguments2 optional_comma 
  ; 
 
arguments2: new_arg_name { $$ = 1; } 
  | arguments2 ',' new_arg_name { $$ = $1 + 1; } 
  | arguments2 ':' new_arg_name 
  { 
    yyerror("Unexpected ':' in argument list."); 
    $$ = $1 + 1; 
  } 
  ; 
 
modifier: 
    TOK_FINAL_ID   { $$ = ID_FINAL | ID_INLINE; } 
  | TOK_STATIC     { 
    $$ = ID_PROTECTED; 
    if( !(THIS_COMPILATION->lex.pragmas & ID_NO_DEPRECATION_WARNINGS) && 
        !TEST_COMPAT(7, 8) && Pike_compiler->compiler_pass==1 ) 
      yywarning("Keyword static is deprecated in favour of 'protected'."); 
    } 
  | TOK_EXTERN     { $$ = ID_EXTERN; } 
  | TOK_OPTIONAL   { $$ = ID_OPTIONAL; } 
  | TOK_PRIVATE    { $$ = ID_PRIVATE | ID_PROTECTED; } 
  | TOK_LOCAL_ID   { $$ = ID_INLINE; } 
  | TOK_PUBLIC     { $$ = ID_PUBLIC; } 
  | TOK_PROTECTED  { $$ = ID_PROTECTED; } 
  | TOK_INLINE     { $$ = ID_INLINE; } 
  | TOK_VARIANT    { $$ = ID_VARIANT; } 
  | TOK_WEAK       { $$ = ID_WEAK; } 
  ; 
 
magic_identifiers1: 
    TOK_FINAL_ID   { $$ = "final"; } 
  | TOK_STATIC     { $$ = "static"; } 
  | TOK_EXTERN     { $$ = "extern"; } 
  | TOK_PRIVATE    { $$ = "private"; } 
  | TOK_LOCAL_ID   { $$ = "local"; } 
  | TOK_PUBLIC     { $$ = "public"; } 
  | TOK_PROTECTED  { $$ = "protected"; } 
  | TOK_INLINE     { $$ = "inline"; } 
  | TOK_OPTIONAL   { $$ = "optional"; } 
  | TOK_VARIANT    { $$ = "variant"; } 
  | TOK_WEAK       { $$ = "__weak__"; } 
  ; 
 
magic_identifiers2: 
    TOK_VOID_ID       { $$ = "void"; } 
  | TOK_MIXED_ID      { $$ = "mixed"; } 
  | TOK_ARRAY_ID      { $$ = "array"; } 
  | TOK_ATTRIBUTE_ID  { $$ = "__attribute__"; } 
  | TOK_DEPRECATED_ID { $$ = "__deprecated__"; } 
  | TOK_MAPPING_ID    { $$ = "mapping"; } 
  | TOK_MULTISET_ID   { $$ = "multiset"; } 
  | TOK_OBJECT_ID     { $$ = "object"; } 
  | TOK_FUNCTION_ID   { $$ = "function"; } 
  | TOK_FUNCTION_NAME { $$ = "__func__"; } 
  | TOK_PROGRAM_ID    { $$ = "program"; } 
  | TOK_STRING_ID     { $$ = "string"; } 
  | TOK_FLOAT_ID      { $$ = "float"; } 
  | TOK_INT_ID        { $$ = "int"; } 
  | TOK_ENUM          { $$ = "enum"; } 
  | TOK_TYPEDEF       { $$ = "typedef"; } 
  /* | TOK_AUTO_ID       { $$ = "auto"; } */ 
  ; 
 
magic_identifiers3: 
    TOK_IF         { $$ = "if"; } 
  | TOK_DO         { $$ = "do"; } 
  | TOK_FOR        { $$ = "for"; } 
  | TOK_WHILE      { $$ = "while"; } 
  | TOK_ELSE       { $$ = "else"; } 
  | TOK_FOREACH    { $$ = "foreach"; } 
  | TOK_CATCH      { $$ = "catch"; } 
  | TOK_GAUGE      { $$ = "gauge"; } 
  | TOK_CLASS      { $$ = "class"; } 
  | TOK_BREAK      { $$ = "break"; } 
  | TOK_CASE       { $$ = "case"; } 
  | TOK_CONSTANT   { $$ = "constant"; } 
  | TOK_CONTINUE   { $$ = "continue"; } 
  | TOK_DEFAULT    { $$ = "default"; } 
  | TOK_IMPORT     { $$ = "import"; } 
  | TOK_INHERIT    { $$ = "inherit"; } 
  | TOK_LAMBDA     { $$ = "lambda"; } 
  | TOK_PREDEF     { $$ = "predef"; } 
  | TOK_RETURN     { $$ = "return"; } 
  | TOK_SSCANF     { $$ = "sscanf"; } 
  | TOK_SWITCH     { $$ = "switch"; } 
  | TOK_TYPEOF     { $$ = "typeof"; } 
  | TOK_GLOBAL     { $$ = "global"; } 
  ; 
 
magic_identifiers: magic_identifiers1 | magic_identifiers2 | magic_identifiers3 ; 
 
magic_identifier: TOK_IDENTIFIER | TOK_RESERVED 
  | magic_identifiers 
  { 
    struct pike_string *tmp=make_shared_string($1); 
    $$=mkstrnode(tmp); 
    free_string(tmp); 
  } 
  ; 
 
modifiers: modifier_list 
 { 
   $$=Pike_compiler->current_modifiers=$1 | 
     (THIS_COMPILATION->lex.pragmas & ID_MODIFIER_MASK); 
 } 
 ; 
 
modifier_list: /* empty */ { $$ = 0; } 
  | modifier_list modifier { $$ = $1 | $2; } 
  ; 
 
attribute: TOK_ATTRIBUTE_ID '(' string_constant optional_comma ')' 
  { 
    $$ = $3; 
  } 
  | TOK_DEPRECATED_ID '(' ')' 
  { 
    struct pike_string *deprecated_string; 
    MAKE_CONST_STRING(deprecated_string, "deprecated"); 
    $$ = mkstrnode(deprecated_string); 
  } 
  | TOK_DEPRECATED_ID 
  { 
    struct pike_string *deprecated_string; 
    MAKE_CONST_STRING(deprecated_string, "deprecated"); 
    $$ = mkstrnode(deprecated_string); 
  } 
  ; 
 
optional_attributes: /* empty */ 
  { 
    if (Pike_compiler->current_attributes) { 
      free_node(Pike_compiler->current_attributes); 
    } 
    if ((Pike_compiler->current_attributes = 
         THIS_COMPILATION->lex.attributes)) { 
      add_ref(Pike_compiler->current_attributes); 
    } 
  } 
  | optional_attributes attribute 
  { 
    if ($2) { 
      Pike_compiler->current_attributes = 
        mknode(F_ARG_LIST, Pike_compiler->current_attributes, $2); 
    } 
  } 
  ; 
 
cast: open_paren_with_line_info type ')' 
    { 
      struct pike_type *s = compiler_pop_type(); 
      $$ = mktypenode(s); 
      free_type(s); 
      COPY_LINE_NUMBER_INFO($$, $1); 
      free_node ($1); 
    } 
    ; 
 
soft_cast: open_bracket_with_line_info type ']' 
    { 
      struct pike_type *s = compiler_pop_type(); 
      $$ = mktypenode(s); 
      free_type(s); 
      COPY_LINE_NUMBER_INFO($$, $1); 
      free_node ($1); 
    } 
    ; 
 
/* Either a basic_type-prefixed expression, or an identifier type. 
 * Value on type stack. 
 */ 
type2: type | identifier_type ; 
 
/* Full type expression. 
 * Value moved to compiler_frame->current_type. 
 */ 
simple_type: full_type 
  { 
    update_current_type(); 
  } 
  ; 
 
/* Basic_type-prefixed expression or an identifier type. 
 * Value moved to compiler_frame->current_type. 
 */ 
simple_type2: type2 
  { 
    update_current_type(); 
  } 
  ; 
 
/* Full type expression. Value on type stack. 
 * Typically used in contexts where there must be a type, 
 * and expressions are invalid. 
 */ 
full_type: full_type '|' type3 { push_type(T_OR); } 
  | type3 
  ; 
 
/* Basic_type-prefixed expression. Value on type stack. 
 * Typically used in contexts where expressions are valid. 
 */ 
type: type '|' type3 { push_type(T_OR); } 
  | basic_type 
  ; 
 
/* Either a basic_type or an identifier type. Value on type stack. */ 
type3: basic_type | identifier_type ; 
 
/* Literal type. Value on type stack. */ 
basic_type: 
    TOK_FLOAT_ID                      { push_type(T_FLOAT); } 
  | TOK_VOID_ID                       { push_type(T_VOID); } 
  | TOK_MIXED_ID                      { push_type(T_MIXED); } 
  | TOK_AUTO_ID                 { push_type(T_ZERO); push_type(PIKE_T_AUTO); } 
  | TOK_STRING_ID   opt_string_width  {} 
  | TOK_INT_ID      opt_int_range     {} 
  | TOK_MAPPING_ID  opt_mapping_type  {} 
  | TOK_FUNCTION_ID opt_function_type {} 
  | TOK_OBJECT_ID   opt_object_type   {} 
  | TOK_PROGRAM_ID  opt_program_type  { push_type(T_PROGRAM); } 
  | TOK_ARRAY_ID    opt_array_type    { push_type(T_ARRAY); } 
  | TOK_MULTISET_ID opt_array_type    { push_type(T_MULTISET); } 
  | TOK_ATTRIBUTE_ID '(' string_constant ',' full_type ')' 
  { 
    push_type_attribute($3->u.sval.u.string); 
    free_node($3); 
  } 
  | TOK_ATTRIBUTE_ID '(' string_constant error ')' 
  { 
    push_type(T_MIXED); 
    push_type_attribute($3->u.sval.u.string); 
    free_node($3); 
  } 
  | TOK_ATTRIBUTE_ID error 
  { 
    push_type(T_MIXED); 
  } 
  | TOK_DEPRECATED_ID '(' full_type ')' 
  { 
    struct pike_string *deprecated_string; 
    MAKE_CONST_STRING(deprecated_string, "deprecated"); 
    push_type_attribute(deprecated_string); 
  } 
  | TOK_DEPRECATED_ID '(' error ')' 
  { 
    struct pike_string *deprecated_string; 
    MAKE_CONST_STRING(deprecated_string, "deprecated"); 
    push_type(T_MIXED); 
    push_type_attribute(deprecated_string); 
  } 
  ; 
 
/* Identifier type. Value on type stack. */ 
identifier_type: idents 
  { 
    if ($1) { 
      fix_type_field($1); 
 
      if (!pike_types_le($1->type, typeable_type_string) && 
          (THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES)) { 
        yytype_report(REPORT_WARNING, 
                      $1->current_file, $1->line_number, typeable_type_string, 
                      $1->current_file, $1->line_number, $1->type, 
                      0, "Invalid type."); 
      } 
    } 
 
    resolv_constant($1); 
 
    if (TYPEOF(Pike_sp[-1]) == T_TYPE) { 
      /* "typedef" */ 
      push_finished_type(Pike_sp[-1].u.type); 
    } else { 
      /* object type */ 
      struct program *p = NULL; 
 
      if (TYPEOF(Pike_sp[-1]) == T_OBJECT) { 
        if(!(p = Pike_sp[-1].u.object->prog)) 
        { 
          pop_stack(); 
          push_int(0); 
          yyerror("Destructed object used as program identifier."); 
        }else{ 
          int f = FIND_LFUN(p->inherits[SUBTYPEOF(Pike_sp[-1])].prog, 
                            LFUN_CALL); 
          if(f!=-1) 
          { 
            SET_SVAL_SUBTYPE(Pike_sp[-1], 
                             f + p->inherits[SUBTYPEOF(Pike_sp[-1])]. 
                             identifier_level); 
            SET_SVAL_TYPE(Pike_sp[-1], T_FUNCTION); 
          }else{ 
            extern void f_object_program(INT32); 
            if (Pike_compiler->compiler_pass == 2) 
              yywarning("Using object as program identifier."); 
            f_object_program(1); 
          } 
        } 
      } 
 
      switch(TYPEOF(Pike_sp[-1])) { 
        case T_FUNCTION: 
        if((p = program_from_function(Pike_sp-1))) { 
          push_object_type(0, p?(p->id):0); 
          break; 
        } else { 
          /* Attempt to get the return type for the function. */ 
          struct pike_type *a, *b; 
          a = get_type_of_svalue(Pike_sp-1); 
          /* Note: check_splice_call() below eats a reference from a. 
           * Note: CALL_INHIBIT_WARNINGS is needed since we don't 
           *       provide a function name (and we don't want 
           *       warnings here anyway). 
           */ 
          a = check_splice_call(NULL, a, 0, mixed_type_string, NULL, 
                                CALL_INHIBIT_WARNINGS); 
          if (a) { 
            b = new_get_return_type(a, 0); 
            free_type(a); 
            if (b) { 
              push_finished_type(b); 
              free_type(b); 
              break; 
            } 
          } 
        } 
        /* FALL_THROUGH */ 
 
      default: 
        if (Pike_compiler->compiler_pass!=1) 
          my_yyerror("Illegal program identifier: %O.", Pike_sp-1); 
        pop_stack(); 
        push_int(0); 
        push_object_type(0, 0); 
        break; 
 
      case T_PROGRAM: 
        p = Pike_sp[-1].u.program; 
        push_object_type(0, p?(p->id):0); 
        break; 
      } 
    } 
    /* Attempt to name the type. */ 
    if (Pike_compiler->last_identifier) { 
      push_type_name(Pike_compiler->last_identifier); 
    } 
    pop_stack(); 
    free_node($1); 
  } 
  | typeof 
  { 
    if ($1) { 
      push_finished_type($1->u.sval.u.type); 
      free_node($1); 
    } else { 
      push_finished_type(mixed_type_string); 
    } 
  } 
  ; 
 
number_or_maxint: /* Empty */ 
  { 
    $$ = mkintnode(MAX_INT_TYPE); 
  } 
  | TOK_NUMBER 
  | '-' TOK_NUMBER 
  { 
#ifdef PIKE_DEBUG 
    if (($2->token != F_CONSTANT) || (TYPEOF($2->u.sval) != T_INT)) { 
      Pike_fatal("Unexpected number in negative int-range.\n"); 
    } 
#endif /* PIKE_DEBUG */ 
    $$ = mkintnode(-($2->u.sval.u.integer)); 
    free_node($2); 
  } 
  ; 
 
number_or_minint: /* Empty */ 
  { 
    $$ = mkintnode(MIN_INT_TYPE); 
  } 
  | TOK_NUMBER 
  | '-' TOK_NUMBER 
  { 
#ifdef PIKE_DEBUG 
    if (($2->token != F_CONSTANT) || (TYPEOF($2->u.sval) != T_INT)) { 
      Pike_fatal("Unexpected number in negative int-range.\n"); 
    } 
#endif /* PIKE_DEBUG */ 
    $$ = mkintnode(-($2->u.sval.u.integer)); 
    free_node($2); 
  } 
  ; 
 
expected_dot_dot: TOK_DOT_DOT 
  | TOK_DOT_DOT_DOT 
  { 
    yyerror("Elipsis ('...') where range indicator ('..') expected."); 
  } 
  ; 
 
opt_int_range: /* Empty */ 
  { 
    push_int_type(MIN_INT_TYPE, MAX_INT_TYPE); 
  } 
  | '(' TOK_BITS ')' 
  { 
      push_int_type( 0, (1<<$2->u.sval.u.integer)-1 ); 
      free_node( $2 ); 
  } 
  | '(' number_or_minint expected_dot_dot number_or_maxint ')' 
  { 
    INT_TYPE min = MIN_INT_TYPE; 
    INT_TYPE max = MAX_INT_TYPE; 
 
    /* FIXME: Check that $4 is >= $2. */ 
    if($4->token == F_CONSTANT) { 
      if (TYPEOF($4->u.sval) == T_INT) { 
        max = $4->u.sval.u.integer; 
      } else if (is_bignum_object_in_svalue(&$4->u.sval)) { 
        push_int(0); 
        if (is_lt(&$4->u.sval, Pike_sp-1)) { 
          max = MIN_INT_TYPE; 
        } 
        pop_stack(); 
      } 
    } 
 
    if($2->token == F_CONSTANT) { 
      if (TYPEOF($2->u.sval) == T_INT) { 
        min = $2->u.sval.u.integer; 
      } else if (is_bignum_object_in_svalue(&$2->u.sval)) { 
        push_int(0); 
        if (is_lt(Pike_sp-1, &$2->u.sval)) { 
          min = MAX_INT_TYPE; 
        } 
        pop_stack(); 
      } 
    } 
 
    push_int_type(min, max); 
 
    free_node($2); 
    free_node($4); 
  } 
  | '(' error ')' 
  { 
    push_int_type(MIN_INT32, MAX_INT32); 
    yyerror("Expected integer range."); 
  } 
  ; 
 
opt_string_width: opt_int_range 
  { 
    push_type(T_STRING); 
  } 
  ; 
 
opt_object_type:  /* Empty */ { push_object_type(0, 0); } 
  | { 
#ifdef PIKE_DEBUG 
      $<ptr>$ = Pike_sp; 
#endif /* PIKE_DEBUG */ 
    } 
    '(' program_ref ')' 
  { 
    /* NOTE: On entry, there are two items on the stack: 
     *   Pike_sp-2:     Name of the program reference (string). 
     *   Pike_sp-1:     The resolved program (program|function|zero). 
     */ 
    struct program *p=program_from_svalue(Pike_sp-1); 
 
#ifdef PIKE_DEBUG 
    if ($<ptr>1 != (Pike_sp - 2)) { 
      Pike_fatal("Unexpected stack depth: %p != %p\n", 
                 $<n>1, Pike_sp-2); 
    } 
#endif /* PIKE_DEBUG */ 
 
    if(!p) { 
      if (Pike_compiler->compiler_pass!=1) { 
        my_yyerror("Not a valid program specifier: %S", Pike_sp[-2].u.string); 
      } 
    } 
    push_object_type(0, p?(p->id):0); 
    /* Attempt to name the type. */ 
    if (TYPEOF(Pike_sp[-2]) == T_STRING) { 
      push_type_name(Pike_sp[-2].u.string); 
    } 
    pop_n_elems(2); 
  } 
  ; 
 
opt_program_type:  /* Empty */ { push_object_type(0, 0); } 
  | '(' full_type ')' 
  | '(' error ')' 
  { 
    push_object_type(0, 0); 
    yyerror("Invalid program subtype."); 
  } 
  ; 
 
opt_function_type: '(' 
  { 
    type_stack_mark(); 
  } 
  function_type_list optional_dot_dot_dot ':' 
  { 
    /* Add the many type if there is none. */ 
    if ($4) 
    { 
      if (!$3) { 
        /* function_type_list ends with a comma, or is empty. 
         * FIXME: Should this be a syntax error or not? 
         */ 
        if (Pike_compiler->compiler_pass == 1) { 
          yyerror("Missing type before ... ."); 
        } 
        push_type(T_MIXED); 
      } 
    }else{ 
      push_type(T_VOID); 
    } 
  } 
  full_type ')' 
  { 
    push_reverse_type(T_MANY); 
    Pike_compiler->pike_type_mark_stackp--; 
    while (*Pike_compiler->pike_type_mark_stackp+1 < 
           Pike_compiler->type_stackp) { 
      push_reverse_type(T_FUNCTION); 
    } 
  } 
  | /* empty */ 
  { 
   push_type(T_MIXED); 
   push_type(T_VOID); 
   push_type(T_OR); 
 
   push_type(T_ZERO); 
   push_type(T_VOID); 
   push_type(T_OR); 
 
   push_type(T_MANY); 
  } 
  ; 
 
function_type_list: /* Empty */ optional_comma { $$=0; } 
  | function_type_list2 optional_comma { $$=!$2; } 
  ; 
 
function_type_list2: full_type { $$=1; } 
  | function_type_list2 ',' 
  { 
  } 
  full_type 
  ; 
 
opt_array_type: '(' full_type ')' 
  |  { push_type(T_MIXED); } 
  ; 
 
opt_mapping_type: '(' 
  { 
  } 
  full_type ':' 
  { 
  } 
  full_type 
  { 
    push_reverse_type(T_MAPPING); 
  } 
  ')' 
  | /* empty */ 
  { 
    push_type(T_MIXED); 
    push_type(T_MIXED); 
    push_type(T_MAPPING); 
  } 
  ; 
 
 
name_list: new_name 
  | name_list ',' new_name 
  ; 
 
new_name: TOK_IDENTIFIER 
  { 
    struct pike_type *type; 
    node *n; 
    push_finished_type(Pike_compiler->compiler_frame->current_type); 
    n = Pike_compiler->current_attributes; 
    while(n) { 
      push_type_attribute(CDR(n)->u.sval.u.string); 
      n = CAR(n); 
    } 
    type=compiler_pop_type(); 
    define_variable($1->u.sval.u.string, type, 
                    Pike_compiler->current_modifiers); 
    free_type(type); 
    free_node($1); 
  } 
  | bad_identifier {} 
  | TOK_IDENTIFIER '=' 
  { 
    struct pike_type *type; 
    node *n; 
    push_finished_type(Pike_compiler->compiler_frame->current_type); 
    n = Pike_compiler->current_attributes; 
    while(n) { 
      push_type_attribute(CDR(n)->u.sval.u.string); 
      n = CAR(n); 
    } 
    type=compiler_pop_type(); 
    if ((Pike_compiler->current_modifiers & ID_EXTERN) && 
        (Pike_compiler->compiler_pass == 1)) { 
      yywarning("Extern declared variable has initializer."); 
    } 
    $<number>$=define_variable($1->u.sval.u.string, type, 
                               Pike_compiler->current_modifiers & (~ID_EXTERN)); 
    free_type(type); 
  } 
  expr0 
  { 
    if ((Pike_compiler->compiler_pass == 2) && 
        !TEST_COMPAT(7, 8) && ($4) && ($4->token == F_CONSTANT) && 
        !Pike_compiler->num_parse_error) { 
      /* Check if it is zero, in which case we can throw it away. 
       * 
       * NB: The compat test is due to that this changes the semantics 
       *     of calling __INIT() by hand. 
       */ 
      if ((TYPEOF($4->u.sval) == PIKE_T_INT) && !SUBTYPEOF($4->u.sval) && 
          !$4->u.sval.u.integer && 
          !IDENTIFIER_IS_ALIAS(ID_FROM_INT(Pike_compiler->new_program, 
                                           $<number>3)->identifier_flags)) { 
        /* NB: Inherited variables get converted into aliases by 
         *     define_variable, and we need to support clearing 
         *     of inherited variables. 
         */ 
#ifdef PIKE_DEBUG 
        if (l_flag > 5) { 
          fprintf(stderr, 
                  "Ignoring initialization to zero for variable %s.\n", 
                  $1->u.sval.u.string->str); 
        } 
#endif /* PIKE_DEBUG */ 
        if(Pike_compiler->compiler_frame->current_type->type == PIKE_T_AUTO) 
        { 
          // auto variable type needs to be updated. 
          fix_type_field( $4 ); 
          fix_auto_variable_type( $<number>3, $4->type ); 
        } 
        free_node($4); 
        $4 = NULL; 
      } 
    } 
    if ($4) { 
      // this is done in both passes to get somewhat better handling 
      // of auto types. 
      // 
      // an example is: auto a  = typeof(b); auto b = (["foo":"bar"]); 
      // if this is only done in the second pass the type of a will be 
      // type(auto), not type(mapping(..)) 
      if( Pike_compiler->compiler_frame->current_type->type == PIKE_T_AUTO ) 
      { 
        fix_type_field( $4 ); 
        fix_auto_variable_type( $<number>3, $4->type ); 
      } 
      Pike_compiler->init_node=mknode(F_COMMA_EXPR,Pike_compiler->init_node, 
                       mkcastnode(void_type_string, 
                                  mknode(F_ASSIGN, 
                                         mkidentifiernode($<number>3), $4))); 
    } 
    free_node($1); 
  } 
  | TOK_IDENTIFIER '=' error 
  { 
    free_node($1); 
  } 
  | TOK_IDENTIFIER '=' TOK_LEX_EOF 
  { 
    yyerror("Unexpected end of file in variable definition."); 
    free_node($1); 
  } 
  | bad_identifier '=' expr0 
  { 
    free_node($3); 
  } 
  ; 
 
/* Type at compiler_frame->current_type. */ 
new_local_name: TOK_IDENTIFIER 
  { 
    int id; 
    struct pike_type *type; 
    copy_pike_type(type, Pike_compiler->compiler_frame->current_type); 
    id = add_local_name($1->u.sval.u.string, type, 0); 
    if( type->type == PIKE_T_AUTO ) 
    { 
      /* FIXME: Update type on assign instead! */ 
      yyerror("auto only valid when the variable is assigned in definition."); 
    } 
 
    if (id >= 0) { 
      /* FIXME: Consider using mklocalnode(id, -1). */ 
      $$=mknode(F_ASSIGN, mklocalnode(id,0), mkintnode(0)); 
    } else 
      $$ = 0; 
    free_node($1); 
  } 
  | bad_identifier { $$=0; } 
  | TOK_IDENTIFIER '=' 
  { 
    push_finished_type(Pike_compiler->compiler_frame->current_type); 
    type_stack_mark(); 
  } 
  expr0 
  { 
    int id; 
    struct pike_type *type; 
    pop_stack_mark(); 
    update_current_type(); 
    copy_pike_type(type, Pike_compiler->compiler_frame->current_type); 
    if( type->type == PIKE_T_AUTO && Pike_compiler->compiler_pass == 2) 
    { 
        free_type( type ); 
        fix_type_field( $4 ); 
        copy_pike_type( type, $4->type ); 
    } 
    id = add_local_name($1->u.sval.u.string, type, 0); 
    if (id >= 0) { 
      if (!(THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES)) { 
        /* Only warn about unused initialized variables in strict types mode. */ 
        Pike_compiler->compiler_frame->variable[id].flags |= LOCAL_VAR_IS_USED; 
      } 
      $$=mknode(F_ASSIGN, mklocalnode(id,0), $4); 
    } else 
      $$ = 0; 
    free_node($1); 
  } 
  | bad_identifier '=' 
  { 
    push_finished_type(Pike_compiler->compiler_frame->current_type); 
    type_stack_mark(); 
  } 
  expr0 
  { 
    pop_stack_mark(); 
    update_current_type(); 
    free_node($4); 
    $$=0; 
  } 
  | TOK_IDENTIFIER '=' 
  { 
    push_finished_type(Pike_compiler->compiler_frame->current_type); 
    type_stack_mark(); 
  } 
  error 
  { 
    pop_stack_mark(); 
    update_current_type(); 
    free_node($1); 
    /* No yyerok here since we aren't done yet. */ 
    $$=0; 
  } 
  | TOK_IDENTIFIER '=' 
  { 
    push_finished_type(Pike_compiler->compiler_frame->current_type); 
    type_stack_mark(); 
  } 
  TOK_LEX_EOF 
  { 
    pop_stack_mark(); 
    update_current_type(); 
    yyerror("Unexpected end of file in local variable definition."); 
    free_node($1); 
    /* No yyerok here since we aren't done yet. */ 
    $$=0; 
  } 
  ; 
 
line_number_info: /* empty */ 
  { 
    /* Used to hold line-number info */ 
    $$ = mkintnode(0); 
  } 
  ; 
 
block:'{' 
  { 
    $<number>1=Pike_compiler->num_used_modules; 
    $<number>$=Pike_compiler->compiler_frame->current_number_of_locals; 
  } 
  line_number_info 
  { 
    /* Trick to store more than one number on compiler stack - Hubbe */ 
    $<number>$=Pike_compiler->compiler_frame->last_block_level; 
 
    if($<number>$ == -1) /* if 'first block' */ 
      Pike_compiler->compiler_frame->last_block_level=0; /* all variables */ 
    else 
      Pike_compiler->compiler_frame->last_block_level=$<number>2; 
  } 
  { 
    $<ptr>$ = Pike_compiler; 
  } 
  statements end_block 
  { 
    /* Recover compilation context on syntax errors. */ 
    while (Pike_compiler != $<ptr>5) { 
      struct program *p; 
      /* fprintf(stderr, "Compiler context out of sync. Attempting to recover...\n"); */ 
      if(Pike_compiler->compiler_pass == 1) 
        p = end_first_pass(0); 
      else 
        p=end_first_pass(1); 
 
      if (p) free_program(p); 
    } 
 
    unuse_modules(Pike_compiler->num_used_modules - $<number>1); 
    $6 = pop_local_variables($<number>2, $6); 
    Pike_compiler->compiler_frame->last_block_level=$<number>4; 
    if ($6) COPY_LINE_NUMBER_INFO($6, $3); 
    free_node ($3); 
    $$=$6; 
  } 
  ; 
 
/* Node with line number info at $0. */ 
end_block: '}' 
  | TOK_LEX_EOF 
  { 
    yyerror("Missing '}'."); 
    if ($<n>0) { 
      low_yyreport(REPORT_ERROR, $<n>0->current_file, $<n>0->line_number, 
                   parser_system_string, 0, "Opening '{' was here."); 
    } 
    yyerror("Unexpected end of file."); 
  } 
  ; 
 
failsafe_block: block 
              | error { $$=0; } 
              | TOK_LEX_EOF { yyerror("Unexpected end of file."); $$=0; } 
              ; 
 
/* Type at compiler_frame->current_type. */ 
local_name_list: new_local_name 
  | local_name_list ',' new_local_name 
    { $$ = mknode(F_COMMA_EXPR, mkcastnode(void_type_string, $1), $3); } 
  ; 
 
 
local_constant_name: TOK_IDENTIFIER '=' safe_expr0 
  { 
    struct pike_type *type; 
 
    /* Ugly hack to make sure that $3 is optimized */ 
    { 
      int tmp=Pike_compiler->compiler_pass; 
      $3=mknode(F_COMMA_EXPR,$3,0); 
      optimize_node($3); 
      Pike_compiler->compiler_pass=tmp; 
      type=$3->u.node.a->type; 
    } 
 
    if(!is_const($3)) 
    { 
      if(Pike_compiler->compiler_pass==2) 
        yyerror("Constant definition is not constant."); 
    }else{ 
      ptrdiff_t tmp=eval_low($3,1); 
      if(tmp < 1) 
      { 
        yyerror("Error in constant definition."); 
      }else{ 
        pop_n_elems((INT32)(tmp - 1)); 
        if($3) free_node($3); 
        $3=mksvaluenode(Pike_sp-1); 
        type=$3->type; 
        pop_stack(); 
      } 
    } 
    if(!type) type = mixed_type_string; 
    add_ref(type); 
    low_add_local_name(Pike_compiler->compiler_frame, /*->previous,*/ 
                       $1->u.sval.u.string, 
                       type, $3); 
    /* Note: Intentionally not marked as used. */ 
    free_node($1); 
  } 
  | bad_identifier '=' safe_expr0 { if ($3) free_node($3); } 
  | error '=' safe_expr0 { if ($3) free_node($3); } 
  ; 
 
local_constant_list: local_constant_name 
  | local_constant_list ',' local_constant_name 
  ; 
 
local_constant: TOK_CONSTANT local_constant_list ';' 
  | TOK_CONSTANT error ';' { yyerrok; } 
  | TOK_CONSTANT error TOK_LEX_EOF 
  { 
    yyerror("Missing ';'."); 
    yyerror("Unexpected end of file."); 
  } 
  | TOK_CONSTANT error '}' { yyerror("Missing ';'."); } 
  ; 
 
 
statements: { $$=0; } 
  | statements statement 
  { 
    $$ = mknode(F_COMMA_EXPR, $1, mkcastnode(void_type_string, $2)); 
  } 
  ; 
 
statement_with_semicolon: unused2 expected_semicolon ; 
 
normal_label_statement: statement_with_semicolon 
  | import { $$=0; } 
  | cond 
  | return 
  | local_constant { $$=0; } 
  | block 
  | break expected_semicolon 
  | continue expected_semicolon 
  | error ';' { reset_type_stack(); $$=0; yyerrok; } 
  | error TOK_LEX_EOF 
  { 
    reset_type_stack(); 
    yyerror("Missing ';'."); 
    yyerror("Unexpected end of file."); 
    $$=0; 
  } 
  | error '}' 
  { 
    reset_type_stack(); 
    yyerror("Missing ';'."); 
/*    yychar = '}'; */  /* Put the '}' back on the input stream. */ 
    $$=0; 
  } 
  | ';' { $$=0; } 
  ; 
 
statement: normal_label_statement 
  { 
    Pike_compiler->compiler_frame->opt_flags &= ~OPT_CUSTOM_LABELS; 
  } 
  | while 
  | do 
  | for 
  | foreach 
  | switch 
  | case 
  | default 
  | labeled_statement 
  | simple_type2 local_function { $$=mkcastnode(void_type_string, $2); } 
  | implicit_modifiers named_class { $$=mkcastnode(void_type_string, $2); } 
  ; 
 
labeled_statement: TOK_IDENTIFIER 
  { 
    Pike_compiler->compiler_frame->opt_flags &= ~OPT_CUSTOM_LABELS; 
  } 
  ':' statement 
  { 
    $$ = mknode(Pike_compiler->compiler_frame->opt_flags & OPT_CUSTOM_LABELS ? 
                F_CUSTOM_STMT_LABEL : F_NORMAL_STMT_LABEL, 
                $1, $4); 
 
    /* FIXME: This won't be correct if the node happens to be shared. 
     * That's an issue to be solved with shared nodes in general, 
     * though. */ 
    COPY_LINE_NUMBER_INFO($$, $1); 
  } 
  ; 
 
optional_label: TOK_IDENTIFIER 
  | /* empty */ {$$ = 0;} 
  ; 
 
break: TOK_BREAK optional_label { $$=mknode(F_BREAK,$2,0); } ; 
default: TOK_DEFAULT ':'  { $$=mknode(F_DEFAULT,0,0); } 
  | TOK_DEFAULT 
  { 
    $$=mknode(F_DEFAULT,0,0); yyerror("Expected ':' after default."); 
  } 
  ; 
 
continue: TOK_CONTINUE optional_label { $$=mknode(F_CONTINUE,$2,0); } ; 
 
/* This variant is used to push the compiler context for 
 * functions without a declared return type (ie lambdas). 
 */ 
start_lambda: /* empty */ 
  { 
    push_compiler_frame(SCOPE_LOCAL); 
 
    debug_malloc_touch(Pike_compiler->compiler_frame->current_return_type); 
    if(Pike_compiler->compiler_frame->current_return_type) 
      free_type(Pike_compiler->compiler_frame->current_return_type); 
    copy_pike_type(Pike_compiler->compiler_frame->current_return_type, 
                   any_type_string); 
 
    $$ = Pike_compiler->compiler_frame; 
  } 
  ; 
 
implicit_identifier: /* empty */ 
  { 
    struct pike_string *name; 
    $$=mkstrnode(name = get_new_name(NULL)); 
    free_string(name); 
  } 
  ; 
 
lambda: TOK_LAMBDA line_number_info implicit_identifier start_lambda 
  func_args 
  { 
    struct pike_string *name = $3->u.sval.u.string; 
    struct pike_type *type; 
    int e; 
 
    $<number>$ = Pike_compiler->varargs; 
    Pike_compiler->varargs = 0; 
 
    if (Pike_compiler->compiler_pass == 1) { 
      /* Define a tentative prototype for the lambda. */ 
      push_finished_type(mixed_type_string); 
      e=$5-1; 
      if($<number>$) 
      { 
        push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
        e--; 
        pop_type_stack(T_ARRAY); 
      }else{ 
        push_type(T_VOID); 
      } 
      Pike_compiler->varargs=0; 
      push_type(T_MANY); 
      for(; e>=0; e--) { 
        push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
        push_type(T_FUNCTION); 
      } 
      type=compiler_pop_type(); 
      Pike_compiler->compiler_frame->current_function_number = 
        define_function(name, type, 
                        ID_PROTECTED | ID_PRIVATE | ID_INLINE | ID_USED, 
                        IDENTIFIER_PIKE_FUNCTION, NULL, 
                        (unsigned INT16) 
                        (Pike_compiler->compiler_frame->opt_flags)); 
      free_type(type); 
    } else { 
      /* In pass 2 we just reuse the type from pass 1. */ 
      Pike_compiler->compiler_frame->current_function_number = 
        isidentifier(name); 
    } 
  } 
  failsafe_block 
  { 
    struct pike_type *type; 
    int f,e; 
    struct pike_string *name; 
    struct compilation *c = THIS_COMPILATION; 
    struct pike_string *save_file = c->lex.current_file; 
    int save_line = c->lex.current_line; 
    c->lex.current_file = $2->current_file; 
    c->lex.current_line = $2->line_number; 
 
    debug_malloc_touch($7); 
    $7=mknode(F_COMMA_EXPR,$7,mknode(F_RETURN,mkintnode(0),0)); 
    if (Pike_compiler->compiler_pass == 2) { 
      /* Doing this in pass 1 might induce too strict checks on types 
       * in cases where we got placeholders. */ 
      type=find_return_type($7); 
      if (type) { 
        push_finished_type(type); 
        free_type(type); 
      } else { 
        yywarning("Failed to determine return type for lambda."); 
        push_type(T_ZERO); 
      } 
    } else { 
      /* Tentative return type. */ 
      push_type(T_MIXED); 
    } 
 
    e=$5-1; 
    if($<number>6) 
    { 
      push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
      e--; 
      pop_type_stack(T_ARRAY); 
    }else{ 
      push_type(T_VOID); 
    } 
    Pike_compiler->varargs=0; 
    push_type(T_MANY); 
    for(; e>=0; e--) { 
      push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
      push_type(T_FUNCTION); 
    } 
 
    type=compiler_pop_type(); 
 
    name = $3->u.sval.u.string; 
 
#ifdef LAMBDA_DEBUG 
    fprintf(stderr, "%d: LAMBDA: %s 0x%08lx 0x%08lx\n%d:   type: ", 
            Pike_compiler->compiler_pass, name->str, 
            (long)Pike_compiler->new_program->id, 
            Pike_compiler->local_class_counter-1, 
            Pike_compiler->compiler_pass); 
    simple_describe_type(type); 
    fprintf(stderr, "\n"); 
#endif /* LAMBDA_DEBUG */ 
 
    f=dooptcode(name, 
                $7, 
                type, 
                ID_PROTECTED | ID_PRIVATE | ID_INLINE | ID_USED); 
 
#ifdef PIKE_DEBUG 
    if (f != Pike_compiler->compiler_frame->current_function_number) { 
      Pike_fatal("Lost track of lambda %s.\n", name->str); 
    } 
#endif /* PIKE_DEBUG */ 
 
#ifdef LAMBDA_DEBUG 
    fprintf(stderr, "%d:   lexical_scope: 0x%08x\n", 
            Pike_compiler->compiler_pass, 
            Pike_compiler->compiler_frame->lexical_scope); 
#endif /* LAMBDA_DEBUG */ 
 
    if(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED) { 
      $$ = mktrampolinenode(f, Pike_compiler->compiler_frame->previous); 
    } else { 
      $$ = mkidentifiernode(f); 
    } 
    free_type(type); 
    c->lex.current_line = save_line; 
    c->lex.current_file = save_file; 
    free_node($3); 
    free_node ($2); 
#ifdef PIKE_DEBUG 
    if (Pike_compiler->compiler_frame != $4) { 
      Pike_fatal("Lost track of compiler_frame!\n" 
                 "  Got: %p (Expected: %p) Previous: %p\n", 
                 Pike_compiler->compiler_frame, $4, 
                 Pike_compiler->compiler_frame->previous); 
    } 
#endif 
    pop_compiler_frame(); 
  } 
  | TOK_LAMBDA line_number_info implicit_identifier start_lambda error 
  { 
#ifdef PIKE_DEBUG 
    if (Pike_compiler->compiler_frame != $4) { 
      Pike_fatal("Lost track of compiler_frame!\n" 
                 "  Got: %p (Expected: %p) Previous: %p\n", 
                 Pike_compiler->compiler_frame, $4, 
                 Pike_compiler->compiler_frame->previous); 
    } 
#endif 
    pop_compiler_frame(); 
    $$ = mkintnode(0); 
    COPY_LINE_NUMBER_INFO($$, $2); 
    free_node($3); 
    free_node($2); 
  } 
  ; 
 
local_function: TOK_IDENTIFIER start_function func_args 
  { 
    struct pike_string *name; 
    struct pike_type *type; 
    int id,e; 
    node *n; 
    struct identifier *i=0; 
 
    /***/ 
    push_finished_type(Pike_compiler->compiler_frame->current_return_type); 
 
    e=$3-1; 
    if(Pike_compiler->varargs) 
    { 
      push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
      e--; 
      pop_type_stack(T_ARRAY); 
    }else{ 
      push_type(T_VOID); 
    } 
    push_type(T_MANY); 
    for(; e>=0; e--) { 
      push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
    push_type(T_FUNCTION); 
    } 
 
    type=compiler_pop_type(); 
    /***/ 
 
    name = get_new_name($1->u.sval.u.string); 
 
#ifdef LAMBDA_DEBUG 
    fprintf(stderr, "%d: LAMBDA: %s 0x%08lx 0x%08lx\n", 
            Pike_compiler->compiler_pass, name->str, 
            (long)Pike_compiler->new_program->id, 
            Pike_compiler->local_class_counter-1); 
#endif /* LAMBDA_DEBUG */ 
 
    if(Pike_compiler->compiler_pass > 1) 
    { 
      id=isidentifier(name); 
    }else{ 
      id=define_function(name, 
                         type, 
                         ID_PROTECTED | ID_PRIVATE | ID_INLINE | ID_USED, 
                         IDENTIFIER_PIKE_FUNCTION | 
                         (Pike_compiler->varargs?IDENTIFIER_VARARGS:0), 
                         0, 
                         OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); 
    } 
    Pike_compiler->varargs=0; 
    Pike_compiler->compiler_frame->current_function_number=id; 
 
    n=0; 
    if(Pike_compiler->compiler_pass > 1 && 
       (i=ID_FROM_INT(Pike_compiler->new_program, id))) 
    { 
      if(i->identifier_flags & IDENTIFIER_SCOPED) 
        n = mktrampolinenode(id, Pike_compiler->compiler_frame->previous); 
      else 
        n = mkidentifiernode(id); 
    } 
 
    low_add_local_name(Pike_compiler->compiler_frame->previous, 
                       $1->u.sval.u.string, type, n); 
 
    $<number>$=id; 
    free_string(name); 
  } 
  failsafe_block 
  { 
    int localid; 
    struct identifier *i=ID_FROM_INT(Pike_compiler->new_program, $<number>4); 
    struct compilation *c = THIS_COMPILATION; 
    struct pike_string *save_file = c->lex.current_file; 
    int save_line = c->lex.current_line; 
    c->lex.current_file = $1->current_file; 
    c->lex.current_line = $1->line_number; 
 
    $5=mknode(F_COMMA_EXPR,$5,mknode(F_RETURN,mkintnode(0),0)); 
 
    debug_malloc_touch($5); 
    dooptcode(i->name, 
              $5, 
              i->type, 
              ID_PROTECTED | ID_PRIVATE | ID_INLINE); 
 
    i->opt_flags = Pike_compiler->compiler_frame->opt_flags; 
 
    c->lex.current_line = save_line; 
    c->lex.current_file = save_file; 
#ifdef PIKE_DEBUG 
    if (Pike_compiler->compiler_frame != $2) { 
      Pike_fatal("Lost track of compiler_frame!\n" 
                 "  Got: %p (Expected: %p) Previous: %p\n", 
                 Pike_compiler->compiler_frame, $2, 
                 Pike_compiler->compiler_frame->previous); 
    } 
#endif 
    pop_compiler_frame(); 
    free_node($1); 
 
    /* WARNING: If the local function adds more variables we are screwed */ 
    /* WARNING2: if add_local_name stops adding local variables at the end, 
     *           this has to be fixed. 
     */ 
 
    localid=Pike_compiler->compiler_frame->current_number_of_locals-1; 
    if(Pike_compiler->compiler_frame->variable[localid].def) 
    { 
      $$=copy_node(Pike_compiler->compiler_frame->variable[localid].def); 
    }else{ 
      if(Pike_compiler->compiler_frame->lexical_scope & 
         (SCOPE_SCOPE_USED | SCOPE_SCOPED)) 
      { 
        $$ = mktrampolinenode($<number>4,Pike_compiler->compiler_frame); 
      }else{ 
        $$ = mkidentifiernode($<number>4); 
      } 
    } 
  } 
  | TOK_IDENTIFIER start_function error 
  { 
#ifdef PIKE_DEBUG 
    if (Pike_compiler->compiler_frame != $2) { 
      Pike_fatal("Lost track of compiler_frame!\n" 
                 "  Got: %p (Expected: %p) Previous: %p\n", 
                 Pike_compiler->compiler_frame, $2, 
                 Pike_compiler->compiler_frame->previous); 
    } 
#endif 
    pop_compiler_frame(); 
    $$=mkintnode(0); 
  } 
  ; 
 
create_arg: modifiers simple_type optional_dot_dot_dot TOK_IDENTIFIER 
  { 
    struct pike_type *type; 
    int ref_no; 
 
    if (Pike_compiler->num_create_args < 0) { 
      yyerror("Can't define more variables after ..."); 
    } 
 
    if ($3) { 
      push_finished_type(Pike_compiler->compiler_frame->current_type); 
      push_type(T_ARRAY); 
      type = compiler_pop_type(); 
    } else { 
      copy_pike_type(type, Pike_compiler->compiler_frame->current_type); 
    } 
 
    /* Add the identifier globally. 
     * Note: Since these are the first identifiers (and references) 
     *       to be added to the program, they will be numbered in 
     *       sequence starting at 0 (zero). This means that the 
     *       counter num_create_args is sufficient extra information 
     *       to be able to keep track of them. 
     */ 
    ref_no = define_variable($4->u.sval.u.string, type, 
                             Pike_compiler->current_modifiers); 
    free_type(type); 
 
    if (Pike_compiler->num_create_args != ref_no) { 
      my_yyerror("Multiple definitions of create variable %S (%d != %d).", 
                 $4->u.sval.u.string, 
                 Pike_compiler->num_create_args, ref_no); 
    } 
    if ($3) { 
      /* Encode varargs marker as negative number of args. */ 
      Pike_compiler->num_create_args = -(ref_no + 1); 
    } else { 
      Pike_compiler->num_create_args = ref_no + 1; 
    } 
 
    /* free_type(type); */ 
    free_node($4); 
    $$=0; 
  } 
  | modifiers simple_type bad_identifier { $$=0; } 
  ; 
 
create_arguments2: create_arg { $$ = 1; } 
  | create_arguments2 ',' create_arg { $$ = $1 + 1; } 
  | create_arguments2 ':' create_arg 
  { 
    yyerror("Unexpected ':' in create argument list."); 
    $$ = $1 + 1; 
  } 
  ; 
 
create_arguments: /* empty */ optional_comma { $$=0; } 
  | create_arguments2 optional_comma 
  ; 
 
optional_create_arguments: /* empty */ { $$ = 0; } 
  | '(' create_arguments close_paren_or_missing 
  { 
    /* NOTE: One more than the number of arguments, so that we 
<     *       can detect the case of no parenthesis below. */ 
    $$ = $2 + 1; 
    free_node($3); 
  } 
  ; 
 
failsafe_program: '{' program { $<n>$ = NULL; } end_block 
                | error { yyerrok; } 
                | TOK_LEX_EOF 
                { 
                  yyerror("End of file where program definition expected."); 
                } 
                ; 
 
/* Modifiers at $0. */ 
anon_class: TOK_CLASS line_number_info 
  { 
    struct pike_string *s; 
    char buffer[42]; 
    sprintf(buffer,"__class_%ld_%ld_line_%d", 
            (long)Pike_compiler->new_program->id, 
            (long)Pike_compiler->local_class_counter++, 
            (int) $2->line_number); 
    s = make_shared_string(buffer); 
    $<n>$ = mkstrnode(s); 
    free_string(s); 
    $<number>0 |= ID_PROTECTED | ID_PRIVATE | ID_INLINE; 
  } 
  { 
    /* fprintf(stderr, "LANGUAGE.YACC: CLASS start\n"); */ 
    if(Pike_compiler->compiler_pass==1) 
    { 
      if ($<number>0 & ID_EXTERN) { 
        yywarning("Extern declared class definition."); 
      } 
      low_start_new_program(0, 1, $<n>3->u.sval.u.string, 
                            $<number>0, 
                            &$<number>$); 
 
      /* fprintf(stderr, "Pass 1: Program %s has id %d\n", 
         $4->u.sval.u.string->str, Pike_compiler->new_program->id); */ 
 
      store_linenumber($2->line_number, $2->current_file); 
      debug_malloc_name(Pike_compiler->new_program, 
                        $2->current_file->str, 
                        $2->line_number); 
    }else{ 
      int i; 
      struct identifier *id; 
      int tmp=Pike_compiler->compiler_pass; 
      i=isidentifier($<n>3->u.sval.u.string); 
      if(i<0) 
      { 
        /* Seriously broken... */ 
        yyerror("Pass 2: program not defined!"); 
        low_start_new_program(0, 2, 0, 
                              $<number>0, 
                              &$<number>$); 
      }else{ 
        id=ID_FROM_INT(Pike_compiler->new_program, i); 
        if(IDENTIFIER_IS_CONSTANT(id->identifier_flags)) 
        { 
          struct svalue *s; 
          if ((id->func.const_info.offset >= 0) && 
              (TYPEOF(*(s = &PROG_FROM_INT(Pike_compiler->new_program,i)-> 
                        constants[id->func.const_info.offset].sval)) == 
               T_PROGRAM)) 
          { 
            low_start_new_program(s->u.program, 2, 
                                  $<n>3->u.sval.u.string, 
                                  $<number>0, 
                                  &$<number>$); 
 
            /* fprintf(stderr, "Pass 2: Program %s has id %d\n", 
               $4->u.sval.u.string->str, Pike_compiler->new_program->id); */ 
 
          }else{ 
            yyerror("Pass 2: constant redefined!"); 
            low_start_new_program(0, 2, 0, 
                                  $<number>0, 
                                  &$<number>$); 
          } 
        }else{ 
          yyerror("Pass 2: class constant no longer constant!"); 
          low_start_new_program(0, 2, 0, 
                                $<number>0, 
                                &$<number>$); 
        } 
      } 
      Pike_compiler->compiler_pass=tmp; 
    } 
  } 
  { 
    /* Clear scoped modifiers. */ 
    $<number>$ = THIS_COMPILATION->lex.pragmas; 
    THIS_COMPILATION->lex.pragmas &= ~ID_MODIFIER_MASK; 
  } 
  optional_create_arguments failsafe_program 
  { 
    struct program *p; 
 
    /* Check if we have create arguments but no locally defined create(). */ 
    if ($6) { 
      struct pike_string *create_string = NULL; 
      struct reference *ref = NULL; 
      struct identifier *id = NULL; 
      int ref_id; 
      MAKE_CONST_STRING(create_string, "create"); 
      if (((ref_id = isidentifier(create_string)) < 0) || 
          (ref = PTR_FROM_INT(Pike_compiler->new_program, ref_id))->inherit_offset || 
          ((id = ID_FROM_PTR(Pike_compiler->new_program, ref))->func.offset == -1)) { 
        int e; 
        struct pike_type *type = NULL; 
        int nargs = Pike_compiler->num_create_args; 
 
        push_compiler_frame(SCOPE_LOCAL); 
 
        /* Init: Prepend the create arguments. */ 
        if (Pike_compiler->num_create_args < 0) { 
          for (e = 0; e < -Pike_compiler->num_create_args; e++) { 
            id = Pike_compiler->new_program->identifiers + e; 
            add_ref(id->type); 
            add_local_name(id->name, id->type, 0); 
            /* Note: add_local_name() above will return e. */ 
            Pike_compiler->compiler_frame->variable[e].flags |= 
              LOCAL_VAR_IS_USED; 
          } 
        } else { 
          for (e = 0; e < Pike_compiler->num_create_args; e++) { 
            id = Pike_compiler->new_program->identifiers + e; 
            add_ref(id->type); 
            add_local_name(id->name, id->type, 0); 
            /* Note: add_local_name() above will return e. */ 
            Pike_compiler->compiler_frame->variable[e].flags |= 
              LOCAL_VAR_IS_USED; 
          } 
        } 
 
        /* First: Deduce the type for the create() function. */ 
        push_type(T_VOID); /* Return type. */ 
 
        if ((e = nargs) < 0) { 
          /* Varargs */ 
          e = nargs = -nargs; 
          push_finished_type(Pike_compiler->compiler_frame->variable[--e].type); 
          pop_type_stack(T_ARRAY); /* Pop one level of array. */ 
        } else { 
          /* Not varargs. */ 
          push_type(T_VOID); 
        } 
        push_type(T_MANY); 
        while(e--) { 
          push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
          push_type(T_FUNCTION); 
        } 
 
        type = compiler_pop_type(); 
 
        /* Second: Declare the function. */ 
 
        Pike_compiler->compiler_frame->current_function_number= 
          define_function(create_string, type, 
                          ID_INLINE | ID_PROTECTED, 
                          IDENTIFIER_PIKE_FUNCTION | 
                          (Pike_compiler->num_create_args < 0?IDENTIFIER_VARARGS:0), 
                          0, 
                          OPT_SIDE_EFFECT); 
 
        if (Pike_compiler->compiler_pass == 2) { 
          node *create_code = NULL; 
          int f; 
 
          /* Third: Generate the initialization code. 
           * 
           * global_arg = [type]local_arg; 
           * [,..] 
           */ 
 
          for(e=0; e<nargs; e++) 
          { 
            if(!Pike_compiler->compiler_frame->variable[e].name || 
               !Pike_compiler->compiler_frame->variable[e].name->len) 
            { 
              my_yyerror("Missing name for argument %d.",e); 
            } else { 
              node *local_node = mklocalnode(e, 0); 
 
              /* FIXME: Should probably use some other flag. */ 
              if ((runtime_options & RUNTIME_CHECK_TYPES) && 
                  (Pike_compiler->compiler_pass == 2) && 
                  (Pike_compiler->compiler_frame->variable[e].type != 
                   mixed_type_string)) { 
                /* fprintf(stderr, "Creating soft cast node for local #%d\n", e);*/ 
 
                local_node = mkcastnode(mixed_type_string, local_node); 
 
                /* NOTE: The cast to mixed above is needed to avoid generating 
                 *       compilation errors, as well as avoiding optimizations 
                 *       in mksoftcastnode(). 
                 */ 
                local_node = mksoftcastnode(Pike_compiler->compiler_frame-> 
                                            variable[e].type, local_node); 
              } 
              create_code = 
                mknode(F_COMMA_EXPR, create_code, 
                       mknode(F_ASSIGN, mkidentifiernode(e), local_node)); 
            } 
          } 
 
          /* Fourth: Add a return 0; at the end. */ 
 
          create_code = mknode(F_COMMA_EXPR, 
                               mknode(F_POP_VALUE, create_code, NULL), 
                               mknode(F_RETURN, mkintnode(0), NULL)); 
 
          /* Fifth: Define the function. */ 
 
          f=dooptcode(create_string, create_code, type, ID_PROTECTED); 
 
#ifdef PIKE_DEBUG 
          if(Pike_interpreter.recoveries && 
             Pike_sp-Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer) 
            Pike_fatal("Stack error (underflow)\n"); 
 
          if(Pike_compiler->compiler_pass == 1 && 
             f!=Pike_compiler->compiler_frame->current_function_number) 
            Pike_fatal("define_function screwed up! %d != %d\n", 
                       f, Pike_compiler->compiler_frame->current_function_number); 
#endif 
        } 
 
        /* Done. */ 
 
        free_type(type); 
        pop_compiler_frame(); 
      } 
    } 
 
    if(Pike_compiler->compiler_pass == 1) 
      p=end_first_pass(0); 
    else 
      p=end_first_pass(1); 
 
    /* fprintf(stderr, "LANGUAGE.YACC: CLASS end\n"); */ 
 
    if(p) { 
      /* Update the type for the program constant, 
       * since we might have a lfun::create(). */ 
      struct identifier *i; 
      struct svalue sv; 
      SET_SVAL(sv, T_PROGRAM, 0, program, p); 
      i = ID_FROM_INT(Pike_compiler->new_program, $<number>4); 
      free_type(i->type); 
      i->type = get_type_of_svalue(&sv); 
      free_program(p); 
    } else if (!Pike_compiler->num_parse_error) { 
      /* Make sure code in this class is aware that something went wrong. */ 
      Pike_compiler->num_parse_error = 1; 
    } 
 
    $$=mkidentifiernode($<number>4); 
 
    free_node($2); 
    free_node($<n>3); 
    check_tree($$,0); 
    THIS_COMPILATION->lex.pragmas = $<number>5; 
  } 
  ; 
 
/* Modifiers at $0. */ 
named_class: TOK_CLASS line_number_info simple_identifier 
  { 
    if(!$3) 
    { 
      struct pike_string *s; 
      char buffer[42]; 
      sprintf(buffer,"__class_%ld_%ld_line_%d", 
              (long)Pike_compiler->new_program->id, 
              (long)Pike_compiler->local_class_counter++, 
              (int) $2->line_number); 
      s=make_shared_string(buffer); 
      $3=mkstrnode(s); 
      free_string(s); 
      $<number>0|=ID_PROTECTED | ID_PRIVATE | ID_INLINE; 
    } 
    /* fprintf(stderr, "LANGUAGE.YACC: CLASS start\n"); */ 
    if(Pike_compiler->compiler_pass==1) 
    { 
      if ($<number>0 & ID_EXTERN) { 
        yywarning("Extern declared class definition."); 
      } 
      low_start_new_program(0, 1, $3->u.sval.u.string, 
                            $<number>0, 
                            &$<number>$); 
 
      /* fprintf(stderr, "Pass 1: Program %s has id %d\n", 
         $4->u.sval.u.string->str, Pike_compiler->new_program->id); */ 
 
      store_linenumber($2->line_number, $2->current_file); 
      debug_malloc_name(Pike_compiler->new_program, 
                        $2->current_file->str, 
                        $2->line_number); 
    }else{ 
      int i; 
      struct identifier *id; 
      int tmp=Pike_compiler->compiler_pass; 
      i=isidentifier($3->u.sval.u.string); 
      if(i<0) 
      { 
        /* Seriously broken... */ 
        yyerror("Pass 2: program not defined!"); 
        low_start_new_program(0, 2, 0, 
                              $<number>0, 
                              &$<number>$); 
      }else{ 
        id=ID_FROM_INT(Pike_compiler->new_program, i); 
        if(IDENTIFIER_IS_CONSTANT(id->identifier_flags)) 
        { 
          struct svalue *s; 
          if ((id->func.const_info.offset >= 0) && 
              (TYPEOF(*(s = &PROG_FROM_INT(Pike_compiler->new_program,i)-> 
                        constants[id->func.const_info.offset].sval)) == 
               T_PROGRAM)) 
          { 
            low_start_new_program(s->u.program, 2, 
                                  $3->u.sval.u.string, 
                                  $<number>0, 
                                  &$<number>$); 
 
            /* fprintf(stderr, "Pass 2: Program %s has id %d\n", 
               $4->u.sval.u.string->str, Pike_compiler->new_program->id); */ 
 
          }else{ 
            yyerror("Pass 2: constant redefined!"); 
            low_start_new_program(0, 2, 0, 
                                  $<number>0, 
                                  &$<number>$); 
          } 
        }else{ 
          yyerror("Pass 2: class constant no longer constant!"); 
          low_start_new_program(0, 2, 0, 
                                $<number>0, 
                                &$<number>$); 
        } 
      } 
      Pike_compiler->compiler_pass=tmp; 
    } 
  } 
  { 
    /* Clear scoped modifiers. */ 
    $<number>$ = THIS_COMPILATION->lex.pragmas; 
    THIS_COMPILATION->lex.pragmas &= ~ID_MODIFIER_MASK; 
  } 
  optional_create_arguments failsafe_program 
  { 
    struct program *p; 
 
    /* Check if we have create arguments but no locally defined create(). */ 
    if ($6) { 
      struct pike_string *create_string = NULL; 
      struct reference *ref = NULL; 
      struct identifier *id = NULL; 
      int ref_id; 
      MAKE_CONST_STRING(create_string, "create"); 
      if (((ref_id = isidentifier(create_string)) < 0) || 
          (ref = PTR_FROM_INT(Pike_compiler->new_program, ref_id))->inherit_offset || 
          ((id = ID_FROM_PTR(Pike_compiler->new_program, ref))->func.offset == -1)) { 
        int e; 
        struct pike_type *type = NULL; 
        int nargs = Pike_compiler->num_create_args; 
 
        push_compiler_frame(SCOPE_LOCAL); 
 
        /* Init: Prepend the create arguments. */ 
        if (Pike_compiler->num_create_args < 0) { 
          for (e = 0; e < -Pike_compiler->num_create_args; e++) { 
            id = Pike_compiler->new_program->identifiers + e; 
            add_ref(id->type); 
            add_local_name(id->name, id->type, 0); 
            /* Note: add_local_name() above will return e. */ 
            Pike_compiler->compiler_frame->variable[e].flags |= 
              LOCAL_VAR_IS_USED; 
          } 
        } else { 
          for (e = 0; e < Pike_compiler->num_create_args; e++) { 
            id = Pike_compiler->new_program->identifiers + e; 
            add_ref(id->type); 
            add_local_name(id->name, id->type, 0); 
            /* Note: add_local_name() above will return e. */ 
            Pike_compiler->compiler_frame->variable[e].flags |= 
              LOCAL_VAR_IS_USED; 
          } 
        } 
 
        /* First: Deduce the type for the create() function. */ 
        push_type(T_VOID); /* Return type. */ 
 
        if ((e = nargs) < 0) { 
          /* Varargs */ 
          e = nargs = -nargs; 
          push_finished_type(Pike_compiler->compiler_frame->variable[--e].type); 
          pop_type_stack(T_ARRAY); /* Pop one level of array. */ 
        } else { 
          /* Not varargs. */ 
          push_type(T_VOID); 
        } 
        push_type(T_MANY); 
        while(e--) { 
          push_finished_type(Pike_compiler->compiler_frame->variable[e].type); 
          push_type(T_FUNCTION); 
        } 
 
        type = compiler_pop_type(); 
 
        /* Second: Declare the function. */ 
 
        Pike_compiler->compiler_frame->current_function_number= 
          define_function(create_string, type, 
                          ID_INLINE | ID_PROTECTED, 
                          IDENTIFIER_PIKE_FUNCTION | 
                          (Pike_compiler->num_create_args < 0?IDENTIFIER_VARARGS:0), 
                          0, 
                          OPT_SIDE_EFFECT); 
 
        if (Pike_compiler->compiler_pass == 2) { 
          node *create_code = NULL; 
          int f; 
 
          /* Third: Generate the initialization code. 
           * 
           * global_arg = [type]local_arg; 
           * [,..] 
           */ 
 
          for(e=0; e<nargs; e++) 
          { 
            if(!Pike_compiler->compiler_frame->variable[e].name || 
               !Pike_compiler->compiler_frame->variable[e].name->len) 
            { 
              my_yyerror("Missing name for argument %d.",e); 
            } else { 
              node *local_node = mklocalnode(e, 0); 
 
              /* FIXME: Should probably use some other flag. */ 
              if ((runtime_options & RUNTIME_CHECK_TYPES) && 
                  (Pike_compiler->compiler_pass == 2) && 
                  (Pike_compiler->compiler_frame->variable[e].type != 
                   mixed_type_string)) { 
                /* fprintf(stderr, "Creating soft cast node for local #%d\n", e);*/ 
 
                local_node = mkcastnode(mixed_type_string, local_node); 
 
                /* NOTE: The cast to mixed above is needed to avoid generating 
                 *       compilation errors, as well as avoiding optimizations 
                 *       in mksoftcastnode(). 
                 */ 
                local_node = mksoftcastnode(Pike_compiler->compiler_frame-> 
                                            variable[e].type, local_node); 
              } 
              create_code = 
                mknode(F_COMMA_EXPR, create_code, 
                       mknode(F_ASSIGN, mkidentifiernode(e), local_node)); 
            } 
          } 
 
          /* Fourth: Add a return 0; at the end. */ 
 
          create_code = mknode(F_COMMA_EXPR, 
                               mknode(F_POP_VALUE, create_code, NULL), 
                               mknode(F_RETURN, mkintnode(0), NULL)); 
 
          /* Fifth: Define the function. */ 
 
          f=dooptcode(create_string, create_code, type, ID_PROTECTED); 
 
#ifdef PIKE_DEBUG 
          if(Pike_interpreter.recoveries && 
             Pike_sp-Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer) 
            Pike_fatal("Stack error (underflow)\n"); 
 
          if(Pike_compiler->compiler_pass == 1 && 
             f!=Pike_compiler->compiler_frame->current_function_number) 
            Pike_fatal("define_function screwed up! %d != %d\n", 
                       f, Pike_compiler->compiler_frame->current_function_number); 
#endif 
        } 
 
        /* Done. */ 
 
        free_type(type); 
        pop_compiler_frame(); 
      } 
    } 
 
    if(Pike_compiler->compiler_pass == 1) 
      p=end_first_pass(0); 
    else 
      p=end_first_pass(1); 
 
    /* fprintf(stderr, "LANGUAGE.YACC: CLASS end\n"); */ 
 
    if(p) { 
      /* Update the type for the program constant, 
       * since we might have a lfun::create(). */ 
      struct identifier *i; 
      struct svalue sv; 
      SET_SVAL(sv, T_PROGRAM, 0, program, p); 
      i = ID_FROM_INT(Pike_compiler->new_program, $<number>4); 
      free_type(i->type); 
      i->type = get_type_of_svalue(&sv); 
      free_program(p); 
    } else if (!Pike_compiler->num_parse_error) { 
      /* Make sure code in this class is aware that something went wrong. */ 
      Pike_compiler->num_parse_error = 1; 
    } 
 
    $$=mkidentifiernode($<number>4); 
 
    free_node($2); 
    free_node($3); 
    check_tree($$,0); 
    THIS_COMPILATION->lex.pragmas = $<number>5; 
  } 
  ; 
 
simple_identifier: TOK_IDENTIFIER 
  | bad_identifier { $$ = 0; } 
  ; 
 
enum_value: /* EMPTY */ { $$ = 0; } 
  | '=' safe_expr0 { $$ = $2; } 
  ; 
 
/* Previous enum value at $0. */ 
enum_def: /* EMPTY */ 
  | simple_identifier enum_value 
  { 
    if ($1) { 
      if ($2) { 
        /* Explicit enum value. */ 
 
        /* This can be made more lenient in the future */ 
 
        /* Ugly hack to make sure that $2 is optimized */ 
        { 
          int tmp=Pike_compiler->compiler_pass; 
          $2=mknode(F_COMMA_EXPR,$2,0); 
          Pike_compiler->compiler_pass=tmp; 
        } 
 
        if(!is_const($2)) 
        { 
          if(Pike_compiler->compiler_pass==2) 
            yyerror("Enum definition is not constant."); 
          push_int(0); 
        } else { 
          if(!Pike_compiler->num_parse_error) 
          { 
            ptrdiff_t tmp=eval_low($2,1); 
            if(tmp < 1) 
            { 
              yyerror("Error in enum definition."); 
              push_int(0); 
            }else{ 
              pop_n_elems((INT32)(tmp - 1)); 
            } 
          } else { 
            push_int(0); 
          } 
        } 
        free_node($2); 
        free_node($<n>0); 
        $<n>0 = mkconstantsvaluenode(Pike_sp-1); 
      } else { 
        /* Implicit enum value. */ 
        $<n>0 = safe_inc_enum($<n>0); 
        push_svalue(&$<n>0->u.sval); 
      } 
      add_constant($1->u.sval.u.string, Pike_sp-1, 
                   (Pike_compiler->current_modifiers & ~ID_EXTERN) | ID_INLINE); 
      /* Update the type. */ 
      { 
        struct pike_type *current = pop_unfinished_type(); 
        struct pike_type *new = get_type_of_svalue(Pike_sp-1); 
        struct pike_type *res = or_pike_types(new, current, 3); 
        free_type(current); 
        free_type(new); 
        type_stack_mark(); 
        push_finished_type(res); 
        free_type(res); 
      } 
      pop_stack(); 
      free_node($1); 
    } else if ($2) { 
      free_node($2); 
    } 
  } 
  ; 
 
/* Previous enum value at $-2 */ 
propagated_enum_value: 
  { 
    $$ = $<n>-2; 
  } 
  ; 
 
/* Previous enum value at $0. */ 
enum_list: enum_def 
  | enum_list ',' propagated_enum_value enum_def { $<n>0 = $3; } 
  | error 
  ; 
 
/* Modifiers at $0. */ 
enum: TOK_ENUM 
  { 
    if ((Pike_compiler->current_modifiers & ID_EXTERN) && 
        (Pike_compiler->compiler_pass == 1)) { 
      yywarning("Extern declared enum."); 
    } 
 
    type_stack_mark(); 
    push_type(T_ZERO);  /* Joined type so far. */ 
  } 
  optional_identifier '{' 
  { 
    push_int(-1);       /* Previous value. */ 
    $<n>$ = mkconstantsvaluenode(Pike_sp-1); 
    pop_stack(); 
  } 
  enum_list { $<n>$ = NULL; } end_block 
  { 
    struct pike_type *t = pop_unfinished_type(); 
    free_node($<n>5); 
    if ($3) { 
      ref_push_type_value(t); 
      add_constant($3->u.sval.u.string, Pike_sp-1, 
                   (Pike_compiler->current_modifiers & ~ID_EXTERN) | ID_INLINE); 
      pop_stack(); 
      free_node($3); 
    } 
    $$ = mktypenode(t); 
    free_type(t); 
  } 
  ; 
 
typedef: modifiers TOK_TYPEDEF full_type simple_identifier ';' 
  { 
    struct pike_type *t = compiler_pop_type(); 
 
    if ((Pike_compiler->current_modifiers & ID_EXTERN) && 
        (Pike_compiler->compiler_pass == 1)) { 
      yywarning("Extern declared typedef."); 
    } 
 
    if ($4) { 
      ref_push_type_value(t); 
      add_constant($4->u.sval.u.string, Pike_sp-1, 
                   (Pike_compiler->current_modifiers & ~ID_EXTERN) | ID_INLINE); 
      pop_stack(); 
      free_node($4); 
    } 
    free_type(t); 
  } 
  ; 
 
save_locals: /* empty */ 
  { 
    Pike_compiler->compiler_frame->last_block_level = 
      $$ = Pike_compiler->compiler_frame->current_number_of_locals; 
  } 
  ; 
 
save_block_level: /* empty */ 
  { 
    /* Trick to store more than one number on compiler stack - Hubbe */ 
    $$ = Pike_compiler->compiler_frame->last_block_level; 
  } 
  ; 
 
cond: TOK_IF save_block_level save_locals line_number_info 
  '(' safe_comma_expr end_cond statement optional_else_part 
  { 
    $$ = mknode('?', $6, 
                mknode(':', 
                       mkcastnode(void_type_string, $8), 
                       mkcastnode(void_type_string, $9))); 
    COPY_LINE_NUMBER_INFO($$, $4); 
    $$ = mkcastnode(void_type_string, $$); 
    COPY_LINE_NUMBER_INFO($$, $4); 
    free_node($4); 
    $$ = pop_local_variables($3, $$); 
    Pike_compiler->compiler_frame->last_block_level = $2; 
  } 
  ; 
 
end_cond: ')' 
  | '}' { yyerror("Missing ')'."); } 
  | TOK_LEX_EOF 
  { 
    yyerror("Missing ')'."); 
    yyerror("Unexpected end of file."); 
  } 
  ; 
 
optional_else_part: { $$=0; } 
  | TOK_ELSE statement { $$=$2; } 
  ; 
 
safe_lvalue: lvalue 
  { 
    if (!(THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES) && $1) { 
      if ($1->token == F_ARRAY_LVALUE) { 
        mark_lvalues_as_used(CAR($1)); 
      } else if (($1->token == F_LOCAL) && !($1->u.integer.b)) { 
        Pike_compiler->compiler_frame->variable[$1->u.integer.a].flags |= 
          LOCAL_VAR_IS_USED; 
      } 
    } 
  } 
  | error { $$=0; } 
  ; 
 
safe_expr0: expr0 
  | TOK_LEX_EOF { yyerror("Unexpected end of file."); $$=0; } 
  | error { $$=0; } 
  ; 
 
 
foreach_optional_lvalue: /* empty */ { $$=0; } 
   | safe_lvalue 
   ; 
 
foreach_lvalues:  ',' safe_lvalue { $$=$2; } 
  | ';' foreach_optional_lvalue ';' foreach_optional_lvalue 
  { $$=mknode(':',$2,$4); } 
  ; 
 
foreach: TOK_FOREACH save_block_level save_locals line_number_info 
  '(' expr0 foreach_lvalues end_cond 
  { 
    /* Fix AUTO type. */ 
    struct pike_type *ind=NULL, *val=NULL; 
    if(Pike_compiler->compiler_pass == 2) 
    { 
      fix_type_field( $6 ); 
      fix_type_field( $7 ); 
      check_foreach_type( $6, $7, &ind, &val ); 
      if( $7->token == ':' ) 
      { 
        if( CAR($7) && CAR($7)->type->type == PIKE_T_AUTO ) 
        { 
          if( CAR($7)->token == F_LOCAL && !CAR($7)->u.integer.b) 
          { 
            copy_pike_type(Pike_compiler->compiler_frame->variable[CAR($7)->u.integer.a].type, 
                           ind); 
          } 
          else 
          { 
            yywarning("Unexpected auto type usage\n"); 
          } 
        } 
        if( CDR($7) && CDR($7)->type->type == PIKE_T_AUTO ) 
        { 
          if( CDR($7)->token == F_LOCAL && !CDR($7)->u.integer.b) 
          { 
            copy_pike_type(Pike_compiler->compiler_frame->variable[CDR($7)->u.integer.a].type, 
                           val); 
          } 
          else 
          { 
            yywarning("Unexpected auto type usage\n"); 
          } 
        } 
      } 
      else 
      { 
        fix_type_field( $7 ); 
        if( $7->type->type == PIKE_T_AUTO ) 
        { 
          if( $7->token == F_LOCAL && !$7->u.integer.b) 
          { 
            copy_pike_type(Pike_compiler->compiler_frame->variable[$7->u.integer.a].type, 
                           val); 
          } 
          else 
          { 
            yywarning("Unexpected auto type usage\n"); 
          } 
        } 
        /* old style foreach. */ 
      } 
      if(ind)free_type(ind); 
      if(val)free_type(val); 
      $<number>$=0; 
    } 
  } 
  statement 
  { 
    if ($7) { 
      $$=mknode(F_FOREACH, 
                mknode(F_VAL_LVAL,$6,$7), 
                $10); 
    } else { 
      /* Error in lvalue */ 
      $$=mknode(F_COMMA_EXPR, mkcastnode(void_type_string, $6), $10); 
    } 
    COPY_LINE_NUMBER_INFO($$, $4); 
    free_node($4); 
    $$ = pop_local_variables($3, $$); 
    Pike_compiler->compiler_frame->last_block_level = $2; 
    Pike_compiler->compiler_frame->opt_flags |= OPT_CUSTOM_LABELS; 
  } 
  ; 
 
do: TOK_DO line_number_info statement 
  TOK_WHILE '(' safe_comma_expr end_cond expected_semicolon 
  { 
    $$=mknode(F_DO,$3,$6); 
    COPY_LINE_NUMBER_INFO($$, $2); 
    free_node ($2); 
    Pike_compiler->compiler_frame->opt_flags |= OPT_CUSTOM_LABELS; 
  } 
  | TOK_DO line_number_info statement TOK_WHILE TOK_LEX_EOF 
  { 
    free_node ($2); 
    $$=0; 
    yyerror("Missing '(' in do-while loop."); 
    yyerror("Unexpected end of file."); 
  } 
  | TOK_DO line_number_info statement TOK_LEX_EOF 
  { 
    free_node ($2); 
    $$=0; 
    yyerror("Missing 'while' in do-while loop."); 
    yyerror("Unexpected end of file."); 
  } 
  ; 
 
expected_semicolon: ';' 
  | TOK_LEX_EOF 
  { 
    yyerror("Missing ';'."); 
    yyerror("Unexpected end of file."); 
  } 
  ; 
 
for: TOK_FOR save_block_level save_locals line_number_info 
  '(' unused expected_semicolon for_expr expected_semicolon unused end_cond 
  statement 
  { 
    $$=mknode(F_COMMA_EXPR, mkcastnode(void_type_string, $6), 
              mknode(F_FOR,$8,mknode(':',$12,$10))); 
    COPY_LINE_NUMBER_INFO($$, $4); 
    free_node($4); 
    $$ = pop_local_variables($3, $$); 
    Pike_compiler->compiler_frame->last_block_level = $2; 
    Pike_compiler->compiler_frame->opt_flags |= OPT_CUSTOM_LABELS; 
  } 
  ; 
 
while: TOK_WHILE save_block_level save_locals line_number_info 
  '(' safe_comma_expr end_cond statement 
  { 
    $$=mknode(F_FOR,$6,mknode(':',$8,NULL)); 
    COPY_LINE_NUMBER_INFO($$, $4); 
    free_node($4); 
    $$ = pop_local_variables($3, $$); 
    Pike_compiler->compiler_frame->last_block_level = $2; 
    Pike_compiler->compiler_frame->opt_flags |= OPT_CUSTOM_LABELS; 
  } 
  ; 
 
for_expr: /* EMPTY */ { $$=mkintnode(1); } 
  | safe_comma_expr 
  ; 
 
switch: TOK_SWITCH save_block_level save_locals line_number_info 
  '(' safe_comma_expr end_cond statement 
  { 
    $$=mknode(F_SWITCH,$6,$8); 
    COPY_LINE_NUMBER_INFO($$, $4); 
    free_node($4); 
    $$ = pop_local_variables($3, $$); 
    Pike_compiler->compiler_frame->last_block_level = $2; 
  } 
  ; 
 
case: TOK_CASE safe_comma_expr expected_colon 
  { 
    $$=mknode(F_CASE,$2,0); 
  } 
  | TOK_CASE safe_comma_expr expected_dot_dot optional_comma_expr expected_colon 
  { 
     $$=mknode(F_CASE_RANGE,$2,$4); 
  } 
  | TOK_CASE expected_dot_dot safe_comma_expr expected_colon 
  { 
     $$=mknode(F_CASE_RANGE,0,$3); 
  } 
  ; 
 
expected_colon: ':' 
  | ';' 
  { 
    yyerror("Missing ':'."); 
  } 
  | '}' 
  { 
    yyerror("Missing ':'."); 
  } 
  | TOK_LEX_EOF 
  { 
    yyerror("Missing ':'."); 
    yyerror("Unexpected end of file."); 
  } 
  ; 
 
return: TOK_RETURN expected_semicolon 
  { 
    if(!match_types(Pike_compiler->compiler_frame->current_return_type, 
                    void_type_string)) 
    { 
      yytype_error("Must return a value for a non-void function.", 
                   Pike_compiler->compiler_frame->current_return_type, 
                   void_type_string, 0); 
    } 
    $$=mknode(F_RETURN,mkintnode(0),0); 
  } 
  | TOK_RETURN safe_comma_expr expected_semicolon 
  { 
    $$=mknode(F_RETURN,$2,0); 
  } 
  ; 
 
unused: { $$=0; } 
  | safe_comma_expr { $$=mkcastnode(void_type_string, $1);  } 
  ; 
 
unused2: comma_expr { $$=mkcastnode(void_type_string, $1);  } ; 
 
optional_comma_expr: { $$=0; } 
  | safe_comma_expr 
  ; 
 
safe_comma_expr: comma_expr 
  | error { $$=0; } 
  ; 
 
comma_expr: comma_expr2 
  | simple_type2 local_name_list { $$=$2; } 
  ; 
 
 
comma_expr2: expr0 
  | comma_expr2 ',' expr0 
  { 
    $$ = mknode(F_COMMA_EXPR, mkcastnode(void_type_string, $1), $3); 
  } 
  ; 
 
splice_expr: expr0 
      | '@' expr0 { $$=mknode(F_PUSH_ARRAY,$2,0); }; 
 
expr0: expr01 
  | expr4 assign expr0  { $$=mknode($2,$1,$3); } 
  | expr4 assign error { $$=$1; reset_type_stack(); yyerrok; } 
  | open_bracket_with_line_info low_lvalue_list ']' assign expr0 
  { 
    if (!(THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES)) { 
      mark_lvalues_as_used($2); 
    } 
    $$=mknode($4,mknode(F_ARRAY_LVALUE,$2,0),$5); 
    COPY_LINE_NUMBER_INFO($$, $1); 
    free_node ($1); 
  } 
  | open_bracket_with_line_info low_lvalue_list ']' error 
    { 
      $$=$2; free_node ($1); reset_type_stack(); yyerrok; 
    } 
/*  | error { $$=0; reset_type_stack(); } */ 
  ; 
 
expr01: expr1 
  | expr1 '?' expr01 ':' expr01 { $$=mknode('?',$1,mknode(':',$3,$5)); } 
  ; 
 
assign: '='    { $$=F_ASSIGN; } 
  | TOK_AND_EQ { $$=F_AND_EQ; } 
  | TOK_OR_EQ  { $$=F_OR_EQ; } 
  | TOK_XOR_EQ { $$=F_XOR_EQ; } 
  | TOK_LSH_EQ { $$=F_LSH_EQ; } 
  | TOK_RSH_EQ { $$=F_RSH_EQ; } 
  | TOK_ADD_EQ { $$=F_ADD_EQ; } 
  | TOK_SUB_EQ { $$=F_SUB_EQ; } 
  | TOK_MULT_EQ{ $$=F_MULT_EQ; } 
  | TOK_POW_EQ { $$=F_POW_EQ; } 
  | TOK_MOD_EQ { $$=F_MOD_EQ; } 
  | TOK_DIV_EQ { $$=F_DIV_EQ; } 
  ; 
 
optional_comma: { $$=0; } | ',' { $$=1; }; 
 
expr_list: { $$=0; } 
  | expr_list2 optional_comma 
  ; 
 
 
expr_list2: splice_expr 
  | expr_list2 ',' splice_expr { $$=mknode(F_ARG_LIST,$1,$3); } 
  ; 
 
m_expr_list: { $$=0; } 
  | m_expr_list2 optional_comma 
  ; 
 
m_expr_list2: assoc_pair 
  | m_expr_list2 ',' assoc_pair 
  { 
    if ($3) { 
      $$=mknode(F_ARG_LIST,$1,$3); 
    } else { 
      /* Error in assoc_pair */ 
      $$=$1; 
    } 
  } 
  | m_expr_list2 ',' error 
  ; 
 
assoc_pair:  expr0 expected_colon expr0 
  { 
    $$=mknode(F_ARG_LIST,$1,$3); 
  } 
  | expr0 expected_colon error { free_node($1); $$=0; } 
  ; 
 
expr1: expr2 
  | expr1 TOK_LOR expr1  { $$=mknode(F_LOR,$1,$3); } 
  | expr1 TOK_LAND expr1 { $$=mknode(F_LAND,$1,$3); } 
  | expr1 '|' expr1    { $$=mkopernode("`|",$1,$3); } 
  | expr1 '^' expr1    { $$=mkopernode("`^",$1,$3); } 
  | expr1 '&' expr1    { $$=mkopernode("`&",$1,$3); } 
  | expr1 TOK_EQ expr1   { $$=mkopernode("`==",$1,$3); } 
  | expr1 TOK_NE expr1   { $$=mkopernode("`!=",$1,$3); } 
  | expr1 '>' expr1    { $$=mkopernode("`>",$1,$3); } 
  | expr1 TOK_GE expr1   { $$=mkopernode("`>=",$1,$3); } 
  | expr1 '<' expr1    { $$=mkopernode("`<",$1,$3); } 
  | expr1 TOK_LE expr1   { $$=mkopernode("`<=",$1,$3); } 
  | expr1 TOK_LSH expr1  { $$=mkopernode("`<<",$1,$3); } 
  | expr1 TOK_RSH expr1  { $$=mkopernode("`>>",$1,$3); } 
  | expr1 '+' expr1    { $$=mkopernode("`+",$1,$3); } 
  | expr1 '-' expr1    { $$=mkopernode("`-",$1,$3); } 
  | expr1 '*' expr1    { $$=mkopernode("`*",$1,$3); } 
  | expr1 TOK_POW expr1 { $$=mkopernode("`**",$1,$3); } 
  | expr1 '%' expr1    { $$=mkopernode("`%",$1,$3); } 
  | expr1 '/' expr1    { $$=mkopernode("`/",$1,$3); } 
  | expr1 TOK_LOR error 
  | expr1 TOK_LAND error 
  | expr1 '|' error 
  | expr1 '^' error 
  | expr1 '&' error 
  | expr1 TOK_EQ error 
  | expr1 TOK_NE error 
  | expr1 '>' error 
  | expr1 TOK_GE error 
  | expr1 '<' error 
  | expr1 TOK_LE error 
  | expr1 TOK_LSH error 
  | expr1 TOK_RSH error 
  | expr1 '+' error 
  | expr1 '-' error 
  | expr1 '*' error 
  | expr1 '%' error 
  | expr1 '/' error 
  ; 
 
expr2: expr3 
  | cast expr2 
  { 
    $$ = mkcastnode($1->u.sval.u.type, $2); 
    free_node($1); 
  } 
  | soft_cast expr2 
  { 
    $$ = mksoftcastnode($1->u.sval.u.type, $2); 
    free_node($1); 
  } 
  | TOK_INC expr4       { $$=mknode(F_INC,$2,0); } 
  | TOK_DEC expr4       { $$=mknode(F_DEC,$2,0); } 
  | TOK_NOT expr2        { $$=mkopernode("`!",$2,0); } 
  | '~' expr2 
  { 
    if ($2 && ($2->token == F_CONSTANT) && (TYPEOF($2->u.sval) == T_INT)) { 
      $$ = mkintnode(~($2->u.sval.u.integer)); 
      free_node($2); 
    } else { 
      $$ = mkopernode("`~", $2, 0); 
    } 
  } 
  | '-' expr2 
  { 
    if ($2 && ($2->token == F_CONSTANT) && (TYPEOF($2->u.sval) == T_INT) && 
        !INT_TYPE_NEG_OVERFLOW($2->u.sval.u.integer)) { 
      $$ = mkintnode(-($2->u.sval.u.integer)); 
      free_node($2); 
    } else { 
      $$=mkopernode("`-", $2, 0); 
    } 
  } 
  ; 
 
expr3: expr4 
  | expr4 TOK_INC       { $$=mknode(F_POST_INC,$1,0); } 
  | expr4 TOK_DEC       { $$=mknode(F_POST_DEC,$1,0); } 
  ; 
 
/* FIXMEs 
 * It would be nice if 'return' would exit from 
 * the surrounding function rather than from the 
 * implicit lambda. (I think) So beware that the 
 * behaviour of 'return' might change some day. 
 * -Hubbe 
 * 
 * It would also be nice if it was possible to send 
 * arguments to the implicit function, but it would 
 * require using ugly implicit variables or extending 
 * the syntax, and if you extend the syntax you might 
 * as well use lambda() instead. 
 * -Hubbe 
 * 
 * We might want to allow having more than block after 
 * a function ( ie. func(args) {} {} {} {} ) 
 * -Hubbe 
 */ 
 
optional_block: /* EMPTY */ { $$=0; } 
  | '{' line_number_info 
  /* FIXME: Use implicit_identifier to make __func__ point to the lambda? */ 
  start_lambda 
  { 
    /* block code */ 
    $<number>1=Pike_compiler->num_used_modules; 
    $<number>$=Pike_compiler->compiler_frame->current_number_of_locals; 
 
    /* Declare the argument variable. 
     * 
     * NB: The code in the next block knows that this variable 
     *     will be variable  #0. 
     */ 
    push_type(T_MIXED); 
    push_type(T_ARRAY); 
    add_local_name(args_string, compiler_pop_type(), 0); 
  } 
  statements end_block 
  { 
    struct pike_type *type; 
    int f/*, e */; 
    struct pike_string *name; 
    struct compilation *c = THIS_COMPILATION; 
    struct pike_string *save_file = c->lex.current_file; 
    int save_line = c->lex.current_line; 
    int args_used = 
      Pike_compiler->compiler_frame->variable[0].flags & LOCAL_VAR_IS_USED; 
 
    /* Don't warn about the argument if unused. */ 
    Pike_compiler->compiler_frame->variable[0].flags |= LOCAL_VAR_IS_USED; 
 
    c->lex.current_file = $2->current_file; 
    c->lex.current_line = $2->line_number; 
 
    /* block code */ 
    unuse_modules(Pike_compiler->num_used_modules - $<number>1); 
    $5 = pop_local_variables($<number>4, $5); 
 
    debug_malloc_touch($5); 
    $5=mknode(F_COMMA_EXPR,$5,mknode(F_RETURN,mkintnode(0),0)); 
 
    if (Pike_compiler->compiler_pass == 2) { 
      /* Doing this in pass 1 might induce too strict checks on types 
       * in cases where we got placeholders. */ 
      type=find_return_type($5); 
      if (type) { 
        push_finished_type(type); 
        free_type(type); 
      } else { 
        yywarning("Failed to determine return type for implicit lambda."); 
        push_type(T_ZERO); 
      } 
    } else { 
      /* Tentative return type. */ 
      push_type(T_MIXED); 
    } 
 
    if (args_used) { 
      /* __ARGS__ is used. */ 
      push_type(T_MIXED); 
    } else { 
      push_type(T_VOID); 
    } 
 
    push_type(T_MANY); 
 
    type=compiler_pop_type(); 
 
    name = get_new_name(NULL); 
 
#ifdef LAMBDA_DEBUG 
    fprintf(stderr, "%d: IMPLICIT LAMBDA: %s 0x%08lx 0x%08lx\n", 
            Pike_compiler->compiler_pass, name->str, 
            (long)Pike_compiler->new_program->id, 
            Pike_compiler->local_class_counter-1); 
#endif /* LAMBDA_DEBUG */ 
 
    f=dooptcode(name, 
                $5, 
                type, 
                ID_PROTECTED | ID_PRIVATE | ID_INLINE | ID_USED); 
 
    if(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED) { 
      $$ = mktrampolinenode(f,Pike_compiler->compiler_frame->previous); 
    } else { 
      $$ = mkidentifiernode(f); 
    } 
 
    c->lex.current_line = save_line; 
    c->lex.current_file = save_file; 
    free_node ($2); 
    free_string(name); 
    free_type(type); 
#ifdef PIKE_DEBUG 
    if (Pike_compiler->compiler_frame != $3) { 
      Pike_fatal("Lost track of compiler_frame!\n" 
                 "  Got: %p (Expected: %p) Previous: %p\n", 
                 Pike_compiler->compiler_frame, $3, 
                 Pike_compiler->compiler_frame->previous); 
    } 
#endif 
    pop_compiler_frame(); 
  } 
  ; 
 
apply: 
  expr4 open_paren_with_line_info expr_list ')' optional_block 
  { 
    $$ = mkapplynode($1, mknode(F_ARG_LIST, $3, $5)); 
    COPY_LINE_NUMBER_INFO($$, $2); 
    free_node ($2); 
  } 
  | expr4 open_paren_with_line_info error ')' optional_block 
  { 
    $$=mkapplynode($1, $5); 
    free_node ($2); 
    yyerrok; 
  } 
  | expr4 open_paren_with_line_info error TOK_LEX_EOF 
  { 
    yyerror("Missing ')'."); 
    yyerror("Unexpected end of file."); 
    $$=mkapplynode($1, NULL); 
    free_node ($2); 
  } 
  | expr4 open_paren_with_line_info error ';' 
  { 
    yyerror("Missing ')'."); 
    $$=mkapplynode($1, NULL); 
    free_node ($2); 
  } 
  | expr4 open_paren_with_line_info error '}' 
  { 
    yyerror("Missing ')'."); 
    $$=mkapplynode($1, NULL); 
    free_node ($2); 
  } 
  ; 
 
implicit_modifiers: 
  { 
    $$ = Pike_compiler->current_modifiers = ID_PROTECTED|ID_INLINE|ID_PRIVATE | 
      (THIS_COMPILATION->lex.pragmas & ID_MODIFIER_MASK); 
  } 
  ; 
 
expr4: idents2 | expr5 
  | expr5 '.' line_number_info TOK_IDENTIFIER 
  { 
    $$=index_node($1,".",$4->u.sval.u.string); 
    COPY_LINE_NUMBER_INFO($$, $3); 
    free_node ($1); 
    free_node ($3); 
    free_node ($4); 
  } 
  ; 
 
expr5: literal_expr 
  | catch 
  | gauge 
  | typeof 
  | sscanf 
  | lambda 
  | implicit_modifiers anon_class { $$ = $2; } 
  | implicit_modifiers enum { $$ = $2; } 
  | apply 
  | expr4 open_bracket_with_line_info '*' ']' 
  { 
    $$=mknode(F_AUTO_MAP_MARKER, $1, 0); 
    COPY_LINE_NUMBER_INFO($$, $2); 
    free_node ($2); 
  } 
  | expr4 open_bracket_with_line_info expr0 ']' 
  { 
    $$=mknode(F_INDEX,$1,$3); 
    COPY_LINE_NUMBER_INFO($$, $2); 
    free_node ($2); 
  } 
  | expr4 open_bracket_with_line_info 
    range_bound expected_dot_dot range_bound ']' 
  { 
    $$=mknode(F_RANGE,$1,mknode(':',$3,$5)); 
    COPY_LINE_NUMBER_INFO($$, $2); 
    free_node ($2); 
  } 
  | expr4 TOK_SAFE_START_INDEX line_number_info expr0 ']' 
  { 
    /* A[?X] to ((tmp=A) && tmp[X]) */ 
    if( $1 && ($1->token == F_LOCAL) ) 
    { 
      $$=mknode(F_LAND, copy_node($1), mknode(F_INDEX,  $1, $4)); 
    } 
    else 
    { 
      fix_type_field( $1 ); 
      if( $1 && $1->type ) 
      { 
        int temporary; 
        $1->type->refs++; 
 
        temporary = add_local_name(empty_pike_string, $1->type, 0); 
        Pike_compiler->compiler_frame->variable[temporary].flags |= LOCAL_VAR_IS_USED; 
        $$=mknode(F_LAND, 
                  mknode(F_ASSIGN, mklocalnode(temporary,0), $1), 
                  mknode(F_INDEX,  mklocalnode(temporary,0), $4)); 
        $$ = pop_local_variables(temporary, $$); 
      } 
      else 
      { 
        $$=mknode(F_INDEX, $1,$4); 
        yyerror("Indexing unexpected value."); 
      } 
    } 
    COPY_LINE_NUMBER_INFO($$, $3); 
    free_node ($3); 
  } 
  | expr4 TOK_SAFE_START_INDEX  line_number_info 
    range_bound expected_dot_dot range_bound ']' 
  { 
    /* A[?X..Y] to ((tmp=A) && tmp[X..Y]) */ 
    node *range = mknode(':',$4,$6); 
    if( $1 && ($1->token == F_LOCAL ) ) 
    { 
      $$ = mknode( F_LAND, copy_node($1), mknode(F_RANGE, $1, range) ); 
    } 
    else 
    { 
      fix_type_field( $1 ); 
      if( $1 && $1->type ) 
      { 
        int temporary; 
        $1->type->refs++; 
 
        temporary = add_local_name(empty_pike_string, $1->type, 0); 
        Pike_compiler->compiler_frame->variable[temporary].flags |= LOCAL_VAR_IS_USED; 
        $$=mknode(F_LAND, 
                  mknode(F_ASSIGN, mklocalnode(temporary,0), $1), 
                  mknode(F_RANGE,  mklocalnode(temporary,0), range) ); 
        $$ = pop_local_variables(temporary, $$); 
      } 
      else 
      { 
        $$ = mknode( F_LAND, $1, mknode(F_RANGE,$1,range) ); 
        yyerror("Indexing unexpected value."); 
      } 
    } 
    COPY_LINE_NUMBER_INFO($$, $3); 
    free_node ($3); 
  } 
  | expr4 open_bracket_with_line_info error ']' 
  { 
    $$=$1; 
    free_node ($2); 
    yyerrok; 
  } 
  | expr4 open_bracket_with_line_info error TOK_LEX_EOF 
  { 
    $$=$1; yyerror("Missing ']'."); 
    yyerror("Unexpected end of file."); 
    free_node ($2); 
  } 
  | expr4 open_bracket_with_line_info error ';' 
    {$$=$1; yyerror("Missing ']'."); free_node ($2);} 
  | expr4 open_bracket_with_line_info error '}' 
    {$$=$1; yyerror("Missing ']'."); free_node ($2);} 
  | expr4 open_bracket_with_line_info error ')' 
    {$$=$1; yyerror("Missing ']'."); free_node ($2);} 
  | open_paren_with_line_info comma_expr2 ')' 
    { 
      $$=$2; 
      if ($$) { 
        COPY_LINE_NUMBER_INFO($$, $1); 
      } 
      free_node ($1); 
    } 
  | open_paren_with_line_info error ')' { $$=$1; yyerrok; } 
  | open_paren_with_line_info error TOK_LEX_EOF 
  { 
    $$=$1; yyerror("Missing ')'."); 
    yyerror("Unexpected end of file."); 
  } 
  | open_paren_with_line_info error ';' { $$=$1; yyerror("Missing ')'."); } 
  | open_paren_with_line_info error '}' { $$=$1; yyerror("Missing ')'."); } 
  | expr4 TOK_ARROW line_number_info magic_identifier 
  { 
    $$=mknode(F_ARROW,$1,$4); 
    COPY_LINE_NUMBER_INFO($$, $3); 
    free_node ($3); 
  } 
  | expr4 TOK_SAFE_INDEX line_number_info TOK_IDENTIFIER 
  { 
    /* A?->B to ((tmp=A) && tmp->B) */ 
    int temporary; 
    if( $1 && ($1->token == F_LOCAL) ) 
    { 
      $$=mknode(F_LAND, copy_node($1), mknode(F_ARROW, $1, $4)); 
    } 
    else 
    { 
      fix_type_field( $1 ); 
      if( $1 && $1->type ) 
      { 
        add_ref($1->type); 
        temporary = add_local_name(empty_pike_string, $1->type, 0); 
        Pike_compiler->compiler_frame->variable[temporary].flags |= 
          LOCAL_VAR_IS_USED; 
        $$=mknode(F_LAND, 
                  mknode(F_ASSIGN, mklocalnode(temporary,0), $1), 
                  mknode(F_ARROW,  mklocalnode(temporary,0), $4)); 
        $$ = pop_local_variables(temporary, $$); 
      } 
      else 
      { 
        $$=mknode(F_ARROW, $1,$4); 
        yyerror("Indexing unexpected value."); 
      } 
    } 
    COPY_LINE_NUMBER_INFO($$, $3); 
    free_node ($3); 
  } 
  | expr4 TOK_ARROW line_number_info error {$$=$1; free_node ($3);} 
  ; 
 
idents2: idents 
  | TOK_LOCAL_ID TOK_COLON_COLON TOK_IDENTIFIER 
  { 
    if(Pike_compiler->last_identifier) { 
      free_string(Pike_compiler->last_identifier); 
    } 
    copy_shared_string(Pike_compiler->last_identifier, $3->u.sval.u.string); 
 
    $$ = find_inherited_identifier(Pike_compiler, 0, INHERIT_LOCAL, 
                                   Pike_compiler->last_identifier); 
    if (!$$) { 
      if (Pike_compiler->compiler_pass == 2) { 
        my_yyerror("%S not defined in local scope.", $3->u.sval.u.string); 
        $$ = 0; 
      } else { 
        $$ = mknode(F_UNDEFINED, 0, 0); 
      } 
    } 
 
    free_node($3); 
  } 
  | TOK_LOCAL_ID TOK_COLON_COLON bad_identifier 
  { 
    $$=0; 
  } 
  ; 
 
literal_expr: string 
  | TOK_NUMBER 
  | TOK_FLOAT { $$=mkfloatnode((FLOAT_TYPE)$1); } 
  | open_paren_with_line_info '{' expr_list close_brace_or_missing ')' 
    { 
      /* FIXME: May eat lots of stack; cf Standards.FIPS10_4.divisions */ 
      $$=mkefuncallnode("aggregate",$3); 
      COPY_LINE_NUMBER_INFO($$, $1); 
      free_node ($1); 
    } 
  | open_paren_with_line_info 
    open_bracket_with_line_info /* Only to avoid shift/reduce conflicts. */ 
    m_expr_list close_bracket_or_missing ')' 
    { 
      /* FIXME: May eat lots of stack; cf Standards.FIPS10_4.divisions */ 
      $$=mkefuncallnode("aggregate_mapping",$3); 
      COPY_LINE_NUMBER_INFO($$, $1); 
      free_node ($1); 
      free_node ($2); 
    } 
  | TOK_MULTISET_START line_number_info expr_list TOK_MULTISET_END 
    { 
      /* FIXME: May eat lots of stack; cf Standards.FIPS10_4.divisions */ 
      $$=mkefuncallnode("aggregate_multiset",$3); 
      COPY_LINE_NUMBER_INFO($$, $2); 
      free_node ($2); 
    } 
  | TOK_MULTISET_START line_number_info expr_list ')' 
    { 
      yyerror("Missing '>'."); 
      $$=mkefuncallnode("aggregate_multiset",$3); 
      COPY_LINE_NUMBER_INFO($$, $2); 
      free_node ($2); 
    } 
  | TOK_MULTISET_START line_number_info error TOK_MULTISET_END { $$=$2; yyerrok; } 
  | TOK_MULTISET_START line_number_info error ')' { 
    yyerror("Missing '>'."); 
    $$=$2; yyerrok; 
  } 
  | TOK_MULTISET_START line_number_info error TOK_LEX_EOF 
  { 
    $$=$2; yyerror("Missing '>)'."); 
    yyerror("Unexpected end of file."); 
  } 
  | TOK_MULTISET_START line_number_info error ';' { $$=$2; yyerror("Missing '>)'."); } 
  | TOK_MULTISET_START line_number_info error '}' { $$=$2; yyerror("Missing '>)'."); } 
  ; 
 
idents: low_idents 
  | idents '.' TOK_IDENTIFIER 
  { 
    $$=index_node($1, Pike_compiler->last_identifier?Pike_compiler->last_identifier->str:NULL, 
                  $3->u.sval.u.string); 
    free_node($1); 
    if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier); 
    copy_shared_string(Pike_compiler->last_identifier, $3->u.sval.u.string); 
    free_node($3); 
  } 
  | idents '.' bad_identifier {} 
  | idents '.' error {} 
  ; 
 
string_or_identifier: TOK_IDENTIFIER 
  | string 
  ; 
 
/* Note that the result of this rule is passed both with 
 * the node value (inherit number) and with two global 
 * variables (inherit_state and inherit_depth). 
 * 
 * Note also that inherit number -1 indicates any inherit. 
 */ 
inherit_specifier: string_or_identifier TOK_COLON_COLON 
  { 
    struct compilation *c = THIS_COMPILATION; 
    struct program_state *state = Pike_compiler; 
    int depth; 
    int e = INHERIT_ALL; 
 
    inherit_state = NULL; 
    inherit_depth = 0; 
 
    /* NB: The heuristics here are a bit strange 
     *     (all to make it as backward compatible as possible). 
     * 
     *     The priority order is as follows: 
     * 
     *     1: Direct inherits in the current class. 
     * 
     *     2: The name of the current class. 
     * 
     *     3: 1 & 2 recursively for surrounding parent classes. 
     * 
     *     4: Indirect inherits in the current class. 
     * 
     *     5: 4 recursively for surrounding parent classes. 
     * 
     *     6: this_program. 
     * 
     * Note that a deep inherit in the current class trumphs 
     * a not so deep inherit in a parent class (but not a 
     * direct inherit in a parent class). To select the deep 
     * inherit in the parent class in this case, prefix it 
     * with the name of the parent class. 
     */ 
    for (depth = 0;; depth++, state = state->previous) { 
      int inh = find_inherit(state->new_program, $1->u.sval.u.string); 
      if (inh && 
          (!inherit_state || 
           (state->new_program->inherits[inh].inherit_level == 1))) { 
        /* Found, and we've either not found anything earlier, 
         * or this is a direct inherit (and the previous 
         * wasn't since we didn't break out of the loop). 
         */ 
        e = inh; 
        inherit_state = state; 
        inherit_depth = depth; 
        if (state->new_program->inherits[inh].inherit_level == 1) { 
          /* Name of direct inherit ==> Done. */ 
          break; 
        } 
      } 
      /* The top-level class does not have a name, so break here. */ 
      if (depth == c->compilation_depth) break; 
      if (ID_FROM_INT (state->previous->new_program, 
                       state->parent_identifier)->name == 
          $1->u.sval.u.string) { 
        /* Name of surrounding class ==> Done. */ 
        e = INHERIT_SELF; 
        inherit_state = state; 
        inherit_depth = depth; 
        break; 
      } 
    } 
    if (e < 0) { 
      inherit_state = state; 
      inherit_depth = depth; 
      if ($1->u.sval.u.string == this_program_string || 
          $1->u.sval.u.string == this_string) { 
        inherit_state = Pike_compiler; 
        inherit_depth = 0; 
        e = INHERIT_SELF; 
      } 
      else 
        my_yyerror("No inherit or surrounding class %S.", 
                   $1->u.sval.u.string); 
    } 
    free_node($1); 
    $$ = e; 
  } 
  | TOK_GLOBAL TOK_COLON_COLON 
  { 
    struct compilation *c = THIS_COMPILATION; 
    inherit_state = Pike_compiler; 
    for (inherit_depth = 0; inherit_depth < c->compilation_depth; 
         inherit_depth++, inherit_state = inherit_state->previous) {} 
    $$ = INHERIT_GLOBAL; 
  } 
  | inherit_specifier TOK_IDENTIFIER TOK_COLON_COLON 
  { 
    int e = 0; 
    if ($1 < 0) { 
      $1 = INHERIT_SELF; 
    } 
#if 0 
    /* FIXME: The inherit modifiers aren't kept. */ 
    if (!(inherit_state->new_program->inherits[$1].flags & ID_PRIVATE)) { 
#endif /* 0 */ 
      e = find_inherit(inherit_state->new_program->inherits[$1].prog, 
                       $2->u.sval.u.string); 
#if 0 
    } 
#endif /* 0 */ 
    if (!e) { 
      if (inherit_state->new_program->inherits[$1].name) { 
        my_yyerror("No such inherit %S::%S.", 
                   inherit_state->new_program->inherits[$1].name, 
                   $2->u.sval.u.string); 
      } else { 
        my_yyerror("No such inherit %S.", $2->u.sval.u.string); 
      } 
      $$ = INHERIT_ALL; 
    } else { 
      /* We know stuff about the inherit structure... */ 
      $$ = e + $1; 
    } 
    free_node($2); 
  } 
  | inherit_specifier bad_identifier TOK_COLON_COLON { $$ = INHERIT_ALL; } 
  ; 
 
low_idents: TOK_IDENTIFIER 
  { 
    if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier); 
    copy_shared_string(Pike_compiler->last_identifier, $1->u.sval.u.string); 
 
    if(($$=lexical_islocal(Pike_compiler->last_identifier))) 
    { 
      /* done, nothing to do here */ 
    }else if(!($$=find_module_identifier(Pike_compiler->last_identifier,1)) && 
             !($$ = program_magic_identifier (Pike_compiler, 0, -1, 
                                              Pike_compiler->last_identifier, 0))) { 
      if((Pike_compiler->flags & COMPILATION_FORCE_RESOLVE) || 
         (Pike_compiler->compiler_pass==2)) { 
        my_yyerror("Undefined identifier %S.", 
                   Pike_compiler->last_identifier); 
        /* FIXME: Add this identifier as a constant in the current program to 
         *        avoid multiple reporting of the same identifier. 
         * NOTE: This should then only be done in the second pass. 
         */ 
        $$=0; 
      }else{ 
        $$=mknode(F_UNDEFINED,0,0); 
      } 
    } 
    free_node($1); 
  } 
  | '.' TOK_IDENTIFIER 
  { 
    struct pike_string *dot; 
    MAKE_CONST_STRING(dot, "."); 
    if (call_handle_import(dot)) { 
      node *tmp=mkconstantsvaluenode(Pike_sp-1); 
      pop_stack(); 
      $$=index_node(tmp, ".", $2->u.sval.u.string); 
      free_node(tmp); 
    } 
    else 
      $$=mknewintnode(0); 
    if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier); 
    copy_shared_string(Pike_compiler->last_identifier, $2->u.sval.u.string); 
    free_node($2); 
  } 
  | TOK_GLOBAL '.' TOK_IDENTIFIER 
  { 
    $$ = resolve_identifier ($3->u.sval.u.string); 
    if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier); 
    copy_shared_string(Pike_compiler->last_identifier, $3->u.sval.u.string); 
    free_node ($3); 
  } 
  | TOK_RESERVED 
  { 
    ref_push_string($1->u.sval.u.string); 
    low_yyreport(REPORT_ERROR, NULL, 0, parser_system_string, 
                 1, "Unknown reserved symbol %s."); 
    free_node($1); 
    $$ = 0; 
  } 
  | TOK_PREDEF TOK_COLON_COLON TOK_IDENTIFIER 
  { 
    struct compilation *c = THIS_COMPILATION; 
    node *tmp2; 
 
    if(Pike_compiler->last_identifier) 
      free_string(Pike_compiler->last_identifier); 
    copy_shared_string(Pike_compiler->last_identifier, $3->u.sval.u.string); 
 
    tmp2 = mkconstantsvaluenode(&c->default_module); 
    $$ = index_node(tmp2, "predef", $3->u.sval.u.string); 
    if(!$$->name) 
      add_ref( $$->name=$3->u.sval.u.string ); 
    free_node(tmp2); 
    free_node($3); 
  } 
  | TOK_PREDEF TOK_COLON_COLON bad_identifier 
  { 
    $$=0; 
  } 
  | TOK_VERSION TOK_COLON_COLON TOK_IDENTIFIER 
  { 
    $$ = find_versioned_identifier($3->u.sval.u.string, 
                                   $1->u.integer.a, $1->u.integer.b); 
    free_node($1); 
    free_node($3); 
  } 
  | TOK_VERSION TOK_COLON_COLON bad_identifier 
  { 
    free_node($1); 
    $$=0; 
  } 
  | inherit_specifier TOK_IDENTIFIER 
  { 
    int id; 
 
    if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier); 
    copy_shared_string(Pike_compiler->last_identifier, $2->u.sval.u.string); 
 
    $$ = find_inherited_identifier(inherit_state, inherit_depth, $1, 
                                   Pike_compiler->last_identifier); 
    if (!$$) { 
      if ((Pike_compiler->flags & COMPILATION_FORCE_RESOLVE) || 
          (Pike_compiler->compiler_pass == 2)) { 
        if (($1 >= 0) && inherit_state->new_program->inherits[$1].name) { 
          my_yyerror("Undefined identifier %S::%S.", 
                     inherit_state->new_program->inherits[$1].name, 
                     Pike_compiler->last_identifier); 
        } else { 
          my_yyerror("Undefined identifier %S.", 
                     Pike_compiler->last_identifier); 
        } 
        $$=0; 
      } 
      else 
        $$=mknode(F_UNDEFINED,0,0); 
    } 
 
    free_node($2); 
  } 
  | inherit_specifier bad_identifier { $$=0; } 
  | inherit_specifier error { $$=0; } 
  | TOK_COLON_COLON TOK_IDENTIFIER 
  { 
    if(Pike_compiler->last_identifier) { 
      free_string(Pike_compiler->last_identifier); 
    } 
    copy_shared_string(Pike_compiler->last_identifier, $2->u.sval.u.string); 
 
    $$ = find_inherited_identifier(Pike_compiler, 0, INHERIT_ALL, 
                                   Pike_compiler->last_identifier); 
    if(!$$) 
    { 
      if (Pike_compiler->compiler_pass == 2) { 
        my_yyerror("Undefined identifier ::%S.", $2->u.sval.u.string); 
      } 
      $$=mkintnode(0); 
    } 
    free_node($2); 
  } 
  | TOK_COLON_COLON bad_identifier 
  { 
    $$=0; 
  } 
  ; 
 
range_bound: 
  /* empty */ 
  {$$ = mknode (F_RANGE_OPEN, NULL, NULL);} 
  | comma_expr 
  {$$ = mknode (F_RANGE_FROM_BEG, $1, NULL);} 
  | '<' comma_expr 
  {$$ = mknode (F_RANGE_FROM_END, $2, NULL);} 
  | TOK_LEX_EOF 
  { 
    yyerror("Unexpected end of file."); 
    $$ = mknode (F_RANGE_OPEN, NULL, NULL); 
  } 
  | '<' TOK_LEX_EOF 
  { 
    yyerror("Unexpected end of file."); 
    $$ = mknode (F_RANGE_OPEN, NULL, NULL); 
  } 
  ; 
 
gauge: TOK_GAUGE catch_arg 
  { 
    $$=mkopernode("`/", 
                  mkopernode("`-", 
                             mkopernode("`-", 
                                        mkefuncallnode("gethrvtime", 
                                                       mkintnode(1)), 
                                        mknode(F_COMMA_EXPR, 
                                               mknode(F_POP_VALUE, $2, NULL), 
                                               mkefuncallnode("gethrvtime", 
                                                              mkintnode(1)))), 
                             NULL), 
                  mkfloatnode((FLOAT_TYPE)1e9)); 
  }; 
 
typeof: TOK_TYPEOF '(' expr0 ')' 
  { 
    struct pike_type *t; 
    node *tmp; 
 
    /* FIXME: Why build the node at all? */ 
    /* Because the optimizer cannot optimize the root node of the 
     * tree properly -Hubbe 
     */ 
    tmp=mknode(F_COMMA_EXPR, $3, 0); 
    optimize_node(tmp); 
 
    t=(tmp && CAR(tmp) && CAR(tmp)->type ? CAR(tmp)->type : mixed_type_string); 
    $$ = mktypenode(t); 
    free_node(tmp); 
  } 
  | TOK_TYPEOF '(' error ')' { $$=0; yyerrok; } 
  | TOK_TYPEOF '(' error '}' { $$=0; yyerror("Missing ')'."); } 
  | TOK_TYPEOF '(' error TOK_LEX_EOF 
  { 
    $$=0; yyerror("Missing ')'."); 
    yyerror("Unexpected end of file."); 
  } 
  | TOK_TYPEOF '(' error ';' { $$=0; yyerror("Missing ')'."); } 
  ; 
 
catch_arg: '(' comma_expr ')'  { $$=$2; } 
  | '(' error ')' { $$=0; yyerrok; } 
  | '(' error TOK_LEX_EOF 
  { 
    $$=0; yyerror("Missing ')'."); 
    yyerror("Unexpected end of file."); 
  } 
  | '(' error '}' { $$=0; yyerror("Missing ')'."); } 
  | '(' error ';' { $$=0; yyerror("Missing ')'."); } 
  | block 
  | error { $$=0; yyerror("Bad expression for catch."); } 
  ; 
 
catch: TOK_CATCH 
     { 
       Pike_compiler->catch_level++; 
     } 
     catch_arg 
     { 
       $$=mknode(F_CATCH,$3,NULL); 
       Pike_compiler->catch_level--; 
     } 
     ; 
 
sscanf: TOK_SSCANF '(' expr0 ',' expr0 lvalue_list ')' 
  { 
    if ($6 && !(THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES)) { 
      mark_lvalues_as_used($6); 
    } 
    $$=mknode(F_SSCANF,mknode(F_ARG_LIST,$3,$5),$6); 
  } 
  | TOK_SSCANF '(' expr0 ',' expr0 error ')' 
  { 
    $$=0; 
    free_node($3); 
    free_node($5); 
    yyerrok; 
  } 
  | TOK_SSCANF '(' expr0 ',' expr0 error TOK_LEX_EOF 
  { 
    $$=0; 
    free_node($3); 
    free_node($5); 
    yyerror("Missing ')'."); 
    yyerror("Unexpected end of file."); 
  } 
  | TOK_SSCANF '(' expr0 ',' expr0 error '}' 
  { 
    $$=0; 
    free_node($3); 
    free_node($5); 
    yyerror("Missing ')'."); 
  } 
  | TOK_SSCANF '(' expr0 ',' expr0 error ';' 
  { 
    $$=0; 
    free_node($3); 
    free_node($5); 
    yyerror("Missing ')'."); 
  } 
  | TOK_SSCANF '(' expr0 error ')' 
  { 
    $$=0; 
    free_node($3); 
    yyerrok; 
  } 
  | TOK_SSCANF '(' expr0 error TOK_LEX_EOF 
  { 
    $$=0; 
    free_node($3); 
    yyerror("Missing ')'."); 
    yyerror("Unexpected end of file."); 
  } 
  | TOK_SSCANF '(' expr0 error '}' 
  { 
    $$=0; 
    free_node($3); 
    yyerror("Missing ')'."); 
  } 
  | TOK_SSCANF '(' expr0 error ';' 
  { 
    $$=0; 
    free_node($3); 
    yyerror("Missing ')'."); 
  } 
  | TOK_SSCANF '(' error ')' { $$=0; yyerrok; } 
  | TOK_SSCANF '(' error TOK_LEX_EOF 
  { 
    $$=0; yyerror("Missing ')'."); 
    yyerror("Unexpected end of file."); 
  } 
  | TOK_SSCANF '(' error '}' { $$=0; yyerror("Missing ')'."); } 
  | TOK_SSCANF '(' error ';' { $$=0; yyerror("Missing ')'."); } 
  ; 
 
lvalue: expr4 
  | open_bracket_with_line_info low_lvalue_list ']' 
  { 
    $$=mknode(F_ARRAY_LVALUE, $2,0); 
    COPY_LINE_NUMBER_INFO($$, $1); 
    free_node($1); 
  } 
  | type2 TOK_IDENTIFIER 
  { 
    int id = add_local_name($2->u.sval.u.string,compiler_pop_type(),0); 
    /* Note: Variable intentionally not marked as used. */ 
    if (id >= 0) 
      $$=mklocalnode(id,-1); 
    else 
      $$ = 0; 
    free_node($2); 
  } 
  /* FIXME: Add production for type2 ==> constant type svalue here? */ 
  | bad_expr_ident 
  { $$=mknewintnode(0); } 
  ; 
 
low_lvalue_list: lvalue lvalue_list 
  { 
    $$=mknode(F_LVALUE_LIST,$1,$2); 
  } 
  ; 
 
lvalue_list: /* empty */ { $$ = 0; } 
  | ',' lvalue lvalue_list 
  { 
    $$ = mknode(F_LVALUE_LIST,$2,$3); 
  } 
  ; 
 
string_segment: TOK_STRING 
  | TOK_FUNCTION_NAME 
  { 
    struct compiler_frame *f = Pike_compiler->compiler_frame; 
    if (!f || (f->current_function_number < 0)) { 
      $$ = mkstrnode(lfun_strings[LFUN___INIT]); 
    } else { 
      struct identifier *id = 
        ID_FROM_INT(Pike_compiler->new_program, f->current_function_number); 
      if (!id->name->size_shift) { 
        int len; 
        if ((len = strlen(id->name->str)) == id->name->len) { 
          /* Most common case. */ 
          $$ = mkstrnode(id->name); 
        } else { 
          struct pike_string *str = 
            make_shared_binary_string(id->name->str, len); 
          $$ = mkstrnode(str); 
          free_string(str); 
        } 
      } else { 
        struct pike_string *str; 
        struct array *split; 
        MAKE_CONST_STRING(str, "\0"); 
        split = explode(id->name, str); 
        $$ = mkstrnode(split->item->u.string); 
        free_array(split); 
      } 
    } 
  } 
  ; 
 
string: string_segment 
  | string string_segment 
  { 
    struct pike_string *a,*b; 
    copy_shared_string(a,$1->u.sval.u.string); 
    copy_shared_string(b,$2->u.sval.u.string); 
    free_node($1); 
    free_node($2); 
    a=add_and_free_shared_strings(a,b); 
    $$=mkstrnode(a); 
    free_string(a); 
  } 
  ; 
 
string_constant: string 
  | string_constant '+' string 
  { 
    struct pike_string *a,*b; 
    copy_shared_string(a,$1->u.sval.u.string); 
    copy_shared_string(b,$3->u.sval.u.string); 
    free_node($1); 
    free_node($3); 
    a=add_and_free_shared_strings(a,b); 
    $$=mkstrnode(a); 
    free_string(a); 
  } 
  ; 
 
/* Same as string_constant above, but without TOK_FUNCTION_NAME. */ 
real_string_constant: TOK_STRING 
  | real_string_constant TOK_STRING 
  { 
    struct pike_string *a,*b; 
    copy_shared_string(a,$1->u.sval.u.string); 
    copy_shared_string(b,$2->u.sval.u.string); 
    free_node($1); 
    free_node($2); 
    a=add_and_free_shared_strings(a,b); 
    $$=mkstrnode(a); 
    free_string(a); 
  } 
  | real_string_constant '+' TOK_STRING 
  { 
    struct pike_string *a,*b; 
    copy_shared_string(a,$1->u.sval.u.string); 
    copy_shared_string(b,$3->u.sval.u.string); 
    free_node($1); 
    free_node($3); 
    a=add_and_free_shared_strings(a,b); 
    $$=mkstrnode(a); 
    free_string(a); 
  } 
  ; 
 
 
/* 
 * Some error-handling 
 */ 
 
/* FIXME: Should probably set Pike_compiler->last_identifier. */ 
bad_identifier: bad_expr_ident 
  | TOK_ARRAY_ID 
  { yyerror_reserved("array"); } 
  | TOK_ATTRIBUTE_ID 
  { yyerror_reserved("__attribute__"); } 
  | TOK_CLASS 
  { yyerror_reserved("class"); } 
  | TOK_DEPRECATED_ID 
  { yyerror_reserved("__deprecated__"); } 
  | TOK_ENUM 
  { yyerror_reserved("enum"); } 
  | TOK_FLOAT_ID 
  { yyerror_reserved("float");} 
  | TOK_FUNCTION_ID 
  { yyerror_reserved("function");} 
  | TOK_FUNCTION_NAME 
  { yyerror_reserved("__FUNCTION__");} 
  | TOK_INT_ID 
  { yyerror_reserved("int"); } 
  | TOK_MAPPING_ID 
  { yyerror_reserved("mapping"); } 
  | TOK_MIXED_ID 
  { yyerror_reserved("mixed"); } 
  | TOK_MULTISET_ID 
  { yyerror_reserved("multiset"); } 
  | TOK_OBJECT_ID 
  { yyerror_reserved("object"); } 
  | TOK_PROGRAM_ID 
  { yyerror_reserved("program"); } 
  | TOK_STRING_ID 
  { yyerror_reserved("string"); } 
  | TOK_TYPEDEF 
  { yyerror_reserved("typedef"); } 
  | TOK_VOID_ID 
  { yyerror_reserved("void"); } 
  | TOK_RESERVED 
  { 
    ref_push_string($1->u.sval.u.string); 
    low_yyreport(REPORT_ERROR, NULL, 0, parser_system_string, 
                 1, "Unknown reserved symbol %s."); 
    free_node($1); 
  } 
  ; 
 
bad_expr_ident: 
    TOK_INLINE 
  { yyerror_reserved("inline"); } 
  | TOK_LOCAL_ID 
  { yyerror_reserved("local"); } 
  | TOK_PREDEF 
  { yyerror_reserved("predef"); } 
  | TOK_PRIVATE 
  { yyerror_reserved("private"); } 
  | TOK_PROTECTED 
  { yyerror_reserved("protected"); } 
  | TOK_PUBLIC 
  { yyerror_reserved("public"); } 
  | TOK_OPTIONAL 
  { yyerror_reserved("optional"); } 
  | TOK_VARIANT 
  { yyerror_reserved("variant"); } 
  | TOK_WEAK 
  { yyerror_reserved("__weak__"); } 
  | TOK_STATIC 
  { yyerror_reserved("static"); } 
  | TOK_EXTERN 
  { yyerror_reserved("extern"); } 
  | TOK_FINAL_ID 
  { yyerror_reserved("final");} 
  | TOK_DO 
  { yyerror_reserved("do"); } 
  | TOK_ELSE 
  { yyerror("else without if."); } 
  | TOK_RETURN 
  { yyerror_reserved("return"); } 
  | TOK_IMPORT 
  { yyerror_reserved("import"); } 
  | TOK_INHERIT 
  { yyerror_reserved("inherit"); } 
  | TOK_CATCH 
  { yyerror_reserved("catch"); } 
  | TOK_GAUGE 
  { yyerror_reserved("gauge"); } 
  | TOK_LAMBDA 
  { yyerror_reserved("lambda"); } 
  | TOK_SSCANF 
  { yyerror_reserved("sscanf"); } 
  | TOK_SWITCH 
  { yyerror_reserved("switch"); } 
  | TOK_TYPEOF 
  { yyerror_reserved("typeof"); } 
  | TOK_BREAK 
  { yyerror_reserved("break"); } 
  | TOK_CASE 
  { yyerror_reserved("case"); } 
  | TOK_CONTINUE 
  { yyerror_reserved("continue"); } 
  | TOK_DEFAULT 
  { yyerror_reserved("default"); } 
  | TOK_FOR 
  { yyerror_reserved("for"); } 
  | TOK_FOREACH 
  { yyerror_reserved("foreach"); } 
  | TOK_IF 
  { yyerror_reserved("if"); } 
  ; 
 
/* 
 * Kludge for bison 1.50. 
 * 
 * Bison 1.50 doesn't support having multiple action blocks 
 * in a sequence where a block refers to the value of its 
 * immediate predecessor. 
 */ 
 
/* empty: ; */ /* line_number_info is now used in these cases. */ 
 
%% 
 
static void yyerror_reserved(const char *keyword) 
{ 
  my_yyerror("%s is a reserved word.", keyword); 
} 
 
static struct pike_string *get_new_name(struct pike_string *prefix) 
{ 
  char buf[40]; 
  /* Generate a name for a global symbol... */ 
  sprintf(buf,"__lambda_%ld_%ld_line_%d", 
          (long)Pike_compiler->new_program->id, 
          (long)(Pike_compiler->local_class_counter++ & 0xffffffff), /* OSF/1 cc bug. */ 
          (int) THIS_COMPILATION->lex.current_line); 
  if (prefix) { 
    struct string_builder sb; 
    init_string_builder_alloc(&sb, prefix->len + strlen(buf) + 1, 
                              prefix->size_shift); 
    string_builder_shared_strcat(&sb, prefix); 
    string_builder_putchar(&sb, 0); 
    string_builder_strcat(&sb, buf); 
    return finish_string_builder(&sb); 
  } 
  return make_shared_string(buf); 
} 
 
 
static int low_islocal(struct compiler_frame *f, 
                       struct pike_string *str) 
{ 
  int e; 
  for(e=f->current_number_of_locals-1;e>=0;e--) 
    if(f->variable[e].name==str) { 
      f->variable[e].flags |= LOCAL_VAR_IS_USED; 
      return e; 
    } 
  return -1; 
} 
 
 
/* Add a local variable to the current function in frame. 
 * NOTE: Steals the references to type and def, but not to str. 
 */ 
int low_add_local_name(struct compiler_frame *frame, 
                       struct pike_string *str, 
                       struct pike_type *type, 
                       node *def) 
{ 
 
  if (str->len) { 
    int tmp=low_islocal(frame,str); 
    if(tmp>=0 && tmp >= frame->last_block_level) 
    { 
      my_yyerror("Duplicate local variable %S, " 
                 "previous declaration on line %d\n", 
                 str, frame->variable[tmp].line); 
    } 
 
    if(type == void_type_string) 
    { 
      my_yyerror("Local variable %S is void.\n", str); 
    } 
  } 
 
  debug_malloc_touch(def); 
  debug_malloc_touch(type); 
  debug_malloc_touch(str); 
  /* NOTE: The number of locals can be 0..255 (not 256), due to 
   *       the use of READ_INCR_BYTE() in apply_low.h. 
   */ 
  if (frame->current_number_of_locals == MAX_LOCAL-1) 
  { 
    my_yyerror("Too many local variables: no space for local variable %S.", 
               str); 
    free_type(type); 
    if (def) free_node(def); 
    return -1; 
  } else { 
    int var = frame->current_number_of_locals; 
 
    if (pike_types_le(type, void_type_string)) { 
      if (Pike_compiler->compiler_pass != 1) { 
        yywarning("Declaring local variable %S with type void " 
                  "(converted to type zero).", str); 
      } 
      free_type(type); 
      copy_pike_type(type, zero_type_string); 
    } 
    frame->variable[var].type = type; 
    frame->variable[var].name = str; 
    reference_shared_string(str); 
    frame->variable[var].def = def; 
 
    frame->variable[var].line = THIS_COMPILATION->lex.current_line; 
    copy_shared_string(frame->variable[var].file, 
                       THIS_COMPILATION->lex.current_file); 
 
    if (pike_types_le(void_type_string, type)) { 
      /* Don't warn about unused voidable variables. */ 
      frame->variable[var].flags = LOCAL_VAR_IS_USED; 
    } else { 
      frame->variable[var].flags = 0; 
    } 
 
    frame->current_number_of_locals++; 
    if(frame->current_number_of_locals > frame->max_number_of_locals) 
    { 
      frame->max_number_of_locals = frame->current_number_of_locals; 
    } 
 
    return var; 
  } 
} 
 
 
/* argument must be a shared string */ 
/* Note that this function eats a reference to 'type' */ 
/* If def is nonzero, it also eats a ref to def */ 
int add_local_name(struct pike_string *str, 
                   struct pike_type *type, 
                   node *def) 
{ 
  return low_add_local_name(Pike_compiler->compiler_frame, 
                            str, 
                            type, 
                            def); 
} 
 
/* Mark local variables declared in a multi-assign or sscanf expression 
 * as used. */ 
static void mark_lvalues_as_used(node *n) 
{ 
  while (n && n->token == F_LVALUE_LIST) { 
    if (!CAR(n)) { 
      /* Can happen if a variable hasn't been declared. */ 
    } else if (CAR(n)->token == F_ARRAY_LVALUE) { 
      mark_lvalues_as_used(CAAR(n)); 
    } else if ((CAR(n)->token == F_LOCAL) && !(CAR(n)->u.integer.b)) { 
      Pike_compiler->compiler_frame->variable[CAR(n)->u.integer.a].flags |= 
        LOCAL_VAR_IS_USED; 
    } 
    n = CDR(n); 
  } 
} 
 
#if 0 
/* Note that this function eats a reference to each of 
 * 'type' and 'initializer', but not to 'name'. 
 * Note also that 'initializer' may be NULL. 
 */ 
static node *add_protected_variable(struct pike_string *name, 
                                    struct pike_type *type, 
                                    int depth, 
                                    node *initializer) 
{ 
  struct compiler_frame *f = Pike_compiler->compiler_frame; 
  int i; 
  int id; 
  node *n = NULL; 
 
  if (initializer) { 
    /* FIXME: We need to pop levels off local and external variables here. */ 
  } 
 
  for(i = depth; f && i; i--) { 
    f->lexical_scope |= SCOPE_SCOPED; 
    f = f->previous; 
  } 
  if (!f) { 
    int parent_depth = i; 
    struct program_state *p = Pike_compiler; 
    struct pike_string *tmp_name; 
    while (i--) { 
      if (!p->previous) { 
        my_yyerror("Too many levels of protected (%d, max:%d).", 
                   depth, depth - (i+1)); 
        parent_depth -= i+1; 
        break; 
      } 
      p->new_program->flags |= PROGRAM_USES_PARENT; 
      p = p->previous; 
    } 
 
    tmp_name = get_new_name(name); 
    id = define_parent_variable(p, tmp_name, type, 
                                ID_PROTECTED|ID_PRIVATE|ID_INLINE); 
    free_string(tmp_name); 
    if (id >= 0) { 
      if (def) { 
        p->init_node = 
          mknode(F_COMMA_EXPR, Pike_compiler->init_node, 
                 mkcastnode(void_type_string, 
                            mknode(F_ASSIGN, 
                                   mkidentifiernode(id), initializer))); 
        initializer = NULL; 
      } 
      n = mkexternalnode(id, parent_depth); 
    } 
  } else if (depth) { 
    f->lexical_scope|=SCOPE_SCOPE_USED; 
    tmp_name = get_new_name(name); 
    id = low_add_local_name(f, tmp_name, type, NULL); 
    free_string(tmp_name); 
    if(f->min_number_of_locals < id+1) 
      f->min_number_of_locals = id+1; 
    if (initializer) { 
      /* FIXME! */ 
      yyerror("Initializers not yet supported for protected variables with function scope."); 
    } 
    n = mklocalnode(id, depth); 
  } 
  id = add_local_name(name, type, n); 
  if (id >= 0) { 
    if (initializer) { 
      return mknode(F_ASSIGN, mklocalnode(id,0), initializer); 
    } 
    return mklocalnode(id, 0); 
  } 
  if (initializer) { 
    free_node(initializer); 
  } 
  return NULL; 
} 
#endif /* 0 */ 
 
int islocal(struct pike_string *str) 
{ 
  return low_islocal(Pike_compiler->compiler_frame, str); 
} 
 
/* argument must be a shared string */ 
static node *lexical_islocal(struct pike_string *str) 
{ 
  int e,depth=0; 
  struct compiler_frame *f=Pike_compiler->compiler_frame; 
 
  while(1) 
  { 
    for(e=f->current_number_of_locals-1;e>=0;e--) 
    { 
      if(f->variable[e].name==str) 
      { 
        struct compiler_frame *q=Pike_compiler->compiler_frame; 
 
        f->variable[e].flags |= LOCAL_VAR_IS_USED; 
 
        while(q!=f) 
        { 
          q->lexical_scope|=SCOPE_SCOPED; 
          q=q->previous; 
        } 
 
        if(depth) { 
          q->lexical_scope|=SCOPE_SCOPE_USED; 
 
          if(q->min_number_of_locals < e+1) 
            q->min_number_of_locals = e+1; 
          q->variable[e].flags |= LOCAL_VAR_USED_IN_SCOPE; 
        } 
 
        if(f->variable[e].def) { 
          /*fprintf(stderr, "Found prior definition of \"%s\"\n", str->str); */ 
          return copy_node(f->variable[e].def); 
        } 
 
        return mklocalnode(e,depth); 
      } 
    } 
    if(!(f->lexical_scope & SCOPE_LOCAL)) return 0; 
    depth++; 
    f=f->previous; 
  } 
} 
 
static node *safe_inc_enum(node *n) 
{ 
  JMP_BUF recovery; 
  node *ret; 
  STACK_LEVEL_START(0); 
 
  if (SETJMP(recovery)) { 
    handle_compile_exception ("Bad implicit enum value (failed to add 1)."); 
    push_int(0); 
  } else { 
    if (n->token != F_CONSTANT) Pike_fatal("Bad node to safe_inc_enum().\n"); 
    push_svalue(&n->u.sval); 
    push_int(1); 
    f_add(2); 
  } 
  UNSETJMP(recovery); 
  STACK_LEVEL_DONE(1); 
  free_node(n); 
  ret = mkconstantsvaluenode(Pike_sp-1); 
  pop_stack(); 
  return ret; 
} 
 
static node *find_versioned_identifier(struct pike_string *identifier, 
                                       int major, int minor) 
{ 
  struct compilation *c = THIS_COMPILATION; 
  int old_major = Pike_compiler->compat_major; 
  int old_minor = Pike_compiler->compat_minor; 
  struct svalue *efun = NULL; 
  /* NOTE: Compilers warn about res being globbered by the setjmp,longjmp 
   * below. This warning is spurious because pop_stack() does not actually 
   * do the longjmp, instead f_index() does. */ 
  node *res = NULL; 
 
  change_compiler_compatibility(major, minor); 
 
  if(Pike_compiler->last_identifier) 
    free_string(Pike_compiler->last_identifier); 
  copy_shared_string(Pike_compiler->last_identifier, identifier); 
 
  /* Check predef:: first, and then the modules. */ 
 
  if (TYPEOF(c->default_module) == T_MAPPING) { 
    if ((efun = low_mapping_string_lookup(c->default_module.u.mapping, 
                                          identifier))) 
      res = mkconstantsvaluenode(efun); 
  } 
  else if (TYPEOF(c->default_module) != T_INT) { 
    JMP_BUF tmp; 
    if (SETJMP (tmp)) { 
      handle_compile_exception ("Couldn't index %d.%d " 
                                "default module with \"%S\".", 
                                major, minor, identifier); 
    } else { 
      push_svalue(&c->default_module); 
      ref_push_string(identifier); 
      f_index (2); 
      if (!IS_UNDEFINED(Pike_sp - 1)) 
        res = mkconstantsvaluenode(Pike_sp - 1); 
      pop_stack(); 
    } 
    UNSETJMP(tmp); 
  } 
 
  if (!res && !(res = resolve_identifier(identifier))) { 
    if((Pike_compiler->flags & COMPILATION_FORCE_RESOLVE) || 
       (Pike_compiler->compiler_pass==2)) { 
      my_yyerror("Undefined identifier %d.%d::%S.", 
                 major, minor, identifier); 
    }else{ 
      res = mknode(F_UNDEFINED, 0, 0); 
    } 
  } 
 
  change_compiler_compatibility(old_major, old_minor); 
 
  return res; 
} 
 
static int call_handle_import(struct pike_string *s) 
{ 
  struct compilation *c = THIS_COMPILATION; 
  int args; 
 
  ref_push_string(s); 
  ref_push_string(c->lex.current_file); 
  if (c->handler && c->handler->prog) { 
    ref_push_object(c->handler); 
    args = 3; 
  } 
  else args = 2; 
 
  if (safe_apply_handler("handle_import", c->handler, c->compat_handler, 
                         args, BIT_MAPPING|BIT_OBJECT|BIT_PROGRAM|BIT_ZERO)) 
    if (TYPEOF(Pike_sp[-1]) != T_INT) 
      return 1; 
    else { 
      pop_stack(); 
      my_yyerror("Couldn't find module to import: %S", s); 
    } 
  else 
    handle_compile_exception ("Error finding module to import"); 
 
  return 0; 
} 
 
/* Set compiler_frame->current_type from the type stack. */ 
static void update_current_type() 
{ 
  if(Pike_compiler->compiler_frame->current_type) 
    free_type(Pike_compiler->compiler_frame->current_type); 
  Pike_compiler->compiler_frame->current_type = compiler_pop_type(); 
}