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
|
#define YY_CHAR unsigned char
#line 1 "../pars/flexskel.cc"
/* A lexical scanner generated by flex */
/* scanner skeleton version:
* $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
*/
/* MODIFIED FOR C++ CLASS BY Alain Coetmeur: coetmeur(at)icdc.fr */
/* Note that (at) mean the 'at' symbol that I cannot write */
/* because it is expanded to the class name */
/* made at Informatique-CDC, Research&development department */
/* company from the Caisse Des Depots et Consignations */
/* institutional financial group (say 'Cat Doc Cad') */
/* theses symbols are added before this file */
/* #define YY_CHAR 'unsigned char' if 8bit or 'char' if 7bit */
/* #define FLEX_DEBUG if debug mode */
#define FLEX_SCANNER
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
/* Old MSC, before c7 */
#ifdef MSDOS
#ifndef _MSDOS
#define _MSDOS
#endif
#endif
/* turboc */
#ifdef __MSDOS__
#ifndef _MSDOS
#define _MSDOS
#endif
#endif
#ifdef __cplusplus
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#ifndef _MSDOS
#include <osfcn.h>
#endif
#else /* ! __cplusplus */
#ifdef __STDC__
#ifdef __GNUC__
#include <stddef.h>
void *malloc( size_t );
void free( void* );
int read();
#else
#include <stdlib.h>
#endif /* __GNUC__ */
#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
#ifdef __TURBOC__
#define YY_USE_CONST
#endif
#include <stdio.h>
/*********************************************/
/* COMPILER DEPENDENT MACROS */
/*********************************************/
/* use prototypes in function declarations */
/* the "const" storage-class-modifier is valid */
#ifndef YY_USE_CONST
#define const
#endif
/* use prototypes in function declarations */
#ifndef YY_PROTO
#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif
#endif
/*********************/
/* parameters */
/* amount of stuff to slurp up with each read */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif
/* size of default input buffer */
#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2)
#endif
/***********************************/
/* to be redefined for application */
/* returned upon end-of-file */
#define YY_END_TOK 0
/* no semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#define yyterminate() return ( YY_NULL )
/* code executed at the end of each rule */
#define YY_BREAK break;
/* #define YY_USER_ACTION */
/* #define YY_USER_INIT */
#ifndef YY_USE_CLASS
/* copy whatever the last rule matched to the standard output */
/* cast to (char *) is because for 8-bit chars, yy___text is (unsigned char *) */
/* this used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite()
*/
#define ECHO (void) fwrite( (char *) yy___text, yy___leng, 1, yy___out )
/* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#ifdef _MSDOS
#define YY_INPUT(buf,result,max_size) \
if ( (result = fread(buf,1,max_size,yy___in)) < 0 ) \
YY_FATAL_ERROR( "fread() in flex scanner failed" );
#else
#define YY_INPUT(buf,result,max_size) \
if ( (result = read( fileno(yy___in), (char *) buf, max_size )) < 0 ) \
YY_FATAL_ERROR( "read() in flex scanner failed" );
#endif
/* report a fatal error */
/* The funky do-while is used to turn this macro definition into
* a single C statement (which needs a semi-colon terminator).
* This avoids problems with code like:
*
* if ( something_happens )
* YY_FATAL_ERROR( "oops, the something happened" );
* else
* everything_okay();
*
* Prior to using the do-while the compiler would get upset at the
* "else" because it interpreted the "if" statement as being all
* done when it reached the ';' after the YY_FATAL_ERROR() call.
*/
#define YY_FATAL_ERROR(msg) \
do \
{ \
(void) fputs( msg, stderr ); \
(void) putc( '\n', stderr ); \
exit( 1 ); \
} \
while ( 0 )
/* default yywrap function - always treat EOF as an EOF */
#define yywrap() 1
/* default declaration of generated scanner - a define so the user can
* easily add parameters
*/
#define YY_DECL int yylex YY_PROTO(( void ))
#else
/* c++ */
#define ECHO yy___echo()
#define YY_INPUT(buf,result,max_size) \
if ( yy___input((char *)buf, result,max_size) < 0 ) \
YY_FATAL_ERROR( "YY_INPUT() in flex scanner failed" );
#define YY_FATAL_ERROR(msg) yy___fatal_error(msg)
#define yywrap() yy___wrap()
#endif
/***********************************/
/* not to be changed */
#define YY_NULL 0
#define YY_END_OF_BUFFER_CHAR 0
/* special action meaning "start processing a new file" */
#define YY_NEW_FILE yy___newfile
/* enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN
*/
#define BEGIN yy_start = 1 + 2 *
/* action number for EOF rule of a given start state */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* % section 1 definitions go here */
#line 1 "../d.l"
#define INITIAL 0
#define YY_Tlexer_FLEX_SCANNER
#line 16 "../d.l"
#include <string.h>
#include "tree.H"
#include "d.y.h"
/*#undef YY_READ_BUF_SIZE*/
/*#define YY_READ_BUF_SIZE 512*/
static Tchar *strdup_Stripped(const Tchar[]);
static void rm_escape(Tchar *);
#define YY_USER_ACTION QuoteMeansChar++;
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size)\
{\
if (EofSeen) {\
(result) = 0;\
} else if (inputstreamptr->good()) {\
inputstreamptr->read((char*)(buf),(max_size));\
(result) = inputstreamptr->gcount();\
} else {\
*(char*)buf = '}'; (result) = 1; EofSeen = 1;\
}\
}
#include "../d.l.h"
#line 45 "../d.l"
#line 193 "../pars/flexskel.cc"
#define yy___text YY_Tlexer_TEXT
#define yy___leng YY_Tlexer_LENG
#define yy___in YY_Tlexer_IN
#define yy___out YY_Tlexer_OUT
#define yy___newfile \
do \
{ \
YY_Tlexer_INIT_BUFFER( yy_current_buffer, yy___in ); \
YY_Tlexer_LOAD_BUFFER_STATE(); \
} \
while ( 0 )
#if YY_Tlexer_DEBUG != 0
#define yy___flex_debug YY_Tlexer_DEBUG_FLAG
#endif
#ifdef YY_USE_CLASS
#define yy___echo YY_Tlexer_ECHO
#define yy___input YY_Tlexer_INPUT
#define yy___fatal_error YY_Tlexer_FATAL_ERROR
#define yy___wrap YY_Tlexer_WRAP
#endif
/* done after the current pattern has been matched and before the
* corresponding action - sets up yy___text
*/
#define YY_DO_BEFORE_ACTION \
yy___text = yy_bp; \
/* % code to fiddle yy___text and yy___leng for yymore() goes here */ \
yy___leng = yy_cp - yy_bp; \
yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* return all but the first 'n' matched characters back to the input stream */
#define yyless(n) \
do \
{ \
/* undo effects of setting up yy___text */ \
*yy_cp = yy_hold_char; \
yy_c_buf_p = yy_cp = yy_bp + n; \
YY_DO_BEFORE_ACTION; /* set up yy___text again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, yy___text )
struct yy_buffer_state
{
FILE *yy_input_file;
YY_Tlexer_CHAR *yy_ch_buf; /* input buffer */
YY_Tlexer_CHAR *yy_buf_pos; /* current position in input buffer */
/* size of input buffer in bytes, not including room for EOB characters */
int yy_buf_size;
/* number of characters read into yy_ch_buf, not including EOB characters */
int yy_n_chars;
int yy_eof_status; /* whether we've seen an EOF on this buffer */
#define EOF_NOT_SEEN 0
/* "pending" happens when the EOF has been seen but there's still
* some text process
*/
#define EOF_PENDING 1
#define EOF_DONE 2
};
/* we provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state"
*/
#ifndef YY_USE_CLASS
#if YY_Tlexer_DEBUG != 0
int YY_Tlexer_DEBUG_FLAG=YY_Tlexer_DEBUG_INIT;
#endif
#define YY_CURRENT_BUFFER yy_current_buffer
static YY_BUFFER_STATE yy_current_buffer;
/* yy_hold_char holds the character lost when yy___text is formed */
static YY_Tlexer_CHAR yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
/* GLOBAL */
YY_Tlexer_CHAR *yy___text;
int yy___leng;
FILE *yy___in = (FILE *) 0, *yy___out = (FILE *) 0;
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif
/* these variables are all declared out here so that section 3 code can
* manipulate them
*/
/* points to current character in buffer */
static YY_Tlexer_CHAR *yy_c_buf_p = (YY_Tlexer_CHAR *) 0;
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yy___in. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
static int yy_get_next_buffer YY_PROTO(( void ));
static void yyunput YY_PROTO(( YY_Tlexer_CHAR c, YY_Tlexer_CHAR *buf_ptr ));
#else
/* c++ */
#ifndef YY_Tlexer_ECHO_NOCODE
void YY_Tlexer_CLASS::yy___echo()
{YY_Tlexer_ECHO_CODE
}
#endif
#ifndef YY_Tlexer_INPUT_NOCODE
int YY_Tlexer_CLASS::yy___input(char * buffer,int &result,int max_size)
{YY_Tlexer_INPUT_CODE
}
#endif
#ifndef YY_Tlexer_FATAL_ERROR_NOCODE
void YY_Tlexer_CLASS::yy___fatal_error(char *msg)
{YY_Tlexer_FATAL_ERROR_CODE
}
#endif
#ifndef YY_Tlexer_WRAP_NOCODE
int YY_Tlexer_CLASS::yy___wrap()
{YY_Tlexer_WRAP_CODE
}
#endif
void YY_Tlexer_CLASS::yy_initialize()
{
yy___in=0;yy___out=0;yy_init = 1;
yy_start=0;
yy___text=0;yy___leng=0;
yy_current_buffer=0;
yy_did_buffer_switch_on_eof=0;
yy_c_buf_p=0;yy_hold_char=0;yy_n_chars=0;
#if YY_Tlexer_DEBUG != 0
YY_Tlexer_DEBUG_FLAG=YY_Tlexer_DEBUG_INIT;
#endif
}
YY_Tlexer_CLASS::YY_Tlexer_CLASS(YY_Tlexer_CONSTRUCTOR_PARAM) YY_Tlexer_CONSTRUCTOR_INIT
{yy_initialize();
YY_Tlexer_CONSTRUCTOR_CODE;
}
#endif
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
#ifndef YY_USER_INIT
#define YY_USER_INIT
#endif
/* % data tables for the DFA go here */
#define YY_END_OF_BUFFER 61
typedef int yy_state_type;
static const short int yy_accept[175] =
{ 0,
0, 0, 61, 59, 1, 2, 45, 59, 59, 33,
59, 36, 57, 59, 59, 59, 59, 59, 24, 43,
59, 41, 58, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 59, 1, 44, 0,
34, 0, 50, 33, 46, 52, 55, 37, 53, 38,
54, 35, 0, 26, 0, 22, 23, 56, 25, 24,
0, 29, 42, 48, 39, 40, 49, 33, 33, 33,
33, 33, 33, 33, 33, 33, 3, 33, 33, 33,
33, 33, 33, 33, 47, 51, 0, 26, 30, 0,
28, 26, 0, 27, 33, 33, 33, 33, 33, 6,
33, 33, 33, 33, 33, 21, 33, 33, 33, 33,
33, 0, 0, 28, 32, 0, 26, 29, 27, 31,
33, 19, 33, 20, 4, 33, 33, 33, 13, 33,
33, 33, 33, 33, 33, 33, 0, 0, 0, 0,
0, 8, 33, 33, 33, 33, 14, 17, 33, 33,
33, 12, 5, 0, 0, 0, 0, 0, 33, 33,
33, 18, 33, 11, 10, 0, 0, 33, 7, 33,
16, 9, 15, 0
} ;
static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 4, 5, 6, 7, 1, 8, 9, 10,
11, 12, 13, 1, 14, 15, 16, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 1, 1, 18,
19, 20, 1, 1, 7, 7, 7, 7, 21, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
22, 23, 24, 1, 25, 1, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 7, 42, 43, 44, 45, 7, 46, 7,
7, 7, 1, 47, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 7, 7, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 7, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 7, 7, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 7, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static const YY_CHAR yy_meta[48] =
{ 0,
1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
2, 1, 1, 1, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1
} ;
static const short int yy_base[177] =
{ 0,
0, 0, 271, 272, 268, 272, 250, 43, 258, 0,
259, 272, 272, 37, 38, 36, 43, 49, 54, 40,
247, 246, 244, 221, 27, 228, 224, 32, 39, 229,
52, 219, 232, 227, 217, 222, 207, 251, 272, 58,
272, 0, 272, 0, 272, 272, 272, 272, 272, 272,
272, 272, 237, 65, 77, 272, 272, 272, 76, 86,
91, 272, 272, 272, 272, 272, 272, 221, 213, 210,
205, 204, 204, 206, 204, 199, 0, 215, 213, 211,
211, 68, 194, 203, 272, 272, 219, 98, 272, 218,
107, 110, 217, 100, 207, 195, 187, 189, 199, 198,
199, 199, 185, 194, 197, 0, 186, 185, 168, 178,
174, 121, 53, 131, 272, 126, 137, 272, 147, 272,
174, 0, 168, 0, 0, 174, 154, 168, 0, 153,
151, 159, 148, 128, 132, 133, 158, 109, 136, 161,
166, 0, 123, 131, 123, 114, 0, 0, 115, 93,
90, 0, 0, 106, 169, 172, 101, 174, 69, 69,
58, 0, 66, 0, 0, 182, 184, 57, 0, 46,
0, 0, 0, 272, 219, 52
} ;
static const short int yy_def[177] =
{ 0,
174, 1, 174, 174, 174, 174, 174, 175, 174, 176,
174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 176, 176, 176, 176, 176, 176, 176,
176, 176, 176, 176, 176, 176, 174, 174, 174, 175,
174, 175, 174, 176, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 176, 176, 176,
176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
176, 176, 176, 176, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 176, 176, 176, 176, 176, 176,
176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
176, 174, 174, 174, 174, 174, 174, 174, 174, 174,
176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
176, 176, 176, 176, 176, 176, 174, 174, 174, 174,
174, 176, 176, 176, 176, 176, 176, 176, 176, 176,
176, 176, 176, 174, 174, 174, 174, 174, 176, 176,
176, 176, 176, 176, 176, 174, 174, 176, 176, 176,
176, 176, 176, 0, 174, 174
} ;
static const short int yy_nxt[320] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 4,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
10, 4, 4, 23, 4, 10, 24, 25, 26, 27,
28, 29, 10, 30, 10, 10, 31, 32, 10, 10,
33, 34, 10, 10, 35, 36, 37, 41, 46, 50,
48, 52, 69, 44, 51, 47, 49, 53, 63, 54,
56, 64, 41, 55, 57, 42, 70, 58, 59, 138,
60, 73, 55, 139, 61, 75, 74, 78, 76, 87,
42, 88, 139, 61, 173, 55, 172, 62, 62, 90,
90, 79, 92, 91, 55, 171, 55, 170, 89, 89,
59, 169, 60, 93, 93, 55, 61, 94, 108, 62,
62, 109, 87, 168, 88, 61, 119, 158, 55, 62,
62, 113, 155, 114, 116, 138, 117, 55, 165, 139,
55, 89, 89, 120, 120, 87, 164, 137, 139, 55,
115, 115, 140, 118, 118, 113, 163, 114, 154, 154,
162, 116, 155, 117, 89, 89, 161, 55, 160, 62,
62, 159, 153, 119, 115, 115, 55, 141, 152, 151,
118, 118, 87, 150, 137, 116, 141, 156, 157, 157,
120, 120, 158, 113, 149, 166, 116, 148, 156, 147,
167, 89, 89, 146, 118, 118, 113, 145, 166, 144,
167, 143, 115, 115, 141, 118, 118, 120, 120, 142,
136, 135, 134, 141, 133, 115, 115, 120, 120, 40,
40, 132, 131, 130, 129, 128, 127, 126, 125, 124,
123, 122, 121, 94, 91, 112, 111, 110, 107, 106,
105, 104, 103, 102, 101, 100, 99, 98, 97, 96,
95, 86, 38, 85, 84, 83, 82, 81, 80, 77,
72, 71, 68, 67, 66, 65, 45, 43, 39, 38,
174, 3, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 174, 174
} ;
static const short int yy_chk[320] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 8, 14, 16,
15, 17, 25, 176, 16, 14, 15, 17, 20, 17,
18, 20, 40, 17, 18, 8, 25, 18, 19, 113,
19, 28, 17, 113, 19, 29, 28, 31, 29, 54,
40, 54, 113, 19, 170, 54, 168, 19, 19, 55,
55, 31, 59, 55, 54, 163, 59, 161, 54, 54,
60, 160, 60, 61, 61, 59, 60, 61, 82, 59,
59, 82, 88, 159, 88, 60, 94, 157, 88, 60,
60, 91, 154, 91, 92, 138, 92, 88, 151, 138,
92, 88, 88, 94, 94, 112, 150, 112, 138, 92,
91, 91, 116, 92, 92, 114, 149, 114, 139, 139,
146, 117, 139, 117, 112, 112, 145, 117, 144, 116,
116, 143, 136, 119, 114, 114, 117, 119, 135, 134,
117, 117, 137, 133, 137, 140, 119, 140, 141, 141,
119, 119, 141, 155, 132, 155, 156, 131, 156, 130,
158, 137, 137, 128, 140, 140, 166, 127, 166, 126,
167, 123, 155, 155, 167, 156, 156, 158, 158, 121,
111, 110, 109, 167, 108, 166, 166, 167, 167, 175,
175, 107, 105, 104, 103, 102, 101, 100, 99, 98,
97, 96, 95, 93, 90, 87, 84, 83, 81, 80,
79, 78, 76, 75, 74, 73, 72, 71, 70, 69,
68, 53, 38, 37, 36, 35, 34, 33, 32, 30,
27, 26, 24, 23, 22, 21, 11, 9, 7, 5,
3, 174, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
174, 174, 174, 174, 174, 174, 174, 174, 174
} ;
static yy_state_type yy_last_accepting_state;
static YY_CHAR *yy_last_accepting_cpos;
#if YY_Tlexer_DEBUG != 0
static const short int yy_rule_linenum[60] =
{ 0,
48, 51, 54, 55, 56, 57, 58, 59, 60, 61,
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 75, 91, 100, 113, 114, 115, 121, 128, 129,
130, 136, 145, 153, 161, 165, 192, 193, 194, 195,
196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
206, 207, 208, 209, 210, 211, 213, 214, 216
} ;
#endif
/* the intent behind this definition is that it'll catch
* any uses of REJECT which flex missed
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#line 366 "../pars/flexskel.cc"
#ifndef YY_USE_CLASS
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
#else
#define yy_get_previous_state() ((yy_state_type)(yy_get_previous_state_()))
#define yy_try_NUL_trans(c) ((yy_state_type)(yy_try_NUL_trans_(c)))
#endif
#ifndef YY_USE_CLASS
#ifdef YY_Tlexer_LEX_DEFINED
YY_Tlexer_LEX_RETURN YY_Tlexer_LEX ( YY_Tlexer_LEX_PARAM )
YY_Tlexer_LEX_PARAM_DEF
#else
YY_DECL
#endif
#else
YY_Tlexer_LEX_RETURN YY_Tlexer_CLASS::YY_Tlexer_LEX ( YY_Tlexer_LEX_PARAM)
#endif
{
register yy_state_type yy_current_state;
register YY_Tlexer_CHAR *yy_cp, *yy_bp;
register int yy_act;
/* % user's declarations go here */
/* skip blanks and tabs */
/* % end of prolog */
#line 391 "../pars/flexskel.cc"
if ( yy_init )
{
{
YY_USER_INIT;
}
if ( ! yy_start )
yy_start = 1; /* first start state */
if ( ! yy___in )
yy___in = stdin;
if ( ! yy___out )
yy___out = stdout;
if ( yy_current_buffer )
YY_Tlexer_INIT_BUFFER( yy_current_buffer, yy___in );
else
yy_current_buffer = YY_Tlexer_CREATE_BUFFER( yy___in, YY_BUF_SIZE );
YY_Tlexer_LOAD_BUFFER_STATE();
yy_init=0;
}
while ( 1 ) /* loops until end-of-file is reached */
{
/* % yymore()-related code goes here */
#line 419 "../pars/flexskel.cc"
yy_cp = yy_c_buf_p;
/* support of yy___text */
*yy_cp = yy_hold_char;
/* yy_bp points to the position in yy_ch_buf of the start of the
* current run.
*/
yy_bp = yy_cp;
/* % code to set up and find next match goes here */
yy_current_state = yy_start;
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[*yy_cp];
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = yy_def[yy_current_state];
if ( yy_current_state >= 175 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_current_state != 174 );
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
#line 430 "../pars/flexskel.cc"
yy_find_action:
/* % code to find the action number goes here */
yy_act = yy_accept[yy_current_state];
#line 433 "../pars/flexskel.cc"
YY_DO_BEFORE_ACTION;
YY_USER_ACTION;
do_action: /* this label is used only to access EOF actions */
#if YY_Tlexer_DEBUG != 0
if ( yy___flex_debug )
{
if ( yy_act == 0 )
fprintf( stderr, "--scanner backtracking\n" );
else if ( yy_act < YY_END_OF_BUFFER -1 )
fprintf( stderr,
"--accepting rule at line %d (\"%s\")\n",
yy_rule_linenum[yy_act], yy___text );
else if ( yy_act == YY_END_OF_BUFFER -1 )
fprintf( stderr,
"--accepting default rule (\"%s\")\n",
yy___text );
else if ( yy_act == YY_END_OF_BUFFER )
fprintf( stderr, "--(end of buffer or a NUL)\n" );
else
fprintf( stderr, "--EOF\n" );
}
#endif
switch ( yy_act )
{
/* % actions go here */
case 0: /* must backtrack */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_char;
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
goto yy_find_action;
case 1:
#line 48 "../d.l"
{ QuoteMeansChar--; }
YY_BREAK
/* skip also newlines, but keep track of line numbers */
case 2:
#line 51 "../d.l"
{ QuoteMeansChar--; global::lineno++; }
YY_BREAK
/* recognize keywords */
case 3:
#line 54 "../d.l"
return IF;
YY_BREAK
case 4:
#line 55 "../d.l"
return ELSE;
YY_BREAK
case 5:
#line 56 "../d.l"
return WHILE;
YY_BREAK
case 6:
#line 57 "../d.l"
return FOR;
YY_BREAK
case 7:
#line 58 "../d.l"
return FOREACH;
YY_BREAK
case 8:
#line 59 "../d.l"
return BREAK;
YY_BREAK
case 9:
#line 60 "../d.l"
return CONTINUE;
YY_BREAK
case 10:
#line 61 "../d.l"
return RETURN;
YY_BREAK
case 11:
#line 62 "../d.l"
return REPEAT;
YY_BREAK
case 12:
#line 63 "../d.l"
return UNTIL;
YY_BREAK
case 13:
#line 64 "../d.l"
return GOTO;
YY_BREAK
case 14:
#line 65 "../d.l"
return LABEL;
YY_BREAK
case 15:
#line 66 "../d.l"
return FUNCTION;
YY_BREAK
case 16:
#line 67 "../d.l"
return PACKAGE;
YY_BREAK
case 17:
#line 68 "../d.l"
return LOCAL;
YY_BREAK
case 18:
#line 69 "../d.l"
return GLOBAL;
YY_BREAK
case 19:
#line 70 "../d.l"
return CALL;
YY_BREAK
case 20:
#line 71 "../d.l"
return DISP;
YY_BREAK
case 21:
#line 72 "../d.l"
return MOD;
YY_BREAK
/* recognize C style comments */
case 22:
#line 75 "../d.l"
{
int c,d,si=1;
QuoteMeansChar--;
for(;;) {
while ( ((c=input()) != '*') && (c != '/') && (c != EOF)) if (c=='\n') global::lineno++;
if (c == '/') {
if ((d=input()) == '*') si++; else if (d=='\n') global::lineno++;
} else if (c == '*') {
d = input();
if (d == '/') si--; else unput(d);
} else break; /* now c must be EOF */
if (si == 0) break;
}
}
YY_BREAK
/* recognize C++ style comments */
case 23:
#line 91 "../d.l"
{
int c;
QuoteMeansChar--;
/* eat up the comment, until a newline */
while ( ((c=input()) != '\n') && (c != EOF)) ;
global::lineno++;
}
YY_BREAK
/* read literal integers */
case 24:
#line 100 "../d.l"
{
double x = atof((const char*)yytext);
QuoteMeansChar = -1;
if (x > MAXTINT-1) { /* if too large, handle it as real */
yylval.real_val = x;
return REAL;
} else {
yylval.int_val = Tint(x+0.5);
return INTEGER;
}
}
YY_BREAK
/* read literal real numbers */
case 25:
#line 114 "../d.l"
case 26:
#line 115 "../d.l"
case 27:
#line 115 "../d.l"
{
QuoteMeansChar = -1;
yylval.real_val = atof((const char*)yytext);
return REAL;
}
YY_BREAK
case 28:
#line 121 "../d.l"
{
QuoteMeansChar = -1;
yylval.real_val = atof((const char*)yytext);
return REAL;
}
YY_BREAK
/* read imaginary constants */
case 29:
#line 129 "../d.l"
case 30:
#line 130 "../d.l"
case 31:
#line 130 "../d.l"
{
QuoteMeansChar = -1;
yylval.real_val = atof((const char*)yytext);
return iREAL;
}
YY_BREAK
case 32:
#line 136 "../d.l"
{
QuoteMeansChar = -1;
yylval.real_val = atof((const char*)yytext);
return iREAL;
}
YY_BREAK
/* read identifiers */
/* an identifier begins with a letter or dollar sign, the rest can be */
/* also underscores and digits */
case 33:
#line 145 "../d.l"
{
QuoteMeansChar = -1;
Tsymbol* symptr = theHT.add(yytext);
yylval.sym_val = symptr;
return(IDENTIFIER);
}
YY_BREAK
/* get character strings enclosed in " " */
case 34:
#line 153 "../d.l"
{
yylval.str_val = strdup_Stripped(yytext); // Strip means: leave surrounding quotes off
for (int i=0; yylval.str_val[i]; i++)
if (yylval.str_val[i] == '\n') global::lineno++;
rm_escape(yylval.str_val); // do escape sequences in place
return(STRING);
}
YY_BREAK
case 35:
#line 161 "../d.l"
return(TRANSPOSE);
YY_BREAK
/* A single quote starts a character constant if QuoteMeansChar is nonzero.
If QuoteMeansChar is zero, it is the hermitian trasnpose. */
case 36:
#line 165 "../d.l"
{
if (QuoteMeansChar) {
Tchar buff[20];
int L=0;
buff[L++] = '\'';
buff[L++] = input();
if (buff[L-1]=='\\') {
buff[L++] = input();
do {
buff[L++] = input();
if (L>=19) return(ERROR_TOKEN);
} while (buff[L-1]!='\'');
} else {
buff[L++] = input();
if (buff[L-1]!='\'') return(ERROR_TOKEN);
}
buff[L] = '\0';
Tchar *ptr = strdup_Stripped(yytext);
rm_escape(ptr);
yylval.ch_val = *ptr;
delete [] ptr;
return(CHAR);
} else { /* Else Quote Means Hermitian Transpose */
return(HERMITIAN_TRANSPOSE);
}
}
YY_BREAK
case 37:
#line 192 "../d.l"
return INC;
YY_BREAK
case 38:
#line 193 "../d.l"
return DEC;
YY_BREAK
case 39:
#line 194 "../d.l"
return EQ;
YY_BREAK
case 40:
#line 195 "../d.l"
return GE;
YY_BREAK
case 41:
#line 196 "../d.l"
return GT;
YY_BREAK
case 42:
#line 197 "../d.l"
return LE;
YY_BREAK
case 43:
#line 198 "../d.l"
return LT;
YY_BREAK
case 44:
#line 199 "../d.l"
return NE;
YY_BREAK
case 45:
#line 200 "../d.l"
return NOT;
YY_BREAK
case 46:
#line 201 "../d.l"
return AND;
YY_BREAK
case 47:
#line 202 "../d.l"
return OR;
YY_BREAK
case 48:
#line 203 "../d.l"
return DOUBLELEFTBRACKET;
YY_BREAK
case 49:
#line 204 "../d.l"
{ QuoteMeansChar = -1; return DOUBLERIGHTBRACKET; }
YY_BREAK
case 50:
#line 205 "../d.l"
return LEFTCONSTRUCTOR;
YY_BREAK
case 51:
#line 206 "../d.l"
return ELLIPSIS;
YY_BREAK
case 52:
#line 207 "../d.l"
return DOT;
YY_BREAK
case 53:
#line 208 "../d.l"
return INCASSIGN;
YY_BREAK
case 54:
#line 209 "../d.l"
return DECASSIGN;
YY_BREAK
case 55:
#line 210 "../d.l"
return MULASSIGN;
YY_BREAK
case 56:
#line 211 "../d.l"
return DIVASSIGN;
YY_BREAK
case 57:
#line 213 "../d.l"
{ QuoteMeansChar = -1; return yytext[0]; }
YY_BREAK
case 58:
#line 214 "../d.l"
{ QuoteMeansChar = -1; return yytext[0]; }
YY_BREAK
case 59:
#line 216 "../d.l"
{ return yytext[0]; }
YY_BREAK
case 60:
#line 218 "../d.l"
ECHO;
YY_BREAK
case YY_STATE_EOF(INITIAL):
yyterminate();
#line 460 "../pars/flexskel.cc"
case YY_END_OF_BUFFER:
{
/* amount of text matched not including the EOB char */
int yy_amount_of_matched_text = yy_cp - yy___text - 1;
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_char;
/* note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the end-
* of-buffer state). Contrast this with the test in yyinput().
*/
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
/* this was really a NUL */
{
yy_state_type yy_next_state;
yy_c_buf_p = yy___text + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state();
/* okay, we're now positioned to make the
* NUL transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we
* don't want to build jamming into it because
* then it will run more slowly)
*/
yy_next_state = yy_try_NUL_trans( yy_current_state );
yy_bp = yy___text + YY_MORE_ADJ;
if ( yy_next_state )
{
/* consume the NUL */
yy_cp = ++yy_c_buf_p;
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
/* % code to do backtracking for compressed tables and set up yy_cp goes here */
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
#line 508 "../pars/flexskel.cc"
goto yy_find_action;
}
}
else switch ( yy_get_next_buffer() )
{
case EOB_ACT_END_OF_FILE:
{
yy_did_buffer_switch_on_eof = 0;
if ( yywrap() )
{
/* note: because we've taken care in
* yy_get_next_buffer() to have set up yy___text,
* we can now set up yy_c_buf_p so that if some
* total hoser (like flex itself) wants
* to call the scanner after we return the
* YY_NULL, it'll still work - another YY_NULL
* will get returned.
*/
yy_c_buf_p = yy___text + YY_MORE_ADJ;
yy_act = YY_STATE_EOF((yy_start - 1) / 2);
goto do_action;
}
else
{
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
}
}
break;
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p = yy___text + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yy___text + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
yy_c_buf_p =
&yy_current_buffer->yy_ch_buf[yy_n_chars];
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yy___text + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}
default:
#if YY_Tlexer_DEBUG != 0
fprintf(stderr, "action # %d\n", yy_act );
#endif
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
}
}
yyterminate();/* avoid the no return value error message on MS-C7/dos */
}
/* yy_get_next_buffer - try to read in a new buffer
*
* synopsis
* int yy_get_next_buffer();
*
* returns a code representing an action
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
#ifndef YY_USE_CLASS
static int yy_get_next_buffer()
#else
int YY_Tlexer_CLASS::yy_get_next_buffer()
#endif
{
register YY_Tlexer_CHAR *dest = yy_current_buffer->yy_ch_buf;
register YY_Tlexer_CHAR *source = yy___text - 1; /* copy prev. char, too */
register int number_to_move, i;
int ret_val;
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
/* try to read more data */
/* first move last chars to start of buffer */
number_to_move = yy_c_buf_p - yy___text;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
yy_n_chars = 0;
else
{
int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
else if ( num_to_read <= 0 )
YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
/* read in more data */
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
yy_n_chars, num_to_read );
}
if ( yy_n_chars == 0 )
{
if ( number_to_move - YY_MORE_ADJ == 1 )
{
ret_val = EOB_ACT_END_OF_FILE;
yy_current_buffer->yy_eof_status = EOF_DONE;
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
yy_current_buffer->yy_eof_status = EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
yy_n_chars += number_to_move;
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
/* yy___text begins at the second character in yy_ch_buf; the first
* character is the one which preceded it before reading in the latest
* buffer; it needs to be kept around in case it's a newline, so
* yy_get_previous_state() will have with '^' rules active
*/
yy___text = &yy_current_buffer->yy_ch_buf[1];
return ( ret_val );
}
/* yy_get_previous_state - get the state just before the EOB char was reached
*
* synopsis
* yy_state_type yy_get_previous_state();
*/
#ifndef YY_USE_CLASS
static yy_state_type yy_get_previous_state()
#else
long YY_Tlexer_CLASS::yy_get_previous_state_()
#endif
{
register yy_state_type yy_current_state;
register YY_Tlexer_CHAR *yy_cp;
/* % code to get the start state into yy_current_state goes here */
yy_current_state = yy_start;
#line 680 "../pars/flexskel.cc"
for ( yy_cp = yy___text + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
{
/* % code to find the next state goes here */
register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = yy_def[yy_current_state];
if ( yy_current_state >= 175 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
#line 684 "../pars/flexskel.cc"
}
#ifndef YY_USE_CLASS
return ( yy_current_state );
#else
return (long)( yy_current_state );
#endif
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
#ifndef YY_USE_CLASS
#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
register yy_state_type yy_current_state;
#endif
#else
long YY_Tlexer_CLASS::yy_try_NUL_trans_(long yy_current_state_)
#endif
{
#ifndef YY_USE_CLASS
#else
yy_state_type yy_current_state=(yy_state_type)yy_current_state_;
#endif
register int yy_is_jam;
/* % code to find the next state, and perhaps do backtracking, goes here */
register YY_CHAR *yy_cp = yy_c_buf_p;
register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = yy_def[yy_current_state];
if ( yy_current_state >= 175 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 174);
#line 718 "../pars/flexskel.cc"
#ifndef YY_USE_CLASS
return ( yy_is_jam ? 0 : yy_current_state );
#else
return (long)( yy_is_jam ? 0 : yy_current_state );
#endif
}
#ifndef YY_USE_CLASS
#ifdef YY_USE_PROTOS
static void yyunput( YY_Tlexer_CHAR c, register YY_Tlexer_CHAR *yy_bp )
#else
static void yyunput( c, yy_bp )
YY_Tlexer_CHAR c;
register YY_Tlexer_CHAR *yy_bp;
#endif
#else
void YY_Tlexer_CLASS::yyunput( YY_Tlexer_CHAR c, YY_Tlexer_CHAR *yy_bp )
#endif
{
register YY_Tlexer_CHAR *yy_cp = yy_c_buf_p;
/* undo effects of setting up yy___text */
*yy_cp = yy_hold_char;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
register YY_Tlexer_CHAR *dest =
&yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
register YY_Tlexer_CHAR *source =
&yy_current_buffer->yy_ch_buf[number_to_move];
while ( source > yy_current_buffer->yy_ch_buf )
*--dest = *--source;
yy_cp += dest - source;
yy_bp += dest - source;
yy_n_chars = yy_current_buffer->yy_buf_size;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
yy_cp[-2] = '\n';
*--yy_cp = c;
/* note: the formal parameter *must* be called "yy_bp" for this
* macro to now work correctly
*/
YY_DO_BEFORE_ACTION; /* set up yy___text again */
}
#ifndef YY_USE_CLASS
#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif
#else
int YY_Tlexer_CLASS::input()
#endif
{
int c;
YY_Tlexer_CHAR *yy_cp = yy_c_buf_p;
*yy_cp = yy_hold_char;
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
/* this was really a NUL */
*yy_c_buf_p = '\0';
else
{ /* need more input */
yy___text = yy_c_buf_p;
++yy_c_buf_p;
switch ( yy_get_next_buffer() )
{
case EOB_ACT_END_OF_FILE:
{
if ( yywrap() )
{
yy_c_buf_p = yy___text + YY_MORE_ADJ;
return ( EOF );
}
YY_NEW_FILE;
#ifndef YY_USE_CLASS
#ifdef __cplusplus
return ( yyinput() );
#else
return ( input() );
#endif
#else
return ( input() );
#endif
}
break;
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p = yy___text + YY_MORE_ADJ;
break;
case EOB_ACT_LAST_MATCH:
#ifndef YY_USE_CLASS
#ifdef __cplusplus
YY_FATAL_ERROR( "unexpected last match in yyinput()" );
#else
YY_FATAL_ERROR( "unexpected last match in input()" );
#endif
#else
YY_FATAL_ERROR( "unexpected last match in YY_Tlexer_CLASS::input()" );
#endif
}
}
}
c = *yy_c_buf_p;
yy_hold_char = *++yy_c_buf_p;
return ( c );
}
#ifndef YY_USE_CLASS
#ifdef YY_USE_PROTOS
void YY_Tlexer_RESTART( FILE *input_file )
#else
void YY_Tlexer_RESTART( input_file )
FILE *input_file;
#endif
#else
void YY_Tlexer_CLASS::YY_Tlexer_RESTART ( FILE *input_file )
#endif
{
YY_Tlexer_INIT_BUFFER( yy_current_buffer, input_file );
YY_Tlexer_LOAD_BUFFER_STATE();
}
#ifndef YY_USE_CLASS
#ifdef YY_USE_PROTOS
void YY_Tlexer_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer )
#else
void YY_Tlexer_SWITCH_TO_BUFFER( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
#else
void YY_Tlexer_CLASS::YY_Tlexer_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer )
#endif
{
if ( yy_current_buffer == new_buffer )
return;
if ( yy_current_buffer )
{
/* flush out information for old buffer */
*yy_c_buf_p = yy_hold_char;
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
yy_current_buffer->yy_n_chars = yy_n_chars;
}
yy_current_buffer = new_buffer;
YY_Tlexer_LOAD_BUFFER_STATE();
/* we don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
* is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yy_did_buffer_switch_on_eof = 1;
}
#ifndef YY_USE_CLASS
#ifdef YY_USE_PROTOS
void YY_Tlexer_LOAD_BUFFER_STATE( void )
#else
void YY_Tlexer_LOAD_BUFFER_STATE()
#endif
#else
void YY_Tlexer_CLASS::YY_Tlexer_LOAD_BUFFER_STATE( )
#endif
{
yy_n_chars = yy_current_buffer->yy_n_chars;
yy___text = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
yy___in = yy_current_buffer->yy_input_file;
yy_hold_char = *yy_c_buf_p;
}
#ifndef YY_USE_CLASS
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE YY_Tlexer_CREATE_BUFFER( FILE *file, int size )
#else
YY_BUFFER_STATE YY_Tlexer_CREATE_BUFFER( file, size )
FILE *file;
int size;
#endif
#else
YY_BUFFER_STATE YY_Tlexer_CLASS::YY_Tlexer_CREATE_BUFFER( FILE *file, int size )
#endif
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in YY_Tlexer_CREATE_BUFFER()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (YY_Tlexer_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in YY_Tlexer_CREATE_BUFFER()" );
YY_Tlexer_INIT_BUFFER( b, file );
return ( b );
}
#ifndef YY_USE_CLASS
#ifdef YY_USE_PROTOS
void YY_Tlexer_DELETE_BUFFER( YY_BUFFER_STATE b )
#else
void YY_Tlexer_DELETE_BUFFER( b )
YY_BUFFER_STATE b;
#endif
#else
void YY_Tlexer_CLASS::YY_Tlexer_DELETE_BUFFER( YY_BUFFER_STATE b )
#endif
{
if ( b == yy_current_buffer )
yy_current_buffer = (YY_BUFFER_STATE) 0;
free( (char *) b->yy_ch_buf );
free( (char *) b );
}
#ifndef YY_USE_CLASS
#ifdef YY_USE_PROTOS
void YY_Tlexer_INIT_BUFFER( YY_BUFFER_STATE b, FILE *file )
#else
void YY_Tlexer_INIT_BUFFER( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif
#else
void YY_Tlexer_CLASS::YY_Tlexer_INIT_BUFFER( YY_BUFFER_STATE b, FILE *file)
#endif
{
b->yy_input_file = file;
/* we put in the '\n' and start reading from [1] so that an
* initial match-at-newline will be true.
*/
b->yy_ch_buf[0] = '\n';
b->yy_n_chars = 1;
/* we always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
b->yy_buf_pos = &b->yy_ch_buf[1];
b->yy_eof_status = EOF_NOT_SEEN;
}
#line 218 "../d.l"
int Tlexer::seekback(Tchar s[], int N) {
// s must be a pointer to N chars. This function tries to fetch N most recent characters
// from the input stream and place them to s. If the stream does not contain that many
// characters, the routine does not fetch them all --- in any case the function returns
// the number of characters actually fetched and placed in s.
Tchar *startptr = yy_current_buffer->yy_ch_buf;
int L = strlen(startptr);
Tchar *endptr = startptr + L;
L--;
if (N<L) L=N;
s[L] = '\0';
for (int i=1; i<=L; i++) s[L-i] = endptr[-i];
return L;
}
int Tlexer::AtEOF() {
if (yy_current_buffer)
return !inputstreamptr->good();
else // if no buffer yet allocated, EOF is false:
return 0;
}
Tlexer::~Tlexer() {YY_Tlexer_DELETE_BUFFER(yy_current_buffer);}
static Tchar *strdup_Stripped(const Tchar s[]) {
int L = strlen(s);
Tchar *result = new Tchar [L-1];
for (int i=1; i<L-1; i++) result[i-1] = s[i];
result[L-2] = '\0';
return result;
}
// The following code fragment taken from RLaB by Ian Searle,
// who in turn obtained it from Mike Brennan...
/* **************************************************************
* Process STRINGS before giving them to yyparse(). This piece of
* code obtained from MAWK (GNU copylefted) by Mike Brennan.
* However I have modified it so any bugs are my fault.
* ************************************************************** */
// process the escape characters in a string, in place
static void rm_escape(Tchar *s)
{
Tchar *p=s, *q=s;
int i;
const int ET_END = 10;
struct Tescape_test {
Tchar in;
Tchar out;
};
static Tescape_test escape_test[ET_END+1] = {
{ 'n' , '\n' },
{ 't' , '\t' },
{ 'f' , '\f' },
{ 'b' , '\b' },
{ 'r' , '\r' },
{ 'a' , '\07' },
{ 'v' , '\013' },
{ '\\', '\\' },
{ '\"', '\"' },
{ '\n', '\0' },
{ 0 , 0 }
};
while (*p)
if ( *p == '\\' ) {
escape_test[ET_END].in = *++p; // sentinal
i = 0;
while (escape_test[i].in != *p) i++;
if (i != ET_END) { // in table
p++;
if (escape_test[i].out) *q++ = escape_test[i].out;
} else if (*p == '\0') // not sure when this can happen yet
*q++ = '\\' ;
else { // not an escape sequence
*q++ = '\\';
*q++ = *p++;
}
} else
*q++ = *p++;
*q = '\0';
}
|