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 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229
|
@q io.web @>
@q * Copyright and License.@>
@q This file is part of 3DLDF, a package for three-dimensional drawing. @>
@q Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, @>
@q 2011, 2012, 2013 The Free Software Foundation. @>
@q GNU 3DLDF is free software; you can redistribute it and/or modify @>
@q it under the terms of the GNU General Public License as published by @>
@q the Free Software Foundation; either version 3 of the License, or @>
@q (at your option) any later version. @>
@q GNU 3DLDF is distributed in the hope that it will be useful, @>
@q but WITHOUT ANY WARRANTY; without even the implied warranty of @>
@q MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @>
@q GNU General Public License for more details. @>
@q You should have received a copy of the GNU General Public License @>
@q along with GNU 3DLDF; if not, write to the Free Software @>
@q Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @>
@q GNU 3DLDF is a GNU package. @>
@q It is part of the GNU Project of the @>
@q Free Software Foundation @>
@q and is published under the GNU General Public License. @>
@q See the website http://www.gnu.org @>
@q for more information. @>
@q GNU 3DLDF is available for downloading from @>
@q http://www.gnu.org/software/3dldf/LDF.html. @>
@q (``@@'' stands for a single at-sign in the following paragraph.) @>
@q Please send bug reports to Laurence.Finston@@gmx.de @>
@q The mailing list help-3dldf@@gnu.org is available for people to @>
@q ask other users for help. @>
@q The mailing list info-3dldf@@gnu.org is for sending @>
@q announcements to users. To subscribe to these mailing lists, send an @>
@q email with ``subscribe <email-address>'' as the subject. @>
@q The author can be contacted at: @>
@q Laurence D. Finston @>
@q c/o Free Software Foundation, Inc. @>
@q 51 Franklin St, Fifth Floor @>
@q Boston, MA 02110-1301 @>
@q USA @>
@q Laurence.Finston@@gmx.de (@@ stands for a single ``at'' sign.)@>
@q * I/O.@>
@** I/O\quad ({\tt io\PERIOD web}).\hfil
\LOG
\initials{LDF 2003.11.12.}
Removed the version control identifiers from the CWEB
files for the distribution of 3DLDF 1.1. They're still used in my
development versions.
\initials{LDF 2003.12.10.}
Put the version control identifiers back
into my release versions for 3DLDF 1.1.4. I've already put some of
them back in, now I'm doing the rest of them. However, the release
versions are now in their own RCS repository.
\ENDLOG
@q * Include files.@>
@ Include files.
@<Include files@>=
#include "loader.h++"
#include <time.h>
#include "pspglb.h++"
@q * Structures for input and output.@>
@* Structures for input and output.
@f Io_Struct int
@q ** (0) |Io_Struct|.@>
@*1 {\bf Io\_Struct}.@>
\LOG
\initials{LDF 2004.06.19.}
Moved |pthread_mutex_t mutex| and |pthread_cond_t cond_var| here from
|Output_Struct|.
\initials{LDF 2004.06.19.}
Now including the section |@<Declare |Io_Struct| functions@>|, which
currently contains only the default constructor, which I've defined today.
\initials{LDF 2004.06.29.}
Removed |pthread_mutex_t mutex| and |pthread_cond_t cond_var|.
Now deriving |Io_Struct| from |Mutex_Type|, if the preprocessor macro
|HAVE_PTHREAD_H| is defined. Currently not using condition variables.
\initials{LDF 2004.09.09.}
Replaced |bool is_file| with |unsigned short type|.
Added the |static const unsigned short| data members
|INVALID_TYPE|, |FILE_TYPE|, |STDIN_TYPE|, |STDOUT_TYPE|,
|COND_STRING_TYPE|, |COND_FILE_TYPE|, |LOOP_STRING_TYPE|,
|LOOP_FILE_TYPE|, |MACRO_STRING_TYPE|, and |MACRO_FILE_TYPE|
for setting |type|.
\initials{LDF 2004.12.01.}
Added the |static const unsigned short| data members
|SCANTOKENS_STRING_TYPE| and |SCANTOKENS_FILE_TYPE|.
\initials{LDF 2004.12.21.}
Added the |static const unsigned short| data members
|DEFUN_STRING_TYPE| and |DEFUN_FILE_TYPE|.
\initials{LDF 2005.06.09.}
Removed the |static const unsigned short| data members
|DEFUN_STRING_TYPE| and |DEFUN_FILE_TYPE|.
\ENDLOG
@q *** Declaration.@>
@<Declare I/O |structs|@>=
struct
Io_Struct
#ifdef HAVE_PTHREAD_H
: public Mutex_Type
#endif /* |HAVE_PTHREAD_H| */@;
{
string filename;
unsigned short type;
static const unsigned short INVALID_TYPE;
static const unsigned short FILE_TYPE;
static const unsigned short STDIN_TYPE;
static const unsigned short STDOUT_TYPE;
static const unsigned short COND_STRING_TYPE;
static const unsigned short COND_FILE_TYPE;
static const unsigned short LOOP_STRING_TYPE;
static const unsigned short LOOP_FILE_TYPE;
static const unsigned short MACRO_STRING_TYPE;
static const unsigned short MACRO_FILE_TYPE;
static const unsigned short SCANTOKENS_STRING_TYPE;
static const unsigned short SCANTOKENS_FILE_TYPE;
@<Declare |Io_Struct| functions@>@;
};
@q *** (3) Initialize |static Io_Struct| member constants.@>
@*2 Initialize |static Io_Struct| member constants.
\initials{LDF 2004.09.09.}
\LOG
\initials{LDF 2004.09.09.}
Added this section.
\initials{LDF 2004.12.01.}
Now initializing |SCANTOKENS_STRING_TYPE| and
|SCANTOKENS_FILE_TYPE|.
\initials{LDF 2004.12.21.}
Now initializing |DEFUN_STRING_TYPE| and |DEFUN_FILE_TYPE|.
\initials{LDF 2005.06.09.}
No longer initializing |DEFUN_STRING_TYPE| and |DEFUN_FILE_TYPE|,
since I've removed these data members.
\ENDLOG
@<Initialize |static Io_Struct| member constants@>=
const unsigned short Io_Struct::INVALID_TYPE = 0;
const unsigned short Io_Struct::FILE_TYPE = 1;
const unsigned short Io_Struct::STDIN_TYPE = 2;
const unsigned short Io_Struct::STDOUT_TYPE = 3;
const unsigned short Io_Struct::COND_STRING_TYPE = 4;
const unsigned short Io_Struct::COND_FILE_TYPE = 5;
const unsigned short Io_Struct::LOOP_STRING_TYPE = 6;
const unsigned short Io_Struct::LOOP_FILE_TYPE = 7;
const unsigned short Io_Struct::MACRO_STRING_TYPE = 8;
const unsigned short Io_Struct::MACRO_FILE_TYPE = 9;
const unsigned short Io_Struct::SCANTOKENS_STRING_TYPE = 10;
const unsigned short Io_Struct::SCANTOKENS_FILE_TYPE = 11;
@q *** (3) |Io_Struct| functions.@>
@*2 {\bf Io\_Struct} functions.
@q **** (4) Default constructor.@>
@*3 Default constructor.
\LOG
\initials{LDF 2004.06.19.}
Added this function.
\ENDLOG
\TODO
@q { @>
@:TO DO}{{\bf TO DO}@>
@q } @>
@q !! TO DO: @>
\initials{LDF 2004.06.19.}
Add error handling for the cases that |pthread_cond_init| or
|pthread_cond_mutex| fails.
\initials{LDF 2004.06.29.}
Removed code for handling |pthread_mutex_t mutex| and
|pthread_cond_t cond_var|. Now deriving |Io_Struct| from |Mutex_Type|
using |public| derivation if the preprocessor macro
|HAVE_PTHREAD_H| is defined. Currently not using condition variables.
\ENDTODO
@q **** (4) Declaration@>
@<Declare |Io_Struct| functions@>=
Io_Struct(void);
@q **** (4) Definition@>
@
@<Define |Io_Struct| functions@>=
Io_Struct::Io_Struct(void)
{
#if DEBUG_COMPILE
bool DEBUG = false; /* |true| */ @;
#endif /* |DEBUG_COMPILE| */@;
filename = "";
}
@q **** (4) Destructor.@>
@*3 Destructor.
\LOG
\initials{LDF 2004.06.19.}
Added this function.
\initials{LDF 2004.06.29.}
Removed code for handling |pthread_mutex_t mutex| and
|pthread_cond_t cond_var|. Now deriving |Io_Struct| from |Mutex_Type|
using |public| derivation if the preprocessor macro
|HAVE_PTHREAD_H| is defined. Currently not using condition variables.
\ENDLOG
@q ***** (5) Declaration@>
@<Declare |Io_Struct| functions@>=
~Io_Struct(void);
@q ***** (5) Definition@>
@
@<Define |Io_Struct| functions@>=
Io_Struct::~Io_Struct(void)
{
#if DEBUG_COMPILE
bool DEBUG = false; /* |true| */ @;
if (DEBUG)
cerr << "Entering `Io_Struct::~Io_Struct()'."
<< endl;
#endif /* |DEBUG_COMPILE| */@;
#if DEBUG_COMPILE
if (DEBUG)
cerr << "Exiting `Io_Struct::~Io_Struct()'."
<< endl;
#endif /* |DEBUG_COMPILE| */@;
return;
}
@q ** |Input_Struct|.@>
@*1 {\bf Input\_Struct}.
\LOG
\initials{LDF 2004.05.02.} Added |Input_Struct* up|.
\initials{LDF 2004.06.19.}
Now including the section |@<Declare |Input_Struct| functions@>|,
which currently contains only the default constructor, which I've
defined today.
\ENDLOG
@f Input_Struct Io_Struct
@q *** Declaration@>
@<Declare I/O |structs|@>=
struct
Input_Struct : public Io_Struct
{
istream* stream_ptr;
Input_Struct* up;
@<Declare |Input_Struct| functions@>@;
};
@q *** |Input_Struct| functions.@>
@*2 {\bf Input\_Struct} functions.
@q **** (4) Default constructor.@>
@*3 Default constructor.
This constructor initializes |stream_ptr| and |up| to 0
(just for insurance).
\initials{LDF 2004.06.19.}
\LOG
\initials{LDF 2004.06.19.}
Added this function.
\ENDLOG
@q ***** (5) Declaration@>
@
@<Declare |Input_Struct| functions@>=
Input_Struct(void);
@q ***** (5) Definition@>
@
@<Define |Input_Struct| functions@>=
Input_Struct::Input_Struct(void)
{
stream_ptr = static_cast<istream*>(0);
up = static_cast<Input_Struct*>(0);
}
@q **** (4) Destructor.@>
@*3 Destructor.
\LOG
\initials{LDF 2004.07.01.}
Rewrote this function. Added loop for deleting |up|,
|up->up|, etc. Added debugging code.
\initials{LDF 2004.07.02.}
Added code to this function. It now tests whether |stream_ptr| points to an
|ifstream|. If it does, and the file stream is open, it closes it before
deleting it and pointing |stream_ptr| at 0.
\initials{LDF 2004.09.09.}
@:BUG FIX@> BUG FIX:
Now only deleting |stream_ptr| if |is_file == true|.
\initials{LDF 2004.09.09.}
Now testing |ype == FILE_TYPE| instead of |is_file == true|.
\initials{LDF 2004.09.13.}
Now deleting |stream_ptr| and pointing it at 0 if
|type == LOOP_STRING_TYPE|.
\initials{LDF 2004.09.14.}
No longer deleting |stream_ptr| and pointing it at 0 if
|type == LOOP_STRING_TYPE|. This is now done in the |Loop_Info_Type|
destructor.
\initials{LDF 2004.09.14.}
Commented-out the code for deleting |up|.
\ENDLOG
@q ***** (5) Declaration@>
@
@<Declare |Input_Struct| functions@>=
~Input_Struct(void);
@q ***** (5) Definition@>
@
@<Define |Input_Struct| functions@>=
Input_Struct::~Input_Struct(void)
{
#if DEBUG_COMPILE
bool DEBUG = false; /* |true| */ @;
if (DEBUG)
cerr << "Entering `Input_Struct' destructor."
<< "\n";
#endif /* |DEBUG_COMPILE| */@;
if (type == FILE_TYPE)
{
ifstream* i= static_cast<ifstream*>(stream_ptr);
if (i->is_open())
{
#if DEBUG_COMPILE
if (DEBUG)
cerr << "Closing " << filename << ".\n";
#endif /* |DEBUG_COMPILE| */@;
i->close();
}
} /* |if (type == FILE_TYPE)| */@;
if (type == FILE_TYPE && stream_ptr != static_cast<ifstream*>(0))
{
#if DEBUG_COMPILE
if (DEBUG)
cerr << "Deleting stream_ptr and pointing it at 0"
<< ".\n";
#endif /* |DEBUG_COMPILE| */@;
delete (stream_ptr);
stream_ptr = static_cast<ifstream*>(0);
} /* |if (type == FILE_TYPE && stream_ptr != static_cast<ifstream*>(0))| */
#if DEBUG_COMPILE
else if (!type == FILE_TYPE && DEBUG)
{
cerr_mutex.lock();
cerr << "In `Input_Struct' destructor: "
<< endl << "`type' isn't `FILE_TYPE'."
<< endl
<< " Not deleting `stream_ptr'." << endl;
cerr << "Type <RETURN> to continue. ";
getchar();
cerr_mutex.unlock();
}
#endif /* |DEBUG_COMPILE| */@;
Input_Struct* i;
#if DEBUG_COMPILE
int j = 0;
#endif /* |DEBUG_COMPILE| */@;
@q ****** (6) Commented-out code.@>
@ Commented-out. |up| should not be deleted.
\initials{LDF 2004.09.14.}
@<Define |Input_Struct| functions@>=
#if 0
while (up != static_cast<Input_Struct*>(0))
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr << "`up' " << j++ << " is non-null. Deleting"
<< "\n";
}
#endif /* |DEBUG_COMPILE| */@;
i = up;
up = i->up;
delete i;
i = static_cast<Input_Struct*>(0);
}
#endif
@q ****** (6) |type == SCANTOKENS_STRING_TYPE|.@>
@ |type == SCANTOKENS_STRING_TYPE|.
\initials{LDF 2004.12.01.}
\LOG
\initials{LDF 2004.12.01.}
Added this section.
\ENDLOG
@<Define |Input_Struct| functions@>=
if (type == SCANTOKENS_STRING_TYPE && stream_ptr != static_cast<istream*>(0))
{
#if DEBUG_COMPILE
if (DEBUG)
cerr << "Deleting stream_ptr and pointing it at 0"
<< ".\n";
#endif /* |DEBUG_COMPILE| */@;
delete (stream_ptr);
stream_ptr = static_cast<istream*>(0);
} /* |if (type == SCANTOKENS_STRING_TYPE && stream_ptr != static_cast<istream*>(0))| */
@q ****** (6) |type == MACRO_STRING_TYPE|.@>
@ |type == MACRO_STRING_TYPE|.
\initials{LDF 2004.12.23.}
\LOG
\initials{LDF 2004.12.23.}
Added this section.
\ENDLOG
@<Define |Input_Struct| functions@>=
if (type == MACRO_STRING_TYPE && stream_ptr != static_cast<istream*>(0))
{
delete stream_ptr;
stream_ptr = static_cast<istream*>(0);
} /* |if (type == MACRO_STRING_TYPE && stream_ptr != static_cast<istream*>(0))| */
@q ****** (6) Exit destructor.@>
@ Exit destructor.
\initials{LDF 2004.09.14.}
@<Define |Input_Struct| functions@>=
#if DEBUG_COMPILE
if (DEBUG)
{
cerr << "Exiting `Input_Struct' destructor."
<< "\n";
}
#endif /* |DEBUG_COMPILE| */@;
return;
}
@q ** |Output_Struct|.@>
@*1 {\bf Output\_Struct}.
\LOG
\initials{LDF 2004.06.19.}
Added |pthread_mutex_t mutex| and |pthread_cond_t cond_var|.
\initials{LDF 2004.06.19.}
Now including the section |@<Declare |Output_Struct| functions@>|, which
currently contains only the default constructor, which I've defined today.
\initials{LDF 2004.06.19.}
Moved |pthread_mutex_t mutex| and |pthread_cond_t cond_var| to
|Io_Struct|.
\ENDLOG
@f Output_Struct Io_Struct
@q *** Declaration@>
@<Declare I/O |structs|@>=
struct
Output_Struct : public Io_Struct
{
ostream* stream_ptr;
@<Declare |Output_Struct| functions@>@;
};
@q *** |Output_Struct| functions.@>
@*2 {\bf Output\_Struct} functions.
@q **** (4) Default constructor.@>
@*3 Default constructor.
This constructor initializes |stream_ptr| to 0 (just for insurance).
\initials{LDF 2004.06.19.}
\LOG
\initials{LDF 2004.06.19.}
Added this function.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Output_Struct| functions@>=
Output_Struct(void);
@q ***** (5) Definition.@>
@
@<Define |Output_Struct| functions@>=
Output_Struct::Output_Struct(void)
{
stream_ptr = static_cast<ostream*>(0);
}
@q **** (4) Destructor.@>
@*3 Destructor.
\LOG
\initials{LDF 2004.07.02.}
Added code to this function. It now tests whether |stream_ptr| points to an
|ofstream|. If it does, and the file stream is open, it closes it before
deleting it and pointing |stream_ptr| at 0.
\ENDLOG
@q ***** (5) Declaration@>
@<Declare |Output_Struct| functions@>=
~Output_Struct(void);
@q ***** (5) Definition.@>
@
@<Define |Output_Struct| functions@>=
Output_Struct::~Output_Struct(void)
{
#if DEBUG_COMPILE
bool DEBUG = false; /* |true| */ @;
if (DEBUG)
cerr << "Entering `Output_Struct' destructor."
<< endl;
#endif /* |DEBUG_COMPILE| */@;
if (type == FILE_TYPE)
{
ofstream* o= static_cast<ofstream*>(stream_ptr);
if (o->is_open())
{
#if DEBUG_COMPILE
if (DEBUG)
cerr << "Closing " << filename << ".\n";
#endif /* |DEBUG_COMPILE| */@;
o->close();
}
} /* |if (type == FILE_TYPE)| */@;
if (stream_ptr != static_cast<ostream*>(0))
{
#if DEBUG_COMPILE
if (DEBUG)
cerr << "Deleting `stream_ptr' and pointing it at 0."
<< endl;
#endif /* |DEBUG_COMPILE| */@;
delete (stream_ptr);
stream_ptr = 0;
}
return;
}
@q * Global variables.@>
@* Global variables.
\initials{LDF 2002.10.16.} |in_stream| is an input stream attached to a file
with user code for input. Currently, it is used, but it fulfills no
useful function, because I haven't defined an input routine yet.
|out_stream| is an output stream attached to the file of \MP/ code
that 3DLDF currently produces as its output. |tex_stream| is an
output stream attached to a file of {\TeX} code. The user can write
{\TeX} code to this file and load it into \filename{persp.tex} or use
it for some other purpose. 3DLDF makes no use of it itself.
\LOG
\initials{LDF 2002.08.30.} Added |tex_stream| so that
I can include {\TeX} code in my user code.
Code written by 3DLDF to |tex_stream| will
be loaded by \filename{persp.tex}, or whatever
{\TeX} file includes the PostScript file
generated by \MP/ from the output of 3DLDF.
User code is currently in \filename{main.web}.
In production versions user code will be
in \filename{user.web}.
\initials{LDF 2003.07.16.} Added |fig_num|.
\initials{LDF 2004.03.26.} Removed |fig_num|. It won't work with
multiprocess or multithread input and output.
\initials{LDF 2004.04.02.} Removed |in_stream| and |tex_stream|.
|in_stream| has been replaced by an |istream*| in an |Input_Struct| in
|class Scanner_Type|. |tex_stream| was never used.
\initials{LDF 2004.05.25.} Removed |out_stream|.
It has been replaced by an |ostream*| in an |Output_Struct| in
|class Scanner_Type|.
\ENDLOG
@f ifstream int
@f ofstream int
@<Global variables@>=
string default_out_filename_metapost = "3DLDFput.mp";
string default_out_filename_png = "3DLDFput.png";
string default_out_filename_libplot = "3DLDFput.lpt";
@q * extern declarations for the global variables.@>
@ |extern| declarations for the global variables.
\LOG
\initials{LDF 2004.04.02.} Removed the |extern| declarations of
|in_stream| and |tex_stream|.
\initials{LDF 2004.05.25.} Removed the
|extern| declaration of |out_stream|.
\ENDLOG
@<|extern| variable declarations@>=
extern string default_out_filename_metapost;
extern string default_out_filename_png;
extern string default_out_filename_libplot;
@q * I/O functions.@>
@* I/O functions.
@q ** Initialize I/O.@>
@*1 Initialize I/O.
\LOG
\initials{LDF 2003.08.29.} Changed, so that |in_stream| isn't opened.
\initials{LDF 2004.04.02.} Commented-out. This function is not
currently being used.
\ENDLOG
\TODO
@q { @>
@:TO DO}{{\bf TO DO}@>
@q } @>
Adapt for use with |class Scanner_Node|.
\initials{LDF 2004.04.02.}
\ENDTODO
@<Declare I/O functions@>=
#if 0
void
initialize_io(string in_stream_name, string out_stream_name,
string tex_stream_name, char* program_name);
#endif
@
@s tm int
@<Define I/O functions@>=
#if 0
void
initialize_io(string in_stream_name, string out_stream_name,
string tex_stream_name, char* program_name)
{
time_t tt;
tm *lt;
tt = time(0);
lt =localtime(&tt);
string datestamp(asctime(lt));
datestamp.erase(datestamp.size() - 1); // Remove terminal line-feed.
@ Open |out_stream| and |tex_stream|.
|in_stream| is currently not opened. \initials{LDF 2003.08.29.}
@<Define I/O functions@>=
#if 0
in_stream.open(in_stream_name.c_str());
#endif
out_stream.open(out_stream_name.c_str());
#ifdef __DECCXX
out_stream.setf(ios_base::fixed, ios_base::floatfield);
#else
#ifdef __GNUC__
out_stream.setf(ios::fixed, ios::floatfield);
#endif
#endif
tex_stream.open(tex_stream_name.c_str());
/* Write datestamp to |out_stream|. */
out_stream << "%%%% This is " << out_stream_name << "." << endl
<< "%%%% Generated on " << datestamp << " from " << program_name
<< ".\n\n";
/* Write datestamp to |tex_stream|. */
tex_stream << "%%%% This is " << tex_stream_name << "." << endl
<< "%%%% Generated on " << datestamp << " from " << program_name
<< ".\n\n";
}
#endif
@q ** Write footers.@>
@*1 Write footers.
\initials{LDF 2002.10.16.}
Footers can be written to |output stream| and
|tex_stream|. I use them for Local
Variables lists for Emacs. Other users may not want this, which is
why this code is commented out here.
@:!!@> !! Comment out this code in production versions!
\LOG
\initials{LDF 2004.04.02.} Commented-out. This function is not
currently being used.
\ENDLOG
\TODO
@:TO DO}{{\bf TO DO}@>
Adapt for use with |class Scanner_Node|.
\initials{LDF 2004.04.02.}
\ENDTODO
@<Declare I/O functions@>=
#if 0
void
write_footers();
#endif
@
@<Define I/O functions@>=
#if 0
void
write_footers()
{
out_stream << endl << endl << "%% L" << "ocal Variables:" << endl
<< "%% mode:Metafont" << endl
<< "%% eval:(if metapost-keymap nil (load \"metapost-keymap\"))"
<< endl << "%% eval:(use-local-map metapost-mode-map)" << endl
<< "%% eval:(local-set-key [f9] 'mp-file)" << endl
<< "%% run-mp-on-file:\"persp.mp\"" << endl
<< "%% run-cweb-on-file:\"main.web\"" << endl
<< "%% run-tex-on-file:\"persp.tex\"" << endl
<< "%% run-dvips-on-file:\"persp.ps\"" << endl
<< "%% End:" << endl << endl;
tex_stream << "\n\n%% L" << "ocal Variables:\n"
<< "%% mode:tex\n"
<< "%% eval:(local-set-key [f9] 'mp-file)\n"
<< "%% run-mp-on-file:\"persp.mp\"\n"
<< "%% run-cweb-on-file:\"main.web\"\n"
<< "%% run-tex-on-file:\"persp.tex\"\n"
<< "%% run-dvips-on-file:\"persp.ps\"\n"
<< "%% End:\n";
return;
}
#endif
@q * (1) Identifier mapping.@>
@* Identifier mapping.
@q ** (2) Id_Map_Entry_Node.@>
@*1 {\bf Id\_Map\_Entry\_Node}.
\LOG
\initials{LDF 2004.04.20.}
Added this section.
\ENDLOG
@<|Id_Map_Entry_Node| declaration@>=
typedef Id_Map_Entry_Type* Id_Map_Entry_Node;
@q ** (2) Id_Map_Entry_Type.@>
@*1 {\bf Id\_Map\_Entry\_Type}.
No |Id_Map_Entry_Type| objects should ever be declared. They should
only ever be accessed via |Id_Map_Entry_Nodes|, which should be
created by dynamically on the free store by using
|new Id_Map_Entry_Type|.
\initials{LDF 2004.04.20.}
@q *** (3) Beginning of LOG.@>
\LOG
\initials{LDF 2004.04.16.}
Moved to this file from
\filename{scanprse.web}.
\initials{LDF 2004.04.20.}
Changed |Id_Map_Entry_Node|
to |Id_Map_Entry_Type|. Added |string name|, removed |bool b|, changed
|void* ptr| to |void* object|.
\initials{LDF 2004.04.20.}
Changed |Id_Map_Entry_Type| from a
|struct| to a |class| and declared |Id_Map_Type| to be a |friend|.
\initials{LDF 2004.04.20.}
Declared |Scanner_Type| to be a |friend|.
\initials{LDF 2004.04.23.}
Replaced |bool known| with |unsigned short
known_state|. Added the |static const unsigned shorts INDEPENDENT|,
|DEPENDENT|, and |KNOWN|. |known_state| should only ever be set by
using one of these constants.
\initials{LDF 2004.04.29.}
Replaced |bool spark_flag| with
|unsigned short category|. Added the |static const unsigned shorts|
|SPARK|, |REGULAR|, and |INTERNAL|. |category| should only ever be set using
one of these constants.
\initials{LDF 2004.04.29.}
Removed |real real_value| and |bool bool_value|.
Now |object| is used for storing values of all types.
\initials{LDF 2004.05.09.}
Added |const_flag|. Changed |is_array| to
|array_flag|.
\initials{LDF 2004.06.22.}
Added |pthread_mutex_t mutex| and |pthread_cond_t cond_var|.
\initials{LDF 2004.06.24.}
Now conditionally compiling the declarations of |mutex| and |cond_var|,
depending upon whether |HAVE_PTHREAD_H| is defined.
\initials{LDF 2004.06.29.}
Removed |pthread_mutex_t mutex| and |pthread_cond_t cond_var|.
Now deriving |Id_Map_Entry_Type|
from |Mutex_Type| using |public| derivation
if the preprocessor macro |HAVE_PTHREAD_H| is defined.
Currently not using condition variables.
\initials{LDF 2004.08.24.}
Added the private data member
|Id_Map_Entry_Node superordinate_vector|. It will only be non-null in
array entries that are created by means of vector-type declarations.
\initials{LDF 2004.08.25.}
Added the private data member
|Id_Map_Entry_Node subordinate_array|.
It will only be non-null in the vector-type entries created by means of
vector-type declarations. For example, |color_vector c;| will
create two |Id_Map_Entry_Nodes|. The first will have |name == c|,
|type == COLOR_VECTOR|, |array_flag == false|, |subordinate_array != 0|, and
|superordinate_vector == 0|. The other will have
|name == c-|,
|type == COLOR|, |array_flag == true|, |subordinate_array == 0|, and
|superordinate_vector != 0|. The non-null |superordinate_vector| and
|subordinate_array| will point to the other |Id_Map_Entry_Node|
of the pair.
\initials{LDF 2004.08.28.}
Added the private data member |Scanner_Node scanner_node|.
\initials{LDF 2004.09.08.}
Now including
|@<|friend| declarations for functions in |namespace Scan_Parse|@>|.
\initials{LDF 2004.11.11.}
Added |static const unsigned short TRUE_INTERNAL|. It's meant to be used
for setting |category|.
\ENDLOG
@q **** (4) End of LOG.@>
@f Id_Map_Entry_Type int@>
@f Id_Map_Entry_Node Id_Map_Entry_Type
@q *** (3) Declaration. @>
@<|Id_Map_Entry_Type| declaration@>=
class
Id_Map_Entry_Type
#ifdef HAVE_PTHREAD_H
: public Mutex_Type
#endif /* |HAVE_PTHREAD_H| */@;
{
@q **** (4) Private members. @>
@ Private members.
\initials{LDF 2004.08.24.}
@q ***** (5) |friend| declarations. @>
|friend| declarations.
\initials{LDF 2004.08.24.}
@<|Id_Map_Entry_Type| declaration@>=
friend class Id_Map_Type;
friend class Scanner_Type;
friend int yyparse(yyscan_t);
@<|friend| declarations for functions in |namespace Scan_Parse|@>@;
@q ***** (5) Data members. @>
@ Data members.
\initials{LDF 2004.08.24.}
\LOG
\initials{LDF 2004.08.29.}
Replaced |Scanner_Node scanner_node| with |Id_Map_Node id_map_node|.
\ENDLOG
@<|Id_Map_Entry_Type| declaration@>=
string name;
bool const_flag;
bool array_flag;
unsigned short known_state;
unsigned short category;
unsigned int type;
void* object;
Id_Map_Entry_Node up;
Id_Map_Entry_Node left;
Id_Map_Entry_Node right;
Id_Map_Entry_Node superordinate_vector;
Id_Map_Entry_Node subordinate_array;
Id_Map_Node id_map_node;
@q **** (4) Public members. @>
@ Public members.
\initials{LDF 2004.08.24.}
@<|Id_Map_Entry_Type| declaration@>=
public:
@q ***** (5) Static constants. @>
@ Static constants.
\initials{LDF 2004.08.24.}
\LOG
\initials{LDF 2004.08.27.}
Added |EXPIRED|.
\initials{LDF 2004.08.29.}
Removed |EXPIRED|.
\ENDLOG
@<|Id_Map_Entry_Type| declaration@>=
static const unsigned short INDEPENDENT; /* For setting |known_state|. */
static const unsigned short DEPENDENT;
static const unsigned short KNOWN;
static const unsigned short SPARK; /* For setting |category|. */
static const unsigned short REGULAR;
static const unsigned short INTERNAL;
static const unsigned short TRUE_INTERNAL;
@q ***** (5) Function declarations. @>
@ Function declarations.
\initials{LDF 2004.08.24.}
@<|Id_Map_Entry_Type| declaration@>=
@<Declare |Id_Map_Entry_Type| functions@>@;
};
@q *** (3) |static Id_Map_Entry_Type| member constants. @>
@*2 {\bf static Id\_Map\_Entry\_Type} member constants.
\LOG
\initials{LDF 2004.04.23.} Added this section.
\ENDLOG
@<Initialize |static Id_Map_Entry_Type| member constants@>=
const unsigned short Id_Map_Entry_Type::INDEPENDENT = 0;
const unsigned short Id_Map_Entry_Type::DEPENDENT = 1;
const unsigned short Id_Map_Entry_Type::KNOWN = 2;
const unsigned short Id_Map_Entry_Type::SPARK = 0;
const unsigned short Id_Map_Entry_Type::REGULAR = 1;
const unsigned short Id_Map_Entry_Type::INTERNAL = 2;
const unsigned short Id_Map_Entry_Type::TRUE_INTERNAL = 3;
@q *** (3) |Id_Map_Entry_Type| functions. @>
@*2 {\bf Id\_Map\_Entry\_Type} functions.
@q **** (4) Default constructor. @>
@*3 Default constructor.
\LOG
\initials{LDF 2004.09.14.}
Added this function declaration. The definition is in
\filename{imetfncs.web}
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
Id_Map_Entry_Type(void);
@q **** (4) Setting function. @>
@*3 Setting function.
\LOG
\initials{LDF 2004.04.20.} Added this function.
\initials{LDF 2004.04.22.} Moved definition to \filename{scan.web}.
\initials{LDF 2004.04.29.} Changed |bool sspark_flag| argument to
|unsigned short ccategory|.
\initials{LDF 2004.04.29.} Changed the name of this function from |set| to
|set_entry|. It was too difficult to find the places where it's invoked
before, since the classes derived from |Shape| also have |set| functions.
\initials{LDF 2004.05.09.}
Added |cconst_flag| argument. Changed |iis_array|
argument to |aarray_flag|.
\initials{LDF 2004.08.24.}
Added |Id_Map_Entry_Node ssuperordinate_vector|
argument with default 0.
\initials{LDF 2004.08.25.}
Added |Id_Map_Entry_Node ssubordinate_array|
argument with default 0.
\initials{LDF 2004.08.28.}
Added |Scanner_Node sscanner_node| argument.
\initials{LDF 2004.08.29.}
Replaced |Scanner_Node sscanner_node| argument with
|Id_Map_Node iid_map_node|. |id_map_node| is set to it.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
bool
set_entry(string nname,
unsigned int ttype,
Id_Map_Node iid_map_node,
unsigned short ccategory = Id_Map_Entry_Type::REGULAR,
bool cconst_flag = false,
bool aarray_flag = false,
unsigned short kknown_state = Id_Map_Entry_Type::INDEPENDENT,
void* oobject = 0,
Id_Map_Entry_Node uup = 0,
Id_Map_Entry_Node lleft = 0,
Id_Map_Entry_Node rright = 0,
Id_Map_Entry_Node ssuperordinate_vector = 0,
Id_Map_Entry_Node ssubordinate_array = 0);
@q **** (4) Destructor. @>
@*3 Destructor.
\LOG
\initials{LDF 2004.06.22.}
Added this function.
\initials{LDF 2004.06.29.}
Removed code for handling |pthread_mutex_t mutex| and
|pthread_cond_t cond_var|. Now deriving |Id_Map_Entry_Type| from
|Mutex_Type| using |public| derivation if the preprocessor macro
|HAVE_PTHREAD_H| is defined. Currently not using condition variables.
\initials{LDF 2004.07.01.}
Rewrote this function. It now tests for the type of |object|, casts it to the
proper type, and frees the memory that had been allocated for it. If
the object pointed to by |object| is a |Shape|, |clear| is called for it
before the memory is freed. Loops ensure that the |Shapes| are cleared (where
appropriate), and memory is freed for |left|, |left->left|, |right|,
|right->right|, etc., when they are non-null.
\initials{LDF 2004.07.01.}
Moved the definition from \.{io.web} (this file) to \.{scan.web}.
\initials{LDF 2004.07.16.}
Moved the definition from \filename{scan.web} to
\filename{imetfncs.web}.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Id_Map_Entry_Type| functions@>=
~Id_Map_Entry_Type(void);
@q **** (4) Destroy array subentries.@>
@*3 Destroy array subentries.
\LOG
\initials{LDF 2004.08.21.}
Added this function. It's defined in \filename{imetfncs.web}.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Id_Map_Entry_Type| functions@>=
int
destroy_array_subentries(Scanner_Node scanner_node = 0);
@q **** (4) Assignment operator. @>
@*3 Assignment operator.
\LOG
\initials{LDF 2004.09.14.}
Added this declaration. This function is defined in
\filename{imetfncs.web}.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
const Id_Map_Entry_Type&
operator=(const Id_Map_Entry_Type& idet);
@q **** (4) Setting values of date members.@>
@*3 Setting values of date members.
@q ***** (5) Set |superordinate_vector|.@>
@*4 Set {\bf superordinate\_vector}.
\LOG
\initials{LDF 2004.08.24.}
Added this function.
\initials{LDF 2004.09.17.}
Added |bool traverse| argument with default |false|.
Made non-inline and moved definition to \filename{imetfncs.web}.
\initials{LDF 2004.09.17.}
Added |bool set_vector| argument with default |false| and |int type|
argument with default 0.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
int
set_superordinate_vector(Id_Map_Entry_Node s,
bool set_vector = false,
bool traverse = false,
int type = 0);
@q ***** (5) Set |id_map_node|.@>
@*4 Set {\bf id\_map\_node}.
\LOG
\initials{LDF 2004.09.17.}
Added this declaration. This function is defined in
\filename{imetfncs.web}.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
int
set_id_map_node(const Id_Map_Node i, bool traverse = false);
@q ***** (5) Set |subordinate_array|.@>
@*4 Set {\bf subordinate\_array}.
\LOG
\initials{LDF 2004.08.25.}
Added this function.
\initials{LDF 2004.09.17.}
Added |bool traverse| argument with default |false|.
Made non-inline and moved definition to \filename{imetfncs.web}.
\initials{LDF 2004.09.17.}
Added |int type| argument. It's only needed when |traverse| is
|true|, hence the default of 0.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
int
set_subordinate_array(Id_Map_Entry_Node s,
bool traverse = false,
int type = 0);
@q **** (4) Get object.@>
@*3 Get object.
\initials{LDF 2005.03.14.}
\LOG
\initials{LDF 2005.03.14.}
Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
void*
get_object(void)
{
return object;
}
@q **** (4) Transformations. @>
@*3 Transformations.
\LOG
\initials{LDF 2004.09.29.}
Added this section.
\ENDLOG
@q ***** (5) Multiplying by a |Transform| with assignment.@>
@*4 Multiplying by a {\bf Transform} with assignment.
\LOG
\initials{LDF 2004.09.29.}
Added this function declaration.
\ENDLOG
@
@<Declare |Id_Map_Entry_Type| functions@>=
Transform
operator*=(const Transform& t);
@q **** (4) Returning elements and information. @>
@*3 Returning elements and information.
@q ***** (5) Is const. @>
@*4 Is const.
\LOG
\initials{LDF 2005.05.12.}
Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
bool
is_const(void) const
{
return const_flag;
}
@q ***** (5) Is |Shape|. @>
@*4 Is {\bf Shape}.
This function is defined in \.{scan.web}.
\initials{LDF 2004.07.01.}
\LOG
\initials{LDF 2005.07.01.}
Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
bool
is_shape(void) const;
@q ***** (5) Is |Shape|-vector-type.@>
@*4 Is {\bf Shape}-vector-type.
\initials{LDF 2004.12.12.}
This function is defined in \filename{imetfncs.web}.
\initials{LDF 2004.12.12.}
\LOG
\initials{LDF 2004.12.12.}
Added this declaration.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
bool
is_shape_vector_type(void) const;
@q ***** (5) Is Non-|Shape|-vector-type.@>
@*4 Is Non-{\bf Shape}-vector-type.
\initials{LDF 2004.12.12.}
This function is defined in \filename{imetfncs.web}.
\initials{LDF 2004.12.12.}
\LOG
\initials{LDF 2004.12.12.}
Added this declaration.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
bool
is_non_shape_vector_type(void) const;
@q ***** (5) Is Vector-type.@>
@*4 Is Vector-type.
\initials{LDF 2004.12.12.}
This function is defined in \filename{imetfncs.web}.
\initials{LDF 2004.12.12.}
\LOG
\initials{LDF 2004.12.12.}
Added this declaration.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
bool
is_vector_type(void) const;
@q ***** (5) Get object. @>
@*4 Get object.
\LOG
\initials{LDF 2004.04.29.} Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
void*
get_object(void) const
{
return object;
}
@q ***** (5) Get name. @>
@*4 Get name.
\LOG
\initials{LDF 2004.04.29.} Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
string
get_name(void) const
{
return name;
}
@q ***** (5) Get category. @>
@*4 Get category.
\LOG
\initials{LDF 2004.04.29.} Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
unsigned short
get_category(void) const
{
return category;
}
@q ***** (5) Get type. @>
@*4 Get type.
\LOG
\initials{LDF 2004.04.22.} Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
unsigned int
get_type(void) const
{
return type;
}
@q ***** (5) Is spark. @>
@*4 Is spark.
\LOG
\initials{LDF 2004.04.27.} Added this function.
\initials{LDF 2004.04.29.} Changed this function so that it returns |true|
if |category == SPARK|, otherwise |false|.
I've replaced |bool spark_flag| with |unsigned short category| today.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
bool
is_spark(void) const
{
return (category == SPARK);
}
@q ***** (5) Is regular. @>
@*4 Is regular.
\LOG
\initials{LDF 2004.04.29.} Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
bool
is_regular(void) const
{
return (category == REGULAR);
}
@q ***** (5) Is internal. @>
@*4 Is internal.
\LOG
\initials{LDF 2004.04.29.}
Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
bool
is_internal(void) const
{
return (category == INTERNAL);
}
@q ***** (5) Is true internal. @>
@*4 Is true internal.
\LOG
\initials{LDF 2004.11.11.}
Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
inline
bool
is_true_internal(void) const
{
return (category == TRUE_INTERNAL);
}
@q ***** (5) Is 3DLDF object type. @>
@*4 Is 3DLDF object type.
This function is defined in \filename{scan.web}, because it uses
C preprocessor macros generated by Bison from `token' declarations in
\filename{parser.w}.
\initials{LDF 2004.04.23.}
\LOG
\initials{LDF 2004.04.23.} Added this function.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
bool
is_ldf_type(void) const;
@q **** (4) Showing. @>
@*3 Showing.
This function is defined in \filename{scan.web}, because it uses
|name_map|, and the constants |TRANSFORM|, and |TRUNC_OCTAHEDRON|,
which are all declared in \filename{parser.w}.
\LOG
\initials{LDF 2004.04.22.}
Added this function.
\initials{LDF 2004.08.23.}
Added |Scanner_Node| argument with default 0.
\initials{LDF 2004.09.14.}
Added |bool traverse| argument with default |false|.
\initials{LDF 2004.09.19.}
Removed |Scanner_Node scanner_node| argument. Now declaring
|scanner_node| locally and setting it to |id_map_node->scanner_node|,
or 0, if |id_map_node| is 0.
\initials{LDF 2004.10.26.}
Added optional |bool verbose| argument with default |false|.
\ENDLOG
@<Declare |Id_Map_Entry_Type| functions@>=
void
show(string s = "",
bool traverse = false,
bool verbose = false) const;
@q ** Declare |Id_Map_Sub_Type|.@>
@*1 Declare {\bf Id\_Map\_Sub\_Type}.
\LOG
\initials{LDF 2004.04.20.} Changed this |typedef|, so that |second|
is an |Id_Map_Entry_Node| rather than a |pair| with |first| an
|unsigned int| and |second| a |void*|. Changed name of type from
|id_map_type| to |Id_Map_Sub_Type|.
\ENDLOG
@f Id_Map_Sub_Type int
@f Id_Map_Iterator Id_Map_Sub_Type
@f Id_Map_Const_Iterator Id_Map_Iterator
@<|Id_Map_Sub_Map_Type| declaration@>=
typedef map <string, Id_Map_Entry_Node > Id_Map_Sub_Type;
typedef Id_Map_Sub_Type::iterator Id_Map_Iterator;
typedef Id_Map_Sub_Type::const_iterator Id_Map_Const_Iterator;
@q ** Declare |Id_Map_Node|.@>
@*1 Declare {\bf Id\_Map\_Node}.
\LOG
\initials{LDF 2004.04.20.} Added this section.
\ENDLOG
@<|Id_Map_Node| declaration@>=
typedef Id_Map_Type* Id_Map_Node;
@q ** Declare |Id_Map_Type|.@>
@*1 Declare {\bf Id\_Map\_Type}.
\LOG
\initials{LDF 2004.04.16.} Moved to this file from
\filename{scanprse.web}.
\initials{LDF 2004.04.20.} Changed |Id_Map_Node| to |Id_Map_Type| and made
|Id_Map_Node| a pointer type that points to |Id_Map_Type| using
|typedef| (see above).
\initials{LDF Undated. Probably 2004.07.03.}
Declared |Scanner_Type| to be a |friend|.
\initials{LDF 2004.04.16.} Moved to this file from
\filename{scanprse.web}.
\initials{LDF 2004.04.20.} Changed |Id_Map_Type| from a
|struct| to a |class|.
\initials{LDF 2004.07.22.}
Added |friend| declaration for |Scan_Parse::shape_decl_func|.
\initials{LDF 2004.07.23.}
Added default value for the |C*| argument to
|Scan_Parse::shape_decl_func| in the |friend| declaration.
\initials{LDF 2004.08.29.}
Added the private data member |Scanner_Node Scanner_node|.
\initials{LDF 2004.09.19.}
Now including the section
|@<|friend| declarations for functions in |namespace Scan_Parse|@>|.
\ENDLOG
@f Id_Map_Type int
@f Id_Map_Node Id_Map_Type
@q *** Declaration. @>
@<|Id_Map_Type| declaration@>=
class
Id_Map_Type
{
friend class Scanner_Type;
friend class Id_Map_Entry_Type;
friend int yyparse(yyscan_t);
Scanner_Node scanner_node;
Id_Map_Sub_Type id_map;
Id_Map_Node up;
@<|friend| declarations for functions in |namespace Scan_Parse|@>@;
public:
@<Declare |Id_Map_Type| functions@>@;
};
@q *** |Id_Map_Type| functions. @>
@*2 {\bf Id\_Map\_Type} functions. @>
@q **** (4) Destructor. @>
@*3 Destructor.
\initials{LDF 2004.07.01.}
\LOG
\initials{LDF 2004.07.01.}
Added this function.
\initials{LDF 2004.08.21.}
Made debugging and error output thread-safe. Now calling
|Id_Map_Entry_Type::destroy_array_subentries|.
\ENDLOG
@<Declare |Id_Map_Type| functions@>=
~Id_Map_Type(void);
@
@<Define |Id_Map_Type| functions@>=
Id_Map_Type::~Id_Map_Type(void)
{
stringstream cerr_strm;
Thread_Info_Type* thread_info = Thread_Info_Type::get_thread_info(true);
string thread_name = Thread_Info_Type::get_thread_name(thread_info);
bool error_stop_value = true; /* |false| */
using namespace Scan_Parse;
#if DEBUG_COMPILE
bool DEBUG = false; /* |true| */ @;
if (DEBUG)
{
cerr_strm << thread_name << "Entering `Id_Map_Type' destructor.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
Id_Map_Entry_Node n;
for (Id_Map_Iterator iter = id_map.begin();
iter != id_map.end();
++iter)
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name << "In `Id_Map_Type' destructor:"
<< endl
<< "iter->first == " << iter->first << ".";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
n = iter->second;
if (n != static_cast<Id_Map_Entry_Node>(0))
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_mutex.lock();
cerr << thread_name << "In `Id_Map_Type' destructor:"
<< endl;
n->show("n:");
cerr << "Destroying `n'." << endl;
cerr_mutex.unlock();
}
#endif /* |DEBUG_COMPILE| */@;
n->destroy_array_subentries();
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name << "In `Id_Map_Type' destructor:"
<< endl
<< "Deleting `n' and setting it to 0.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
/* Error was here, before I put a kludge in |Scan_Parse::vector_type_decl|.
\initials{LDF 2006.10.08.} */
delete n;
n = 0;
} /* |if (n != static_cast<Id_Map_Entry_Node>(0))| */
} /* |for| */
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name << "Exiting `Id_Map_Type' destructor.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
if (up != static_cast<Id_Map_Node>(0))
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name << "In `Id_Map_Type' destructor:"
<< endl
<< "`up' != 0. Deleting `up'.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
delete up;
up = 0;
} /* |if (up != static_cast<Id_Map_Entry_Node>(0))| */
#if DEBUG_COMPILE
else if (DEBUG) /* (|up == static_cast<Id_Map_Entry_Node>(0)|) */
{
cerr_strm << thread_name << "In `Id_Map_Type' destructor:"
<< endl
<< "`up' == 0. Not deleting `up'.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
} /* |else| (|up == static_cast<Id_Map_Entry_Node>(0)|) */
#endif /* |DEBUG_COMPILE| */@;
return;
}
@q **** (4) Assignment Operator. @>
@*3 Assignment Operator.
\LOG
\initials{LDF 2004.09.14.}
Started working on this function.
\initials{LDF 2004.09.15.}
Moved the definition to \filename{imetfncs.web}.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Id_Map_Type| functions@>=
const Id_Map_Type&
operator=(const Id_Map_Type& i);
@q **** (4) Show. @>
@*3 Show.
If the |show_all| argument is |false| (the default),
|Id_Map_Entry_Type::show| is only called for entries whose types are
|NUMERIC|, |TRANSFORM|, or one of the |Shape| types. If |show_all| is
|true|, |Id_Map_Entry_Type::show| is called for all entries,
including predefined |sparks| such as |END|, |NULL_VALUE|, etc.
\initials{LDF 2004.04.23.}
\LOG
\initials{LDF 2004.04.23.}
Added this function.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Id_Map_Type| functions@>=
void
show(string s = "", bool show_all = false) const;
@q ***** (5) Definition. @>
@
@<Define |Id_Map_Type| functions@>=
void
Id_Map_Type::show(string s, bool show_all) const
{
if (s == "")
s = "Id_Map_Type:";
cerr << s << endl << "id_map:" << endl;
for (Id_Map_Const_Iterator iter = id_map.begin();
iter != id_map.end();
++iter)
{
/* !! TO DO: Show other types of entries. \initials{LDF 2004.04.25.} */@;
if (show_all || (!iter->second->is_const()
&& iter->second->is_regular()))
iter->second->show();
} /* |for| */@;
if (up == static_cast<Id_Map_Node>(0))
cerr << "up == 0\n";
else
{
cerr << "up != 0. Showing up." << endl;
up->show();
}
return;
}
@q * (1) Loop Information.@>
@* Loop Information.
\LOG
\initials{LDF 2004.09.13.}
Added this section.
\ENDLOG
@q ** (2) |Loop_Info_Node|.@>
@*1 {\bf Loop\_Info\_Node}.
\initials{LDF 2004.09.13.}
\LOG
\initials{LDF 2004.09.13.}
Added this section.
\ENDLOG
@<|Loop_Info_Node| declaration@>=
typedef Loop_Info_Type* Loop_Info_Node;
@q ** (2) |Loop_Info_Type|.@>
@*1 {\bf Loop\_Info\_Type}.
\initials{LDF 2004.09.13.}
\LOG
\initials{LDF 2004.09.13.}
Added this section.
\initials{LDF 2004.09.14.}
Removed |bool first_time| and |stringstream::pos_type end_of_prefix|.
Added |istream* loop_strm_ptr| and |Id_Map_Entry_Node entry|.
\initials{LDF 2004.09.22.}
Added the |unsigned short| data member |type| and the
|static const unsigned short| data members |INVALID_TYPE|, |FOR_TYPE|,
|FOREVER_TYPE|, and |FOR_SUFFIXES_TYPE|.
\initials{LDF 2004.10.28.}
Removed |real start_value|. It's not needed, because
|*static_cast<real*>(entry->object)| can be used instead.
In addition, this makes it possible to change the value of
the variable declared in the loop header within the loop.
\initials{LDF 2005.01.18.}
Added |vector<string> suffix_vector|.
\initials{LDF 2005.01.18.}
Added |size_t skip_value|.
\initials{LDF 2005.01.19.}
Changed |vector<string> suffix_vector| to
|list<string> suffix_list|.
\initials{LDF 2005.01.19.}
Added |string suffix_parameter|.
\initials{LDF 2005.01.20.}
Removed |size_t skip_value|.
\ENDLOG
@q *** (3) Declaration.@>
@<|Loop_Info_Type| declaration@>=
struct
Loop_Info_Type
{
real step_value;
real limit_value;
stringstream* loop_strm_ptr;
list<string> suffix_list;
string suffix_parameter;
Id_Map_Entry_Node entry;
Loop_Info_Node up;
unsigned short type;
static const unsigned short INVALID_TYPE;
static const unsigned short FOR_TYPE;
static const unsigned short FOREVER_TYPE;
static const unsigned short FOR_SUFFIXES_TYPE;
@<Declare |Loop_Info_Type| functions@>@;
};
@q *** (3) Initialize |static Loop_Info_Type| member constants.@>
@*2 Initialize |static Loop_Info_Type| member constants.
\initials{LDF 2004.09.22.}
\LOG
\initials{LDF 2004.09.22.}
Added this section.
\ENDLOG
@<Initialize |static Loop_Info_Type| member constants@>=
const unsigned short Loop_Info_Type::INVALID_TYPE = 0;
const unsigned short Loop_Info_Type::FOR_TYPE = 2;
const unsigned short Loop_Info_Type::FOREVER_TYPE = 3;
const unsigned short Loop_Info_Type::FOR_SUFFIXES_TYPE = 4;
@q *** (3) |Loop_Info_Type| functions.@>
@*2 {\bf Loop\_Info\_Type} functions.
\initials{LDF 2004.09.13.}
\LOG
\initials{LDF 2004.09.13.}
Added this section.
\ENDLOG
@q **** (4) Default constructor.@>
@*3 Default constructor.
\initials{LDF 2004.09.13.}
\LOG
\initials{LDF 2004.09.13.}
Added this function.
\initials{LDF 2004.09.14.}
No longer initializing |first_time| and |end_of_prefix|, since I've removed
these data members. Now initializing |loop_strm_ptr| and |entry|. I
allocate memory for a new |stringstream| for |loop_strm_ptr|.
\initials{LDF 2004.10.28.}
No longer setting |real start_value| to 0, because I've removed it.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Loop_Info_Type| functions@>=
Loop_Info_Type(void);
@q ***** (5) Definition.@>
@
@<Define |Loop_Info_Type| functions@>=
Loop_Info_Type::Loop_Info_Type(void)
{
step_value = 0; /* |real| */
limit_value = 0; /* |real| */
entry = 0;
loop_strm_ptr = new stringstream;
up = 0;
return;
}
@q **** (4) Destructor.@>
@*3 Destructor.
\initials{LDF 2004.09.14.}
\LOG
\initials{LDF 2004.09.14.}
Added this function.
\initials{LDF 2004.10.28.}
No longer setting |real start_value| to 0, because I've removed it.
\initials{LDF 2005.01.18.}
Now clearing |suffix_vector|. Not that it's really necessary.
\initials{LDF 2005.01.19.}
Changed |vector<string> suffix_vector| to
|list<string> suffix_list|.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Loop_Info_Type| functions@>=
~Loop_Info_Type(void);
@q ***** (5) Definition.@>
@
@<Define |Loop_Info_Type| functions@>=
Loop_Info_Type::~Loop_Info_Type(void)
{
step_value = 0;
limit_value = 0;
if (loop_strm_ptr != static_cast<stringstream*>(0))
delete loop_strm_ptr;
loop_strm_ptr = 0;
entry = 0;
up = 0;
suffix_list.clear();
return;
} /* End of |Loop_Info_Type| destructor definition. */
@q * (1) Definition Information.@>
@* Definition Information.
\initials{LDF 2004.12.21.}
\LOG
\initials{LDF 2004.12.21.}
Added this section.
\ENDLOG
@q ** (2) |Definition_Info_Node|.@>
@*1 {\bf Definition\_Info\_Node}.
\initials{LDF 2004.12.21.}
\LOG
\initials{LDF 2004.12.21.}
Added this section.
\ENDLOG
@<|Definition_Info_Node| declaration@>=
typedef Definition_Info_Type* Definition_Info_Node;
@q ** (2) |Definition_Info_Type|.@>
@*1 {\bf Definition\_Info\_Type}.
\initials{LDF 2004.12.21.}
\LOG
\initials{LDF 2004.12.21.}
Added this section.
\initials{LDF 2004.12.21.}
Changed |stringstream* strm_ptr| to |stringstream* definition_strm_ptr[2]|.
\initials{LDF 2004.12.22.}
Added |vector<string> definition_parameter_vector|.
\initials{LDF 2004.12.29.}
Changed the name of |vector<string> definition_parameter_vector|
to |untyped_parameter_vector| and added
|vector<Int_String> typed_parameter_vector|.
\initials{LDF 2005.01.02.}
Replaced |vector<string> untyped_parameter_vector| and
|vector<Int_String> typed_parameter_vector| with
|unsigned int untyped_parameter_ctr| and
|unsigned int typed_parameter_ctr|, respectively.
\initials{LDF 2005.01.03.}
Removed |string name|, |Definition_Info_Node up|, and
|Id_Map_Entry_Node entry|.
\ENDLOG
@q *** (3) Declaration.@>
@<|Definition_Info_Type| declaration@>=
struct
Definition_Info_Type
{
stringstream* definition_strm_ptr[2];
unsigned int untyped_parameter_ctr;
unsigned int typed_parameter_ctr;
unsigned short type;
@<Declare |Definition_Info_Type| functions@>@;
};
@q *** (3) Initialize |static Definition_Info_Type| member constants.@>
@*2 Initialize |static Definition_Info_Type| member constants.
\initials{LDF 2004.12.21.}
\LOG
\initials{LDF 2004.12.21.}
Added this section.
\ENDLOG
@<Initialize |static Definition_Info_Type| member constants@>=
@q *** (3) |Definition_Info_Type| functions.@>
@*2 {\bf Definition\_Info\_Type} functions.
\initials{LDF 2004.12.21.}
\LOG
\initials{LDF 2004.12.21.}
Added this section.
\ENDLOG
@q **** (4) Default constructor.@>
@*3 Default constructor.
\initials{LDF 2004.12.21.}
\LOG
\initials{LDF 2004.12.21.}
Added this function.
\initials{LDF 2005.01.02.}
Now setting |unsigned int untyped_parameter_ctr| and
|unsigned int typed_parameter_ctr| to 0.
\initials{LDF 2005.01.03.}
No longer setting |Id_Map_Entry_Node entry| to 0, because I've removed
this data member.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Definition_Info_Type| functions@>=
Definition_Info_Type(void);
@q ***** (5) Definition.@>
@
@<Define |Definition_Info_Type| functions@>=
Definition_Info_Type::Definition_Info_Type(void)
{
untyped_parameter_ctr = 0;
typed_parameter_ctr = 0;
try
{
definition_strm_ptr[0] = new stringstream;
definition_strm_ptr[1] = new stringstream;
}
catch (bad_alloc)
{
cerr_mutex.lock();
cerr << "ERROR! In the default `Definition_Info_Type' constructor:"
<< endl << "`new stringstream' failed. Rethrowing `bad_alloc'."
<< endl;
cerr_mutex.unlock();
throw;
} /* |catch (bad_alloc)| */
return;
} /* End of the |Definition_Info_Type::Definition_Info_Type(void)|
definition. */
@q **** (4) Destructor.@>
@*3 Destructor.
\initials{LDF 2004.12.21.}
\LOG
\initials{LDF 2004.12.21.}
Added this function.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Definition_Info_Type| functions@>=
~Definition_Info_Type(void);
@q ***** (5) Definition.@>
@
@<Define |Definition_Info_Type| functions@>=
Definition_Info_Type::~Definition_Info_Type(void)
{
delete definition_strm_ptr[0];
delete definition_strm_ptr[1];
definition_strm_ptr[0] = 0;
definition_strm_ptr[1] = 0;
return;
} /* End of |Definition_Info_Type| destructor definition. */
@q **** (4) Assignment operator.@>
@*3 Assignment operator.
\initials{LDF 2004.12.30.}
\LOG
\initials{LDF 2004.12.30.}
Added this function.
\initials{LDF 2005.01.02.}
Removed code using |untyped_parameter_vector| and
|typed_parameter_vector|. Now setting
|untyped_parameter_ctr = d.untyped_parameter_ctr|
and
|typed_parameter_ctr = d.typed_parameter_ctr|.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Definition_Info_Type| functions@>=
const
Definition_Info_Type&
operator=(const Definition_Info_Type& d);
@q ***** (5) Definition.@>
@
@<Define |Definition_Info_Type| functions@>=
const
Definition_Info_Type&
Definition_Info_Type::operator=(const Definition_Info_Type& d)
{
untyped_parameter_ctr = d.untyped_parameter_ctr;
typed_parameter_ctr = d.typed_parameter_ctr;
definition_strm_ptr[0]->str(d.definition_strm_ptr[0]->str());
definition_strm_ptr[1]->str(d.definition_strm_ptr[1]->str());
return *this;
} /* End of |Definition_Info_Type| destructor definition. */
@q **** (4) Clear.@>
@*3 Clear.
\initials{LDF 2004.12.29.}
\LOG
\initials{LDF 2004.12.29.}
Added this function declaration. This function is defined in
\filename{deftfncs.web}.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Definition_Info_Type| functions@>=
void
clear(void);
@q **** (4) Show.@>
@*3 Show.
\initials{LDF 2004.12.21.}
This function requires |type_name_map|, so it's defined in
\filename{deftfncs.web}.
\LOG
\initials{LDF 2004.12.21.}
Added this function declaration.
\initials{LDF 2004.12.22.}
Made this function |const|.
\ENDLOG
@q ***** (5) Declaration.@>
@<Declare |Definition_Info_Type| functions@>=
void
show(string text = "") const;
@q * (1) Scanning.@>
@* Scanning.
@q ** (2) Scanner_Node.@>
@*1 {\bf Scanner\_Node}.
\LOG
\initials{LDF 2004.04.20.} Added this section.
\ENDLOG
@<|Scanner_Node| declaration@>=
typedef Scanner_Type* Scanner_Node;
@q ** (2) class Scanner_Type.@>
@*1 {\bf class Scanner\_Type}.
It's not possible to make |yylex| and |sub_yylex| |friends| of
|Scanner_Type|, because they have arguments of the types |YYSTYPE*|
and |YYLTYPE*|, and |YYSTYPE| and |YYLTYPE| haven't been declared
yet when \filename{io.c} is compiled.
@q *** (3) Log.@>
\LOG
\initials{LDF 2004.04.16.}
Moved this |class| definition to this file (\filename{io.web})
from \filename{scanprse.web}.
\initials{LDF 2004.04.20.}
Changed name of this |struct| from |Scanner_Node|
to |Scanner_Type|.
\initials{LDF 2004.04.20.}
Changed |Scanner_Type| from |struct| to |class|.
Added |friend| declaration for |yyparse|.
Made |Input_Struct* in| private.
\initials{LDF 2004.04.20.}
Removed |bool is_on_free_store|.
|Scanner_Types| should only ever be accessed via |Scanner_Nodes|, and
the latter should only ever be dynamically allocated on the free store.
\initials{LDF 2004.05.03.}
Added |rescan_stack|.
\initials{LDF 2004.06.02.}
Added the pointers to |void| |draw_color_ptr|,
|fill_color_ptr|, |pen_ptr|, |dash_pattern_ptr|,
and |picture_ptr|. They're used in the rules for
\drawing command>.
\initials{LDF 2004.06.03.}
Added |void* color_ptr|.
\initials{LDF 2004.07.02.}
Now deriving |Scanner_Type| from |Thread_Info_Type| using
|public| derivation.
\initials{LDF 2004.07.03.}
No longer deriving |Scanner_Type| from |Thread_Info_Type|. Added
|Thread_Info_Type* thread_info| instead. This is necessary in order to be able
pass |Thread_Info_Type*| to |pthread_setspecific| in the thread start
functions.
\initials{LDF 2004.07.05.}
Removed |Thread_Info_Type* thread_info|. There's no reason for it to be
included in |Scanner_Type|.
\initials{LDF 2004.07.18.}
Added |Thread_Info_Type* thread_info|. I was having trouble getting
|Thread_Info_Type::get_thread_info| to work in one of the parser rules.
\initials{LDF 2004.07.29.}
Changed |string type_name| and |C* expr| arguments of
|Scan_Parse::assign_simple| to |const| in |friend| declaration.
\initials{LDF 2004.09.08.}
Now including
|@<|friend| declarations for functions in |namespace Scan_Parse|@>|.
\initials{LDF 2004.09.09.}
Added |bool first_call_yylex|. It's set to |true| in
|Scanner_Type::create| and |false| in |yylex|. It's needed in
|yylex| in order to get the message
``(Please type a command or say `end')'' to
be printed to standard error correctly when reading from standard
input.
\ENDLOG
@q **** (4) End of log.@>
@f Scanner_Type int
@f Scanner_Node Scanner_Type
@q *** (3) Declaration. @>
@<|Scanner_Type| declaration@>=
class
Scanner_Type
{
@q **** (4) |friend| declarations. @>
@*3 |friend| declarations.
\initials{LDF 2004.06.28.}
\LOG
\initials{LDF 2007.08.03.}
Added |friend| declaration for |Conic_Section_Lattice|.
\initials{LDF 2007.10.12.}
Added |friend| declaration for |class Dodecahedron|.
\initials{LDF 2007.10.24.}
Added |friend| declaration for |class Rhombic_Triacontahedron|.
\ENDLOG
@<|Scanner_Type| declaration@>=
friend class Id_Map_Type;
friend class Id_Map_Entry_Type;
friend class Matrix;
friend class Conic_Section_Lattice;
friend class Dodecahedron;
friend class Rhombic_Triacontahedron;
friend int yyparse(yyscan_t);
friend int main(int, char**);
friend int Id_Map_Entry_Type::destroy_array_subentries(Scanner_Node);
@<|friend| declarations for functions in |namespace Scan_Parse|@>@;
@q **** (4) |private| data members. @>
@*3 |private| data members.
\initials{LDF 2004.06.28.}
\LOG
\initials{LDF 2004.09.10.}
Added |unsigned int if_ctr|. It's used in
|Scan_Parse::conditional|, which is defined in
\filename{scanprsf.web}.
\initials{LDF 2004.09.12.}
Added |unsigned int group_ctr| and |unsigned int loop_ctr|.
They're used to keep track of the nesting of groups and loops,
respectively.
\initials{LDF 2004.09.13.}
Added |Loop_Info_Node loop_info_node|.
\initials{LDF 2004.09.15.}
@:BUG FIX@> BUG FIX:
Now conditionally compiling the declaration of
|Thread_Info_Type* thread_info|. It's now only compiled if
|HAVE_PTHREAD_H| is defined.
\initials{LDF 2004.09.22.}
Added |vector<string> suffix_vector|.
\initials{LDF 2005.01.19.}
Removed |vector<string> suffix_vector|.
\initials{LDF 2007.11.25.}
Added |vector <real> numeric_list_real_vector|.
\ENDLOG
@q ***** (5) Code.@>
@<|Scanner_Type| declaration@>=
Run_State run_state;
#ifdef HAVE_PTHREAD_H
Thread_Info_Type* thread_info;
vector<pthread_t*> thread_vector;
pthread_mutex_t thread_vector_mutex;
Cond_Var_Type<bool, unsigned int> output_pending;
#endif /* |HAVE_PTHREAD_H| */@;
Input_Struct* in;
Id_Map_Node id_map_node;
Scanner_Node up;
bool array_switch;
bool known_switch;
int action_switch;
vector <String_Bool> token_string_bool_vector;
vector <real> token_real_vector;
vector <real> numeric_list_real_vector;
bool first_call_yylex;
unsigned int if_ctr;
unsigned int group_ctr;
unsigned int loop_ctr;
string token_string;
Loop_Info_Node loop_info_node;
@q ***** (5) Pointers for true internal quantities.@>
@*4 Pointers for true internal quantities.
\initials{LDF 2004.11.11.}
\LOG
\initials{LDF 2004.11.11.}
Added this section with declarations of
the |Pen**| variables |current_pen| and |default_pen|,
the |Color**| variables |current_color|, |current_draw_color|,
|current_fill_color|, |default_color|,
|default_draw_color|, and |default_fill_color|,
and the |Dash_Pattern**| variables |current_dash_pattern| and
|default_dash_pattern|.
\ENDLOG
@q ****** (6) Code.@>
@<|Scanner_Type| declaration@>=
Pen** current_pen;
Pen** default_pen;
Color** current_color;
Color** current_draw_color;
Color** current_fill_color;
Color** default_color;
Color** default_draw_color;
Color** default_fill_color;
Dash_Pattern** current_dash_pattern;
Dash_Pattern** default_dash_pattern;
@q ***** (5) Data members for setting non-|Shape|-types.@>
@*4 Data members for setting non-|Shape|-types.
\initials{LDF 2007.09.19.}
\LOG
\initials{LDF 2007.09.19.}
Added this section with the declaration of
|Focus_Options* focus_options|.
\initials{LDF 2007.11.28.}
Added the declaration of |Matrix_Options* matrix_options|.
\ENDLOG
@q ****** (6) Code.@>
@<|Scanner_Type| declaration@>=
Matrix_Options* matrix_options;
Focus_Options* focus_options;
@q ***** (5) Data members for setting |Shape|-types.@>
@*4 Data members for setting |Shape|-types.
\initials{LDF 2005.05.19.}
\LOG
\initials{LDF 2005.05.19.}
Added this section with the declaration of
|Helix_Set_Option_Struct* helix_set_option_struct|.
\initials{LDF 2005.05.25.}
Added the declarations of
|Cone_Set_Option_Struct* cone_set_option_struct|
and
|Cylinder_Set_Option_Struct* cylinder_set_option_struct|.
\initials{LDF 2005.05.26.}
Added the declaration of
|Ellipsoid_Set_Option_Struct* ellipsoid_set_option_struct|.
\initials{LDF 2005.06.06.}
Added the declaration of
|Sphere_Set_Option_Struct* sphere_set_option_struct|.
\initials{LDF 2005.11.07.}
Added the declaration of
|Parabola_Set_Option_Struct* parabola_set_option_struct|.
\initials{LDF 2005.11.14.}
Added the declaration of
|Hyperbola_Set_Option_Struct* hyperbola_set_option_struct|.
\initials{LDF 2006.01.25.}
Added the declaration of
|Paraboloid_Set_Option_Struct* paraboloid_set_option_struct|.
\initials{LDF 2007.07.29.}
Added the declaration of
|Conic_Section_Lattice_Options* conic_section_lattice_options|.
\initials{LDF 2007.10.12.}
Added the declaration of
|Polyhedron_Options* polyhedron_options|.
\initials{LDF 2007.11.25.}
Added the declaration of |Arc_Options* arc_options|.
\initials{LDF 2009.11.17.}
Added the declaration of
|Sphere_Development_Set_Option_Struct* sphere_development_set_option_struct|.
\ENDLOG
@q ****** (6) Code.@>
@<|Scanner_Type| declaration@>=
Parabola_Set_Option_Struct* parabola_set_option_struct;
Hyperbola_Set_Option_Struct* hyperbola_set_option_struct;
Conic_Section_Lattice_Options* conic_section_lattice_options;
Arc_Options* arc_options;
Helix_Set_Option_Struct* helix_set_option_struct;
Cone_Set_Option_Struct* cone_set_option_struct;
Cylinder_Set_Option_Struct* cylinder_set_option_struct;
Polyhedron_Options* polyhedron_options;
Ellipsoid_Set_Option_Struct* ellipsoid_set_option_struct;
Sphere_Set_Option_Struct* sphere_set_option_struct;
Sphere_Development_Set_Option_Struct* sphere_development_set_option_struct;
Paraboloid_Set_Option_Struct* paraboloid_set_option_struct;
@q ***** (5) Pointers for |with_clause_draw|. @>
@*4 Pointers for |with_clause_draw|.
\initials{LDF 2004.06.28.}
\LOG
\initials{LDF 2004.08.29.}
Added |color_vector_ptr|, |draw_color_vector_ptr|, and
|fill_color_vector_ptr|.
\initials{LDF 2005.03.18.}
Added |pen_vector_ptr| and |dash_pattern_vector_ptr|.
\ENDLOG
@<|Scanner_Type| declaration@>=
void* color_ptr;
void* color_vector_ptr;
void* draw_color_ptr;
void* draw_color_vector_ptr;
void* fill_color_ptr;
void* fill_color_vector_ptr;
void* pen_ptr;
void* pen_vector_ptr;
void* dash_pattern_ptr;
void* dash_pattern_vector_ptr;
@q ***** (5) Pointers for |with_clause_output|. @>
@*4 Pointers for |with_clause_output|.
\initials{LDF 2004.06.28.}
\LOG
\initials{LDF 2004.06.28.}
Added this section.
\initials{LDF 2004.06.28.}
Changed all these variables to |void*|.
\initials{LDF 2004.06.28.}
Added ``|_ptr|'' to the end of the names of all of the variables in this
section, except for |focus_ptr|, which already had it.
\initials{LDF 2004.07.14.}
Added |clear_ptr| and |endfig_ptr|.
\initials{LDF 2005.03.13.}
Added |surface_hiding_value_ptr|.
\ENDLOG
@q ****** (6) Code.@>
@<|Scanner_Type| declaration@>=
void* picture_entry_ptr;
void* clear_ptr;
void* endfig_ptr;
void* focus_ptr;
void* projection_ptr;
void* factor_ptr;
void* sort_value_ptr;
void* min_x_proj_ptr;
void* max_x_proj_ptr;
void* min_y_proj_ptr;
void* max_y_proj_ptr;
void* min_z_proj_ptr;
void* max_z_proj_ptr;
void* surface_hiding_value_ptr;
@q ***** (5) Pointers for |predicate_clause|. @>
@*4 Pointers for |predicate_clause|.
\initials{LDF 2005.10.26.}
\LOG
\initials{LDF 2005.10.26.}
Added this section with the declaration of |tolerance|.
\ENDLOG
@q ****** (6) Code.@>
@<|Scanner_Type| declaration@>=
real* tolerance;
@q ***** (5) Data members for macro definitions.@>
@*4 Data members for macro definitions.
\initials{LDF 2004.12.21.}
\LOG
\initials{LDF 2004.12.21.}
Added this section.
\initials{LDF 2004.12.21.}
Changed the type of |definition_parameter_vector| from
|vector<pair<int, string> >| to |vector<Int_String>|.
\initials{LDF 2004.12.22.}
Changed the type of |definition_parameter_vector| from
|vector<Int_String>| to |vector<string>|.
\initials{LDF 2004.12.29.}
Replaced |vector<string> definition_parameter_vector| with
|vector<string> macro_untyped_parameter_vector| and
|vector<Int_String> macro_typed_parameter_vector|.
\initials{LDF 2005.01.02.}
Removed |int definition_ctr|.
\ENDLOG
@q ****** (6) Code.@>
@<|Scanner_Type| declaration@>=
vector<string> macro_untyped_parameter_vector;
vector<Int_String> macro_typed_parameter_vector;
@q **** (4) |public| data and function members.@>
@*3 |public| data and function members.
\initials{LDF 2004.06.28.}
\LOG
\initials{LDF 2004.07.03.}
Added |vector<pthread_t*> pthread_t_ptr_vector|.
\initials{LDF 2004.07.05.}
Removed |Thread_Info_Type* thread_info|. There's no reason for it to be
included in |Scanner_Type|.
\initials{LDF 2005.12.05.}
Added |bool ulong_long_switch|.
\ENDLOG
@q ***** (5) Code.@>
@<|Scanner_Type| declaration@>=
public:
bool ulong_long_switch;
stack<Int_Void_Ptr_Bool> rescan_stack;
Output_Struct* out[3];
@<Declare |Scanner_Type| functions@>@;
};
@q *** (3) Scanner_Type functions.@>
@*2 {\bf Scanner\_Type} functions.
@q **** (4) Destructor. @>
@*3 Destructor.
This function is defined in \filename{sctpfncs.web}.
\initials{LDF 2004.09.22.}
\LOG
\initials{LDF 2004.07.01.}
Added this function declaration.
\ENDLOG
@q ***** (5) Declaration. @>
@<Declare |Scanner_Type| functions@>=
~Scanner_Type(void);
@q **** (4) Pseudo-constructor for dynamic allocation. @>
@*3 Pseudo-constructor for dynamic allocation.
@q ***** (5) Declaration. @>
\LOG
\initials{LDF 2004.03.28.} Added this function.
\initials{LDF 2004.04.16.} Moved to this file from
\filename{scanprse.web}.
\initials{LDF 2004.04.16.} Changed |metafont_output|, |png_output|, and
|libplot_output| to |do_output[Run_State::METAFONT]|,
|do_output[Run_State::PNG]|, and |do_output[Run_State::LIBPLOT]|,
respectively.
\initials{LDF 2004.04.16.} Moved definition to
\filename{colors.web}. This was necessary because it now calls
|Color::initialize_colors| to write the |Color| definitions to the
MetaPost output file.
\initials{LDF 2004.04.20.} Added |bool top_level| argument. If it's
|true|, then |scanner_node->id_map_node| will be initialized. Just
started working on this.
\initials{LDF 2004.04.20.}
Removed the definition of |Scanner_Type::create| from
\filename{colors.web} to \filename{scan.web}. This was necessary because it
uses |LDF_TYPE|, which is declared in \filename{parser.w}.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
static
Scanner_Node
create(string str, const Run_State& r, bool top_level = false);
@q **** (4) Setting function.@>
@*3 Setting function.
Currently, this function is only used for setting |scanner_node_stdin|
in |@<Main@>|.
\TODO
@q { @>
@:TO DO}{{\bf TO DO}@>
@q } @>
@q !! TO DO:@>
\initials{LDF 2004.04.20.} Add arguments and code for handling |out|.
\ENDTODO
\LOG
\initials{LDF 2004.04.20.} Added this function.
\initials{LDF 2004.05.02.} Now setting |scanner_node->in->up| to 0.
Added |Input_Struct* up| to |struct Input_Struct| today.
\initials{LDF 2004.09.09.}
Replaced the |bool iis_file| argument with
|const unsigned short ttype|.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
void
set(string in_filename,
istream* in_stream_ptr,
Scanner_Node uup,
const unsigned short ttype,
Run_State& rrun_state = run_state_initial);
@
@<Define |Scanner_Type| functions@>=
void
Scanner_Type::set(string in_filename,
istream* in_stream_ptr,
Scanner_Node uup,
const unsigned short ttype,
Run_State& rrun_state)
{
in = new Input_Struct;
in->up = 0;
up = uup;
in->filename = in_filename;
in->stream_ptr = in_stream_ptr;
in->type = ttype;
arc_options = 0;
for (int i = 0; i < Run_State::MAX_OUTPUT_FORMATS; ++i)
out[i] = 0;
return;
}
@q **** (4) Assignment operator. @>
@*3 Assignment operator.
\LOG
\initials{LDF 2004.09.15.}
Added this declaration. This function is defined in
\filename{sctpfncs.web}.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
const Scanner_Type&
operator=(const Scanner_Type& s);
@q **** (4) Open default output file. @>
@*3 Open default output file.
\LOG
\initials{LDF 2004.04.16.} Moved to this file from
\filename{scanprse.web}.
\initials{LDF 2004.04.16.} Changed |metafont_output|, |png_output|, and
|libplot_output| to |do_output[Run_State::METAFONT]|,
|do_output[Run_State::PNG]|, and |do_output[Run_State::LIBPLOT]|,
respectively.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
bool
open_default_out_file(const unsigned short format, Run_State& r);
@q ***** (5) Definition. @>
@
@<Define |Scanner_Type| functions@>=
bool
Scanner_Type::open_default_out_file(const unsigned short format, Run_State& r)
{
bool DEBUG = false; /* |true| */ @;
if (DEBUG)
cerr << "Entering Scanner_Type::open_default_out_file()" << endl
<< "format == " << format << endl;
run_state = r;
bool do_output;
string filename;
string conditional_string;
if (format == Run_State::METAPOST)
{
do_output = run_state.do_output[Run_State::METAPOST];
filename = default_out_filename_metapost;
if (DEBUG)
conditional_string = "do_output[Run_State::METAPOST]";
}
else if (format == Run_State::PNG)
{
do_output = run_state.do_output[Run_State::PNG];
filename = default_out_filename_png;
if (DEBUG)
conditional_string = "do_output[Run_State::PNG]";
}
else if (format == Run_State::LIBPLOT)
{
do_output = run_state.do_output[Run_State::LIBPLOT];
filename = default_out_filename_libplot;
if (DEBUG)
conditional_string = "do_output[Run_State::LIBPLOT]";
}
else
{
cerr << "ERROR! In Scanner_Type::open_default_out_file():\n"
<< "Invalid `format\' argument: " << format << endl
<< "Returning `false\'." << endl << endl;
return false;
}
if (do_output)
{
ofstream* out_file_stream = new ofstream;
out_file_stream->open(filename.c_str());
if (!(*out_file_stream))
{
delete out_file_stream;
out_file_stream = 0;
cerr << "ERROR! In Scanner_Type::open_default_out_file():"
<< "Opening " << filename
<< " failed! Returning false.\n\n";
return false;
}
else
{
out[format] = new Output_Struct;
out[format]->stream_ptr
= static_cast<ostream*>(out_file_stream);
out[format]->filename = filename;
if (DEBUG)
cerr << "Opening " << filename
<< " succeeded! returning `true\'" << endl
<< "Exiting Scanner_Type::open_default_out_file()" << endl
<< endl;
return true;
} /* |else| */@;
} /* |if (do_output)| */@;
else if (DEBUG)
{
cerr << conditional_string << " == false. Returning `false\'.\n"
<< "Exiting Scanner_Type::open_default_out_file()" << endl;
return false;
}
} /* |Scanner_Type::open_default_out_file| */@;
@q **** (4) Get thread name and stop value.@>
@*3 Get thread name and stop value.
\initials{LDF 2004.10.03.}
\LOG
\initials{LDF 2004.10.03.}
Added this function.
\initials{LDF 2004.10.05.}
Now setting |*error_stop_value| to |Run_State::STOPPING| rather than
|Run_State::ERRORSTOP|.
Now setting |*warning_stop_value| to |Run_State::STOPPING|.
\initials{LDF 2005.11.03.}
Made all of the arguments optional, with the default 0.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
int
get_thread_name_and_stop_values(string* thread_name = 0,
bool* error_stop_value = 0,
bool* warning_stop_value = 0);
@q ***** (5) Definition. @>
@
@<Define |Scanner_Type| functions@>=
int
Scanner_Type::get_thread_name_and_stop_values(string* thread_name,
bool* error_stop_value,
bool* warning_stop_value)
{
#if DEBUG_COMPILE
bool DEBUG = false; /* |true| */ @;
#endif /* |DEBUG_COMPILE| */@;
if (thread_name)
*thread_name = "";
if (error_stop_value)
*error_stop_value = (run_state.error_stop_mode == Run_State::STOPPING)
? true : false;
if (warning_stop_value)
*warning_stop_value = (run_state.warning_stop_mode == Run_State::STOPPING)
? true : false;
#ifdef HAVE_PTHREAD_H
if (thread_name)
{
Thread_Info_Type* thread_info;
if ( run_state.multithread_input
|| run_state.multithread_output
|| run_state.multithread_include)
{
thread_info = Thread_Info_Type::get_thread_info();
*thread_name = thread_info->name;
}
else
{
thread_info = 0;
*thread_name = "";
}
} /* |if (thread_name)| */
#endif /* |HAVE_PTHREAD_H| */@;
return 0;
} /* End of |Scanner_Type::get_thread_name_and_stop_values| definition. */
@q **** (4) Handling input. @>
@*3 Handling input.
@q ***** (5) Get. @>
@*4 Get.
\LOG
\initials{LDF 2004.04.20.} Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
char
get() const;
@q ****** (6) Definition. @>
@
@<Define |Scanner_Type| functions@>=
char
Scanner_Type::get() const
{
return in->stream_ptr->get();
}
@q ***** (5) Peek. @>
@*4 Peek.
\LOG
\initials{LDF 2004.04.20.} Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
char
peek() const;
@q ****** (6) Definition. @>
@
@<Define |Scanner_Type| functions@>=
char
Scanner_Type::peek() const
{
return in->stream_ptr->peek();
}
@q ***** (5) Ignore. @>
@*4 Ignore.
\LOG
\initials{LDF 2004.04.20.} Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
void
ignore() const;
@q ****** (6) Definition. @>
@
@<Define |Scanner_Type| functions@>=
void
Scanner_Type::ignore() const
{
in->stream_ptr->ignore();
return;
}
@q ***** (5) Put back. @>
@*4 Put back.
\LOG
\initials{LDF 2004.09.13.}
Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
inline
void
putback(char c)
{
in->stream_ptr->putback(c);
return;
}
@q **** (4) Querying. @>
@*3 Querying.
@q ***** (5) Is open for input. @>
@*4 Is open for input.
\LOG
\initials{LDF 2004.04.20.} Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
bool
is_open_in() const;
@q ****** (6) Definition. @>
@
@<Define |Scanner_Type| functions@>=
bool
Scanner_Type::is_open_in() const
{
return in->stream_ptr;
}
@q ***** (5) Get input filename. @>
@*4 Get input filename.
\LOG
\initials{LDF 2004.04.20.} Added this function.
\initials{LDF 2004.04.20.} Added error handling and debugging code.
Added |silent| argument. Changed return type from |const string&| to
|const string|. This was necessary in order to be able to return the
empty |string| if |in| is a null pointer.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
const
string
get_in_filename(const bool silent = false) const;
@q ****** (6) Definition. @>
@
@<Define |Scanner_Type| functions@>=
const
string
Scanner_Type::get_in_filename(const bool silent) const
{
bool DEBUG = false; /* |true| */ @;
if (in == static_cast<Input_Struct*>(0))
{
if (!silent || DEBUG)
cerr << "WARNING! In Scanner_Type::get_in_filename():\n"
<< "Scanner_Type.in is a null pointer. Returning "
<< "empty string.\n";
return "";
}
else
{
if (DEBUG)
cerr << "In Scanner_Type::get_in_filename():\n"
<< "returning " << in->filename << ".\n";
return in->filename;
}
}
@q ***** (5) Get |run_state|. @>
@*4 Get |run_state|.
\LOG
\initials{LDF 2004.06.01.} Added this function.
\ENDLOG
@q ****** (6) Declaration. @>
@<Declare |Scanner_Type| functions@>=
inline
Run_State const*
get_run_state(void) const
{
return &run_state;
}
@q ***** (5) Pop |in|.@>
@*4 Pop {\bf in}.
\LOG
\initials{LDF 2004.09.09.}
Added this function.
\initials{LDF 2004.09.20.}
Made this function non-inline.
\initials{LDF 2004.09.20.}
@:BUG FIX@> BUG FIX: Now testing whether |in->up| is null
rather than whether |up| is null.
\ENDLOG
\TODO
@q { @>
@:TO DO}{{\bf TO DO}@>
@q } @>
@q !! TO DO: @>
\initials{LDF 2004.09.20.}
Get thread information and revise warning output.
\ENDTODO
@q ****** (6) Declaration. @>
@<Declare |Scanner_Type| functions@>=
int
pop_in(void);
@
@<Define |Scanner_Type| functions@>=
int
Scanner_Type::pop_in(void)
{
if (in->up == static_cast<Input_Struct*>(0))
{
cerr_mutex.lock();
cerr << "WARNING: In `Scanner_Type::pop_in()': "
<< "`in->up' == 0. Not popping."
<< endl << "Exiting function with return value 1."
<< endl;
cerr_mutex.unlock();
return 1;
} /* |if (in->up == static_cast<Input_Struct*>(0))| */
Input_Struct* i = in;
in = in->up;
i->up = static_cast<Input_Struct*>(0);
delete i;
i = static_cast<Input_Struct*>(0);
return 0;
} /* End of |Scanner_Type::pop_in| definition. */
@q ***** (5) Get the type of |in| (|in->type|). @>
@*4 Get the type of {\bf in}.
\LOG
\initials{LDF 2004.09.09.}
Added this function.
\ENDLOG
@q ****** (6) Declaration. @>
@<Declare |Scanner_Type| functions@>=
inline
unsigned short
get_in_type(void) const
{
return in->type;
}
@q ***** (5) |get_in_eof|. @>
@*4 {\bf get\_in\_eof}.
\LOG
\initials{LDF 2004.09.13.}
Added this function.
\ENDLOG
@q ****** (6) Declaration. @>
@<Declare |Scanner_Type| functions@>=
inline
bool
get_in_eof(void) const
{
return in->stream_ptr->eof();
}
@q ***** (5) |get_in_good|. @>
@*4 {\bf get\_in\_good}.
\LOG
\initials{LDF 2004.09.13.}
Added this function.
\ENDLOG
@q ****** (6) Declaration. @>
@<Declare |Scanner_Type| functions@>=
inline
bool
get_in_good(void) const
{
return in->stream_ptr->good();
}
@q ***** (5) |get_in_bad|. @>
@*4 {\bf get\_in\_bad}.
\LOG
\initials{LDF 2004.09.13.}
Added this function.
\ENDLOG
@q ****** (6) Declaration. @>
@<Declare |Scanner_Type| functions@>=
inline
bool
get_in_bad(void) const
{
return in->stream_ptr->bad();
}
@q ***** (5) |get_in_fail|. @>
@*4 {\bf get\_in\_fail}.
\LOG
\initials{LDF 2004.09.13.}
Added this function.
\ENDLOG
@q ****** (6) Declaration. @>
@<Declare |Scanner_Type| functions@>=
inline
bool
get_in_fail(void) const
{
return in->stream_ptr->fail();
}
@q **** (4) Add entry. @>
@*3 Add entry.
\LOG
\initials{LDF 2004.08.20.}
Moved the definition from this file (\filename{io.web}) to
\filename{sctpfncs.web}. See that file for additional log entries.
\initials{LDF 2004.08.24.}
Added |Id_Map_Entry_Node ssuperordinate_vector|
argument with default 0.
\initials{LDF 2004.08.25.}
Added |Id_Map_Entry_Node ssubordinate_array|
argument with default 0.
\initials{LDF 2004.08.28.}
Added the |Scanner_Node sscanner_node| argument.
\initials{LDF 2004.08.29.}
Removed the |Scanner_Node sscanner_node| argument.
\ENDLOG
@q ***** (5) Declaration. @>
@<Declare |Scanner_Type| functions@>=
Id_Map_Entry_Node
add_entry(string nname,
unsigned int ttype,
unsigned short ccategory = Id_Map_Entry_Type::REGULAR,
bool cconst_flag = false,
bool aarray_flag = false,
unsigned short kknown_state = Id_Map_Entry_Type::INDEPENDENT,
void* oobject = 0,
Id_Map_Entry_Node uup = 0,
Id_Map_Entry_Node lleft = 0,
Id_Map_Entry_Node rright = 0,
Id_Map_Entry_Node ssuperordinate_vector = 0,
Id_Map_Entry_Node ssubordinate_array = 0);
@q **** (4) Add synonym. @>
@*3 Add synonym.
\LOG
\initials{LDF 2004.05.17.} Added this function.
\initials{LDF 2004.07.01.}
Moved the definition of this function from \filename{io.web} (this file)
to \filename{scan.web}.
\ENDLOG
@q ***** (5) Declaration. @>
@<Declare |Scanner_Type| functions@>=
Id_Map_Entry_Node
add_synonym(string synonym, string name);
@q **** (4) Lookup. @>
@*3 Lookup.
\LOG
\initials{LDF 2004.02.05.}
Added this function.
\initials{LDF 2004.03.17.}
Changed return value from
|Id_Map_Entry_Node| to |Id_Map_Entry_Node*|.
\initials{LDF 2004.04.16.}
Moved this function to this file from \filename{scanprse.web}.
\initials{LDF 2004.04.20.}
Changed this function to account for
changes to types used for identifier mapping.
\initials{LDF 2004.04.20.}
Made this function a member function of
|Scanner_Type|.
\initials{LDF 2004.04.22.}
Changed the name of this function from
|check_id| to |lookup| and rewrote it.
\initials{LDF 2004.04.24.}
Moved this function definition from \filename{io.web}
to \filename{scan.web} because I'm now using |name_map| in it.
\ENDLOG
@q ***** (5) Declaration. @>
@<Declare |Scanner_Type| functions@>=
Id_Map_Entry_Node
lookup(string s,
bool traverse = true,
unsigned short level = 0,
Id_Map_Node local_id_map_node = 0);
@q **** (4) Erase entry. @>
@*3 Erase entry.
\LOG
\initials{LDF 2004.08.25.}
Added this declaration. This function is defined in
\filename{sctpfncs.web}
\ENDLOG
@q ***** (5) Declaration. @>
@<Declare |Scanner_Type| functions@>=
int
erase_entry(string s);
@q **** (4) Resolve array name. @>
@*3 Resolve array name.
\LOG
\initials{LDF 2004.05.03.}
Added this function.
\initials{LDF 2004.12.28.}
Now using the character octal 243 (British Pound) as the placeholder
for subscripts rather than \.{-}.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
string
resolve_array_name(string s);
@
@<Define |Scanner_Type| functions@>=
string
Scanner_Type::resolve_array_name(string s)
{
stringstream real_stream;
string::size_type s_size;
for (vector<real>::const_iterator iter
= token_real_vector.begin();
iter != token_real_vector.end();
++iter)
{
real_stream << '[' << *iter << ']';
s_size = s.find('');
if (s_size != string::npos)
s.replace(s_size, 1, real_stream.str());
real_stream.str("");
}
token_real_vector.clear();
return s;
} /* End of |Scanner_Type::resolve_array_name| definition. */
@q **** (4) Get array entry. @>
@*3 Get array entry.
\initials{LDF 2004.05.03.}
\LOG
\initials{LDF 2004.05.03.}
Added this function.
\initials{LDF 2004.05.09.}
Added an argument for |cconst_flag| in calls to
|Id_Map_Entry_Type::set_entry|.
\initials{LDF 2004.08.23.}
Made debugging and error output thread-safe.
\initials{LDF 2004.08.23.}
@:BUG FIX@> BUG FIX:
Now returning |root->left|, if this is the newly-created
|Id_Map_Entry_Node|. Formerly, |root| was returned.
\initials{LDF 2004.08.25.}
Now passing |root->superordinate_vector| as an argument in calls to
|Id_Map_Entry_Type::set_entry|.
\initials{LDF 2004.08.28.}
Now passing |this| as the |Scanner_Node| argument in calls to
|Id_Map_Entry_Type::set_entry|.
\initials{LDF 2004.08.29.}
Now passing |id_map_node| as an |Id_Map_Node| argument in calls to
|Id_Map_Entry_Type::set_entry| instead of |this| as a |Scanner_Node|
argument.
\initials{LDF 2005.01.08.}
Added the argument |bool create_if_none| with the default |true|.
If it's |false| and there is no array entry corresponding to the
|string s| argument, this function returns 0. Previously, a new
entry was always created if none existed.
\ENDLOG
@q ***** (5) Declaration. @>
@<Declare |Scanner_Type| functions@>=
Id_Map_Entry_Node
get_array_entry(string s,
Id_Map_Entry_Node head,
bool create_if_none = true);
@q ***** (5) Definition. @>
@
@<Define |Scanner_Type| functions@>=
Id_Map_Entry_Node
Scanner_Type::get_array_entry(string s,
Id_Map_Entry_Node root,
bool create_if_none)
{
using namespace Scan_Parse;
#if DEBUG_COMPILE
bool DEBUG = false; /* |true| */ @;
#endif /* |DEBUG_COMPILE| */@;
string thread_name;
#ifdef HAVE_PTHREAD_H
Thread_Info_Type* thread_info;
if ( run_state.multithread_input
|| run_state.multithread_output
|| run_state.multithread_include)
{
thread_info = Thread_Info_Type::get_thread_info(true);
thread_name = Thread_Info_Type::get_thread_name(thread_info);
}
else
{
thread_info = 0;
thread_name = "";
}
#else /* |HAVE_PTHREAD_H| is undefined. */@;
thread_name = "";
#endif /* |HAVE_PTHREAD_H| is undefined. */@;
stringstream cerr_strm;
bool error_stop_value = (run_state.error_stop_mode == Run_State::STOPPING)
? true : false;
int status;
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "Entering `Scanner_Type::get_array_entry()'.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
if (root == static_cast<Id_Map_Entry_Node>(0))
{
cerr_strm << thread_name
<< "ERROR! In `Scanner_Type::get_array_entry()':"
<< endl
<< "root == 0. Returning static_cast<Id_Map_Entry_Node>(0).";
log_message(cerr_strm);
cerr_message(cerr_strm, error_stop_value);
cerr_strm.str("");
return static_cast<Id_Map_Entry_Node>(0);
} /* |if (root == static_cast<Id_Map_Entry_Node>(0))| */
int curr_type = root->type;
@q ****** (6) |root->left == static_cast<Id_Map_Entry_Node>(0)|.@>
@ |root->left == static_cast<Id_Map_Entry_Node>(0)|.
\initials{LDF Undated.}
\LOG
\initials{LDF 2005.01.08.}
Added the condition |create_if_none == true|.
\ENDLOG
@<Define |Scanner_Type| functions@>=
if (root->left == static_cast<Id_Map_Entry_Node>(0) && create_if_none)
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "In `Scanner_Type::get_array_entry()':" << endl
<< "`root->left' == 0 && `create_if_none == true'. "
<< "Creating new `Id_Map_Entry_Node' "
<< "and setting it.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
root->left = new (Id_Map_Entry_Type);
root->left->set_entry(s,
curr_type,
id_map_node,
Id_Map_Entry_Type::REGULAR,
false,
true,
Id_Map_Entry_Type::INDEPENDENT,
static_cast<void*>(0), /* |object| */
root, /* |up| */
static_cast<Id_Map_Entry_Node>(0), /* |left| */
static_cast<Id_Map_Entry_Node>(0), /* |right| */
root->superordinate_vector);
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "Exiting `Scanner_Type::get_array_entry()'.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
return root->left;
} /* |if (root->left == static_cast<Id_Map_Entry_Node>(0))| */
@q ****** (6) |root->left == static_cast<Id_Map_Entry_Node>(0) && !create_if_none|.@>
@ |root->left == static_cast<Id_Map_Entry_Node>(0) && !create_if_none|.
\initials{LDF 2005.01.08.}
\LOG
\initials{LDF 2005.01.08.}
Added this section.
\ENDLOG
@<Define |Scanner_Type| functions@>=
else if (root->left == static_cast<Id_Map_Entry_Node>(0) && !create_if_none)
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "In `Scanner_Type::get_array_entry()':" << endl
<< "`root->left' == 0 && `create_if_none == false'. "
<< "Returning 0.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
return 0;
} /* |else if ( root->left == static_cast<Id_Map_Entry_Node>(0)
&& !create_if_none)| */
@q ****** (6) |root->left != static_cast<Id_Map_Entry_Node>(0)|.@>
@ |root->left != static_cast<Id_Map_Entry_Node>(0)|.
@<Define |Scanner_Type| functions@>=
else /* (|root->left != static_cast<Id_Map_Entry_Node>(0)|) */
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "In `Scanner_Type::get_array_entry()':" << endl
<< "root->left != 0. Will traverse.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
root = root->left;
for(;;)
{
@q ******* (7) There's an existing entry with this name. @>
@ There's an existing entry with this name. We just return it.
\initials{LDF 2004.05.03.}
@<Define |Scanner_Type| functions@>=
if (s == root->name)
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "In `Scanner_Type::get_array_entry()':" << endl
<< "`s' == `root_name':" << endl
<< "`s' == " << s << ", `root->name' == "
<< root->name << "." << endl
<< "Exiting `get_array_entry()' with return value `root'.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
return root;
} /* |if (s == root->name)| */@;
@q ***** (5) |(s < root->name)|.@>
@ |s < root->name|. If |left| is a null pointer, put the new
|Id_Map_Entry_Node| there, otherwise continue traversing the tree structure.
\initials{LDF 2004.04.27.}
@<Define |Scanner_Type| functions@>=
else if (s < root->name)
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "In `Scanner_Type::get_array_entry()':" << endl
<< "`s' (" << s << ") < `root->name' (" << root->name
<< ").";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
@q ****** (6) |(root->left == static_cast<Id_Map_Entry_Node>(0)|.@>
@ |(root->left == static_cast<Id_Map_Entry_Node>(0))|.
\initials{LDF 2004.08.23.}
@<Define |Scanner_Type| functions@>=
if (root->left == static_cast<Id_Map_Entry_Node>(0))
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "In `Scanner_Type::get_array_entry()':" << endl
<< "`" << root->name << "->left' == 0. "
<< "Creating new `Id_Map_Entry_Node'.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
root->left = new (Id_Map_Entry_Type);
root->left->set_entry(s,
curr_type,
id_map_node,
Id_Map_Entry_Type::REGULAR,
false,
true,
Id_Map_Entry_Type::INDEPENDENT,
static_cast<void*>(0), /* |object| */
root, /* |up| */
static_cast<Id_Map_Entry_Node>(0), /* |left| */
static_cast<Id_Map_Entry_Node>(0), /* |right| */
root->superordinate_vector);
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "Exiting `Scanner_Type::get_array_entry()' "
<< "with return value `root->left' (" << root->left->name << ").";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
return root->left;
} /* |if (root->left == static_cast<Id_Map_Entry_Node>(0))| */@;
@q ****** (6) |(root->left != static_cast<Id_Map_Entry_Node>(0))|.@>
@ |(root->left != static_cast<Id_Map_Entry_Node>(0))|.
\initials{LDF 2004.08.23.}
@<Define |Scanner_Type| functions@>=
else /* |if (root->left != static_cast<Id_Map_Entry_Node>(0))| */@;
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "In `Scanner_Type::get_array_entry()':" << endl
<< "`" << root->name << "->left' != 0. Traversing.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
root = root->left;
continue;
} /* |else| (|root->left != static_cast<Id_Map_Entry_Node>(0)|) */@;
} /* |if (s < root->name)| */@;
@q ***** (5) |s > root->name|.@>
@ |s > root->name|.
If |right| is a null pointer, put the new
|Id_Map_Entry_Node| there, otherwise continue traversing the tree structure.
\initials{LDF 2004.04.27.}
@<Define |Scanner_Type| functions@>=
else if (s > root->name)
{
@q ****** (6) |root->right == static_cast<Id_Map_Entry_Node>(0)|.@>
@ |root->right == static_cast<Id_Map_Entry_Node>(0)|.
\initials{LDF 2004.08.23.}
@<Define |Scanner_Type| functions@>=
if (root->right == static_cast<Id_Map_Entry_Node>(0))
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "In `Scanner_Type::get_array_entry()':"
<< endl
<< "`" << root->name << "->right' == 0. "
<< "Creating new `Id_Map_Entry_Node'.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
root->right = new (Id_Map_Entry_Type);
root->right->set_entry(s,
curr_type,
id_map_node,
Id_Map_Entry_Type::REGULAR,
false,
true,
Id_Map_Entry_Type::INDEPENDENT,
static_cast<void*>(0), /* |object| */
root, /* |up| */
static_cast<Id_Map_Entry_Node>(0), /* |left| */
static_cast<Id_Map_Entry_Node>(0), /* |right| */
root->superordinate_vector);
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "Exiting `Scanner_Type::get_array_entry()' "
<< "with return value `root->right' "
<< "(" << root->right->name << ").";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
return root->right;
} /* |if (root->right == static_cast<Id_Map_Entry_Node>(0))| */@;
@q ****** (6) |root->right != static_cast<Id_Map_Entry_Node>(0)|.@>
@ |root->right != static_cast<Id_Map_Entry_Node>(0)|.
\initials{LDF 2004.08.23.}
@<Define |Scanner_Type| functions@>=
else /* |root->right != static_cast<Id_Map_Entry_Node>(0)| */
{
#if DEBUG_COMPILE
if (DEBUG)
{
cerr_strm << thread_name
<< "In `Scanner_Type::get_array_entry()':"
<< endl
<< "`" << root->name
<< "->right' != 0. Traversing.";
log_message(cerr_strm);
cerr_message(cerr_strm);
cerr_strm.str("");
}
#endif /* |DEBUG_COMPILE| */@;
root = root->right;
continue;
} /* |else| (|root->right != static_cast<Id_Map_Entry_Node>(0)|) */
} /* |else if (s > root->name)| */
} /* |for| */
} /* |else| (|root->left != static_cast<Id_Map_Entry_Node>(0)|) */
} /* End of |Scanner_Type::get_array_entry| definition. */
@q **** (4) Set |first_call_yylex|. @>
@*3 Set {\bf first\_call\_yylex}.
\LOG
\initials{LDF 2004.09.09.}
Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
inline
void
set_first_call_yylex(bool arg = false)
{
first_call_yylex = arg;
return;
}
@q **** (4) Get |first_call_yylex|. @>
@*3 Get {\bf first\_call\_yylex}.
\LOG
\initials{LDF 2004.09.09.}
Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
inline
bool
get_first_call_yylex(void) const
{
return first_call_yylex;
}
@q **** (4) Set |token_string|. @>
@*3 Set {\bf token\_string}.
\LOG
\initials{LDF 2004.09.12.}
Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
inline
void
set_token_string(const string s)
{
token_string = s;
return;
}
@q **** (4) Get |token_string|. @>
@*3 Get {\bf token\_string}.
\LOG
\initials{LDF 2004.09.12.}
Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
inline
string
get_token_string(void)
{
return token_string;
}
@q **** (4) Showing. @>
@*3 Showing.
\LOG
\initials{LDF 2004.04.16.} Moved to this file from
\filename{scanprse.web}.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
void
show(string s, bool show_all = false) const;
@q ***** (5) Definition. @>
@
@<Define |Scanner_Type| functions@>=
void
Scanner_Type::show(string s, bool show_all) const
{
if (s == "")
cerr << "Scanner_Type:\n";
else
cerr << s << ":" << endl;
if (in == static_cast<Input_Struct*>(0))
cerr << "in == 0" << endl;
else
cerr << "in->filename == " << in->filename << endl;
for (int i = Run_State::METAPOST; i <= Run_State::LIBPLOT; ++i)
{
if (out[i] == static_cast<Output_Struct*>(0))
cerr << "out[" << i << "] == 0" << endl;
else
cerr << "out[" << i << "]->filename == " << out[i]->filename
<< endl;
}
id_map_node->show("", show_all);
return;
}
@q **** (4) Handle |numeric_list|. @>
@*3 Handle {\bf numeric\_list}.
This function is defined in \filename{scan.web}.
\initials{LDF 2004.05.13.}
\LOG
\initials{LDF 2004.05.13.} Added this function.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
Bool_Void_Pointer
handle_numeric_list(int transform_token, void* r);
@q ** Extract |Picture| output arguments. @>
@*1 Extract {\bf Picture} output arguments.
This function is defined in \filename{scan.web}.
\initials{LDF 2004.07.12.}
\LOG
\initials{LDF 2004.07.12.} Added this function
declaration.
\ENDLOG
@<Declare |Scanner_Type| functions@>=
Scan_Parse::Picture_Output_Arg_Type*
extract_picture_output_args();
@q * |friend| declarations for functions in |namespace Scan_Parse|.@>
@* {\bf friend} declarations for functions in
{\bf namespace Scan\_Parse}.
\initials{LDF 2004.09.08.}
This section is included in |@<|Id_Map_Entry_Type| declaration@>|
and |@<|Scanner_Type| declaration@>|.
\initials{LDF 2004.09.08.}
\TODO
@q { @>
@:TO DO}{{\bf TO DO}@>
@q } @>
@q !! TO DO: @>
\initials{LDF 2004.09.08.}
Consider making these functions members of |Scanner_Type|.
\ENDTODO
@q ** (2) LOG.@>
\LOG
\initials{LDF 2004.09.08.}
Added this section. The following log entries with an earlier date
than this one have been moved here
from the logs for |@<|Id_Map_Entry_Type| declaration@>| and
|@<|Scanner_Type| declaration@>|.
\initials{LDF 2004.07.03.}
Declared |Scan_Parse::parse_func| to be a |friend|.
\initials{LDF 2004.07.16.}
Removed |friend| declaration for |Scan_Parse::endfig_func|, which I've
removed. Added |friend| declaration for |Scan_Parse::beginfig_func|, which
I've added.
\initials{LDF 2004.07.21.}
Added |friend| declaration for |Scan_Parse::variable_func|.
\initials{LDF 2004.07.21.}
Added |friend| declaration for |Scan_Parse::non_shape_decl_func|.
\initials{LDF 2004.07.22.}
Added |friend| declaration for |Scan_Parse::shape_decl_func|.
\initials{LDF 2004.07.23.}
Added default value for the |C*| argument to
|Scan_Parse::shape_decl_func| in the |friend| declaration.
\initials{LDF 2004.07.24.}
Added |friend| declaration for |Scan_Parse::assign_simple|.
\initials{LDF 2004.07.26.}
Added |friend| declaration for |Scan_Parse::assign_chained|.
\initials{LDF 2004.07.27.}
@:BUG FIX@> BUG FIX: Added ``|Scan_Parse::|'' before
``|assign_chained|'' in |friend| declaration.
\initials{LDF 2004.07.27.}
Added |friend| declaration for
|Scan_Parse::assign_simple_1|.
\initials{LDF 2004.07.28.}
Removed |friend| declaration for
|Scan_Parse::assign_simple_1| and changed arguments for
|Scan_Parse::assign_simple|.
\initials{LDF 2004.07.29.}
Changed |string type_name| and |C* expr| arguments of |assign_simple|
to |const| in |friend| declaration.
\initials{LDF 2004.08.08.}
In the |friend| declaration of |Scan_Parse::assign_chained|:
Changed the |void* expr| argument to |const C* expr| and removed the
|const C* dummy| argument.
\initials{LDF 2004.08.12.}
Added |friend| declaration for
|Scan_Parse::assign_picture_simple|.
\initials{LDF 2004.08.13.}
Added |friend| declaration for
|Scan_Parse::assign_picture_chained|.
\initials{LDF 2004.08.13.}
Added |friend| declaration for
|Scan_Parse::assign_point_numeric|.
\initials{LDF 2004.08.14.}
Added |friend| declaration for
|Scan_Parse::set_color|.
\initials{LDF 2004.08.14.}
Added |friend| declaration for
|Scan_Parse::set_focus|.
\initials{LDF 2004.08.14.}
In |friend| declaration for |set_focus|:
Changed the type of the arguments |position| and |direction|
from |void*| to |Point*|.
\initials{LDF 2004.08.14.}
Added the |int| arguments |x_axis|, |y_axis|, and |z_axis|
to the |friend| declaration of |set_focus|. This makes it possible to leave
the definition in \filename{scanprse.web}. The values passed are
|X_AXIS|, |Y_AXIS|, and |Z_AXIS|, which are
terminal symbols declared in the parser file and therefore unknown when
\filename{scanprse.web} is compiled.
\initials{LDF 2004.08.14.}
In the |friend| declaration for |set_focus|:
Made the |int| arguments |x_axis|, |y_axis|, and |z_axis|
|const|.
\initials{LDF 2004.08.16.}
Added |friend| declaration for
|Scan_Parse::label_command|.
\initials{LDF 2004.08.17.}
Added |friend| declaration for
|Scan_Parse::on_picture_optional_0|.
\initials{LDF 2004.08.17.}
Added |friend| declaration for |Scan_Parse::drawing_command|.
\initials{LDF 2004.08.17.}
Added |friend| declaration for |Scan_Parse::drawdot_command|.
\initials{LDF 2004.08.18.}
Added |friend| declaration for |Scan_Parse::variable_type|.
\initials{LDF 2004.08.24.}
Added |friend| declaration for |Scan_Parse::vector_type_decl|.
\initials{LDF 2004.08.24.}
Changed the |friend| declaration of |Scan_Parse::vector_type_decl|:
It's now a non-template function and I've changed its arguments.
\initials{LDF 2004.08.25.}
Changed the |friend| declaration for |Scan_Parse::vector_type_decl|
to reflect the fact that I've made it a template function again.
\initials{LDF 2004.08.30.}
Changed name of |Scan_Parse::drawing_command| to
|drawing_command_path| in |friend| declaration.
\initials{LDF 2004.08.30.}
Added |friend| declaration for
|Scan_Parse::drawing_command_solid|.
\initials{LDF 2004.09.01.}
Added |friend| declaration for
|Scan_Parse::vector_type_plus_assign|.
\initials{LDF 2004.09.01.}
Added |Id_Map_Entry_Node entry| argument to
|vector_type_plus_assign| in |friend| declaration.
\initials{LDF 2004.09.06.}
Added |friend| declaration for
|Scan_Parse::intersection_point_command|.
\initials{LDF 2004.09.06.}
In the |friend| declaration of
|Scan_Parse::intersection_point_command|:
Changed the |Id_Map_Entry_Node path_entry_0| and
|Id_Map_Entry_Node path_entry_1| arguments
to |Path* path_0| and |Path* path_1|.
\initials{LDF 2004.09.07.}
In |friend| declaration for |intersection_point_command|:
Changed name of |Id_Map_Entry_Node point_entry| argument to
|entry| and added |int type| argument.
\initials{LDF 2004.09.07.}
Added |friend| declaration for
|Scan_Parse::intersection_point_command|.
\initials{LDF 2004.09.08.}
Added |friend| declaration for the template function
|Scan_Parse::intersection_points_ellipse_like|.
\initials{LDF 2004.09.10.}
Added |friend| declaration for |Scan_Parse::conditional|.
\initials{LDF 2004.09.10.}
In |friend| declaration for |Scan_Parse::conditional|:
Changed |bool bool_value| argument to |int arg|.
\initials{LDF 2004.09.14.}
Added |friend| declaration for |Scan_Parse::input_command|.
\initials{LDF 2004.09.24.}
Added |friend| declaration for |Scan_Parse::transformation_command_func|.
\initials{LDF 2004.09.25.}
In |Scan_Parse::transformation_command_func|:
Changed the |Pointer_Vector<real>* pvr| argument to |void* v|.
\initials{LDF 2004.09.29.}
Added |friend| declaration for |Scan_Parse::rotate_around_func|.
\initials{LDF 2004.10.01.}
Added |friend| declaration for
|Scan_Parse::transformation_assignment_command_func|.
\initials{LDF 2004.10.01.}
Added |friend| declaration for
|Scan_Parse::intersection_points_polygon_like|.
\initials{LDF 2004.10.04.}
Added |friend| declaration for the template function
|Scan_Parse::reflect_func|.
\initials{LDF 2004.10.08.}
Added |friend| declaration for |Scan_Parse::label_path_command|.
\initials{LDF 2004.10.12.}
Changed the name of |Scan_Parse::reflect_func| to
|reflect_in_func| in the |friend| declaration.
\initials{LDF 2004.10.25.}
Made |C* expr| argument of |Scan_Parse::assign_simple|
non-|const| in |friend| declaration.
\initials{LDF 2004.10.26.}
Added |friend| declaration for the specialization of
|Scan_Parse::assign_simple| for |real|.
\initials{LDF 2004.10.26.}
Removed the |friend| declaration for the specialization of
|Scan_Parse::assign_simple| for |real|, which didn't work.
Added |friend| declaration for |Scan_Parse::assign_real|, which
replaces the former function.
\initials{LDF 2004.10.27.}
In the |friend| declaration for the template function
|Scan_Parse::assign_simple|:
Added the argument |bool use_or_delete|.
Removed the declaration of |Scan_Parse::assign_real|.
\initials{LDF 2004.10.28.}
Added |friend| declaration for |Scan_Parse::for_loop_func|.
\initials{LDF 2004.11.08.}
Added |friend| declaration for the template function
|Scan_Parse::vector_type_assign|.
\initials{LDF 2004.11.10.}
Removed the |friend| declarations for
|Scan_Parse::intersection_point_command|,
|Scan_Parse::intersection_points_path_ellipse|,
|Scan_Parse::intersection_points_ellipse_like|, and
|Scan_Parse::intersection_points_polygon_like|.
These functions are no longer used.
\initials{LDF 2004.11.11.}
Added a second type parameter to the template function
|Scan_Parse::vector_type_assign| and removed the |int|
arguments |vector_type_num| and |array_type_num|, which
weren't used.
\initials{LDF 2004.11.13.}
Added |friend| declaration for the template function
|Scan_Parse::pickup_command|.
\initials{LDF 2004.11.14.}
Added the |friend| declaration for the template function
|Scan_Parse::drop_command|.
\initials{LDF 2004.12.02.}
In the |friend| declaration for |Scan_Parse::assign_picture_simple|:
Changed |Id_Map_Entry_Node entry_0| argument to
|Picture* p|.
\initials{LDF 2004.12.03.}
In the |friend| declaration for |Scan_Parse::assign_picture_simple|:
Changed |Picture* p| argument back to |Id_Map_Entry_Node entry_0|.
\initials{LDF 2004.12.04.}
Added |friend| declaration for the template function
|Scan_Parse::reflect_off_func|.
\initials{LDF 2004.12.09.}
In the |friend| declaration for the template function
|Scan_Parse::reflect_off_func|:
Changed the |C* reflection| argument to |Point_Vector<C>* pv|.
It's passed to |C::reflect_off|.
\initials{LDF 2004.12.13.}
Added the |friend| declaration for
|Scan_Parse::verbatim_metapost_func|.
\initials{LDF 2004.12.29.}
Added the |friend| declaration for
|Scan_Parse::macro_definition_func|.
\initials{LDF 2005.01.02.}
Added the |friend| declaration for |Scan_Parse::is_symbolic_token|.
\initials{LDF 2005.01.02.}
Added the |friend| declaration for |Scan_Parse::macro_call_func|.
\initials{LDF 2005.01.03.}
In the |friend| declaration for
|Scan_Parse::macro_call_func|:
Added |bool left_brace_predicate| argument.
\initials{LDF 2005.01.03.}
Added the |friend| declaration for
|Scan_Parse::macro_vector_definition_func|.
\initials{LDF 2005.01.03.}
In the |friend| declaration for
|Scan_Parse::vector_type_plus_assign|:
Added |bool copy_object| argument.
\initials{LDF 2005.01.03.}
@:BUG FIX@> BUG FIX:
In the |friend| declaration for
|Scan_Parse::vector_type_plus_assign|:
Now specifying the default (|true|) for the |bool copy_object|
argument. Compilation failed when it was not specified.
\initials{LDF 2005.01.03.}
Added the |friend| declaration for |Scan_Parse::clear_vector_func|.
\initials{LDF 2005.01.05.}
Added |friend| declarations for |Scan_Parse::push_back_func|
and |Scan_Parse::pop_back_func|.
\initials{LDF 2005.01.18.}
Added |friend| declaration for |Scan_Parse::for_suffixes_loop_func|.
\initials{LDF 2005.01.19.}
Added |friend| declaration for
|Scan_Parse::for_suffixes_internal_func|.
\initials{LDF 2005.01.19.}
In the |friend| declaration for
|Scan_Parse::for_suffixes_internal_func|:
Added |unsigned short ctr| argument.
\initials{LDF 2005.01.26.}
Added |friend| declaration for |Scan_Parse::let_func|.
\initials{LDF 2005.01.26.}
In the |friend| declaration for |Scan_Parse::let_func|:
Removed the second |string| argument.
\initials{LDF 2005.01.29.}
In the |friend| declaration for |Scan_Parse::label_point_command|:
Added |Color* text_color| and |Color* dot_color|
arguments.
\initials{LDF 2005.01.29.}
In the |friend| declaration for |Scan_Parse::label_path_command|:
Added |Color* text_color| and |Color* dot_color|
arguments.
\initials{LDF 2005.02.23.}
Added |friend| declaration for |Scan_Parse::decompose_func|.
\initials{LDF 2005.02.24.}
Added the arguments |void* object_2| and |int type_2| to
|Scan_Parse::decompose_func|.
\initials{LDF 2005.03.10.}
Added |friend| declaration for |Scan_Parse::drawing_command_path_vector|.
\initials{LDF 2005.08.14.}
Added |Transform* transform| argument to |Scan_Parse::label_point_command|.
\initials{LDF 2007.08.14.}
Added the |friend| declaration for |Scan_Parse::reverse_func|.
\initials{LDF 2007.08.16.}
Made |Scan_Parse::reverse_func| a template function.
\ENDLOG
@q *** (3) End of LOG.@>
@q **** (4) Functions for groups.@>
@*3 Functions for groups.
\initials{LDF 2007.10.09.}
\LOG
\initials{LDF 2007.10.09.}
Added this section with the |friend| declaration for |end_group_func|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void
Scan_Parse::end_group_func(void* parameter);
@q **** (4) Function for numerics.@>
@*3 Function for numerics.
\initials{LDF 2005.08.29.}
\LOG
\initials{LDF 2005.08.29.}
Added this section with the |friend| declaration for
|Scan_Parse::measure_text_func|.
\initials{LDF 2005.08.30.}
In the |friend| declaration for |Scan_Parse::measure_text_func|:
Replaced the argument |real* r| with |Pointer_Vector<real>* pv|.
\initials{LDF 2005.08.30.}
Added the |friend| declaration for
|Scan_Parse::numeric_vector_assignment_func|.
\initials{LDF 2007.02.06.}
Added the friend declaration for |Scan_Parse::numeric_primary_rule_func_0|.
\initials{LDF 2007.11.04.}
Added the friend declaration for |Scan_Parse::numeric_primary_rule_func_1|.
\initials{LDF 2007.11.04.}
Added the friend declaration for |Scan_Parse::numeric_list_rule_func_0|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
int
Scan_Parse::measure_text_func(Scanner_Node scanner_node,
void* v,
Pointer_Vector<real>* pv);
friend
void*
Scan_Parse::numeric_vector_assignment_func(Scanner_Node scanner_node,
void* v,
void* w);
friend
int
Scan_Parse::numeric_primary_rule_func_0(int operator_value,
real operand,
real* result,
Scanner_Node scanner_node);
friend
real
Scan_Parse::numeric_primary_rule_func_1(int point_part,
void* v,
void* parameter);
friend
void*
Scan_Parse::numeric_list_rule_func_0(void* v, void* parameter);
@q **** (4) Functions for complex numbers.@>
@*3 Functions for complex numbers.
\initials{LDF 2007.12.11.}
\LOG
\initials{LDF 2007.12.11.}
Added this section with the |friend| declarations for
|complex_arith_op_rule_func| and |complex_primary_rule_func_0|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::complex_arith_op_rule_func(void* v,
void* w,
int op,
void* parameter);
friend
void*
Scan_Parse::complex_primary_rule_func_0(void* v,
int op,
void* parameter);
@q **** (4) Functions for matrices.@>
@*3 Functions for matrices.
\initials{LDF 2007.12.20.}
\LOG
\initials{LDF 2007.12.20.}
Added this section with the |friend| declaration for
|matrix_secondary_rule_func_0|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::matrix_secondary_rule_func_0(void* v, void* w, void* parameter);
@q **** (4) Functions for |Points|.@>
@*3 Functions for {\bf Points}.
\initials{LDF 2005.10.25.}
\LOG
\initials{LDF 2005.10.25.}
Added this section with the |friend| declaration for the template function
|get_center_func|.
\initials{LDF 2005.11.09.}
Added the |friend| declarations for the template functions
|get_focus0_func| and |get_vertex_func|.
\initials{LDF 2005.11.09.}
Added the |friend| declaration for the template function
|get_point_func|.
\initials{LDF 2005.11.14.}
Changed the names of |get_focus0_func| and |get_vertex_func|
to |get_focus_0_func| and |get_vertex_0_func|, respectively.
Added the |friend| declarations for |get_focus_1_func| and |get_vertex_1_func|.
\initials{LDF 2005.11.17.}
Changed the name of |get_focus_0_func| to |get_focus_func|
and the name of |get_vertex_0_func| to |get_vertex_func|.
Added optional |const unsigned short s| arguments with the default 0.
Removed |get_focus_1_func| and |get_vertex_1_func|.
\ENDLOG
@q ***** (5) Code.@>
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
template <class C>
friend
void*
Scan_Parse::get_point_func(real r, C* c, void* parameter);
template <class C>
friend
void*
Scan_Parse::get_center_func(C* c, void* parameter);
template <class C>
friend
void*
Scan_Parse::get_focus_func(C* c, const unsigned short s, void* parameter);
template <class C>
friend
void*
Scan_Parse::get_vertex_func(C* c, const unsigned short s, void* parameter);
@q **** (4) Functions for |Focuses|.@>
@*3 Functions for {\bf Focuses}.
\initials{LDF 2007.09.19.}
\LOG
\initials{LDF 2007.09.19.}
Added this section with the |friend| declaration for the function
|rotate_focus_func|.
\initials{LDF 2007.09.19.}
Added |real tolerance| argument to |rotate_focus_func|.
\initials{LDF 2007.09.24.}
Removed the |real tolerance| argument from |rotate_focus_func|.
\ENDLOG
@q ***** (5) Code.@>
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
int
Scan_Parse::rotate_focus_func(void* id,
void* num,
int axes,
void* parameter);
@q **** (4) Functions for |strings|.@>
@*3 Functions for {\bf strings}.
\initials{LDF 2005.09.09.}
\LOG
\initials{LDF 2005.09.09.}
Added this section with |friend| declarations for
|binary_number_string_func| and
|sub_binary_number_string_func|.
\initials{LDF 2005.09.10.}
In the declaration of |sub_binary_number_string_func|:
Added optional |bool oversize_switch| argument with
the default |false|. This required making
|Scanner_Node scanner_node| optional, too. The default is 0.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
string*
Scan_Parse::binary_number_string_func(real r, Scanner_Node scanner_node);
template<class C>
friend
string*
Scan_Parse::sub_binary_number_string_func(C c,
bool oversize_switch,
Scanner_Node scanner_node);
@q **** (4) @>
@
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend void* Scan_Parse::parse_func(void*);
friend void* Scan_Parse::output_func(void*);
friend int Scan_Parse::output_command_func(Scanner_Node);
friend int Scan_Parse::beginfig_func(Scanner_Node, int);
friend String_Bool Scan_Parse::variable_func(Scanner_Node,
char*,
char*,
int,
int);
friend int Scan_Parse::non_shape_decl_func(Scanner_Node, int);
template <class C>
friend
int
Scan_Parse::shape_decl_func(Scanner_Node,
int,
C*);
template <class C>
friend
Int_Void_Ptr
Scan_Parse::assign_simple(Scanner_Node scanner_node,
const string type_name,
void* var,
C* expr,
bool use_or_delete_expr);
template <class C>
friend
Int_Void_Ptr
Scan_Parse::assign_chained(Scanner_Node scanner_node,
void* var,
const C* expr);
friend
Int_Void_Ptr
Scan_Parse::assign_picture_simple(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
Id_Map_Entry_Node entry_0);
friend
Int_Void_Ptr
Scan_Parse::assign_picture_chained(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
Id_Map_Entry_Node entry_0);
friend
Int_Void_Ptr
Scan_Parse::assign_point_numeric(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
real x);
friend
Int_Void_Ptr
Scan_Parse::set_color(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
real red_part,
real green_part,
real blue_part);
friend
Int_Void_Ptr
Scan_Parse::set_focus(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
Point* position,
Point* direction,
real distance,
real angle,
int axis,
const int x_axis,
const int y_axis,
const int z_axis);
@q **** (4) Functions for labels.@>
@ Functions for labels.
\initials{LDF 2005.12.01.}
\LOG
\initials{LDF 2005.12.01.}
Added the |friend| declaration for |label_bool_point_func|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
int
Scan_Parse::label_point_command(Scanner_Node scanner_node,
int label_or_dotlabel,
int label_suffix,
string* text_str,
Point* position,
Transform* transform,
Color* text_color,
Color* dot_color,
Id_Map_Entry_Node entry);
friend
int
Scan_Parse::label_bool_point_func(void* parameter,
int label_type,
int suffix,
void* str,
real num,
void* bp,
void* col,
void* dot_col,
void* pict);
friend
int
Scan_Parse::label_path_command(Scanner_Node scanner_node,
int label_or_dotlabel,
int label_suffix,
string* text_str,
Color* text_color,
Color* dot_color,
int start_ctr,
Path* position,
Id_Map_Entry_Node entry);
@q **** (4) Functions for |Points|.@>
@ Functions for {\bf Points}.
\initials{LDF 2005.12.09.}
\LOG
\initials{LDF 2005.12.09.}
Added this section with the |friend| declaration for |Scan_Parse::normal_func|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
template <class C>
friend
void*
Scan_Parse::normal_func(C* c, Scanner_Node scanner_node);
@q **** (4)@>
@
\LOG
\initials{LDF 2009.11.16.}
Added |friend| declaration for |Scan_Parse::drawing_command_sphere_development|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::on_picture_optional_0(Scanner_Node scanner_node);
friend
int
Scan_Parse::drawing_command_path(Scanner_Node scanner_node,
int basic_drawing_command,
Path* ppath);
friend
int
Scan_Parse::drawing_command_path_vector(Scanner_Node scanner_node,
int basic_drawing_command,
Pointer_Vector<Path>* pv);
friend
int
Scan_Parse::drawing_command_solid(Scanner_Node scanner_node,
int basic_drawing_command,
Solid* solid);
friend
int
Scan_Parse::drawing_command_sphere_development(Scanner_Node scanner_node,
int basic_drawing_command,
Sphere_Development* sd);
friend
int
Scan_Parse::drawdot_command(Scanner_Node scanner_node,
int drawdot_or_undrawdot,
Point* ppoint);
friend
Int_Void_Ptr
Scan_Parse::variable_type(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
string curr_name,
int curr_type);
template <class C>
friend
int
Scan_Parse::vector_type_decl(Scanner_Node scanner_node,
int vector_type_num,
int array_type_num,
C* dummy);
template <class C>
friend
int
Scan_Parse::vector_type_plus_assign(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
int vector_type_num,
int array_type_num,
C* object,
bool copy_object);
template <class C, class D>
friend
int
Scan_Parse::vector_type_assign(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
const Pointer_Vector<D>* object_vector,
C* dummy);
friend
int
Scan_Parse::conditional(Scanner_Node scanner_node,
int arg);
friend
int
Scan_Parse::input_command(Scanner_Node scanner_node, string* filename);
friend
int
Scan_Parse::transformation_command_func(Scanner_Node scanner_node,
int transformation_type,
Id_Map_Entry_Node entry,
void* v);
friend
Transform*
Scan_Parse::rotate_around_func(Scanner_Node scanner_node,
Point* p,
Point* q,
real r);
friend
Transform*
Scan_Parse::transformation_assignment_command_func(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
Transform* t);
template <class C>
friend
C*
Scan_Parse::reflect_in_func(Scanner_Node scanner_node,
C* object,
Path* plane_path);
friend
int
Scan_Parse::for_loop_func(Scanner_Node scanner_node,
const unsigned short loop_type,
string curr_symbol,
real start_value,
real step_value,
real limit_value);
friend
int
Scan_Parse::for_suffixes_loop_func(Scanner_Node scanner_node,
string curr_symbol);
friend
int
Scan_Parse::for_suffixes_internal_func(Scanner_Node scanner_node,
unsigned int ctr);
template<class C>
friend
int
Scan_Parse::pickup_command(Scanner_Node scanner_node,
C* expression,
C* pointer);
template<class C>
friend
int
Scan_Parse::drop_command(Scanner_Node scanner_node,
C** pointer,
string pointer_name);
template <class C>
friend
int
Scan_Parse::reflect_off_func(Scanner_Node scanner_node,
C* object,
Path* plane_path,
Point* direction,
Pointer_Vector<C>* pv);
friend
int
Scan_Parse::verbatim_metapost_func(Scanner_Node scanner_node,
const string* s);
friend
int
Scan_Parse::macro_definition_func(Scanner_Node scanner_node,
Id_Map_Entry_Node entry);
friend
int
Scan_Parse::macro_vector_definition_func(Scanner_Node scanner_node,
Id_Map_Entry_Node entry);
friend
int
Scan_Parse::macro_call_func(Scanner_Node scanner_node,
Id_Map_Entry_Node entry,
bool left_brace_predicate);
friend
bool
Scan_Parse::is_symbolic_token(int curr_token);
friend
int
Scan_Parse::clear_vector_func(Scanner_Node scanner_node,
Id_Map_Entry_Node entry);
friend
int
Scan_Parse::push_back_func(Scanner_Node scanner_node,
Id_Map_Entry_Node entry);
friend
int
Scan_Parse::pop_back_func(Scanner_Node scanner_node,
Id_Map_Entry_Node entry);
template<class C>
friend
int
Scan_Parse::reverse_func(void* v, void* parameter, C* c);
friend
int
Scan_Parse::let_func(Scanner_Node scanner_node,
string s);
friend
int
Scan_Parse::decompose_func(Scanner_Node scanner_node,
void* object_0,
int type_0,
void* object_1,
int type_1,
void* object_2,
int type_2,
void* vector_object,
int vector_type);
@q **** (4) Parser rule functions.@>
@*3 Parser rule functions.
\initials{LDF 2005.04.15.}
\LOG
\initials{LDF 2005.04.15.}
Added this section.
\ENDLOG
@q ***** (5) |string| expressions.@>
@*4 {\bf string} expressions.
\initials{LDF 2005.11.03.}
\LOG
\initials{LDF 2005.11.03.}
Added this section with the |friend| declaration for
|string_primary_rule_func|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::string_primary_rule_func(void* v, void* parameter);
@q ***** (5) Functions for |Transforms|.@>
@*4 Functions for {\bf Transforms}.
\LOG
\initials{LDF 2005.04.15.}
Added this section with the |friend| declaration for
|transform_primary_rule_0|.
\initials{LDF 2005.04.16.}
Added the |friend| declaration for |transform_primary_rule_1|.
\initials{LDF 2005.11.18.}
Added the |friend| declaration for |standardize_func|.
\initials{LDF 2007.10.02.}
Added the |friend| declaration for |align_path_func|.
\initials{LDF 2007.10.14.}
Added the |int command| argument to |transform_primary_rule_func_1|.
Changed the |void* ttransform| argument to |Transform* transform|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::transform_primary_rule_func_1(Transform* transform,
int command,
Scanner_Node scanner_node);
template<class C>
friend
void*
standardize_func(C* c, void* v);
friend
void*
Scan_Parse::align_path_func(void* v, int ax, void* parameter);
@q ***** (5) |point| expressions.@>
@*4 {\bf point} expressions.
\LOG
\initials{LDF 2005.04.15.}
Added this section with the declaration of |point_primary_rule_0|.
\initials{LDF 2005.04.15.}
Changed the name of |Scan_Parse::point_primary_rule_0| to
|point_primary_rule_func_0| and added the argument
|void* ffocus|.
\initials{LDF 2005.04.15.}
In the |friend| declaration of |Scan_Parse::point_primary_rule_0|:
Added optional |Scanner_Node scanner_node| argument with default 0.
\initials{LDF 2005.04.19.}
Changed the name of |point_primary_rule_func_0|
to |point_secondary_rule_func_0|.
\initials{LDF 2005.04.19.}
Added the argument |int with_z| to |point_secondary_rule_0|.
\initials{LDF 2007.11.04.}
Added the |friend| declaration of |Scan_Parse::point_primary_rule_func_0|
(a new version).
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::point_primary_rule_func_0(void* v, void* parameter);
friend
void*
Scan_Parse::point_secondary_rule_func_0(void* ppoint,
void* ffocus,
int with_z,
Scanner_Node scanner_node);
@q ***** (5) |path| expressions.@>
@*4 {\bf path} expressions.
\LOG
\initials{LDF 2005.04.15.}
Added this section with the declaration of |path_primary_rule_0|.
\initials{LDF 2005.04.19.}
Changed the name of |path_primary_rule_func_0|
to |path_secondary_rule_func_0|.
\initials{LDF 2005.04.19.}
Added the argument |int with_z| to |path_secondary_rule_0|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::path_secondary_rule_func_0(void* ppath,
void* ffocus,
int with_z,
Scanner_Node scanner_node);
@q ***** (5) |polygon| expressions.@>
@*4 {\bf polygon} expressions.
\LOG
\initials{LDF 2005.04.15.}
Added this section with the declaration of |polygon_primary_rule_0|.
\initials{LDF 2005.04.19.}
Changed the name of |polygon_primary_rule_func_0|
to |polygon_secondary_rule_func_0|.
\initials{LDF 2005.04.19.}
Added the argument |int with_z| to |path_secondary_rule_0|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::polygon_secondary_rule_func_0(void* ppolygon,
void* ffocus,
int with_z,
Scanner_Node scanner_node);
@q ***** (5) Functions for conic sections and |Conic_Section_Lattices|.@>
@*4 Functions for conic sections and {\bf Conic\_Section\_Lattices}.
\initials{LDF 2007.07.03.}
\LOG
\initials{LDF 2007.07.03.}
Added this section with the |friend| declaration for |get_conic_section_func|.
\initials{LDF 2007.07.03.}
Added |const unsigned short conic_section_type| argument
to |Scan_Parse::get_conic_section_func|.
\initials{LDF 2007.07.09.}
Added the |friend| declaration for
|Scan_Parse::get_hyperbola_branch_func|.
\initials{LDF 2007.07.15.}
Added |real tolerance| and |bool ignore_extra_points| arguments
to |Scan_Parse::get_conic_section_func|.
\initials{LDF 2007.07.20.}
Added optional |bool test_points| argument with the default |true|.
\initials{LDF 2007.07.20.}
Added optional |bool rectify_points| argument with the default |true|.
\initials{LDF 2007.07.20.}
In the |friend| declaration for |Scan_Parse::get_conic_section|:
Changed the default value of |real tolerance| argument from |INVALID_REAL|
to -1.
\initials{LDF 2007.08.05.}
Added |friend| declaration for |Scan_Parse::get_conic_section_lattice_func|.
\initials{LDF 2007.08.08.}
Added |friend| declaration for
|Scan_Parse::traverse_conic_section_lattice_func|.
\initials{LDF 2007.08.16.}
Added |friend| declaration for
|Scan_Parse::conic_section_lattice_intersection_func|.
\initials{LDF 2007.08.21.}
Added |real| arguments |tolerance| and |increment|
to the |friend| declaration for
|Scan_Parse::conic_section_lattice_intersection_func|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::get_hyperbola_branch_func(real r,
void* v,
void* parameter);
template<class C>
friend
void*
Scan_Parse::get_conic_section_func(Pointer_Vector<Point>* pv,
int increment_value,
const unsigned short conic_section_type,
C* c,
void* parameter,
bool test_points,
bool rectify_points,
real tolerance,
bool ignore_extra_points);
friend
void*
Scan_Parse::get_conic_section_lattice_func(Pointer_Vector<Point>* pv,
Scanner_Node scanner_node,
Conic_Section_Lattice_Options* options);
template<class C>
friend
void*
Scan_Parse::conic_section_lattice_intersection_func(
Scanner_Node scanner_node,
Conic_Section_Lattice* conic_section_lattice,
C* c,
real tolerance,
real increment);
friend
void*
Scan_Parse::traverse_conic_section_lattice_func(void* parameter,
void* c,
real start,
real end);
@q ***** (5) Functions for |Pointer_Vectors|.@>
@*4 Functions for {\bf Pointer\_Vectors}.
\initials{LDF 2007.07.23.}
\LOG
\initials{LDF 2007.07.23.}
Added this section with the |friend| declaration for |cull_func|.
\initials{LDF 2007.07.23.}
Added optional |const unsigned short comparison| argument
to |cull_func|. The default is 0.
\initials{LDF 2007.07.27.}
Added optional |real tolerance| argument to |cull_func|.
The default is -1.
\initials{LDF 2007.07.27.}
Added the |friend| declaration for |rectify_func|.
\initials{LDF 2007.08.05.}
Changed types of arguments of |Scan_Parse::rectify_func|.
\initials{LDF 2007.08.06.}
Added optional |Transform* transform| argument to
|Scan_Parse::rectify_func|. The default is 0.
\initials{LDF 2007.08.06.}
Added optional |bool do_transform| argument to
|Scan_Parse::rectify_func|. The default is |true|.
\ENDLOG
@q ****** (6) Code @>
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
template<class C>
friend
int
Scan_Parse::cull_func(void* v,
const unsigned short comparison,
Scanner_Node scanner_node,
real tolerance,
C* c);
template<class C>
friend
int
Scan_Parse::rectify_func(void* v,
Scanner_Node scanner_node,
bool do_test,
bool do_cull,
bool do_transform,
real tolerance,
Transform* t,
C* c);
@q ***** (5) |cuboid| expressions.@>
@*4 {\bf cuboid} expressions.
\LOG
\initials{LDF 2005.12.07.}
Added this section with the |friend| declarations for |in_cuboid_func|
and |out_cuboid_func|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
template<class C>
friend
void*
Scan_Parse::in_cuboid_func(C* c, void* parameter);
template<class C>
friend
void*
Scan_Parse::out_cuboid_func(C* c, void* parameter);
@q ***** (5) Functions for |Polyhedra|.@>
@*4 Functions for {\bf Polyhedra}.
\initials{LDF 2005.12.20.}
\LOG
\initials{LDF 2005.12.20.}
Added this section with the |friend| declaration for
|polyhedron_get_net_func|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::polyhedron_get_net_func(int type,
real diameter,
int do_half,
void* parameter);
@q ***** (5) Functions for Quadric Surfaces.@>
@ Functions for Quadric Surfaces.
\initials{LDF 2006.11.09.}
\LOG
\initials{LDF 2006.11.09.}
Added this section with the |friend| declaration for |quad_surf_get_element_func|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
void*
Scan_Parse::quad_surf_get_element_func(void* parameter,
unsigned int command,
unsigned int type,
void* object,
int arg_0,
int arg_1);
@q ***** (5) Operation assignments.@>
@*4 Operation assignments.
\LOG
\initials{LDF 2005.05.12.}
Added this section.
\ENDLOG
@q ****** (6) Operation assignments for |Pictures|.@>
@*5 Operation assignments for {\bf Pictures}.
\LOG
\initials{LDF 2005.05.12.}
Added this section with the declaration of
|operation_assignment_picture_rule_func_0|.
\ENDLOG
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
int
Scan_Parse::operation_assignment_picture_rule_func_0(
void* to_picture_entry,
void* from_picture_entry,
Scanner_Node scanner_node);
@q ***** (5) Set commands.@>
@*4 Set commands.
\initials{LDF 2005.05.19.}
\LOG
\initials{LDF 2005.05.19.}
Added this section.
\ENDLOG
@q ****** (6) Set commands for non-|Shape|-types.@>
@*5 Set commands for non-{\bf Shape}-types.
\initials{LDF 2007.11.28.}
\LOG
\initials{LDF 2007.11.28.}
Added this section with the |friend| declaration for
|set_matrix_rule_func_0|.
\ENDLOG
@q ******* (7) Code.@>
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
int
Scan_Parse::set_matrix_rule_func_0(void* curr_var,
real rrows,
real ccolumns,
void* parameter);
@q ****** (6) Set commands for |Shape|-types.@>
@*5 Set commands for {\bf Shape}-types.
\initials{LDF 2005.05.19.}
\LOG
\initials{LDF 2005.05.19.}
Added this section with the |friend| declaration for
|set_helix_rule_func_0|.
\initials{LDF 2005.05.21.}
Removed the |void* option_list| argument from |set_helix_rule_func_0|.
The |void* parameter| argument is now required.
\initials{LDF 2005.05.25.}
Added |friend| declarations for
|set_cone_rule_func_0| and |set_cylinder_rule_func_0|.
\initials{LDF 2005.05.26.}
Added |friend| declaration for |set_ellipsoid_rule_func_0|.
\initials{LDF 2005.06.06.}
Added |friend| declaration for |set_sphere_rule_func_0|.
\initials{LDF 2005.06.08.}
Added |friend| declaration for
|glyph_vector_variable_rule_func_0|.
\initials{LDF 2005.06.08.}
In the declaration of |glyph_vector_variable_rule_func_0|:
Changed the type of |arg1| from |void*| to |char*|.
\initials{LDF 2005.06.08.}
Removed the declaration of |glyph_vector_variable_func|
and replaced it with the declaration of
|vector_variable_decl_func<class C>|.
\initials{LDF 2005.06.09.}
Added |friend| declaration for |simple_variable_decl_func|.
\initials{LDF 2005.06.09.}
Removed the |friend| declaration for |simple_variable_decl_func|.
Changed |vector_variable_decl_func| to |variable_decl_func|.
There's no need for separate versions for simple and vector-type
variables.
\initials{LDF 2005.08.16.}
Added the |friend| declaration for |clip_to_func|.
\initials{LDF 2005.10.24.}
Added the |friend| declaration for |is_cycle_func|.
\initials{LDF 2005.10.26.}
Added the |friend| declaration for |is_whatever_func|.
\initials{LDF 2005.10.26.}
Added the |friend| declaration for |is_on_sphere_func|.
\initials{LDF 2005.10.27.}
Added the |friend| declaration for |intersection_points_func|.
\initials{LDF 2005.10.27.}
Added the |friend| declaration for |convert|.
\initials{LDF 2005.10.28.}
Added the |friend| declaration for
|ellipse_intersection_func|
\initials{LDF 2005.10.28.}
Replaced the |friend| declaration for |ellipse_intersection_func|
with the |friend| declaration for the template function
|ellipse_like_intersection_func|.
\initials{LDF 2005.10.28.}
Added the |friend| declaration for |polygon_like_intersection_func|
\initials{LDF 2005.10.28.}
Added the |friend| declaration for |sphere_plane_intersection_func|.
\initials{LDF 2005.10.28.}
Added the |friend| declaration for |sphere_line_intersection_func|.
\initials{LDF 2005.10.30.}
In the |friend| declaration for |sphere_plane_intersection_func|:
Changed the |Path*| argument to a |Plane*|.
\initials{LDF 2005.10.30.}
Added the |friend| declaration for |plane_cast_func|.
\initials{LDF 2005.10.30.}
Added the |friend| declaration for |plane_assignment_func|.
\initials{LDF 2005.10.31.}
Added the |friend| declaration for |show_func|.
\initials{LDF 2005.10.31.}
Replaced |sphere_plane_intersection_func| with the
template function |ellipsoid_like_plane_intersection_func|.
\initials{LDF 2005.11.03.}
Added the |friend| declaration for |message_command_func|.
\initials{LDF 2005.11.04.}
Added the |friend| declaration for the template function
|ellipse_like_plane_intersection_func|.
\initials{LDF 2005.11.07.}
Added the |friend| declaration for |set_parabola_rule_func_0|.
\initials{LDF 2005.11.14.}
Added the |friend| declaration for |set_hyperbola_rule_func_0|.
\initials{LDF 2005.11.17.}
Added |friend| declaration for the template function
|conic_section_line_intersection_func|.
\initials{LDF 2005.11.21.}
Changed the name of |conic_section_line_intersection_func|
to |conic_section_intersection_func| and added a second
template parameter. Changed the |Path*| argument to
a pointer to the type of the new template parameter.
\initials{LDF 2006.01.20.}
Added the |friend| declaration for |polyhedron_path_intersection_func|.
\initials{LDF 2006.01.25.}
Added the |friend| declaration for |set_paraboloid_rule_func_0|.
\initials{LDF 2007.10.06.}
Added the |friend| declaration for |plane_intersection_func|.
\initials{LDF 2007.11.25.}
Added the |friend| declaration for |set_arc_rule_func_0|.
\initials{LDF 2009.09.09.}
Added the |friend| declaration for |sphere_size_func|.
\initials{LDF 2009.11.17.}
Added |friend| declaration for |set_sphere_development_rule_func_0|.
\ENDLOG
@q ******* (7) Code.@>
@<|friend| declarations for functions in |namespace Scan_Parse|@>=
friend
int
Scan_Parse::set_parabola_rule_func_0(void* curr_var,
void* parameter);
friend
int
Scan_Parse::set_hyperbola_rule_func_0(void* curr_var,
void* parameter);
friend
int
Scan_Parse::set_arc_rule_func_0(void* curr_var,
void* parameter);
friend
int
Scan_Parse::set_helix_rule_func_0(void* curr_var,
void* parameter);
friend
int
Scan_Parse::set_cone_rule_func_0(void* curr_var,
void* parameter);
friend
int
Scan_Parse::set_cylinder_rule_func_0(void* curr_var,
void* parameter);
friend
int
Scan_Parse::set_ellipsoid_rule_func_0(void* curr_var,
void* parameter);
friend
int
Scan_Parse::set_sphere_rule_func_0(void* curr_var,
void* parameter);
friend
int
Scan_Parse::set_sphere_development_rule_func_0(void* curr_var,
void* parameter);
friend
int
Scan_Parse::set_paraboloid_rule_func_0(void* curr_var,
void* parameter);
friend
void*
Scan_Parse::variable_decl_func(char* arg1,
void* arg2,
unsigned int type,
void* parameter);
friend
void*
Scan_Parse::clip_to_func(void* arg1,
void* parameter);
friend
void*
Scan_Parse::is_cycle_func(void* arg1,
void* parameter);
template<class C>
friend
void*
Scan_Parse::is_whatever_func(C* c, void* parameter);
friend
void*
Scan_Parse::is_on_sphere_func(void* ppoint,
void* ssphere,
void* parameter,
real tolerance);
template <class C, class D, class E>
friend
void*
Scan_Parse::intersection_points_func(C* c,
D* d,
void* parameter,
E* e);
friend
Pointer_Vector<Bool_Point>*
Scan_Parse::convert(Bool_Point_Quadruple* bpq,
void* parameter,
bool delete_bpq);
template<class C, class D>
friend
void*
Scan_Parse::ellipse_like_intersection_func(C* c, D* d, void* parameter);
template<class C>
friend
void*
Scan_Parse::ellipse_like_plane_intersection_func(C* c, void* w, void* parameter);
template<class C, class D>
friend
void*
Scan_Parse::conic_section_intersection_func(C* c, D* d, void* parameter);
template<class C, class D>
friend
void*
Scan_Parse::polygon_like_intersection_func(C* c, D* d, void* parameter);
template<class C>
friend
void*
Scan_Parse::ellipsoid_like_plane_intersection_func(C* c,
Plane* p,
void* parameter);
friend
void*
Scan_Parse::sphere_line_intersection_func(Sphere* s,
Path* p,
void* parameter);
friend
void*
Scan_Parse::polyhedron_path_intersection_func(Polyhedron* p,
Path* q,
void* parameter);
template<class C>
friend
void*
Scan_Parse::plane_cast_func(C* c, void* parameter);
template <class C>
friend
void*
Scan_Parse::plane_assignment_func(void* entry, C* c, void* parameter);
friend
int
Scan_Parse::message_command_func(int message_type, void* v, void* parameter);
template <class C>
friend
int
Scan_Parse::show_func(C* c, string text, void* parameter);
friend
void*
Scan_Parse::plane_intersection_func(void* v, void* w, void* parameter);
friend
int
Scan_Parse::sphere_size_func(void* v, void* parameter);
@q * (1) Putting I/O together.@>
@* Putting I/O together.
\initials{LDF Undated.}
\LOG
\initials{LDF 2004.12.21.}
Now including |@<|Definition_Info_Node| declaration@>|,
|@<|Definition_Info_Type| declaration@>|, and
|@<Define |Definition_Info_Type| functions@>|.
\ENDLOG
@q ** (2).@>
@ This is what's compiled.
@c
@<Include files@>@;
@<Declare I/O |structs|@>@;
@<Initialize |static Io_Struct| member constants@>@;
@<Define I/O functions@>@;
@<Define |Io_Struct| functions@>@;
@<Define |Input_Struct| functions@>@;
@<Define |Output_Struct| functions@>@;
@<|Id_Map_Entry_Node| declaration@>@;
@<|Id_Map_Entry_Type| declaration@>@;
@<Initialize |static Id_Map_Entry_Type| member constants@>@;
@<|Id_Map_Sub_Map_Type| declaration@>@;
@<|Id_Map_Node| declaration@>@;
@<|Id_Map_Type| declaration@>@;
@<Global variables@>@;
@<|Loop_Info_Node| declaration@>@;
@<|Loop_Info_Type| declaration@>@;
@<Initialize |static Loop_Info_Type| member constants@>@;
@<|Definition_Info_Node| declaration@>@;
@<|Definition_Info_Type| declaration@>@;
@<|Scanner_Node| declaration@>@;
@<|Scanner_Type| declaration@>@;
@<Define |Id_Map_Type| functions@>@;
@<Define |Loop_Info_Type| functions@>@;
@<Define |Definition_Info_Type| functions@>@;
@<Define |Scanner_Type| functions@>@;
@q ** (2).@>
@ This is what's written to \filename{io.h}.
\initials{LDF Undated.}
\LOG
\initials{LDF 2004.12.21.}
Now including |@<|Definition_Info_Node| declaration@>| and
|@<|Definition_Info_Type| declaration@>|.
\initials{LDF 2007.04.04.}
Now writing declaration of |yyparse| to \filename{io.h}.
\ENDLOG
@(io.h@>=
#ifndef LDF_IO_H_KNOWN
#define LDF_IO_H_KNOWN
int yyparse(yyscan_t);
@<Declare I/O |structs|@>@;
@<Declare I/O functions@>@;
@<|Id_Map_Entry_Node| declaration@>@;
@<|Id_Map_Entry_Type| declaration@>@;
@<|Id_Map_Sub_Map_Type| declaration@>@;
@<|Id_Map_Node| declaration@>@;
@<|Id_Map_Type| declaration@>@;
@<|Loop_Info_Node| declaration@>@;
@<|Loop_Info_Type| declaration@>@;
@<|Definition_Info_Node| declaration@>@;
@<|Definition_Info_Type| declaration@>@;
@<|Scanner_Node| declaration@>@;
@<|Scanner_Type| declaration@>@;
@<|extern| variable declarations@>@;
#endif
@q * Emacs-Lisp code for use in indirect buffers when using the @>
@q GNU Emacs editor. The local variable list is not evaluated when an @>
@q indirect buffer is visited, so it's necessary to evaluate the @>
@q following s-expression in order to use the facilities normally @>
@q accessed via the local variables list. @>
@q \initials{LDF 2004.02.12}. @>
@q (progn (cweb-mode) (outline-minor-mode t) (setq fill-column 70)) @>
@q Local Variables: @>
@q mode:CWEB @>
@q eval:(display-time) @>
@q run-gxx-on-file:"main.c" @>
@q run-cweb-on-file:"main.web" @>
@q run-cweave-on-file:"3DLDF.web" @>
@q makefile:"makefile" @>
@q executable-name:"pp" @>
@q use-g++:t @>
@q eval:(read-abbrev-file) @>
@q indent-tabs-mode:nil @>
@q eval:(outline-minor-mode) @>
@q fill-column:70 @>
@q End: @>
|