Changeset 5c3283 in git
- Timestamp:
- Jul 26, 2005, 7:09:57 PM (18 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 0cbc03bb27f9fe962c2afb4faaaa825bdb7bed7c
- Parents:
- 111cfec78a96d9c4422cb1db65444db1eac6191a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/libparse.cc
r111cfe r5c3283 20 20 21 21 /* Scanner skeleton version: 22 * $Header: /exports/cvsroot-2/cvsroot/Singular/libparse.cc,v 1. 6 2005-05-23 08:46:17 Singular Exp $22 * $Header: /exports/cvsroot-2/cvsroot/Singular/libparse.cc,v 1.7 2005-07-26 17:09:57 Singular Exp $ 23 23 */ 24 24 … … 1003 1003 * Computer Algebra System SINGULAR * 1004 1004 ****************************************/ 1005 /* $Id: libparse.cc,v 1. 6 2005-05-23 08:46:17 Singular Exp $ */1005 /* $Id: libparse.cc,v 1.7 2005-07-26 17:09:57 Singular Exp $ */ 1006 1006 #include <stdio.h> 1007 1007 #include <string.h> … … 1077 1077 }; 1078 1078 int yylp_errno = 0; 1079 1080 #ifdef __MWERKS__1081 #ifdef __cplusplus1082 extern "C" {1083 #endif1084 long ftell(FILE *fp);1085 #ifdef macintosh1086 int fileno(FILE *stream);1087 FILE *fdopen(int filedes, char *type);1088 int isatty(int filedes);1089 #else1090 int _fileno(FILE *stream);1091 FILE *_fdopen(int filedes, char *type);1092 int _isatty(int filedes);1093 #define fileno _fileno1094 #define fdopen _fdopen1095 #define isatty _isatty1096 #endif /* macintosh */1097 #ifdef __cplusplus1098 }1099 #endif1100 #endif1101 1079 1102 1080 #ifdef STANDALONE_PARSER … … 1392 1370 register int yy_act; 1393 1371 1394 #line 2 58"libparse.l"1372 #line 236 "libparse.l" 1395 1373 1396 1374 … … 1485 1463 case 1: 1486 1464 YY_RULE_SETUP 1487 #line 2 59"libparse.l"1465 #line 237 "libparse.l" 1488 1466 { } 1489 1467 YY_BREAK 1490 1468 case 2: 1491 1469 YY_RULE_SETUP 1492 #line 2 60"libparse.l"1470 #line 238 "libparse.l" 1493 1471 { old_state = YYSTATE; BEGIN(comment); } 1494 1472 YY_BREAK 1495 1473 case 3: 1496 1474 YY_RULE_SETUP 1497 #line 2 62"libparse.l"1475 #line 240 "libparse.l" 1498 1476 { 1499 1477 yyless(4); old_state = YYSTATE; BEGIN(info); … … 1502 1480 case 4: 1503 1481 YY_RULE_SETUP 1504 #line 2 65"libparse.l"1482 #line 243 "libparse.l" 1505 1483 { 1506 1484 yyless(8); old_state = YYSTATE; BEGIN(category); … … 1509 1487 case 5: 1510 1488 YY_RULE_SETUP 1511 #line 2 68"libparse.l"1489 #line 246 "libparse.l" 1512 1490 { 1513 1491 found_version++; … … 1546 1524 case 6: 1547 1525 YY_RULE_SETUP 1548 #line 302"libparse.l"1526 #line 280 "libparse.l" 1549 1527 { p_static=TRUE; } 1550 1528 YY_BREAK 1551 1529 case 7: 1552 1530 YY_RULE_SETUP 1553 #line 304"libparse.l"1531 #line 282 "libparse.l" 1554 1532 { 1555 1533 char proc[256]; … … 1628 1606 case 8: 1629 1607 YY_RULE_SETUP 1630 #line 3 77"libparse.l"1608 #line 355 "libparse.l" 1631 1609 { 1632 1610 BEGIN(pexample); … … 1643 1621 case 9: 1644 1622 YY_RULE_SETUP 1645 #line 3 89"libparse.l"1623 #line 367 "libparse.l" 1646 1624 { quote++; 1647 1625 BEGIN(libcmd); … … 1650 1628 case 10: 1651 1629 YY_RULE_SETUP 1652 #line 3 93"libparse.l"1630 #line 371 "libparse.l" 1653 1631 { quote++; brace2++; 1654 1632 BEGIN(libcmd2); … … 1657 1635 case 11: 1658 1636 YY_RULE_SETUP 1659 #line 3 97"libparse.l"1637 #line 375 "libparse.l" 1660 1638 { 1661 1639 make_version(yytext, 0); … … 1667 1645 case 12: 1668 1646 YY_RULE_SETUP 1669 #line 403"libparse.l"1647 #line 381 "libparse.l" 1670 1648 { 1671 1649 #if YYLPDEBUG … … 1676 1654 case 13: 1677 1655 YY_RULE_SETUP 1678 #line 408"libparse.l"1656 #line 386 "libparse.l" 1679 1657 { 1680 1658 #if YYLPDEBUG > 1 … … 1685 1663 case 14: 1686 1664 YY_RULE_SETUP 1687 #line 413"libparse.l"1665 #line 391 "libparse.l" 1688 1666 { yyless(0); 1689 1667 BEGIN(INITIAL); … … 1693 1671 case 15: 1694 1672 YY_RULE_SETUP 1695 #line 417"libparse.l"1673 #line 395 "libparse.l" 1696 1674 { 1697 1675 yyless(0); … … 1703 1681 case 16: 1704 1682 YY_RULE_SETUP 1705 #line 4 24"libparse.l"1683 #line 402 "libparse.l" 1706 1684 { quote++; 1707 1685 BEGIN(libcmd); … … 1710 1688 case 17: 1711 1689 YY_RULE_SETUP 1712 #line 4 27"libparse.l"1690 #line 405 "libparse.l" 1713 1691 { quote++; brace2++; 1714 1692 BEGIN(libcmd2); … … 1717 1695 case 18: 1718 1696 YY_RULE_SETUP 1719 #line 4 30"libparse.l"1697 #line 408 "libparse.l" 1720 1698 { yylplineno++; } 1721 1699 YY_BREAK 1722 1700 case 19: 1723 1701 YY_RULE_SETUP 1724 #line 4 31"libparse.l"1702 #line 409 "libparse.l" 1725 1703 { 1726 1704 #if YYLPDEBUG > 1 … … 1733 1711 case 20: 1734 1712 YY_RULE_SETUP 1735 #line 4 38"libparse.l"1713 #line 416 "libparse.l" 1736 1714 { 1737 1715 #if YYLPDEBUG > 1 … … 1742 1720 case 21: 1743 1721 YY_RULE_SETUP 1744 #line 4 43"libparse.l"1722 #line 421 "libparse.l" 1745 1723 { 1746 1724 #if YYLPDEBUG > 1 … … 1752 1730 case 22: 1753 1731 YY_RULE_SETUP 1754 #line 4 49"libparse.l"1732 #line 427 "libparse.l" 1755 1733 { 1756 1734 yyless(0); … … 1762 1740 case 23: 1763 1741 YY_RULE_SETUP 1764 #line 4 55"libparse.l"1742 #line 433 "libparse.l" 1765 1743 { 1766 1744 yyless(0); … … 1772 1750 case 24: 1773 1751 YY_RULE_SETUP 1774 #line 4 61"libparse.l"1752 #line 439 "libparse.l" 1775 1753 { quote++; 1776 1754 BEGIN(libcmd); … … 1779 1757 case 25: 1780 1758 YY_RULE_SETUP 1781 #line 4 64"libparse.l"1759 #line 442 "libparse.l" 1782 1760 { quote++; brace2++; 1783 1761 BEGIN(libcmd2); … … 1786 1764 case 26: 1787 1765 YY_RULE_SETUP 1788 #line 4 68"libparse.l"1766 #line 446 "libparse.l" 1789 1767 { yylplineno++; } 1790 1768 YY_BREAK 1791 1769 case 27: 1792 1770 YY_RULE_SETUP 1793 #line 4 69"libparse.l"1771 #line 447 "libparse.l" 1794 1772 { 1795 1773 #if YYLPDEBUG … … 1800 1778 case 28: 1801 1779 YY_RULE_SETUP 1802 #line 4 74"libparse.l"1780 #line 452 "libparse.l" 1803 1781 { 1804 1782 found_oldhelp=1; … … 1810 1788 case 29: 1811 1789 YY_RULE_SETUP 1812 #line 4 82"libparse.l"1790 #line 460 "libparse.l" 1813 1791 { quote--; 1814 1792 yytext[yyleng-1] = '\0'; … … 1827 1805 case 30: 1828 1806 YY_RULE_SETUP 1829 #line 4 95"libparse.l"1807 #line 473 "libparse.l" 1830 1808 { quote--; brace2--; 1831 1809 yytext[yyleng-1] = '\0'; … … 1844 1822 case 31: 1845 1823 YY_RULE_SETUP 1846 #line 509"libparse.l"1824 #line 487 "libparse.l" 1847 1825 { } 1848 1826 YY_BREAK 1849 1827 case 32: 1850 1828 YY_RULE_SETUP 1851 #line 510"libparse.l"1829 #line 488 "libparse.l" 1852 1830 { 1853 1831 brace2++; … … 1859 1837 case 33: 1860 1838 YY_RULE_SETUP 1861 #line 516"libparse.l"1839 #line 494 "libparse.l" 1862 1840 { 1863 1841 brace2--; … … 1878 1856 case 34: 1879 1857 YY_RULE_SETUP 1880 #line 5 31"libparse.l"1858 #line 509 "libparse.l" 1881 1859 { 1882 1860 if(brace2>0) … … 1900 1878 case 35: 1901 1879 YY_RULE_SETUP 1902 #line 5 49"libparse.l"1880 #line 527 "libparse.l" 1903 1881 { yylplineno++; 1904 1882 if(brace2<=0) … … 1913 1891 case 36: 1914 1892 YY_RULE_SETUP 1915 #line 5 58"libparse.l"1893 #line 536 "libparse.l" 1916 1894 { } 1917 1895 YY_BREAK 1918 1896 case 37: 1919 1897 YY_RULE_SETUP 1920 #line 5 59"libparse.l"1898 #line 537 "libparse.l" 1921 1899 { old_state = YYSTATE; BEGIN(comment); } 1922 1900 YY_BREAK 1923 1901 case 38: 1924 1902 YY_RULE_SETUP 1925 #line 5 60"libparse.l"1903 #line 538 "libparse.l" 1926 1904 { 1927 1905 if(brace2<=0) … … 1934 1912 case 39: 1935 1913 YY_RULE_SETUP 1936 #line 5 68"libparse.l"1914 #line 546 "libparse.l" 1937 1915 { 1938 1916 #if YYLPDEBUG … … 1951 1929 case 40: 1952 1930 YY_RULE_SETUP 1953 #line 5 81"libparse.l"1931 #line 559 "libparse.l" 1954 1932 { 1955 1933 #if YYLPDEBUG … … 1962 1940 case 41: 1963 1941 YY_RULE_SETUP 1964 #line 5 88"libparse.l"1942 #line 566 "libparse.l" 1965 1943 { 1966 1944 if(check && yyleng>2) … … 1980 1958 case 42: 1981 1959 YY_RULE_SETUP 1982 #line 602"libparse.l"1960 #line 580 "libparse.l" 1983 1961 { printf("[%s]", yytext); } 1984 1962 YY_BREAK 1985 1963 case 43: 1986 1964 YY_RULE_SETUP 1987 #line 604"libparse.l"1965 #line 582 "libparse.l" 1988 1966 { } 1989 1967 YY_BREAK 1990 1968 case 44: 1991 1969 YY_RULE_SETUP 1992 #line 605"libparse.l"1970 #line 583 "libparse.l" 1993 1971 { 1994 1972 SET_HELP_END(mode, pi, current_pos(0)); … … 2012 1990 case 45: 2013 1991 YY_RULE_SETUP 2014 #line 6 23"libparse.l"1992 #line 601 "libparse.l" 2015 1993 { yylplineno++; } 2016 1994 YY_BREAK 2017 1995 case 46: 2018 1996 YY_RULE_SETUP 2019 #line 6 24"libparse.l"1997 #line 602 "libparse.l" 2020 1998 { } 2021 1999 YY_BREAK 2022 2000 case 47: 2023 2001 YY_RULE_SETUP 2024 #line 6 26"libparse.l"2002 #line 604 "libparse.l" 2025 2003 { 2026 2004 old_state = YYSTATE; … … 2031 2009 case 48: 2032 2010 YY_RULE_SETUP 2033 #line 6 31"libparse.l"2011 #line 609 "libparse.l" 2034 2012 {} 2035 2013 YY_BREAK 2036 2014 case 49: 2037 2015 YY_RULE_SETUP 2038 #line 6 32"libparse.l"2016 #line 610 "libparse.l" 2039 2017 { 2040 2018 brace1++; BEGIN(pbody); … … 2057 2035 case 50: 2058 2036 YY_RULE_SETUP 2059 #line 6 49"libparse.l"2037 #line 627 "libparse.l" 2060 2038 { yylplineno++;} 2061 2039 YY_BREAK 2062 2040 case 51: 2063 2041 YY_RULE_SETUP 2064 #line 6 51"libparse.l"2042 #line 629 "libparse.l" 2065 2043 { } 2066 2044 YY_BREAK 2067 2045 case 52: 2068 2046 YY_RULE_SETUP 2069 #line 6 52"libparse.l"2047 #line 630 "libparse.l" 2070 2048 { quote++; old_state = YYSTATE; 2071 2049 BEGIN(string); /* printf("%s", yytext); */ … … 2074 2052 case 53: 2075 2053 YY_RULE_SETUP 2076 #line 6 56"libparse.l"2054 #line 634 "libparse.l" 2077 2055 { 2078 2056 if(check) printf("*** found 2 proc whithin procedure '%s'.\n", … … 2083 2061 case 54: 2084 2062 YY_RULE_SETUP 2085 #line 6 61"libparse.l"2063 #line 639 "libparse.l" 2086 2064 { 2087 2065 if(check) printf("*** found 1 proc whithin procedure '%s'.\n", … … 2092 2070 case 55: 2093 2071 YY_RULE_SETUP 2094 #line 6 66"libparse.l"2072 #line 644 "libparse.l" 2095 2073 { 2096 2074 brace1++; … … 2102 2080 case 56: 2103 2081 YY_RULE_SETUP 2104 #line 6 72"libparse.l"2082 #line 650 "libparse.l" 2105 2083 { 2106 2084 #if YYLPDEBUG > 1 … … 2132 2110 case 57: 2133 2111 YY_RULE_SETUP 2134 #line 6 98"libparse.l"2112 #line 676 "libparse.l" 2135 2113 { 2136 2114 brace2++; /* printf("%s", yytext); */ … … 2139 2117 case 58: 2140 2118 YY_RULE_SETUP 2141 #line 701"libparse.l"2119 #line 679 "libparse.l" 2142 2120 { 2143 2121 brace2--; /* printf("%s", yytext); */ … … 2150 2128 case 59: 2151 2129 YY_RULE_SETUP 2152 #line 708"libparse.l"2130 #line 686 "libparse.l" 2153 2131 { 2154 2132 brace3++; /* printf("%s", yytext); */ … … 2157 2135 case 60: 2158 2136 YY_RULE_SETUP 2159 #line 711"libparse.l"2137 #line 689 "libparse.l" 2160 2138 { 2161 2139 brace3--; /* printf("%s", yytext); */ … … 2168 2146 case 61: 2169 2147 YY_RULE_SETUP 2170 #line 718"libparse.l"2148 #line 696 "libparse.l" 2171 2149 { yylplineno++; } 2172 2150 YY_BREAK 2173 2151 case 62: 2174 2152 YY_RULE_SETUP 2175 #line 719"libparse.l"2153 #line 697 "libparse.l" 2176 2154 { } 2177 2155 YY_BREAK 2178 2156 case 63: 2179 2157 YY_RULE_SETUP 2180 #line 721"libparse.l"2158 #line 699 "libparse.l" 2181 2159 { 2182 2160 quote++; BEGIN(string); … … 2189 2167 case 64: 2190 2168 YY_RULE_SETUP 2191 #line 7 28"libparse.l"2169 #line 706 "libparse.l" 2192 2170 { yylplineno++; } 2193 2171 YY_BREAK 2194 2172 case 65: 2195 2173 YY_RULE_SETUP 2196 #line 7 29"libparse.l"2174 #line 707 "libparse.l" 2197 2175 { } 2198 2176 YY_BREAK 2199 2177 case 66: 2200 2178 YY_RULE_SETUP 2201 #line 7 31"libparse.l"2179 #line 709 "libparse.l" 2202 2180 { 2203 2181 quote++; BEGIN(string); … … 2210 2188 case 67: 2211 2189 YY_RULE_SETUP 2212 #line 7 38"libparse.l"2190 #line 716 "libparse.l" 2213 2191 { yylplineno++; } 2214 2192 YY_BREAK 2215 2193 case 68: 2216 2194 YY_RULE_SETUP 2217 #line 7 39"libparse.l"2195 #line 717 "libparse.l" 2218 2196 { } 2219 2197 YY_BREAK 2220 2198 case 69: 2221 2199 YY_RULE_SETUP 2222 #line 7 41"libparse.l"2200 #line 719 "libparse.l" 2223 2201 { quote--; 2224 2202 copy_string(mode); … … 2233 2211 case 70: 2234 2212 YY_RULE_SETUP 2235 #line 7 50"libparse.l"2213 #line 728 "libparse.l" 2236 2214 { if (old_state == phelp) IncrCheckSum(*yytext);} 2237 2215 YY_BREAK 2238 2216 case 71: 2239 2217 YY_RULE_SETUP 2240 #line 7 51"libparse.l"2218 #line 729 "libparse.l" 2241 2219 { yylplineno++; if (old_state == phelp) IncrCheckSum('\n');} 2242 2220 YY_BREAK 2243 2221 case 72: 2244 2222 YY_RULE_SETUP 2245 #line 7 52"libparse.l"2223 #line 730 "libparse.l" 2246 2224 { if (old_state == phelp) IncrCheckSum(*yytext);} 2247 2225 YY_BREAK 2248 2226 case 73: 2249 2227 YY_RULE_SETUP 2250 #line 7 54"libparse.l"2228 #line 732 "libparse.l" 2251 2229 { } 2252 2230 YY_BREAK 2253 2231 case 74: 2254 2232 YY_RULE_SETUP 2255 #line 7 55"libparse.l"2233 #line 733 "libparse.l" 2256 2234 { quote++; old_state = YYSTATE; 2257 2235 BEGIN(string); /* printf("%s", yytext); */ … … 2260 2238 case 75: 2261 2239 YY_RULE_SETUP 2262 #line 7 58"libparse.l"2240 #line 736 "libparse.l" 2263 2241 { 2264 2242 brace1++; /* printf("(%d)%s", brace1, yytext); */ … … 2267 2245 case 76: 2268 2246 YY_RULE_SETUP 2269 #line 7 61"libparse.l"2247 #line 739 "libparse.l" 2270 2248 { 2271 2249 brace1--; /* printf("(%d)%s", brace1, yytext); */ … … 2280 2258 case 77: 2281 2259 YY_RULE_SETUP 2282 #line 7 70"libparse.l"2260 #line 748 "libparse.l" 2283 2261 { 2284 2262 brace2++; /* printf("%s", yytext); */ … … 2287 2265 case 78: 2288 2266 YY_RULE_SETUP 2289 #line 7 73"libparse.l"2267 #line 751 "libparse.l" 2290 2268 { 2291 2269 brace2--; /* printf("%s", yytext); */ … … 2294 2272 case 79: 2295 2273 YY_RULE_SETUP 2296 #line 7 76"libparse.l"2274 #line 754 "libparse.l" 2297 2275 { 2298 2276 brace3++; /* printf("%s", yytext); */ … … 2301 2279 case 80: 2302 2280 YY_RULE_SETUP 2303 #line 7 79"libparse.l"2281 #line 757 "libparse.l" 2304 2282 { 2305 2283 brace3--; /* printf("%s", yytext); */ … … 2308 2286 case 81: 2309 2287 YY_RULE_SETUP 2310 #line 7 82"libparse.l"2288 #line 760 "libparse.l" 2311 2289 { yylplineno++; } 2312 2290 YY_BREAK 2313 2291 case 82: 2314 2292 YY_RULE_SETUP 2315 #line 7 83"libparse.l"2293 #line 761 "libparse.l" 2316 2294 { } 2317 2295 YY_BREAK 2318 2296 case 83: 2319 2297 YY_RULE_SETUP 2320 #line 7 85"libparse.l"2298 #line 763 "libparse.l" 2321 2299 { quote--; 2322 2300 BEGIN(pexample); /* printf("%s", yytext); */ … … 2325 2303 case 84: 2326 2304 YY_RULE_SETUP 2327 #line 7 88"libparse.l"2305 #line 766 "libparse.l" 2328 2306 { } 2329 2307 YY_BREAK 2330 2308 case 85: 2331 2309 YY_RULE_SETUP 2332 #line 7 89"libparse.l"2310 #line 767 "libparse.l" 2333 2311 { } 2334 2312 YY_BREAK 2335 2313 case 86: 2336 2314 YY_RULE_SETUP 2337 #line 7 90"libparse.l"2315 #line 768 "libparse.l" 2338 2316 { yylplineno++; } 2339 2317 YY_BREAK 2340 2318 case 87: 2341 2319 YY_RULE_SETUP 2342 #line 7 91"libparse.l"2320 #line 769 "libparse.l" 2343 2321 { } 2344 2322 YY_BREAK 2345 2323 case 88: 2346 2324 YY_RULE_SETUP 2347 #line 7 93"libparse.l"2325 #line 771 "libparse.l" 2348 2326 { BEGIN(old_state); } 2349 2327 YY_BREAK 2350 2328 case 89: 2351 2329 YY_RULE_SETUP 2352 #line 7 94"libparse.l"2330 #line 772 "libparse.l" 2353 2331 { yylplineno++; } 2354 2332 YY_BREAK 2355 2333 case 90: 2356 2334 YY_RULE_SETUP 2357 #line 7 95"libparse.l"2335 #line 773 "libparse.l" 2358 2336 { } 2359 2337 YY_BREAK 2360 2338 case 91: 2361 2339 YY_RULE_SETUP 2362 #line 7 97"libparse.l"2340 #line 775 "libparse.l" 2363 2341 { yylplineno++; } 2364 2342 YY_BREAK 2365 2343 case 92: 2366 2344 YY_RULE_SETUP 2367 #line 7 98"libparse.l"2345 #line 776 "libparse.l" 2368 2346 { } 2369 2347 YY_BREAK 2370 2348 case 93: 2371 2349 YY_RULE_SETUP 2372 #line 7 99"libparse.l"2350 #line 777 "libparse.l" 2373 2351 { p_static = FALSE; 2374 2352 #if YYLPDEBUG > 1 … … 2379 2357 case 94: 2380 2358 YY_RULE_SETUP 2381 #line 804"libparse.l"2359 #line 782 "libparse.l" 2382 2360 { p_static = FALSE; 2383 2361 yylp_errno = YYLP_BAD_CHAR; … … 2397 2375 case 95: 2398 2376 YY_RULE_SETUP 2399 #line 819"libparse.l"2377 #line 797 "libparse.l" 2400 2378 ECHO; 2401 2379 YY_BREAK … … 3304 3282 } 3305 3283 #endif 3306 #line 819"libparse.l"3284 #line 797 "libparse.l" 3307 3285 3308 3286
Note: See TracChangeset
for help on using the changeset viewer.