Changeset 5f2f2d7 for src/Parser
- Timestamp:
- Jun 8, 2015, 8:56:35 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 81419b5
- Parents:
- cd623a4
- Location:
- src/Parser
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
rcd623a4 r5f2f2d7 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jun 7 07:58:00 201513 // Update Count : 1 3512 // Last Modified On : Mon Jun 8 17:33:40 2015 13 // Update Count : 147 14 14 // 15 15 … … 93 93 static inline bool checkX( char c ) { return c == 'x' || c == 'X'; } 94 94 95 // Very difficult to separate extra parts of constants during lexing because actions are not allow in the middle of 96 // patterns: 95 // Difficult to separate extra parts of constants during lexing because actions are not allow in the middle of patterns: 97 96 // 98 97 // prefix action constant action suffix … … 130 129 } // if 131 130 } else { // decimal constant ? 132 sscanf( (char *)value.c_str(), "%ll d", &v );131 sscanf( (char *)value.c_str(), "%llu", &v ); 133 132 //printf( "%llu %llu\n", v, v ); 134 133 } // if … … 136 135 if ( v <= INT_MAX ) { // signed int 137 136 size = 0; 138 } else if ( v <= UINT_MAX ) {// unsigned int137 } else if ( v <= UINT_MAX && ! dec ) { // unsigned int 139 138 size = 0; 140 if ( ! dec ) Unsigned = true;// unsigned139 Unsigned = true; // unsigned 141 140 } else if ( v <= LONG_MAX ) { // signed long int 142 141 size = 1; 143 } else if ( v <= ULONG_MAX ) {// signed long int142 } else if ( v <= ULONG_MAX && ( ! dec || LONG_MAX == LLONG_MAX ) ) { // signed long int 144 143 size = 1; 145 if ( ! dec ) Unsigned = true;// unsigned long int144 Unsigned = true; // unsigned long int 146 145 } else if ( v <= LLONG_MAX ) { // signed long long int 147 146 size = 2; 148 } else { // signed long long int147 } else { // unsigned long long int 149 148 size = 2; 150 if ( ! dec ) Unsigned = true;// unsigned long long int149 Unsigned = true; // unsigned long long int 151 150 } // if 152 151 153 152 if ( checkU( value[last] ) ) { // suffix 'u' ? 154 153 Unsigned = true; 155 if ( checkL( value[ last - 1 ] ) ) {// suffix 'l' ?154 if ( last > 0 && checkL( value[ last - 1 ] ) ) { // suffix 'l' ? 156 155 size = 1; 157 if ( checkL( value[ last - 1] ) ) { // suffix 'll' ?156 if ( last > 1 && checkL( value[ last - 2 ] ) ) { // suffix 'll' ? 158 157 size = 2; 159 158 } // if … … 161 160 } else if ( checkL( value[ last ] ) ) { // suffix 'l' ? 162 161 size = 1; 163 if ( checkL( value[ last - 1 ] ) ) {// suffix 'll' ?162 if ( last > 0 && checkL( value[ last - 1 ] ) ) { // suffix 'll' ? 164 163 size = 2; 165 } // if 166 if ( checkU( value[ last - 1 ] ) ) { // suffix 'u' ? 167 Unsigned = true; 164 if ( last > 1 && checkU( value[ last - 2 ] ) ) { // suffix 'u' ? 165 Unsigned = true; 166 } // if 167 } else { 168 if ( last > 0 && checkU( value[ last - 1 ] ) ) { // suffix 'u' ? 169 Unsigned = true; 170 } // if 168 171 } // if 169 172 } // if -
src/Parser/ParseNode.h
rcd623a4 r5f2f2d7 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jun 7 07:42:50 201513 // Update Count : 6 412 // Last Modified On : Sun Jun 7 22:02:00 2015 13 // Update Count : 65 14 14 // 15 15 … … 337 337 338 338 bool get_hasEllipsis() const; 339 std::stringget_name() const { return name; }339 const std::string &get_name() const { return name; } 340 340 LinkageSpec::Type get_linkage() const { return linkage; } 341 341 DeclarationNode *extractAggregate() const; -
src/Parser/lex.cc
rcd623a4 r5f2f2d7 1390 1390 * Created On : Sat Sep 22 08:58:10 2001 1391 1391 * Last Modified By : Peter A. Buhr 1392 * Last Modified On : Sun Jun 7 07:14:1620151393 * Update Count : 3 741394 */ 1395 #line 19"lex.ll"1392 * Last Modified On : Mon Jun 8 20:24:15 2015 1393 * Update Count : 381 1394 */ 1395 #line 20 "lex.ll" 1396 1396 // This lexer assumes the program has been preprocessed by cpp. Hence, all user level preprocessor directive 1397 1397 // have been performed and removed from the source. The only exceptions are preprocessor directives passed to … … 1409 1409 std::string *strtext; // accumulate parts of character and string constant value 1410 1410 1411 #define RETURN_LOCN(x) yylval.tok.loc.file = yyfilename; yylval.tok.loc.line = yylineno; return(x) 1412 #define RETURN_VAL(x) yylval.tok.str = new std::string( yytext ); RETURN_LOCN(x) 1413 #define RETURN_CHAR(x) yylval.tok.str = NULL; RETURN_LOCN(x) 1414 #define RETURN_STR(x) yylval.tok.str = strtext; RETURN_LOCN(x) 1415 1411 1416 #define WHITE_RETURN(x) // do nothing 1412 1417 #define NEWLINE_RETURN() WHITE_RETURN('\n') 1413 #define RETURN_VAL(x) yylval.tok.str = new std::string( yytext ); \ 1414 yylval.tok.loc.file = yyfilename; \ 1415 yylval.tok.loc.line = yylineno; \ 1416 return(x) 1417 #define RETURN_STR(x) yylval.tok.str = strtext; \ 1418 yylval.tok.loc.file = yyfilename; \ 1419 yylval.tok.loc.line = yylineno; \ 1420 return(x) 1421 1422 #define KEYWORD_RETURN(x) RETURN_VAL(x) // keyword 1418 #define ASCIIOP_RETURN() RETURN_CHAR((int)yytext[0]) // single character operator 1419 #define NAMEDOP_RETURN(x) RETURN_VAL(x) // multichar operator, with a name 1420 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL(x) // numeric constant 1421 #define KEYWORD_RETURN(x) RETURN_CHAR(x) // keyword 1423 1422 #define IDENTIFIER_RETURN() RETURN_VAL((typedefTable.isIdentifier(yytext) ? IDENTIFIER : typedefTable.isTypedef(yytext) ? TYPEDEFname : TYPEGENname)) 1424 //#define ATTRIBUTE_RETURN() RETURN_VAL((typedefTable.isIdentifier(yytext) ? ATTR_IDENTIFIER : typedefTable.isTypedef(yytext) ? ATTR_TYPEDEFname : ATTR_TYPEGENname))1425 1423 #define ATTRIBUTE_RETURN() RETURN_VAL(ATTR_IDENTIFIER) 1426 1427 #define ASCIIOP_RETURN() RETURN_VAL((int)yytext[0]) // single character operator1428 #define NAMEDOP_RETURN(x) RETURN_VAL(x) // multichar operator, with a name1429 1430 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL(x) // numeric constant1431 1424 1432 1425 void rm_underscore() { … … 1455 1448 1456 1449 1457 #line 145 8"Parser/lex.cc"1450 #line 1451 "Parser/lex.cc" 1458 1451 1459 1452 #define INITIAL 0 … … 1518 1511 #endif 1519 1512 1520 static void yyunput (int c,char *buf_ptr );1521 1522 1513 #ifndef yytext_ptr 1523 1514 static void yy_flex_strncpy (char *,yyconst char *,int ); … … 1649 1640 register int yy_act; 1650 1641 1651 #line 1 42"lex.ll"1642 #line 136 "lex.ll" 1652 1643 1653 1644 /* line directives */ 1654 #line 16 55"Parser/lex.cc"1645 #line 1646 "Parser/lex.cc" 1655 1646 1656 1647 if ( !(yy_init) ) … … 1749 1740 /* rule 1 can match eol */ 1750 1741 YY_RULE_SETUP 1751 #line 1 44"lex.ll"1742 #line 138 "lex.ll" 1752 1743 { 1753 1744 /* " stop highlighting */ … … 1776 1767 /* rule 2 can match eol */ 1777 1768 YY_RULE_SETUP 1778 #line 16 7"lex.ll"1769 #line 161 "lex.ll" 1779 1770 ; 1780 1771 YY_BREAK … … 1782 1773 case 3: 1783 1774 YY_RULE_SETUP 1784 #line 1 70"lex.ll"1775 #line 164 "lex.ll" 1785 1776 { BEGIN COMMENT; } 1786 1777 YY_BREAK … … 1788 1779 /* rule 4 can match eol */ 1789 1780 YY_RULE_SETUP 1790 #line 1 71"lex.ll"1781 #line 165 "lex.ll" 1791 1782 ; 1792 1783 YY_BREAK 1793 1784 case 5: 1794 1785 YY_RULE_SETUP 1795 #line 1 72"lex.ll"1786 #line 166 "lex.ll" 1796 1787 { BEGIN 0; } 1797 1788 YY_BREAK … … 1800 1791 /* rule 6 can match eol */ 1801 1792 YY_RULE_SETUP 1802 #line 1 75"lex.ll"1793 #line 169 "lex.ll" 1803 1794 ; 1804 1795 YY_BREAK … … 1806 1797 case 7: 1807 1798 YY_RULE_SETUP 1808 #line 17 8"lex.ll"1799 #line 172 "lex.ll" 1809 1800 { WHITE_RETURN(' '); } 1810 1801 YY_BREAK 1811 1802 case 8: 1812 1803 YY_RULE_SETUP 1813 #line 17 9"lex.ll"1804 #line 173 "lex.ll" 1814 1805 { WHITE_RETURN(' '); } 1815 1806 YY_BREAK … … 1817 1808 /* rule 9 can match eol */ 1818 1809 YY_RULE_SETUP 1819 #line 1 80"lex.ll"1810 #line 174 "lex.ll" 1820 1811 { NEWLINE_RETURN(); } 1821 1812 YY_BREAK … … 1823 1814 case 10: 1824 1815 YY_RULE_SETUP 1816 #line 177 "lex.ll" 1817 { KEYWORD_RETURN(ALIGNAS); } // C11 1818 YY_BREAK 1819 case 11: 1820 YY_RULE_SETUP 1821 #line 178 "lex.ll" 1822 { KEYWORD_RETURN(ALIGNOF); } // C11 1823 YY_BREAK 1824 case 12: 1825 YY_RULE_SETUP 1826 #line 179 "lex.ll" 1827 { KEYWORD_RETURN(ALIGNOF); } // GCC 1828 YY_BREAK 1829 case 13: 1830 YY_RULE_SETUP 1831 #line 180 "lex.ll" 1832 { KEYWORD_RETURN(ALIGNOF); } // GCC 1833 YY_BREAK 1834 case 14: 1835 YY_RULE_SETUP 1836 #line 181 "lex.ll" 1837 { KEYWORD_RETURN(ASM); } 1838 YY_BREAK 1839 case 15: 1840 YY_RULE_SETUP 1841 #line 182 "lex.ll" 1842 { KEYWORD_RETURN(ASM); } // GCC 1843 YY_BREAK 1844 case 16: 1845 YY_RULE_SETUP 1825 1846 #line 183 "lex.ll" 1826 { KEYWORD_RETURN(A LIGNAS); } // C111827 YY_BREAK 1828 case 1 1:1847 { KEYWORD_RETURN(ASM); } // GCC 1848 YY_BREAK 1849 case 17: 1829 1850 YY_RULE_SETUP 1830 1851 #line 184 "lex.ll" 1831 { KEYWORD_RETURN(A LIGNOF); }// C111832 YY_BREAK 1833 case 1 2:1852 { KEYWORD_RETURN(ATOMIC); } // C11 1853 YY_BREAK 1854 case 18: 1834 1855 YY_RULE_SETUP 1835 1856 #line 185 "lex.ll" 1836 { KEYWORD_RETURN(A LIGNOF); } // GCC1837 YY_BREAK 1838 case 1 3:1857 { KEYWORD_RETURN(ATTRIBUTE); } // GCC 1858 YY_BREAK 1859 case 19: 1839 1860 YY_RULE_SETUP 1840 1861 #line 186 "lex.ll" 1841 { KEYWORD_RETURN(A LIGNOF); } // GCC1842 YY_BREAK 1843 case 14:1862 { KEYWORD_RETURN(ATTRIBUTE); } // GCC 1863 YY_BREAK 1864 case 20: 1844 1865 YY_RULE_SETUP 1845 1866 #line 187 "lex.ll" 1846 { KEYWORD_RETURN(A SM); }1847 YY_BREAK 1848 case 15:1867 { KEYWORD_RETURN(AUTO); } 1868 YY_BREAK 1869 case 21: 1849 1870 YY_RULE_SETUP 1850 1871 #line 188 "lex.ll" 1851 { KEYWORD_RETURN( ASM); } // GCC1852 YY_BREAK 1853 case 16:1872 { KEYWORD_RETURN(BOOL); } // C99 1873 YY_BREAK 1874 case 22: 1854 1875 YY_RULE_SETUP 1855 1876 #line 189 "lex.ll" 1856 { KEYWORD_RETURN( ASM); } // GCC1857 YY_BREAK 1858 case 17:1877 { KEYWORD_RETURN(BREAK); } 1878 YY_BREAK 1879 case 23: 1859 1880 YY_RULE_SETUP 1860 1881 #line 190 "lex.ll" 1861 { KEYWORD_RETURN( ATOMIC); } // C111862 YY_BREAK 1863 case 18:1882 { KEYWORD_RETURN(CASE); } 1883 YY_BREAK 1884 case 24: 1864 1885 YY_RULE_SETUP 1865 1886 #line 191 "lex.ll" 1866 { KEYWORD_RETURN( ATTRIBUTE); } // GCC1867 YY_BREAK 1868 case 19:1887 { KEYWORD_RETURN(CATCH); } // CFA 1888 YY_BREAK 1889 case 25: 1869 1890 YY_RULE_SETUP 1870 1891 #line 192 "lex.ll" 1871 { KEYWORD_RETURN( ATTRIBUTE); } // GCC1872 YY_BREAK 1873 case 2 0:1892 { KEYWORD_RETURN(CHAR); } 1893 YY_BREAK 1894 case 26: 1874 1895 YY_RULE_SETUP 1875 1896 #line 193 "lex.ll" 1876 { KEYWORD_RETURN( AUTO); }1877 YY_BREAK 1878 case 2 1:1897 { KEYWORD_RETURN(CHOOSE); } // CFA 1898 YY_BREAK 1899 case 27: 1879 1900 YY_RULE_SETUP 1880 1901 #line 194 "lex.ll" 1881 { KEYWORD_RETURN( BOOL); }// C991882 YY_BREAK 1883 case 2 2:1902 { KEYWORD_RETURN(COMPLEX); } // C99 1903 YY_BREAK 1904 case 28: 1884 1905 YY_RULE_SETUP 1885 1906 #line 195 "lex.ll" 1886 { KEYWORD_RETURN( BREAK); }1887 YY_BREAK 1888 case 2 3:1907 { KEYWORD_RETURN(COMPLEX); } // GCC 1908 YY_BREAK 1909 case 29: 1889 1910 YY_RULE_SETUP 1890 1911 #line 196 "lex.ll" 1891 { KEYWORD_RETURN(C ASE); }1892 YY_BREAK 1893 case 24:1912 { KEYWORD_RETURN(COMPLEX); } // GCC 1913 YY_BREAK 1914 case 30: 1894 1915 YY_RULE_SETUP 1895 1916 #line 197 "lex.ll" 1896 { KEYWORD_RETURN(C ATCH); } // CFA1897 YY_BREAK 1898 case 25:1917 { KEYWORD_RETURN(CONST); } 1918 YY_BREAK 1919 case 31: 1899 1920 YY_RULE_SETUP 1900 1921 #line 198 "lex.ll" 1901 { KEYWORD_RETURN(C HAR); }1902 YY_BREAK 1903 case 26:1922 { KEYWORD_RETURN(CONST); } // GCC 1923 YY_BREAK 1924 case 32: 1904 1925 YY_RULE_SETUP 1905 1926 #line 199 "lex.ll" 1906 { KEYWORD_RETURN(C HOOSE); } // CFA1907 YY_BREAK 1908 case 27:1927 { KEYWORD_RETURN(CONST); } // GCC 1928 YY_BREAK 1929 case 33: 1909 1930 YY_RULE_SETUP 1910 1931 #line 200 "lex.ll" 1911 { KEYWORD_RETURN(CO MPLEX); } // C991912 YY_BREAK 1913 case 28:1932 { KEYWORD_RETURN(CONTEXT); } // CFA 1933 YY_BREAK 1934 case 34: 1914 1935 YY_RULE_SETUP 1915 1936 #line 201 "lex.ll" 1916 { KEYWORD_RETURN(CO MPLEX); } // GCC1917 YY_BREAK 1918 case 29:1937 { KEYWORD_RETURN(CONTINUE); } 1938 YY_BREAK 1939 case 35: 1919 1940 YY_RULE_SETUP 1920 1941 #line 202 "lex.ll" 1921 { KEYWORD_RETURN( COMPLEX); } // GCC1922 YY_BREAK 1923 case 3 0:1942 { KEYWORD_RETURN(DEFAULT); } 1943 YY_BREAK 1944 case 36: 1924 1945 YY_RULE_SETUP 1925 1946 #line 203 "lex.ll" 1926 { KEYWORD_RETURN( CONST); }1927 YY_BREAK 1928 case 3 1:1947 { KEYWORD_RETURN(DO); } 1948 YY_BREAK 1949 case 37: 1929 1950 YY_RULE_SETUP 1930 1951 #line 204 "lex.ll" 1931 { KEYWORD_RETURN( CONST); } // GCC1932 YY_BREAK 1933 case 3 2:1952 { KEYWORD_RETURN(DOUBLE); } 1953 YY_BREAK 1954 case 38: 1934 1955 YY_RULE_SETUP 1935 1956 #line 205 "lex.ll" 1936 { KEYWORD_RETURN( CONST); } // GCC1937 YY_BREAK 1938 case 3 3:1957 { KEYWORD_RETURN(DTYPE); } // CFA 1958 YY_BREAK 1959 case 39: 1939 1960 YY_RULE_SETUP 1940 1961 #line 206 "lex.ll" 1941 { KEYWORD_RETURN( CONTEXT); } // CFA1942 YY_BREAK 1943 case 34:1962 { KEYWORD_RETURN(ELSE); } 1963 YY_BREAK 1964 case 40: 1944 1965 YY_RULE_SETUP 1945 1966 #line 207 "lex.ll" 1946 { KEYWORD_RETURN( CONTINUE); }1947 YY_BREAK 1948 case 35:1967 { KEYWORD_RETURN(ENUM); } 1968 YY_BREAK 1969 case 41: 1949 1970 YY_RULE_SETUP 1950 1971 #line 208 "lex.ll" 1951 { KEYWORD_RETURN( DEFAULT); }1952 YY_BREAK 1953 case 36:1972 { KEYWORD_RETURN(EXTENSION); } // GCC 1973 YY_BREAK 1974 case 42: 1954 1975 YY_RULE_SETUP 1955 1976 #line 209 "lex.ll" 1956 { KEYWORD_RETURN( DO); }1957 YY_BREAK 1958 case 37:1977 { KEYWORD_RETURN(EXTERN); } 1978 YY_BREAK 1979 case 43: 1959 1980 YY_RULE_SETUP 1960 1981 #line 210 "lex.ll" 1961 { KEYWORD_RETURN( DOUBLE); }1962 YY_BREAK 1963 case 38:1982 { KEYWORD_RETURN(FALLTHRU); } // CFA 1983 YY_BREAK 1984 case 44: 1964 1985 YY_RULE_SETUP 1965 1986 #line 211 "lex.ll" 1966 { KEYWORD_RETURN( DTYPE); }// CFA1967 YY_BREAK 1968 case 39:1987 { KEYWORD_RETURN(FINALLY); } // CFA 1988 YY_BREAK 1989 case 45: 1969 1990 YY_RULE_SETUP 1970 1991 #line 212 "lex.ll" 1971 { KEYWORD_RETURN( ELSE); }1972 YY_BREAK 1973 case 4 0:1992 { KEYWORD_RETURN(FLOAT); } 1993 YY_BREAK 1994 case 46: 1974 1995 YY_RULE_SETUP 1975 1996 #line 213 "lex.ll" 1976 { KEYWORD_RETURN( ENUM); }1977 YY_BREAK 1978 case 4 1:1997 { KEYWORD_RETURN(FLOAT); } // GCC 1998 YY_BREAK 1999 case 47: 1979 2000 YY_RULE_SETUP 1980 2001 #line 214 "lex.ll" 1981 { KEYWORD_RETURN( EXTENSION); } // GCC1982 YY_BREAK 1983 case 4 2:2002 { KEYWORD_RETURN(FOR); } 2003 YY_BREAK 2004 case 48: 1984 2005 YY_RULE_SETUP 1985 2006 #line 215 "lex.ll" 1986 { KEYWORD_RETURN( EXTERN); }1987 YY_BREAK 1988 case 4 3:2007 { KEYWORD_RETURN(FORALL); } // CFA 2008 YY_BREAK 2009 case 49: 1989 2010 YY_RULE_SETUP 1990 2011 #line 216 "lex.ll" 1991 { KEYWORD_RETURN(F ALLTHRU); } // CFA1992 YY_BREAK 1993 case 44:2012 { KEYWORD_RETURN(FORTRAN); } 2013 YY_BREAK 2014 case 50: 1994 2015 YY_RULE_SETUP 1995 2016 #line 217 "lex.ll" 1996 { KEYWORD_RETURN(F INALLY); }// CFA1997 YY_BREAK 1998 case 45:2017 { KEYWORD_RETURN(FTYPE); } // CFA 2018 YY_BREAK 2019 case 51: 1999 2020 YY_RULE_SETUP 2000 2021 #line 218 "lex.ll" 2001 { KEYWORD_RETURN( FLOAT); }2002 YY_BREAK 2003 case 46:2022 { KEYWORD_RETURN(GENERIC); } // C11 2023 YY_BREAK 2024 case 52: 2004 2025 YY_RULE_SETUP 2005 2026 #line 219 "lex.ll" 2006 { KEYWORD_RETURN( FLOAT); } // GCC2007 YY_BREAK 2008 case 47:2027 { KEYWORD_RETURN(GOTO); } 2028 YY_BREAK 2029 case 53: 2009 2030 YY_RULE_SETUP 2010 2031 #line 220 "lex.ll" 2011 { KEYWORD_RETURN( FOR); }2012 YY_BREAK 2013 case 48:2032 { KEYWORD_RETURN(IF); } 2033 YY_BREAK 2034 case 54: 2014 2035 YY_RULE_SETUP 2015 2036 #line 221 "lex.ll" 2016 { KEYWORD_RETURN( FORALL); } // CFA2017 YY_BREAK 2018 case 49:2037 { KEYWORD_RETURN(IMAGINARY); } // C99 2038 YY_BREAK 2039 case 55: 2019 2040 YY_RULE_SETUP 2020 2041 #line 222 "lex.ll" 2021 { KEYWORD_RETURN( FORTRAN); }2022 YY_BREAK 2023 case 5 0:2042 { KEYWORD_RETURN(IMAGINARY); } // GCC 2043 YY_BREAK 2044 case 56: 2024 2045 YY_RULE_SETUP 2025 2046 #line 223 "lex.ll" 2026 { KEYWORD_RETURN( FTYPE); } // CFA2027 YY_BREAK 2028 case 5 1:2047 { KEYWORD_RETURN(IMAGINARY); } // GCC 2048 YY_BREAK 2049 case 57: 2029 2050 YY_RULE_SETUP 2030 2051 #line 224 "lex.ll" 2031 { KEYWORD_RETURN( GENERIC); } // C112032 YY_BREAK 2033 case 5 2:2052 { KEYWORD_RETURN(INLINE); } // C99 2053 YY_BREAK 2054 case 58: 2034 2055 YY_RULE_SETUP 2035 2056 #line 225 "lex.ll" 2036 { KEYWORD_RETURN( GOTO); }2037 YY_BREAK 2038 case 5 3:2057 { KEYWORD_RETURN(INLINE); } // GCC 2058 YY_BREAK 2059 case 59: 2039 2060 YY_RULE_SETUP 2040 2061 #line 226 "lex.ll" 2041 { KEYWORD_RETURN(I F); }2042 YY_BREAK 2043 case 54:2062 { KEYWORD_RETURN(INLINE); } // GCC 2063 YY_BREAK 2064 case 60: 2044 2065 YY_RULE_SETUP 2045 2066 #line 227 "lex.ll" 2046 { KEYWORD_RETURN(I MAGINARY); } // C992047 YY_BREAK 2048 case 55:2067 { KEYWORD_RETURN(INT); } 2068 YY_BREAK 2069 case 61: 2049 2070 YY_RULE_SETUP 2050 2071 #line 228 "lex.ll" 2051 { KEYWORD_RETURN(I MAGINARY); }// GCC2052 YY_BREAK 2053 case 56:2072 { KEYWORD_RETURN(INT); } // GCC 2073 YY_BREAK 2074 case 62: 2054 2075 YY_RULE_SETUP 2055 2076 #line 229 "lex.ll" 2056 { KEYWORD_RETURN( IMAGINARY); }// GCC2057 YY_BREAK 2058 case 57:2077 { KEYWORD_RETURN(LABEL); } // GCC 2078 YY_BREAK 2079 case 63: 2059 2080 YY_RULE_SETUP 2060 2081 #line 230 "lex.ll" 2061 { KEYWORD_RETURN( INLINE); } // C992062 YY_BREAK 2063 case 58:2082 { KEYWORD_RETURN(LONG); } 2083 YY_BREAK 2084 case 64: 2064 2085 YY_RULE_SETUP 2065 2086 #line 231 "lex.ll" 2066 { KEYWORD_RETURN( INLINE); } // GCC2067 YY_BREAK 2068 case 59:2087 { KEYWORD_RETURN(LVALUE); } // CFA 2088 YY_BREAK 2089 case 65: 2069 2090 YY_RULE_SETUP 2070 2091 #line 232 "lex.ll" 2071 { KEYWORD_RETURN( INLINE); } // GCC2072 YY_BREAK 2073 case 6 0:2092 { KEYWORD_RETURN(NORETURN); } // C11 2093 YY_BREAK 2094 case 66: 2074 2095 YY_RULE_SETUP 2075 2096 #line 233 "lex.ll" 2076 { KEYWORD_RETURN( INT); }2077 YY_BREAK 2078 case 6 1:2097 { KEYWORD_RETURN(REGISTER); } 2098 YY_BREAK 2099 case 67: 2079 2100 YY_RULE_SETUP 2080 2101 #line 234 "lex.ll" 2081 { KEYWORD_RETURN( INT); } // GCC2082 YY_BREAK 2083 case 6 2:2102 { KEYWORD_RETURN(RESTRICT); } // C99 2103 YY_BREAK 2104 case 68: 2084 2105 YY_RULE_SETUP 2085 2106 #line 235 "lex.ll" 2086 { KEYWORD_RETURN( LABEL); }// GCC2087 YY_BREAK 2088 case 6 3:2107 { KEYWORD_RETURN(RESTRICT); } // GCC 2108 YY_BREAK 2109 case 69: 2089 2110 YY_RULE_SETUP 2090 2111 #line 236 "lex.ll" 2091 { KEYWORD_RETURN( LONG); }2092 YY_BREAK 2093 case 64:2112 { KEYWORD_RETURN(RESTRICT); } // GCC 2113 YY_BREAK 2114 case 70: 2094 2115 YY_RULE_SETUP 2095 2116 #line 237 "lex.ll" 2096 { KEYWORD_RETURN( LVALUE); } // CFA2097 YY_BREAK 2098 case 65:2117 { KEYWORD_RETURN(RETURN); } 2118 YY_BREAK 2119 case 71: 2099 2120 YY_RULE_SETUP 2100 2121 #line 238 "lex.ll" 2101 { KEYWORD_RETURN( NORETURN); } // C112102 YY_BREAK 2103 case 66:2122 { KEYWORD_RETURN(SHORT); } 2123 YY_BREAK 2124 case 72: 2104 2125 YY_RULE_SETUP 2105 2126 #line 239 "lex.ll" 2106 { KEYWORD_RETURN( REGISTER); }2107 YY_BREAK 2108 case 67:2127 { KEYWORD_RETURN(SIGNED); } 2128 YY_BREAK 2129 case 73: 2109 2130 YY_RULE_SETUP 2110 2131 #line 240 "lex.ll" 2111 { KEYWORD_RETURN( RESTRICT); } // C992112 YY_BREAK 2113 case 68:2132 { KEYWORD_RETURN(SIGNED); } // GCC 2133 YY_BREAK 2134 case 74: 2114 2135 YY_RULE_SETUP 2115 2136 #line 241 "lex.ll" 2116 { KEYWORD_RETURN( RESTRICT); }// GCC2117 YY_BREAK 2118 case 69:2137 { KEYWORD_RETURN(SIGNED); } // GCC 2138 YY_BREAK 2139 case 75: 2119 2140 YY_RULE_SETUP 2120 2141 #line 242 "lex.ll" 2121 { KEYWORD_RETURN( RESTRICT); } // GCC2122 YY_BREAK 2123 case 7 0:2142 { KEYWORD_RETURN(SIZEOF); } 2143 YY_BREAK 2144 case 76: 2124 2145 YY_RULE_SETUP 2125 2146 #line 243 "lex.ll" 2126 { KEYWORD_RETURN( RETURN); }2127 YY_BREAK 2128 case 7 1:2147 { KEYWORD_RETURN(STATIC); } 2148 YY_BREAK 2149 case 77: 2129 2150 YY_RULE_SETUP 2130 2151 #line 244 "lex.ll" 2131 { KEYWORD_RETURN(S HORT); }2132 YY_BREAK 2133 case 7 2:2152 { KEYWORD_RETURN(STATICASSERT); } // C11 2153 YY_BREAK 2154 case 78: 2134 2155 YY_RULE_SETUP 2135 2156 #line 245 "lex.ll" 2136 { KEYWORD_RETURN(S IGNED); }2137 YY_BREAK 2138 case 7 3:2157 { KEYWORD_RETURN(STRUCT); } 2158 YY_BREAK 2159 case 79: 2139 2160 YY_RULE_SETUP 2140 2161 #line 246 "lex.ll" 2141 { KEYWORD_RETURN(S IGNED); } // GCC2142 YY_BREAK 2143 case 74:2162 { KEYWORD_RETURN(SWITCH); } 2163 YY_BREAK 2164 case 80: 2144 2165 YY_RULE_SETUP 2145 2166 #line 247 "lex.ll" 2146 { KEYWORD_RETURN( SIGNED); } // GCC2147 YY_BREAK 2148 case 75:2167 { KEYWORD_RETURN(THREADLOCAL); } // C11 2168 YY_BREAK 2169 case 81: 2149 2170 YY_RULE_SETUP 2150 2171 #line 248 "lex.ll" 2151 { KEYWORD_RETURN( SIZEOF); }2152 YY_BREAK 2153 case 76:2172 { KEYWORD_RETURN(THROW); } // CFA 2173 YY_BREAK 2174 case 82: 2154 2175 YY_RULE_SETUP 2155 2176 #line 249 "lex.ll" 2156 { KEYWORD_RETURN( STATIC); }2157 YY_BREAK 2158 case 77:2177 { KEYWORD_RETURN(TRY); } // CFA 2178 YY_BREAK 2179 case 83: 2159 2180 YY_RULE_SETUP 2160 2181 #line 250 "lex.ll" 2161 { KEYWORD_RETURN( STATICASSERT); } // C112162 YY_BREAK 2163 case 78:2182 { KEYWORD_RETURN(TYPE); } // CFA 2183 YY_BREAK 2184 case 84: 2164 2185 YY_RULE_SETUP 2165 2186 #line 251 "lex.ll" 2166 { KEYWORD_RETURN( STRUCT); }2167 YY_BREAK 2168 case 79:2187 { KEYWORD_RETURN(TYPEDEF); } 2188 YY_BREAK 2189 case 85: 2169 2190 YY_RULE_SETUP 2170 2191 #line 252 "lex.ll" 2171 { KEYWORD_RETURN( SWITCH); }2172 YY_BREAK 2173 case 8 0:2192 { KEYWORD_RETURN(TYPEOF); } // GCC 2193 YY_BREAK 2194 case 86: 2174 2195 YY_RULE_SETUP 2175 2196 #line 253 "lex.ll" 2176 { KEYWORD_RETURN(T HREADLOCAL); } // C112177 YY_BREAK 2178 case 8 1:2197 { KEYWORD_RETURN(TYPEOF); } // GCC 2198 YY_BREAK 2199 case 87: 2179 2200 YY_RULE_SETUP 2180 2201 #line 254 "lex.ll" 2181 { KEYWORD_RETURN(T HROW); } // CFA2182 YY_BREAK 2183 case 8 2:2202 { KEYWORD_RETURN(TYPEOF); } // GCC 2203 YY_BREAK 2204 case 88: 2184 2205 YY_RULE_SETUP 2185 2206 #line 255 "lex.ll" 2186 { KEYWORD_RETURN( TRY); } // CFA2187 YY_BREAK 2188 case 8 3:2207 { KEYWORD_RETURN(UNION); } 2208 YY_BREAK 2209 case 89: 2189 2210 YY_RULE_SETUP 2190 2211 #line 256 "lex.ll" 2191 { KEYWORD_RETURN( TYPE); } // CFA2192 YY_BREAK 2193 case 84:2212 { KEYWORD_RETURN(UNSIGNED); } 2213 YY_BREAK 2214 case 90: 2194 2215 YY_RULE_SETUP 2195 2216 #line 257 "lex.ll" 2196 { KEYWORD_RETURN( TYPEDEF); }2197 YY_BREAK 2198 case 85:2217 { KEYWORD_RETURN(VOID); } 2218 YY_BREAK 2219 case 91: 2199 2220 YY_RULE_SETUP 2200 2221 #line 258 "lex.ll" 2201 { KEYWORD_RETURN( TYPEOF); } // GCC2202 YY_BREAK 2203 case 86:2222 { KEYWORD_RETURN(VOLATILE); } 2223 YY_BREAK 2224 case 92: 2204 2225 YY_RULE_SETUP 2205 2226 #line 259 "lex.ll" 2206 { KEYWORD_RETURN( TYPEOF); }// GCC2207 YY_BREAK 2208 case 87:2227 { KEYWORD_RETURN(VOLATILE); } // GCC 2228 YY_BREAK 2229 case 93: 2209 2230 YY_RULE_SETUP 2210 2231 #line 260 "lex.ll" 2211 { KEYWORD_RETURN( TYPEOF); }// GCC2212 YY_BREAK 2213 case 88:2232 { KEYWORD_RETURN(VOLATILE); } // GCC 2233 YY_BREAK 2234 case 94: 2214 2235 YY_RULE_SETUP 2215 2236 #line 261 "lex.ll" 2216 { KEYWORD_RETURN(UNION); }2217 YY_BREAK2218 case 89:2219 YY_RULE_SETUP2220 #line 262 "lex.ll"2221 { KEYWORD_RETURN(UNSIGNED); }2222 YY_BREAK2223 case 90:2224 YY_RULE_SETUP2225 #line 263 "lex.ll"2226 { KEYWORD_RETURN(VOID); }2227 YY_BREAK2228 case 91:2229 YY_RULE_SETUP2230 #line 264 "lex.ll"2231 { KEYWORD_RETURN(VOLATILE); }2232 YY_BREAK2233 case 92:2234 YY_RULE_SETUP2235 #line 265 "lex.ll"2236 { KEYWORD_RETURN(VOLATILE); } // GCC2237 YY_BREAK2238 case 93:2239 YY_RULE_SETUP2240 #line 266 "lex.ll"2241 { KEYWORD_RETURN(VOLATILE); } // GCC2242 YY_BREAK2243 case 94:2244 YY_RULE_SETUP2245 #line 267 "lex.ll"2246 2237 { KEYWORD_RETURN(WHILE); } 2247 2238 YY_BREAK … … 2249 2240 case 95: 2250 2241 YY_RULE_SETUP 2251 #line 2 70"lex.ll"2242 #line 264 "lex.ll" 2252 2243 { IDENTIFIER_RETURN(); } 2253 2244 YY_BREAK 2254 2245 case 96: 2255 2246 YY_RULE_SETUP 2256 #line 2 71"lex.ll"2247 #line 265 "lex.ll" 2257 2248 { ATTRIBUTE_RETURN(); } 2258 2249 YY_BREAK 2259 2250 case 97: 2260 2251 YY_RULE_SETUP 2261 #line 2 72"lex.ll"2252 #line 266 "lex.ll" 2262 2253 { BEGIN BKQUOTE; } 2263 2254 YY_BREAK 2264 2255 case 98: 2265 2256 YY_RULE_SETUP 2266 #line 2 73"lex.ll"2257 #line 267 "lex.ll" 2267 2258 { IDENTIFIER_RETURN(); } 2268 2259 YY_BREAK 2269 2260 case 99: 2270 2261 YY_RULE_SETUP 2271 #line 2 74"lex.ll"2262 #line 268 "lex.ll" 2272 2263 { BEGIN 0; } 2273 2264 YY_BREAK … … 2275 2266 case 100: 2276 2267 YY_RULE_SETUP 2268 #line 271 "lex.ll" 2269 { NUMERIC_RETURN(ZERO); } // CFA 2270 YY_BREAK 2271 case 101: 2272 YY_RULE_SETUP 2273 #line 272 "lex.ll" 2274 { NUMERIC_RETURN(ONE); } // CFA 2275 YY_BREAK 2276 case 102: 2277 YY_RULE_SETUP 2278 #line 273 "lex.ll" 2279 { NUMERIC_RETURN(INTEGERconstant); } 2280 YY_BREAK 2281 case 103: 2282 YY_RULE_SETUP 2283 #line 274 "lex.ll" 2284 { NUMERIC_RETURN(INTEGERconstant); } 2285 YY_BREAK 2286 case 104: 2287 YY_RULE_SETUP 2288 #line 275 "lex.ll" 2289 { NUMERIC_RETURN(INTEGERconstant); } 2290 YY_BREAK 2291 case 105: 2292 YY_RULE_SETUP 2293 #line 276 "lex.ll" 2294 { NUMERIC_RETURN(FLOATINGconstant); } 2295 YY_BREAK 2296 case 106: 2297 YY_RULE_SETUP 2277 2298 #line 277 "lex.ll" 2278 { NUMERIC_RETURN(ZERO); } // CFA2279 YY_BREAK2280 case 101:2281 YY_RULE_SETUP2282 #line 278 "lex.ll"2283 { NUMERIC_RETURN(ONE); } // CFA2284 YY_BREAK2285 case 102:2286 YY_RULE_SETUP2287 #line 279 "lex.ll"2288 { NUMERIC_RETURN(INTEGERconstant); }2289 YY_BREAK2290 case 103:2291 YY_RULE_SETUP2292 #line 280 "lex.ll"2293 { NUMERIC_RETURN(INTEGERconstant); }2294 YY_BREAK2295 case 104:2296 YY_RULE_SETUP2297 #line 281 "lex.ll"2298 { NUMERIC_RETURN(INTEGERconstant); }2299 YY_BREAK2300 case 105:2301 YY_RULE_SETUP2302 #line 282 "lex.ll"2303 { NUMERIC_RETURN(FLOATINGconstant); }2304 YY_BREAK2305 case 106:2306 YY_RULE_SETUP2307 #line 283 "lex.ll"2308 2299 { NUMERIC_RETURN(FLOATINGconstant); } 2309 2300 YY_BREAK … … 2311 2302 case 107: 2312 2303 YY_RULE_SETUP 2313 #line 28 6"lex.ll"2304 #line 280 "lex.ll" 2314 2305 { BEGIN QUOTE; rm_underscore(); strtext = new std::string; *strtext += std::string( yytext ); } 2315 2306 YY_BREAK 2316 2307 case 108: 2317 2308 YY_RULE_SETUP 2318 #line 28 7"lex.ll"2309 #line 281 "lex.ll" 2319 2310 { *strtext += std::string( yytext ); } 2320 2311 YY_BREAK … … 2322 2313 /* rule 109 can match eol */ 2323 2314 YY_RULE_SETUP 2324 #line 28 8"lex.ll"2315 #line 282 "lex.ll" 2325 2316 { BEGIN 0; *strtext += std::string( yytext); RETURN_STR(CHARACTERconstant); } 2326 2317 YY_BREAK … … 2329 2320 case 110: 2330 2321 YY_RULE_SETUP 2331 #line 2 92"lex.ll"2322 #line 286 "lex.ll" 2332 2323 { BEGIN STRING; rm_underscore(); strtext = new std::string; *strtext += std::string( yytext ); } 2333 2324 YY_BREAK 2334 2325 case 111: 2335 2326 YY_RULE_SETUP 2336 #line 2 93"lex.ll"2327 #line 287 "lex.ll" 2337 2328 { *strtext += std::string( yytext ); } 2338 2329 YY_BREAK … … 2340 2331 /* rule 112 can match eol */ 2341 2332 YY_RULE_SETUP 2342 #line 2 94"lex.ll"2333 #line 288 "lex.ll" 2343 2334 { BEGIN 0; *strtext += std::string( yytext ); RETURN_STR(STRINGliteral); } 2344 2335 YY_BREAK … … 2347 2338 case 113: 2348 2339 YY_RULE_SETUP 2349 #line 29 8"lex.ll"2340 #line 292 "lex.ll" 2350 2341 { rm_underscore(); *strtext += std::string( yytext ); } 2351 2342 YY_BREAK … … 2353 2344 /* rule 114 can match eol */ 2354 2345 YY_RULE_SETUP 2355 #line 29 9"lex.ll"2346 #line 293 "lex.ll" 2356 2347 {} // continuation (ALSO HANDLED BY CPP) 2357 2348 YY_BREAK 2358 2349 case 115: 2359 2350 YY_RULE_SETUP 2360 #line 300"lex.ll"2351 #line 294 "lex.ll" 2361 2352 { *strtext += std::string( yytext ); } // unknown escape character 2362 2353 YY_BREAK … … 2364 2355 case 116: 2365 2356 YY_RULE_SETUP 2357 #line 297 "lex.ll" 2358 { ASCIIOP_RETURN(); } 2359 YY_BREAK 2360 case 117: 2361 YY_RULE_SETUP 2362 #line 298 "lex.ll" 2363 { ASCIIOP_RETURN(); } 2364 YY_BREAK 2365 case 118: 2366 YY_RULE_SETUP 2367 #line 299 "lex.ll" 2368 { ASCIIOP_RETURN(); } 2369 YY_BREAK 2370 case 119: 2371 YY_RULE_SETUP 2372 #line 300 "lex.ll" 2373 { ASCIIOP_RETURN(); } 2374 YY_BREAK 2375 case 120: 2376 YY_RULE_SETUP 2377 #line 301 "lex.ll" 2378 { ASCIIOP_RETURN(); } 2379 YY_BREAK 2380 case 121: 2381 YY_RULE_SETUP 2382 #line 302 "lex.ll" 2383 { ASCIIOP_RETURN(); } 2384 YY_BREAK 2385 case 122: 2386 YY_RULE_SETUP 2366 2387 #line 303 "lex.ll" 2367 { ASCIIOP_RETURN(); } 2368 YY_BREAK 2369 case 1 17:2388 { ASCIIOP_RETURN(); } // also operator 2389 YY_BREAK 2390 case 123: 2370 2391 YY_RULE_SETUP 2371 2392 #line 304 "lex.ll" 2372 2393 { ASCIIOP_RETURN(); } 2373 2394 YY_BREAK 2374 case 1 18:2395 case 124: 2375 2396 YY_RULE_SETUP 2376 2397 #line 305 "lex.ll" 2377 2398 { ASCIIOP_RETURN(); } 2378 2399 YY_BREAK 2379 case 1 19:2400 case 125: 2380 2401 YY_RULE_SETUP 2381 2402 #line 306 "lex.ll" 2382 { ASCIIOP_RETURN(); } 2383 YY_BREAK 2384 case 12 0:2403 { ASCIIOP_RETURN(); } // also operator 2404 YY_BREAK 2405 case 126: 2385 2406 YY_RULE_SETUP 2386 2407 #line 307 "lex.ll" 2387 { ASCIIOP_RETURN(); }2388 YY_BREAK2389 case 121:2390 YY_RULE_SETUP2391 #line 308 "lex.ll"2392 { ASCIIOP_RETURN(); }2393 YY_BREAK2394 case 122:2395 YY_RULE_SETUP2396 #line 309 "lex.ll"2397 { ASCIIOP_RETURN(); } // also operator2398 YY_BREAK2399 case 123:2400 YY_RULE_SETUP2401 #line 310 "lex.ll"2402 { ASCIIOP_RETURN(); }2403 YY_BREAK2404 case 124:2405 YY_RULE_SETUP2406 #line 311 "lex.ll"2407 { ASCIIOP_RETURN(); }2408 YY_BREAK2409 case 125:2410 YY_RULE_SETUP2411 #line 312 "lex.ll"2412 { ASCIIOP_RETURN(); } // also operator2413 YY_BREAK2414 case 126:2415 YY_RULE_SETUP2416 #line 313 "lex.ll"2417 2408 { NAMEDOP_RETURN(ELLIPSIS); } 2418 2409 YY_BREAK … … 2420 2411 case 127: 2421 2412 YY_RULE_SETUP 2422 #line 31 6"lex.ll"2413 #line 310 "lex.ll" 2423 2414 { RETURN_VAL('['); } 2424 2415 YY_BREAK 2425 2416 case 128: 2426 2417 YY_RULE_SETUP 2427 #line 31 7"lex.ll"2418 #line 311 "lex.ll" 2428 2419 { RETURN_VAL(']'); } 2429 2420 YY_BREAK 2430 2421 case 129: 2431 2422 YY_RULE_SETUP 2432 #line 31 8"lex.ll"2423 #line 312 "lex.ll" 2433 2424 { RETURN_VAL('{'); } 2434 2425 YY_BREAK 2435 2426 case 130: 2436 2427 YY_RULE_SETUP 2437 #line 31 9"lex.ll"2428 #line 313 "lex.ll" 2438 2429 { RETURN_VAL('}'); } 2439 2430 YY_BREAK … … 2441 2432 case 131: 2442 2433 YY_RULE_SETUP 2434 #line 316 "lex.ll" 2435 { ASCIIOP_RETURN(); } 2436 YY_BREAK 2437 case 132: 2438 YY_RULE_SETUP 2439 #line 317 "lex.ll" 2440 { ASCIIOP_RETURN(); } 2441 YY_BREAK 2442 case 133: 2443 YY_RULE_SETUP 2444 #line 318 "lex.ll" 2445 { ASCIIOP_RETURN(); } 2446 YY_BREAK 2447 case 134: 2448 YY_RULE_SETUP 2449 #line 319 "lex.ll" 2450 { ASCIIOP_RETURN(); } 2451 YY_BREAK 2452 case 135: 2453 YY_RULE_SETUP 2454 #line 320 "lex.ll" 2455 { ASCIIOP_RETURN(); } 2456 YY_BREAK 2457 case 136: 2458 YY_RULE_SETUP 2459 #line 321 "lex.ll" 2460 { ASCIIOP_RETURN(); } 2461 YY_BREAK 2462 case 137: 2463 YY_RULE_SETUP 2443 2464 #line 322 "lex.ll" 2444 2465 { ASCIIOP_RETURN(); } 2445 2466 YY_BREAK 2446 case 13 2:2467 case 138: 2447 2468 YY_RULE_SETUP 2448 2469 #line 323 "lex.ll" 2449 2470 { ASCIIOP_RETURN(); } 2450 2471 YY_BREAK 2451 case 13 3:2472 case 139: 2452 2473 YY_RULE_SETUP 2453 2474 #line 324 "lex.ll" 2454 2475 { ASCIIOP_RETURN(); } 2455 2476 YY_BREAK 2456 case 1 34:2477 case 140: 2457 2478 YY_RULE_SETUP 2458 2479 #line 325 "lex.ll" 2459 2480 { ASCIIOP_RETURN(); } 2460 2481 YY_BREAK 2461 case 1 35:2482 case 141: 2462 2483 YY_RULE_SETUP 2463 2484 #line 326 "lex.ll" 2464 2485 { ASCIIOP_RETURN(); } 2465 2486 YY_BREAK 2466 case 1 36:2487 case 142: 2467 2488 YY_RULE_SETUP 2468 2489 #line 327 "lex.ll" 2469 2490 { ASCIIOP_RETURN(); } 2470 2491 YY_BREAK 2471 case 1 37:2492 case 143: 2472 2493 YY_RULE_SETUP 2473 2494 #line 328 "lex.ll" 2474 2495 { ASCIIOP_RETURN(); } 2475 2496 YY_BREAK 2476 case 1 38:2497 case 144: 2477 2498 YY_RULE_SETUP 2478 2499 #line 329 "lex.ll" 2479 2500 { ASCIIOP_RETURN(); } 2480 2501 YY_BREAK 2481 case 139: 2482 YY_RULE_SETUP 2483 #line 330 "lex.ll" 2484 { ASCIIOP_RETURN(); } 2485 YY_BREAK 2486 case 140: 2502 case 145: 2487 2503 YY_RULE_SETUP 2488 2504 #line 331 "lex.ll" 2489 { ASCIIOP_RETURN(); }2490 YY_BREAK 2491 case 14 1:2505 { NAMEDOP_RETURN(ICR); } 2506 YY_BREAK 2507 case 146: 2492 2508 YY_RULE_SETUP 2493 2509 #line 332 "lex.ll" 2494 { ASCIIOP_RETURN(); }2495 YY_BREAK 2496 case 14 2:2510 { NAMEDOP_RETURN(DECR); } 2511 YY_BREAK 2512 case 147: 2497 2513 YY_RULE_SETUP 2498 2514 #line 333 "lex.ll" 2499 { ASCIIOP_RETURN(); }2500 YY_BREAK 2501 case 14 3:2515 { NAMEDOP_RETURN(EQ); } 2516 YY_BREAK 2517 case 148: 2502 2518 YY_RULE_SETUP 2503 2519 #line 334 "lex.ll" 2504 { ASCIIOP_RETURN(); }2505 YY_BREAK 2506 case 14 4:2520 { NAMEDOP_RETURN(NE); } 2521 YY_BREAK 2522 case 149: 2507 2523 YY_RULE_SETUP 2508 2524 #line 335 "lex.ll" 2509 { ASCIIOP_RETURN(); } 2510 YY_BREAK 2511 case 145: 2525 { NAMEDOP_RETURN(LS); } 2526 YY_BREAK 2527 case 150: 2528 YY_RULE_SETUP 2529 #line 336 "lex.ll" 2530 { NAMEDOP_RETURN(RS); } 2531 YY_BREAK 2532 case 151: 2512 2533 YY_RULE_SETUP 2513 2534 #line 337 "lex.ll" 2514 { NAMEDOP_RETURN( ICR); }2515 YY_BREAK 2516 case 1 46:2535 { NAMEDOP_RETURN(LE); } 2536 YY_BREAK 2537 case 152: 2517 2538 YY_RULE_SETUP 2518 2539 #line 338 "lex.ll" 2519 { NAMEDOP_RETURN( DECR); }2520 YY_BREAK 2521 case 1 47:2540 { NAMEDOP_RETURN(GE); } 2541 YY_BREAK 2542 case 153: 2522 2543 YY_RULE_SETUP 2523 2544 #line 339 "lex.ll" 2524 { NAMEDOP_RETURN( EQ); }2525 YY_BREAK 2526 case 1 48:2545 { NAMEDOP_RETURN(ANDAND); } 2546 YY_BREAK 2547 case 154: 2527 2548 YY_RULE_SETUP 2528 2549 #line 340 "lex.ll" 2529 { NAMEDOP_RETURN( NE); }2530 YY_BREAK 2531 case 1 49:2550 { NAMEDOP_RETURN(OROR); } 2551 YY_BREAK 2552 case 155: 2532 2553 YY_RULE_SETUP 2533 2554 #line 341 "lex.ll" 2534 { NAMEDOP_RETURN( LS); }2535 YY_BREAK 2536 case 15 0:2555 { NAMEDOP_RETURN(ARROW); } 2556 YY_BREAK 2557 case 156: 2537 2558 YY_RULE_SETUP 2538 2559 #line 342 "lex.ll" 2539 { NAMEDOP_RETURN( RS); }2540 YY_BREAK 2541 case 15 1:2560 { NAMEDOP_RETURN(PLUSassign); } 2561 YY_BREAK 2562 case 157: 2542 2563 YY_RULE_SETUP 2543 2564 #line 343 "lex.ll" 2544 { NAMEDOP_RETURN( LE); }2545 YY_BREAK 2546 case 15 2:2565 { NAMEDOP_RETURN(MINUSassign); } 2566 YY_BREAK 2567 case 158: 2547 2568 YY_RULE_SETUP 2548 2569 #line 344 "lex.ll" 2549 { NAMEDOP_RETURN( GE); }2550 YY_BREAK 2551 case 15 3:2570 { NAMEDOP_RETURN(MULTassign); } 2571 YY_BREAK 2572 case 159: 2552 2573 YY_RULE_SETUP 2553 2574 #line 345 "lex.ll" 2554 { NAMEDOP_RETURN( ANDAND); }2555 YY_BREAK 2556 case 1 54:2575 { NAMEDOP_RETURN(DIVassign); } 2576 YY_BREAK 2577 case 160: 2557 2578 YY_RULE_SETUP 2558 2579 #line 346 "lex.ll" 2559 { NAMEDOP_RETURN( OROR); }2560 YY_BREAK 2561 case 1 55:2580 { NAMEDOP_RETURN(MODassign); } 2581 YY_BREAK 2582 case 161: 2562 2583 YY_RULE_SETUP 2563 2584 #line 347 "lex.ll" 2564 { NAMEDOP_RETURN(A RROW); }2565 YY_BREAK 2566 case 1 56:2585 { NAMEDOP_RETURN(ANDassign); } 2586 YY_BREAK 2587 case 162: 2567 2588 YY_RULE_SETUP 2568 2589 #line 348 "lex.ll" 2569 { NAMEDOP_RETURN( PLUSassign); }2570 YY_BREAK 2571 case 1 57:2590 { NAMEDOP_RETURN(ORassign); } 2591 YY_BREAK 2592 case 163: 2572 2593 YY_RULE_SETUP 2573 2594 #line 349 "lex.ll" 2574 { NAMEDOP_RETURN( MINUSassign); }2575 YY_BREAK 2576 case 1 58:2595 { NAMEDOP_RETURN(ERassign); } 2596 YY_BREAK 2597 case 164: 2577 2598 YY_RULE_SETUP 2578 2599 #line 350 "lex.ll" 2579 { NAMEDOP_RETURN( MULTassign); }2580 YY_BREAK 2581 case 1 59:2600 { NAMEDOP_RETURN(LSassign); } 2601 YY_BREAK 2602 case 165: 2582 2603 YY_RULE_SETUP 2583 2604 #line 351 "lex.ll" 2584 { NAMEDOP_RETURN(DIVassign); }2585 YY_BREAK2586 case 160:2587 YY_RULE_SETUP2588 #line 352 "lex.ll"2589 { NAMEDOP_RETURN(MODassign); }2590 YY_BREAK2591 case 161:2592 YY_RULE_SETUP2593 #line 353 "lex.ll"2594 { NAMEDOP_RETURN(ANDassign); }2595 YY_BREAK2596 case 162:2597 YY_RULE_SETUP2598 #line 354 "lex.ll"2599 { NAMEDOP_RETURN(ORassign); }2600 YY_BREAK2601 case 163:2602 YY_RULE_SETUP2603 #line 355 "lex.ll"2604 { NAMEDOP_RETURN(ERassign); }2605 YY_BREAK2606 case 164:2607 YY_RULE_SETUP2608 #line 356 "lex.ll"2609 { NAMEDOP_RETURN(LSassign); }2610 YY_BREAK2611 case 165:2612 YY_RULE_SETUP2613 #line 357 "lex.ll"2614 2605 { NAMEDOP_RETURN(RSassign); } 2615 2606 YY_BREAK … … 2617 2608 case 166: 2618 2609 YY_RULE_SETUP 2619 #line 3 60"lex.ll"2610 #line 354 "lex.ll" 2620 2611 { IDENTIFIER_RETURN(); } // unary 2621 2612 YY_BREAK 2622 2613 case 167: 2623 2614 YY_RULE_SETUP 2624 #line 3 61"lex.ll"2615 #line 355 "lex.ll" 2625 2616 { IDENTIFIER_RETURN(); } 2626 2617 YY_BREAK 2627 2618 case 168: 2628 2619 YY_RULE_SETUP 2629 #line 3 62"lex.ll"2620 #line 356 "lex.ll" 2630 2621 { IDENTIFIER_RETURN(); } // binary 2631 2622 YY_BREAK … … 2658 2649 case 169: 2659 2650 YY_RULE_SETUP 2660 #line 38 9"lex.ll"2651 #line 383 "lex.ll" 2661 2652 { 2662 2653 // 1 or 2 character unary operator ? … … 2673 2664 case 170: 2674 2665 YY_RULE_SETUP 2675 #line 401"lex.ll"2666 #line 395 "lex.ll" 2676 2667 { printf("unknown character(s):\"%s\" on line %d\n", yytext, yylineno); } 2677 2668 YY_BREAK 2678 2669 case 171: 2679 2670 YY_RULE_SETUP 2680 #line 403"lex.ll"2671 #line 397 "lex.ll" 2681 2672 ECHO; 2682 2673 YY_BREAK 2683 #line 26 84"Parser/lex.cc"2674 #line 2675 "Parser/lex.cc" 2684 2675 case YY_STATE_EOF(INITIAL): 2685 2676 case YY_STATE_EOF(COMMENT): … … 3013 3004 3014 3005 return yy_is_jam ? 0 : yy_current_state; 3015 }3016 3017 static void yyunput (int c, register char * yy_bp )3018 {3019 register char *yy_cp;3020 3021 yy_cp = (yy_c_buf_p);3022 3023 /* undo effects of setting up yytext */3024 *yy_cp = (yy_hold_char);3025 3026 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )3027 { /* need to shift things up to make room */3028 /* +2 for EOB chars. */3029 register int number_to_move = (yy_n_chars) + 2;3030 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[3031 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];3032 register char *source =3033 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];3034 3035 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )3036 *--dest = *--source;3037 3038 yy_cp += (int) (dest - source);3039 yy_bp += (int) (dest - source);3040 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =3041 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;3042 3043 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )3044 YY_FATAL_ERROR( "flex scanner push-back overflow" );3045 }3046 3047 *--yy_cp = (char) c;3048 3049 if ( c == '\n' ){3050 --yylineno;3051 }3052 3053 (yytext_ptr) = yy_bp;3054 (yy_hold_char) = *yy_cp;3055 (yy_c_buf_p) = yy_cp;3056 3006 } 3057 3007 … … 3697 3647 #define YYTABLES_NAME "yytables" 3698 3648 3699 #line 403"lex.ll"3649 #line 397 "lex.ll" 3700 3650 3701 3651 -
src/Parser/lex.h
rcd623a4 r5f2f2d7 10 10 // Created On : Sat Sep 22 08:58:10 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 6 07:44:39201513 // Update Count : 3 3812 // Last Modified On : Mon Jun 8 20:28:48 2015 13 // Update Count : 341 14 14 // 15 15 … … 18 18 19 19 int yylex(); 20 void yyerror( char *);20 void yyerror( const char * ); 21 21 22 22 // External declarations for information sharing between lexer and scanner … … 35 35 class Token { 36 36 public: 37 std::string *str; 37 std::string *str; // must be pointer as used in union 38 38 Location loc; 39 39 … … 44 44 45 45 // Local Variables: // 46 // fill-column: 110 //47 46 // tab-width: 4 // 48 47 // mode: c++ // -
src/Parser/lex.ll
rcd623a4 r5f2f2d7 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sun Jun 7 07:14:16201513 * Update Count : 3 7412 * Last Modified On : Mon Jun 8 20:24:15 2015 13 * Update Count : 381 14 14 */ 15 15 16 16 %option yylineno 17 %option nounput 17 18 18 19 %{ … … 32 33 std::string *strtext; // accumulate parts of character and string constant value 33 34 35 #define RETURN_LOCN(x) yylval.tok.loc.file = yyfilename; yylval.tok.loc.line = yylineno; return(x) 36 #define RETURN_VAL(x) yylval.tok.str = new std::string( yytext ); RETURN_LOCN(x) 37 #define RETURN_CHAR(x) yylval.tok.str = NULL; RETURN_LOCN(x) 38 #define RETURN_STR(x) yylval.tok.str = strtext; RETURN_LOCN(x) 39 34 40 #define WHITE_RETURN(x) // do nothing 35 41 #define NEWLINE_RETURN() WHITE_RETURN('\n') 36 #define RETURN_VAL(x) yylval.tok.str = new std::string( yytext ); \ 37 yylval.tok.loc.file = yyfilename; \ 38 yylval.tok.loc.line = yylineno; \ 39 return(x) 40 #define RETURN_STR(x) yylval.tok.str = strtext; \ 41 yylval.tok.loc.file = yyfilename; \ 42 yylval.tok.loc.line = yylineno; \ 43 return(x) 44 45 #define KEYWORD_RETURN(x) RETURN_VAL(x) // keyword 42 #define ASCIIOP_RETURN() RETURN_CHAR((int)yytext[0]) // single character operator 43 #define NAMEDOP_RETURN(x) RETURN_VAL(x) // multichar operator, with a name 44 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL(x) // numeric constant 45 #define KEYWORD_RETURN(x) RETURN_CHAR(x) // keyword 46 46 #define IDENTIFIER_RETURN() RETURN_VAL((typedefTable.isIdentifier(yytext) ? IDENTIFIER : typedefTable.isTypedef(yytext) ? TYPEDEFname : TYPEGENname)) 47 //#define ATTRIBUTE_RETURN() RETURN_VAL((typedefTable.isIdentifier(yytext) ? ATTR_IDENTIFIER : typedefTable.isTypedef(yytext) ? ATTR_TYPEDEFname : ATTR_TYPEGENname))48 47 #define ATTRIBUTE_RETURN() RETURN_VAL(ATTR_IDENTIFIER) 49 50 #define ASCIIOP_RETURN() RETURN_VAL((int)yytext[0]) // single character operator51 #define NAMEDOP_RETURN(x) RETURN_VAL(x) // multichar operator, with a name52 53 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL(x) // numeric constant54 48 55 49 void rm_underscore() { -
src/Parser/module.mk
rcd623a4 r5f2f2d7 11 11 ## Created On : Sat May 16 15:29:09 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Thu Jun 4 09:39:00201514 ## Update Count : 8 613 ## Last Modified On : Mon Jun 8 20:23:47 2015 14 ## Update Count : 87 15 15 ############################################################################### 16 16 -
src/Parser/parser.cc
rcd623a4 r5f2f2d7 9266 9266 // ----end of grammar---- 9267 9267 9268 void yyerror( char *string ) { 9269 using std::cout; 9270 using std::endl; 9271 cout << "Error "; 9268 void yyerror( const char * ) { 9269 std::cout << "Error "; 9272 9270 if ( yyfilename ) { 9273 cout << "in file " << yyfilename << " ";9274 } 9275 cout << "at line " << yylineno << " reading token \"" << *(yylval.tok.str) << "\"" <<endl;9271 std::cout << "in file " << yyfilename << " "; 9272 } // if 9273 std::cout << "at line " << yylineno << " reading token \"" << *(yylval.tok.str) << "\"" << std::endl; 9276 9274 } 9277 9275 9278 9276 // Local Variables: // 9279 // fill-column: 110 //9280 9277 // tab-width: 4 // 9281 9278 // mode: c++ // -
src/Parser/parser.yy
rcd623a4 r5f2f2d7 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 6 20:18:36201513 // Update Count : 10 2612 // Last Modified On : Mon Jun 8 20:31:07 2015 13 // Update Count : 1030 14 14 // 15 15 … … 2717 2717 // ----end of grammar---- 2718 2718 2719 void yyerror( char *string ) { 2720 using std::cout; 2721 using std::endl; 2722 cout << "Error "; 2719 void yyerror( const char * ) { 2720 std::cout << "Error "; 2723 2721 if ( yyfilename ) { 2724 cout << "in file " << yyfilename << " ";2725 } 2726 cout << "at line " << yylineno << " reading token \"" << *(yylval.tok.str) << "\"" <<endl;2722 std::cout << "in file " << yyfilename << " "; 2723 } // if 2724 std::cout << "at line " << yylineno << " reading token \"" << *(yylval.tok.str) << "\"" << std::endl; 2727 2725 } 2728 2726 2729 2727 // Local Variables: // 2730 // fill-column: 110 //2731 2728 // tab-width: 4 // 2732 2729 // mode: c++ //
Note:
See TracChangeset
for help on using the changeset viewer.