Changeset 2415 for trunk/src/kash/generated/arith_lex.c
- Timestamp:
- Sep 14, 2010, 1:13:20 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/generated/arith_lex.c
r1233 r2415 1 #line 2 "/ home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c"2 3 #line 4 "/ home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c"1 #line 2 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/kash/arith_lex.c" 2 3 #line 4 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/kash/arith_lex.c" 4 4 5 5 #define YY_INT_ALIGNED short int … … 478 478 #define YY_RESTORE_YY_MORE_OFFSET 479 479 char *yytext; 480 #line 1 "arith_lex.l" 481 #line 3 "arith_lex.l" 480 #line 1 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 481 #define YY_NO_INPUT 1 482 /** @todo %option reentrant */ 483 #line 33 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 482 484 /* $NetBSD: arith_lex.l,v 1.13 2005/03/21 22:37:09 dsl Exp $ */ 483 485 … … 522 524 #endif 523 525 526 #include <stdio.h> 524 527 #include "arith.h" 525 528 #include "error.h" … … 535 538 result = (*buf = *arith_buf++) ? 1 : YY_NULL; 536 539 #define YY_NO_UNPUT 537 #line 538 "/home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c" 540 541 /* Avoid unnecessary libc bits. */ 542 #undef ECHO 543 #define ECHO \ 544 do {} while (0) 545 #undef stdin 546 #define stdin \ 547 NULL 548 #undef stdout 549 #define stdout \ 550 NULL 551 #define YY_FATAL_ERROR(msg) \ 552 error(arith_psh, "arith: fatal error: %s", msg) 553 #line 554 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/kash/arith_lex.c" 538 554 539 555 #define INITIAL 0 … … 565 581 #endif 566 582 567 static void yyunput (int c,char *buf_ptr );568 569 583 #ifndef yytext_ptr 570 584 static void yy_flex_strncpy (char *,yyconst char *,int ); … … 688 702 register int yy_act; 689 703 690 #line 60 "arith_lex.l"691 692 #line 693 "/home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c"704 #line 104 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 705 706 #line 707 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/kash/arith_lex.c" 693 707 694 708 if ( !(yy_init) ) … … 749 763 ++yy_cp; 750 764 } 751 while ( yy_base[yy_current_state] != 48 ); 765 while ( yy_current_state != 38 ); 766 yy_cp = (yy_last_accepting_cpos); 767 yy_current_state = (yy_last_accepting_state); 752 768 753 769 yy_find_action: 754 770 yy_act = yy_accept[yy_current_state]; 755 if ( yy_act == 0 )756 { /* have to back up */757 yy_cp = (yy_last_accepting_cpos);758 yy_current_state = (yy_last_accepting_state);759 yy_act = yy_accept[yy_current_state];760 }761 771 762 772 YY_DO_BEFORE_ACTION; … … 776 786 /* rule 1 can match eol */ 777 787 YY_RULE_SETUP 778 #line 61 "arith_lex.l"788 #line 105 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 779 789 { ; } 780 790 YY_BREAK 781 791 case 2: 782 792 YY_RULE_SETUP 783 #line 62 "arith_lex.l"793 #line 106 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 784 794 { yylval = strtol(yytext, 0, 0); return(ARITH_NUM); } 785 795 YY_BREAK 786 796 case 3: 787 797 YY_RULE_SETUP 788 #line 63 "arith_lex.l"798 #line 107 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 789 799 { yylval = strtol(yytext, 0, 0); return(ARITH_NUM); } 790 800 YY_BREAK 791 801 case 4: 792 802 YY_RULE_SETUP 793 #line 64 "arith_lex.l"803 #line 108 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 794 804 { yylval = strtol(yytext, 0, 0); return(ARITH_NUM); } 795 805 YY_BREAK 796 806 case 5: 797 807 YY_RULE_SETUP 798 #line 65 "arith_lex.l"808 #line 109 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 799 809 { char *v = lookupvar(arith_psh, yytext); 800 810 if (v) { … … 808 818 case 6: 809 819 YY_RULE_SETUP 810 #line 73 "arith_lex.l"820 #line 117 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 811 821 { return(ARITH_LPAREN); } 812 822 YY_BREAK 813 823 case 7: 814 824 YY_RULE_SETUP 815 #line 74 "arith_lex.l"825 #line 118 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 816 826 { return(ARITH_RPAREN); } 817 827 YY_BREAK 818 828 case 8: 819 829 YY_RULE_SETUP 820 #line 75 "arith_lex.l"830 #line 119 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 821 831 { return(ARITH_OR); } 822 832 YY_BREAK 823 833 case 9: 824 834 YY_RULE_SETUP 825 #line 76 "arith_lex.l"835 #line 120 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 826 836 { return(ARITH_AND); } 827 837 YY_BREAK 828 838 case 10: 829 839 YY_RULE_SETUP 830 #line 77 "arith_lex.l"840 #line 121 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 831 841 { return(ARITH_BOR); } 832 842 YY_BREAK 833 843 case 11: 834 844 YY_RULE_SETUP 835 #line 78 "arith_lex.l"845 #line 122 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 836 846 { return(ARITH_BXOR); } 837 847 YY_BREAK 838 848 case 12: 839 849 YY_RULE_SETUP 840 #line 79 "arith_lex.l"850 #line 123 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 841 851 { return(ARITH_BAND); } 842 852 YY_BREAK 843 853 case 13: 844 854 YY_RULE_SETUP 845 #line 80 "arith_lex.l"855 #line 124 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 846 856 { return(ARITH_EQ); } 847 857 YY_BREAK 848 858 case 14: 849 859 YY_RULE_SETUP 850 #line 81 "arith_lex.l"860 #line 125 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 851 861 { return(ARITH_NE); } 852 862 YY_BREAK 853 863 case 15: 854 864 YY_RULE_SETUP 855 #line 82 "arith_lex.l"865 #line 126 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 856 866 { return(ARITH_GT); } 857 867 YY_BREAK 858 868 case 16: 859 869 YY_RULE_SETUP 860 #line 83 "arith_lex.l"870 #line 127 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 861 871 { return(ARITH_GE); } 862 872 YY_BREAK 863 873 case 17: 864 874 YY_RULE_SETUP 865 #line 84 "arith_lex.l"875 #line 128 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 866 876 { return(ARITH_LT); } 867 877 YY_BREAK 868 878 case 18: 869 879 YY_RULE_SETUP 870 #line 85 "arith_lex.l"880 #line 129 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 871 881 { return(ARITH_LE); } 872 882 YY_BREAK 873 883 case 19: 874 884 YY_RULE_SETUP 875 #line 86 "arith_lex.l"885 #line 130 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 876 886 { return(ARITH_LSHIFT); } 877 887 YY_BREAK 878 888 case 20: 879 889 YY_RULE_SETUP 880 #line 87 "arith_lex.l"890 #line 131 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 881 891 { return(ARITH_RSHIFT); } 882 892 YY_BREAK 883 893 case 21: 884 894 YY_RULE_SETUP 885 #line 88 "arith_lex.l"895 #line 132 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 886 896 { return(ARITH_MUL); } 887 897 YY_BREAK 888 898 case 22: 889 899 YY_RULE_SETUP 890 #line 89 "arith_lex.l"900 #line 133 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 891 901 { return(ARITH_DIV); } 892 902 YY_BREAK 893 903 case 23: 894 904 YY_RULE_SETUP 895 #line 90 "arith_lex.l"905 #line 134 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 896 906 { return(ARITH_REM); } 897 907 YY_BREAK 898 908 case 24: 899 909 YY_RULE_SETUP 900 #line 91 "arith_lex.l"910 #line 135 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 901 911 { return(ARITH_ADD); } 902 912 YY_BREAK 903 913 case 25: 904 914 YY_RULE_SETUP 905 #line 92 "arith_lex.l"915 #line 136 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 906 916 { return(ARITH_SUB); } 907 917 YY_BREAK 908 918 case 26: 909 919 YY_RULE_SETUP 910 #line 93 "arith_lex.l"920 #line 137 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 911 921 { return(ARITH_BNOT); } 912 922 YY_BREAK 913 923 case 27: 914 924 YY_RULE_SETUP 915 #line 94 "arith_lex.l"925 #line 138 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 916 926 { return(ARITH_NOT); } 917 927 YY_BREAK 918 928 case 28: 919 929 YY_RULE_SETUP 920 #line 95 "arith_lex.l"930 #line 139 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 921 931 { error(arith_psh, "arith: syntax error: \"%s\"", arith_startbuf); } 922 932 YY_BREAK 923 933 case 29: 924 934 YY_RULE_SETUP 925 #line 96 "arith_lex.l"935 #line 140 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 926 936 ECHO; 927 937 YY_BREAK 928 #line 9 29 "/home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c"938 #line 939 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/kash/arith_lex.c" 929 939 case YY_STATE_EOF(INITIAL): 930 940 yyterminate(); … … 993 1003 else 994 1004 { 995 yy_cp = (yy_c_buf_p); 1005 yy_cp = (yy_last_accepting_cpos); 1006 yy_current_state = (yy_last_accepting_state); 996 1007 goto yy_find_action; 997 1008 } … … 1247 1258 } 1248 1259 1249 static void yyunput (int c, register char * yy_bp )1250 {1251 register char *yy_cp;1252 1253 yy_cp = (yy_c_buf_p);1254 1255 /* undo effects of setting up yytext */1256 *yy_cp = (yy_hold_char);1257 1258 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )1259 { /* need to shift things up to make room */1260 /* +2 for EOB chars. */1261 register int number_to_move = (yy_n_chars) + 2;1262 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[1263 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];1264 register char *source =1265 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];1266 1267 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )1268 *--dest = *--source;1269 1270 yy_cp += (int) (dest - source);1271 yy_bp += (int) (dest - source);1272 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =1273 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;1274 1275 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )1276 YY_FATAL_ERROR( "flex scanner push-back overflow" );1277 }1278 1279 *--yy_cp = (char) c;1280 1281 (yytext_ptr) = yy_bp;1282 (yy_hold_char) = *yy_cp;1283 (yy_c_buf_p) = yy_cp;1284 }1285 1286 1260 #ifndef YY_NO_INPUT 1287 1261 #ifdef __cplusplus … … 1332 1306 { 1333 1307 if ( yywrap( ) ) 1334 return EOF;1308 return 0; 1335 1309 1336 1310 if ( ! (yy_did_buffer_switch_on_eof) ) … … 1468 1442 } 1469 1443 1470 #ifndef _UNISTD_H /* assume unistd.h has isatty() for us */1471 #ifdef __cplusplus1472 extern "C" {1473 #endif1474 #ifdef __THROW /* this is a gnuism */1475 extern int isatty (int ) __THROW;1476 #else1477 extern int isatty (int );1478 #endif1479 #ifdef __cplusplus1480 }1481 #endif1482 #endif1483 1484 1444 /* Initializes or reinitializes a buffer. 1485 1445 * This function is sometimes called more than once on the same buffer, … … 1505 1465 } 1506 1466 1507 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) :0;1467 b->yy_is_interactive = 0; 1508 1468 1509 1469 errno = oerrno; … … 1631 1591 } 1632 1592 1633 /** Setup the input buffer state to scan directly from a user-specified character buffer.1634 * @param base the character buffer1635 * @param size the size in bytes of the character buffer1636 *1637 * @return the newly allocated buffer state object.1638 */1639 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )1640 {1641 YY_BUFFER_STATE b;1642 1643 if ( size < 2 ||1644 base[size-2] != YY_END_OF_BUFFER_CHAR ||1645 base[size-1] != YY_END_OF_BUFFER_CHAR )1646 /* They forgot to leave room for the EOB's. */1647 return 0;1648 1649 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );1650 if ( ! b )1651 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );1652 1653 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */1654 b->yy_buf_pos = b->yy_ch_buf = base;1655 b->yy_is_our_buffer = 0;1656 b->yy_input_file = 0;1657 b->yy_n_chars = b->yy_buf_size;1658 b->yy_is_interactive = 0;1659 b->yy_at_bol = 1;1660 b->yy_fill_buffer = 0;1661 b->yy_buffer_status = YY_BUFFER_NEW;1662 1663 yy_switch_to_buffer(b );1664 1665 return b;1666 }1667 1668 /** Setup the input buffer state to scan a string. The next call to yylex() will1669 * scan from a @e copy of @a str.1670 * @param str a NUL-terminated string to scan1671 *1672 * @return the newly allocated buffer state object.1673 * @note If you want to scan bytes that may contain NUL values, then use1674 * yy_scan_bytes() instead.1675 */1676 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )1677 {1678 1679 return yy_scan_bytes(yystr,strlen(yystr) );1680 }1681 1682 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will1683 * scan from a @e copy of @a bytes.1684 * @param bytes the byte buffer to scan1685 * @param len the number of bytes in the buffer pointed to by @a bytes.1686 *1687 * @return the newly allocated buffer state object.1688 */1689 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )1690 {1691 YY_BUFFER_STATE b;1692 char *buf;1693 yy_size_t n;1694 int i;1695 1696 /* Get memory for full buffer, including space for trailing EOB's. */1697 n = _yybytes_len + 2;1698 buf = (char *) yyalloc(n );1699 if ( ! buf )1700 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );1701 1702 for ( i = 0; i < _yybytes_len; ++i )1703 buf[i] = yybytes[i];1704 1705 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;1706 1707 b = yy_scan_buffer(buf,n );1708 if ( ! b )1709 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );1710 1711 /* It's okay to grow etc. this buffer, and we should throw it1712 * away when we're done.1713 */1714 b->yy_is_our_buffer = 1;1715 1716 return b;1717 }1718 1719 1593 #ifndef YY_EXIT_FAILURE 1720 1594 #define YY_EXIT_FAILURE 2 … … 1746 1620 /* Accessor methods (get/set functions) to struct members. */ 1747 1621 1748 /** Get the current line number.1749 *1750 */1751 int yyget_lineno (void)1752 {1753 1754 return yylineno;1755 }1756 1757 /** Get the input stream.1758 *1759 */1760 FILE *yyget_in (void)1761 {1762 return yyin;1763 }1764 1765 /** Get the output stream.1766 *1767 */1768 FILE *yyget_out (void)1769 {1770 return yyout;1771 }1772 1773 /** Get the length of the current token.1774 *1775 */1776 int yyget_leng (void)1777 {1778 return yyleng;1779 }1780 1781 1622 /** Get the current token. 1782 1623 * 1783 1624 */ 1784 1785 char *yyget_text (void)1786 {1787 return yytext;1788 }1789 1790 /** Set the current line number.1791 * @param line_number1792 *1793 */1794 void yyset_lineno (int line_number )1795 {1796 1797 yylineno = line_number;1798 }1799 1800 /** Set the input stream. This does not discard the current1801 * input buffer.1802 * @param in_str A readable stream.1803 *1804 * @see yy_switch_to_buffer1805 */1806 void yyset_in (FILE * in_str )1807 {1808 yyin = in_str ;1809 }1810 1811 void yyset_out (FILE * out_str )1812 {1813 yyout = out_str ;1814 }1815 1816 int yyget_debug (void)1817 {1818 return yy_flex_debug;1819 }1820 1821 void yyset_debug (int bdebug )1822 {1823 yy_flex_debug = bdebug ;1824 }1825 1625 1826 1626 static int yy_init_globals (void) … … 1898 1698 #endif 1899 1699 1900 void *yyalloc (yy_size_t size )1901 {1902 return (void *) malloc( size );1903 }1904 1905 void *yyrealloc (void * ptr, yy_size_t size )1906 {1907 /* The cast to (char *) in the following accommodates both1908 * implementations that use char* generic pointers, and those1909 * that use void* generic pointers. It works with the latter1910 * because both ANSI C and C++ allow castless assignment from1911 * any pointer type to void*, and deal with argument conversions1912 * as though doing an assignment.1913 */1914 return (void *) realloc( (char *) ptr, size );1915 }1916 1917 void yyfree (void * ptr )1918 {1919 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */1920 }1921 1922 1700 #define YYTABLES_NAME "yytables" 1923 1701 1924 #line 96 "arith_lex.l"1702 #line 140 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l" 1925 1703 1926 1704 … … 1933 1711 } 1934 1712 1713 void * 1714 yyalloc(yy_size_t cb) 1715 { 1716 return sh_malloc(NULL, cb); 1717 } 1718 1719 void * 1720 yyrealloc(void *pv,yy_size_t cb) 1721 { 1722 return sh_realloc(NULL, pv, cb); 1723 } 1724 1725 void 1726 yyfree(void *pv) 1727 { 1728 sh_free(NULL, pv); 1729 } 1730 1731
Note:
See TracChangeset
for help on using the changeset viewer.