00001 #define YY_SSLParser_h_included
00002
00003
00004
00005
00006
00007
00008
00009 #line 1 "/usr/local/lib/bison.cc"
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #if defined( _MSDOS ) || defined(MSDOS) || defined(__MSDOS__)
00030 #define __MSDOS_AND_ALIKE
00031 #endif
00032 #if defined(_WINDOWS) && defined(_MSC_VER)
00033 #define __HAVE_NO_ALLOCA
00034 #define __MSDOS_AND_ALIKE
00035 #endif
00036
00037 #ifndef alloca
00038 #if defined( __GNUC__)
00039 #define alloca __builtin_alloca
00040
00041 #elif (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
00042 #include <alloca.h>
00043
00044 #elif defined (__MSDOS_AND_ALIKE)
00045 #include <malloc.h>
00046 #ifndef __TURBOC__
00047
00048 #define alloca _alloca
00049 #endif
00050
00051 #elif defined(_AIX)
00052 #include <malloc.h>
00053 #pragma alloca
00054
00055 #elif defined(__hpux)
00056 #ifdef __cplusplus
00057 extern "C" {
00058 void *alloca (unsigned int);
00059 };
00060 #else
00061 void *alloca ();
00062 #endif
00063
00064 #endif
00065 #endif
00066 #ifdef c_plusplus
00067 #ifndef __cplusplus
00068 #define __cplusplus
00069 #endif
00070 #endif
00071 #ifdef __cplusplus
00072 #ifndef YY_USE_CLASS
00073 #define YY_USE_CLASS
00074 #endif
00075 #else
00076 #ifndef __STDC__
00077 #define const
00078 #endif
00079 #endif
00080 #include <stdio.h>
00081 #define YYBISON 1
00082
00083
00084 #line 85 "sslparser.cpp"
00085 #line 41 "sslparser.y"
00086
00087 #include "gc.h"
00088 #include <assert.h>
00089 #if defined(_MSC_VER) && _MSC_VER <= 1200
00090 #pragma warning(disable:4786)
00091 #endif
00092
00093 #include <sstream>
00094 #include "types.h"
00095 #include "rtl.h"
00096 #include "table.h"
00097 #include "insnameelem.h"
00098 #include "util.h"
00099 #include "statement.h"
00100
00101 #ifdef _WIN32
00102 #include <malloc.h>
00103 #endif
00104
00105 class SSLScanner;
00106
00107 #line 68 "sslparser.y"
00108 typedef union {
00109 Exp* exp;
00110 char* str;
00111 int num;
00112 double dbl;
00113 Statement* regtransfer;
00114 Type* typ;
00115
00116 Table* tab;
00117 InsNameElem* insel;
00118 std::list<std::string>* parmlist;
00119 std::list<std::string>* strlist;
00120 std::deque<Exp*>* exprlist;
00121 std::deque<std::string>* namelist;
00122 std::list<Exp*>* explist;
00123 RTL* rtlist;
00124 } yy_SSLParser_stype;
00125 #define YY_SSLParser_STYPE yy_SSLParser_stype
00126 #line 87 "sslparser.y"
00127
00128 #include "sslscanner.h"
00129 OPER strToTerm(char* s);
00130 Exp* listExpToExp(std::list<Exp*>* le);
00131 Exp* listStrToExp(std::list<std::string>* ls);
00132 #define YY_SSLParser_DEBUG 1
00133 #define YY_SSLParser_PARSE_PARAM \
00134 RTLInstDict& Dict
00135 #define YY_SSLParser_CONSTRUCTOR_PARAM \
00136 const std::string& sslFile, \
00137 bool trace
00138 #define YY_SSLParser_CONSTRUCTOR_INIT : \
00139 sslFile(sslFile), bFloat(false)
00140 #define YY_SSLParser_CONSTRUCTOR_CODE \
00141 std::fstream *fin = new std::fstream(sslFile.c_str(), std::ios::in); \
00142 theScanner = NULL; \
00143 if (!*fin) { \
00144 std::cerr << "can't open `" << sslFile << "' for reading\n"; \
00145 return; \
00146 } \
00147 theScanner = new SSLScanner(*fin, trace); \
00148 if (trace) yydebug = 1;
00149 #define YY_SSLParser_MEMBERS \
00150 public: \
00151 SSLParser(std::istream &in, bool trace); \
00152 virtual ~SSLParser(); \
00153 OPER strToOper(const char*s); \
00154 static Statement* parseExp(const char *str); \
00155 \
00156 void expandTables(InsNameElem* iname, std::list<std::string>* params, RTL* o_rtlist, RTLInstDict& Dict); \
00157 Exp* makeSuccessor(Exp* e); \
00158 \
00159
00160
00161 \
00162 SSLScanner* theScanner; \
00163 protected: \
00164 \
00165
00166
00167 \
00168 std::string sslFile; \
00169 \
00170
00171
00172 \
00173 Statement *the_asgn; \
00174 \
00175
00176
00177 \
00178 std::map<std::string,int> ConstTable; \
00179 \
00180
00181
00182 \
00183 std::map<std::string, InsNameElem*> indexrefmap; \
00184 \
00185
00186
00187 \
00188 std::map<std::string, Table*> TableDict; \
00189 \
00190
00191
00192
00193 \
00194 bool bFloat;
00195
00196 #line 73 "/usr/local/lib/bison.cc"
00197
00198 #define YY_SSLParser_BISON 1
00199 #ifndef YY_SSLParser_COMPATIBILITY
00200 #ifndef YY_USE_CLASS
00201 #define YY_SSLParser_COMPATIBILITY 1
00202 #else
00203 #define YY_SSLParser_COMPATIBILITY 0
00204 #endif
00205 #endif
00206
00207 #if YY_SSLParser_COMPATIBILITY != 0
00208
00209 #ifdef YYLTYPE
00210 #ifndef YY_SSLParser_LTYPE
00211 #define YY_SSLParser_LTYPE YYLTYPE
00212 #endif
00213 #endif
00214 #ifdef YYSTYPE
00215 #ifndef YY_SSLParser_STYPE
00216 #define YY_SSLParser_STYPE YYSTYPE
00217 #endif
00218 #endif
00219 #ifdef YYDEBUG
00220 #ifndef YY_SSLParser_DEBUG
00221 #define YY_SSLParser_DEBUG YYDEBUG
00222 #endif
00223 #endif
00224 #ifdef YY_SSLParser_STYPE
00225 #ifndef yystype
00226 #define yystype YY_SSLParser_STYPE
00227 #endif
00228 #endif
00229
00230 #ifndef YY_SSLParser_USE_GOTO
00231 #define YY_SSLParser_USE_GOTO 1
00232 #endif
00233 #endif
00234
00235
00236 #ifndef YY_SSLParser_USE_GOTO
00237 #define YY_SSLParser_USE_GOTO 0
00238 #endif
00239
00240 #ifndef YY_SSLParser_PURE
00241
00242
00243 #line 244 "sslparser.cpp"
00244
00245 #line 117 "/usr/local/lib/bison.cc"
00246
00247 #endif
00248
00249
00250
00251
00252 #line 253 "sslparser.cpp"
00253
00254 #line 121 "/usr/local/lib/bison.cc"
00255
00256 #ifndef YY_SSLParser_DEBUG
00257
00258
00259 #line 260 "sslparser.cpp"
00260
00261 #line 123 "/usr/local/lib/bison.cc"
00262
00263 #endif
00264
00265
00266 #ifndef YY_SSLParser_LSP_NEEDED
00267
00268
00269 #line 270 "sslparser.cpp"
00270
00271 #line 128 "/usr/local/lib/bison.cc"
00272
00273 #endif
00274
00275
00276
00277
00278 #ifdef YY_SSLParser_LSP_NEEDED
00279 #ifndef YY_SSLParser_LTYPE
00280 typedef
00281 struct yyltype
00282 {
00283 int timestamp;
00284 int first_line;
00285 int first_column;
00286 int last_line;
00287 int last_column;
00288 char *text;
00289 }
00290 yyltype;
00291
00292 #define YY_SSLParser_LTYPE yyltype
00293 #endif
00294 #endif
00295
00296
00297
00298
00299
00300 #ifndef YY_SSLParser_STYPE
00301 #define YY_SSLParser_STYPE int
00302 #endif
00303
00304 #ifndef YY_SSLParser_PARSE
00305 #define YY_SSLParser_PARSE yyparse
00306 #endif
00307 #ifndef YY_SSLParser_LEX
00308 #define YY_SSLParser_LEX yylex
00309 #endif
00310 #ifndef YY_SSLParser_LVAL
00311 #define YY_SSLParser_LVAL yylval
00312 #endif
00313 #ifndef YY_SSLParser_LLOC
00314 #define YY_SSLParser_LLOC yylloc
00315 #endif
00316 #ifndef YY_SSLParser_CHAR
00317 #define YY_SSLParser_CHAR yychar
00318 #endif
00319 #ifndef YY_SSLParser_NERRS
00320 #define YY_SSLParser_NERRS yynerrs
00321 #endif
00322 #ifndef YY_SSLParser_DEBUG_FLAG
00323 #define YY_SSLParser_DEBUG_FLAG yydebug
00324 #endif
00325 #ifndef YY_SSLParser_ERROR
00326 #define YY_SSLParser_ERROR yyerror
00327 #endif
00328 #ifndef YY_SSLParser_PARSE_PARAM
00329 #ifndef __STDC__
00330 #ifndef __cplusplus
00331 #ifndef YY_USE_CLASS
00332 #define YY_SSLParser_PARSE_PARAM
00333 #ifndef YY_SSLParser_PARSE_PARAM_DEF
00334 #define YY_SSLParser_PARSE_PARAM_DEF
00335 #endif
00336 #endif
00337 #endif
00338 #endif
00339 #ifndef YY_SSLParser_PARSE_PARAM
00340 #define YY_SSLParser_PARSE_PARAM void
00341 #endif
00342 #endif
00343 #if YY_SSLParser_COMPATIBILITY != 0
00344
00345 #ifdef YY_SSLParser_LTYPE
00346 #ifndef YYLTYPE
00347 #define YYLTYPE YY_SSLParser_LTYPE
00348 #else
00349
00350 #endif
00351 #endif
00352 #ifndef YYSTYPE
00353 #define YYSTYPE YY_SSLParser_STYPE
00354 #else
00355
00356 #endif
00357 #ifdef YY_SSLParser_PURE
00358 #ifndef YYPURE
00359 #define YYPURE YY_SSLParser_PURE
00360 #endif
00361 #endif
00362 #ifdef YY_SSLParser_DEBUG
00363 #ifndef YYDEBUG
00364 #define YYDEBUG YY_SSLParser_DEBUG
00365 #endif
00366 #endif
00367 #ifndef YY_SSLParser_ERROR_VERBOSE
00368 #ifdef YYERROR_VERBOSE
00369 #define YY_SSLParser_ERROR_VERBOSE YYERROR_VERBOSE
00370 #endif
00371 #endif
00372 #ifndef YY_SSLParser_LSP_NEEDED
00373 #ifdef YYLSP_NEEDED
00374 #define YY_SSLParser_LSP_NEEDED YYLSP_NEEDED
00375 #endif
00376 #endif
00377 #endif
00378 #ifndef YY_USE_CLASS
00379
00380
00381
00382 #line 383 "sslparser.cpp"
00383 #define COND_OP 258
00384 #define BIT_OP 259
00385 #define ARITH_OP 260
00386 #define LOG_OP 261
00387 #define NAME 262
00388 #define ASSIGNTYPE 263
00389 #define REG_ID 264
00390 #define REG_NUM 265
00391 #define COND_TNAME 266
00392 #define DECOR 267
00393 #define FARITH_OP 268
00394 #define FPUSH 269
00395 #define FPOP 270
00396 #define TEMP 271
00397 #define SHARES 272
00398 #define CONV_FUNC 273
00399 #define TRUNC_FUNC 274
00400 #define TRANSCEND 275
00401 #define FABS_FUNC 276
00402 #define BIG 277
00403 #define LITTLE 278
00404 #define NAME_CALL 279
00405 #define NAME_LOOKUP 280
00406 #define ENDIANNESS 281
00407 #define COVERS 282
00408 #define INDEX 283
00409 #define NOT 284
00410 #define LNOT 285
00411 #define FNEG 286
00412 #define THEN 287
00413 #define LOOKUP_RDC 288
00414 #define BOGUS 289
00415 #define ASSIGN 290
00416 #define TO 291
00417 #define COLON 292
00418 #define S_E 293
00419 #define AT 294
00420 #define ADDR 295
00421 #define REG_IDX 296
00422 #define EQUATE 297
00423 #define MEM_IDX 298
00424 #define TOK_INTEGER 299
00425 #define TOK_FLOAT 300
00426 #define FAST 301
00427 #define OPERAND 302
00428 #define FETCHEXEC 303
00429 #define CAST_OP 304
00430 #define FLAGMACRO 305
00431 #define SUCCESSOR 306
00432 #define NUM 307
00433 #define FLOATNUM 308
00434 #define FCHS 309
00435
00436
00437 #line 236 "/usr/local/lib/bison.cc"
00438
00439 #else
00440
00441 #ifndef YY_SSLParser_CLASS
00442 #define YY_SSLParser_CLASS SSLParser
00443 #endif
00444 #ifndef YY_SSLParser_INHERIT
00445 #define YY_SSLParser_INHERIT
00446 #endif
00447 #ifndef YY_SSLParser_MEMBERS
00448 #define YY_SSLParser_MEMBERS
00449 #endif
00450 #ifndef YY_SSLParser_LEX_BODY
00451 #define YY_SSLParser_LEX_BODY
00452 #endif
00453 #ifndef YY_SSLParser_ERROR_BODY
00454 #define YY_SSLParser_ERROR_BODY
00455 #endif
00456 #ifndef YY_SSLParser_CONSTRUCTOR_PARAM
00457 #define YY_SSLParser_CONSTRUCTOR_PARAM
00458 #endif
00459 #ifndef YY_SSLParser_CONSTRUCTOR_CODE
00460 #define YY_SSLParser_CONSTRUCTOR_CODE
00461 #endif
00462 #ifndef YY_SSLParser_CONSTRUCTOR_INIT
00463 #define YY_SSLParser_CONSTRUCTOR_INIT
00464 #endif
00465
00466 #ifndef YY_SSLParser_USE_CONST_TOKEN
00467 #define YY_SSLParser_USE_CONST_TOKEN 0
00468
00469
00470 #endif
00471 #if YY_SSLParser_USE_CONST_TOKEN != 0
00472 #ifndef YY_SSLParser_ENUM_TOKEN
00473 #define YY_SSLParser_ENUM_TOKEN yy_SSLParser_enum_token
00474 #endif
00475 #endif
00476
00477 class YY_SSLParser_CLASS YY_SSLParser_INHERIT
00478 {
00479 public:
00480 #if YY_SSLParser_USE_CONST_TOKEN != 0
00481
00482
00483
00484 #line 485 "sslparser.cpp"
00485 static const int COND_OP;
00486 static const int BIT_OP;
00487 static const int ARITH_OP;
00488 static const int LOG_OP;
00489 static const int NAME;
00490 static const int ASSIGNTYPE;
00491 static const int REG_ID;
00492 static const int REG_NUM;
00493 static const int COND_TNAME;
00494 static const int DECOR;
00495 static const int FARITH_OP;
00496 static const int FPUSH;
00497 static const int FPOP;
00498 static const int TEMP;
00499 static const int SHARES;
00500 static const int CONV_FUNC;
00501 static const int TRUNC_FUNC;
00502 static const int TRANSCEND;
00503 static const int FABS_FUNC;
00504 static const int BIG;
00505 static const int LITTLE;
00506 static const int NAME_CALL;
00507 static const int NAME_LOOKUP;
00508 static const int ENDIANNESS;
00509 static const int COVERS;
00510 static const int INDEX;
00511 static const int NOT;
00512 static const int LNOT;
00513 static const int FNEG;
00514 static const int THEN;
00515 static const int LOOKUP_RDC;
00516 static const int BOGUS;
00517 static const int ASSIGN;
00518 static const int TO;
00519 static const int COLON;
00520 static const int S_E;
00521 static const int AT;
00522 static const int ADDR;
00523 static const int REG_IDX;
00524 static const int EQUATE;
00525 static const int MEM_IDX;
00526 static const int TOK_INTEGER;
00527 static const int TOK_FLOAT;
00528 static const int FAST;
00529 static const int OPERAND;
00530 static const int FETCHEXEC;
00531 static const int CAST_OP;
00532 static const int FLAGMACRO;
00533 static const int SUCCESSOR;
00534 static const int NUM;
00535 static const int FLOATNUM;
00536 static const int FCHS;
00537
00538
00539 #line 280 "/usr/local/lib/bison.cc"
00540
00541 #else
00542 enum YY_SSLParser_ENUM_TOKEN { YY_SSLParser_NULL_TOKEN=0
00543
00544
00545 #line 546 "sslparser.cpp"
00546 ,COND_OP=258
00547 ,BIT_OP=259
00548 ,ARITH_OP=260
00549 ,LOG_OP=261
00550 ,NAME=262
00551 ,ASSIGNTYPE=263
00552 ,REG_ID=264
00553 ,REG_NUM=265
00554 ,COND_TNAME=266
00555 ,DECOR=267
00556 ,FARITH_OP=268
00557 ,FPUSH=269
00558 ,FPOP=270
00559 ,TEMP=271
00560 ,SHARES=272
00561 ,CONV_FUNC=273
00562 ,TRUNC_FUNC=274
00563 ,TRANSCEND=275
00564 ,FABS_FUNC=276
00565 ,BIG=277
00566 ,LITTLE=278
00567 ,NAME_CALL=279
00568 ,NAME_LOOKUP=280
00569 ,ENDIANNESS=281
00570 ,COVERS=282
00571 ,INDEX=283
00572 ,NOT=284
00573 ,LNOT=285
00574 ,FNEG=286
00575 ,THEN=287
00576 ,LOOKUP_RDC=288
00577 ,BOGUS=289
00578 ,ASSIGN=290
00579 ,TO=291
00580 ,COLON=292
00581 ,S_E=293
00582 ,AT=294
00583 ,ADDR=295
00584 ,REG_IDX=296
00585 ,EQUATE=297
00586 ,MEM_IDX=298
00587 ,TOK_INTEGER=299
00588 ,TOK_FLOAT=300
00589 ,FAST=301
00590 ,OPERAND=302
00591 ,FETCHEXEC=303
00592 ,CAST_OP=304
00593 ,FLAGMACRO=305
00594 ,SUCCESSOR=306
00595 ,NUM=307
00596 ,FLOATNUM=308
00597 ,FCHS=309
00598
00599
00600 #line 283 "/usr/local/lib/bison.cc"
00601
00602 };
00603 #endif
00604 public:
00605 int YY_SSLParser_PARSE (YY_SSLParser_PARSE_PARAM);
00606 virtual void YY_SSLParser_ERROR(char *msg) YY_SSLParser_ERROR_BODY;
00607 #ifdef YY_SSLParser_PURE
00608 #ifdef YY_SSLParser_LSP_NEEDED
00609 virtual int YY_SSLParser_LEX (YY_SSLParser_STYPE *YY_SSLParser_LVAL,YY_SSLParser_LTYPE *YY_SSLParser_LLOC) YY_SSLParser_LEX_BODY;
00610 #else
00611 virtual int YY_SSLParser_LEX (YY_SSLParser_STYPE *YY_SSLParser_LVAL) YY_SSLParser_LEX_BODY;
00612 #endif
00613 #else
00614 virtual int YY_SSLParser_LEX() YY_SSLParser_LEX_BODY;
00615 YY_SSLParser_STYPE YY_SSLParser_LVAL;
00616 #ifdef YY_SSLParser_LSP_NEEDED
00617 YY_SSLParser_LTYPE YY_SSLParser_LLOC;
00618 #endif
00619 int YY_SSLParser_NERRS;
00620 int YY_SSLParser_CHAR;
00621 #endif
00622 #if YY_SSLParser_DEBUG != 0
00623 int YY_SSLParser_DEBUG_FLAG;
00624 #endif
00625 public:
00626 YY_SSLParser_CLASS(YY_SSLParser_CONSTRUCTOR_PARAM);
00627 public:
00628 YY_SSLParser_MEMBERS
00629 };
00630
00631 #if YY_SSLParser_USE_CONST_TOKEN != 0
00632
00633
00634 #line 635 "sslparser.cpp"
00635 const int YY_SSLParser_CLASS::COND_OP=258;
00636 const int YY_SSLParser_CLASS::BIT_OP=259;
00637 const int YY_SSLParser_CLASS::ARITH_OP=260;
00638 const int YY_SSLParser_CLASS::LOG_OP=261;
00639 const int YY_SSLParser_CLASS::NAME=262;
00640 const int YY_SSLParser_CLASS::ASSIGNTYPE=263;
00641 const int YY_SSLParser_CLASS::REG_ID=264;
00642 const int YY_SSLParser_CLASS::REG_NUM=265;
00643 const int YY_SSLParser_CLASS::COND_TNAME=266;
00644 const int YY_SSLParser_CLASS::DECOR=267;
00645 const int YY_SSLParser_CLASS::FARITH_OP=268;
00646 const int YY_SSLParser_CLASS::FPUSH=269;
00647 const int YY_SSLParser_CLASS::FPOP=270;
00648 const int YY_SSLParser_CLASS::TEMP=271;
00649 const int YY_SSLParser_CLASS::SHARES=272;
00650 const int YY_SSLParser_CLASS::CONV_FUNC=273;
00651 const int YY_SSLParser_CLASS::TRUNC_FUNC=274;
00652 const int YY_SSLParser_CLASS::TRANSCEND=275;
00653 const int YY_SSLParser_CLASS::FABS_FUNC=276;
00654 const int YY_SSLParser_CLASS::BIG=277;
00655 const int YY_SSLParser_CLASS::LITTLE=278;
00656 const int YY_SSLParser_CLASS::NAME_CALL=279;
00657 const int YY_SSLParser_CLASS::NAME_LOOKUP=280;
00658 const int YY_SSLParser_CLASS::ENDIANNESS=281;
00659 const int YY_SSLParser_CLASS::COVERS=282;
00660 const int YY_SSLParser_CLASS::INDEX=283;
00661 const int YY_SSLParser_CLASS::NOT=284;
00662 const int YY_SSLParser_CLASS::LNOT=285;
00663 const int YY_SSLParser_CLASS::FNEG=286;
00664 const int YY_SSLParser_CLASS::THEN=287;
00665 const int YY_SSLParser_CLASS::LOOKUP_RDC=288;
00666 const int YY_SSLParser_CLASS::BOGUS=289;
00667 const int YY_SSLParser_CLASS::ASSIGN=290;
00668 const int YY_SSLParser_CLASS::TO=291;
00669 const int YY_SSLParser_CLASS::COLON=292;
00670 const int YY_SSLParser_CLASS::S_E=293;
00671 const int YY_SSLParser_CLASS::AT=294;
00672 const int YY_SSLParser_CLASS::ADDR=295;
00673 const int YY_SSLParser_CLASS::REG_IDX=296;
00674 const int YY_SSLParser_CLASS::EQUATE=297;
00675 const int YY_SSLParser_CLASS::MEM_IDX=298;
00676 const int YY_SSLParser_CLASS::TOK_INTEGER=299;
00677 const int YY_SSLParser_CLASS::TOK_FLOAT=300;
00678 const int YY_SSLParser_CLASS::FAST=301;
00679 const int YY_SSLParser_CLASS::OPERAND=302;
00680 const int YY_SSLParser_CLASS::FETCHEXEC=303;
00681 const int YY_SSLParser_CLASS::CAST_OP=304;
00682 const int YY_SSLParser_CLASS::FLAGMACRO=305;
00683 const int YY_SSLParser_CLASS::SUCCESSOR=306;
00684 const int YY_SSLParser_CLASS::NUM=307;
00685 const int YY_SSLParser_CLASS::FLOATNUM=308;
00686 const int YY_SSLParser_CLASS::FCHS=309;
00687
00688
00689 #line 314 "/usr/local/lib/bison.cc"
00690
00691 #endif
00692
00693 YY_SSLParser_CLASS::YY_SSLParser_CLASS(YY_SSLParser_CONSTRUCTOR_PARAM) YY_SSLParser_CONSTRUCTOR_INIT
00694 {
00695 #if YY_SSLParser_DEBUG != 0
00696 YY_SSLParser_DEBUG_FLAG=0;
00697 #endif
00698 YY_SSLParser_CONSTRUCTOR_CODE;
00699 };
00700 #endif
00701
00702
00703 #line 704 "sslparser.cpp"
00704
00705
00706 #define YYFINAL 300
00707 #define YYFLAG -32768
00708 #define YYNTBASE 68
00709
00710 #define YYTRANSLATE(x) ((unsigned)(x) <= 309 ? yytranslate[x] : 115)
00711
00712 static const char yytranslate[] = { 0,
00713 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00714 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00715 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00716 2, 2, 2, 62, 2, 64, 2, 2, 63, 66,
00717 61, 2, 2, 56, 2, 2, 2, 2, 2, 2,
00718 2, 2, 2, 2, 2, 2, 2, 2, 55, 2,
00719 2, 2, 67, 2, 2, 2, 2, 2, 2, 2,
00720 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00721 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00722 59, 2, 60, 2, 65, 2, 2, 2, 2, 2,
00723 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00724 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00725 2, 2, 57, 2, 58, 2, 2, 2, 2, 2,
00726 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00727 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00728 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00729 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00730 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00731 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00732 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00733 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00734 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00735 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00736 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00737 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00738 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
00739 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
00740 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
00741 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
00742 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
00743 46, 47, 48, 49, 50, 51, 52, 53, 54
00744 };
00745
00746 #if YY_SSLParser_DEBUG != 0
00747 static const short yyprhs[] = { 0,
00748 0, 2, 4, 6, 10, 13, 15, 18, 20, 22,
00749 24, 26, 28, 30, 33, 37, 39, 45, 51, 55,
00750 56, 57, 61, 62, 66, 70, 72, 76, 83, 94,
00751 109, 120, 129, 133, 135, 142, 146, 152, 156, 158,
00752 160, 162, 165, 167, 171, 176, 178, 182, 184, 188,
00753 192, 195, 197, 199, 201, 203, 207, 213, 217, 221,
00754 227, 231, 232, 237, 239, 242, 244, 246, 249, 253,
00755 257, 261, 266, 271, 275, 278, 280, 282, 286, 290,
00756 293, 295, 299, 301, 305, 307, 308, 310, 314, 316,
00757 317, 324, 329, 331, 333, 336, 338, 340, 344, 346,
00758 354, 358, 366, 370, 374, 376, 378, 382, 386, 390,
00759 394, 397, 400, 403, 406, 409, 413, 417, 421, 425,
00760 429, 435, 437, 439, 443, 445, 449, 451, 459, 461,
00761 464, 468, 472, 475, 477, 479, 481, 484, 488, 490
00762 };
00763
00764 static const short yyrhs[] = { 104,
00765 0, 106, 0, 69, 0, 69, 70, 55, 0, 70,
00766 55, 0, 93, 0, 48, 98, 0, 81, 0, 82,
00767 0, 109, 0, 112, 0, 74, 0, 80, 0, 47,
00768 71, 0, 71, 56, 72, 0, 72, 0, 102, 42,
00769 57, 101, 58, 0, 102, 101, 73, 111, 106, 0,
00770 59, 101, 60, 0, 0, 0, 44, 75, 77, 0,
00771 0, 45, 76, 77, 0, 77, 56, 78, 0, 78,
00772 0, 9, 28, 52, 0, 9, 59, 52, 60, 28,
00773 52, 0, 9, 59, 52, 60, 28, 52, 27, 9,
00774 36, 9, 0, 9, 59, 52, 60, 28, 52, 17,
00775 9, 39, 59, 52, 36, 52, 60, 0, 59, 79,
00776 60, 59, 52, 60, 28, 52, 36, 52, 0, 59,
00777 79, 60, 59, 52, 60, 28, 52, 0, 79, 56,
00778 9, 0, 9, 0, 24, 101, 61, 57, 98, 58,
00779 0, 7, 42, 52, 0, 7, 42, 52, 5, 52,
00780 0, 7, 42, 83, 0, 84, 0, 89, 0, 91,
00781 0, 84, 86, 0, 86, 0, 85, 56, 84, 0,
00782 85, 56, 62, 62, 0, 84, 0, 57, 85, 58,
00783 0, 87, 0, 63, 7, 63, 0, 62, 7, 62,
00784 0, 64, 7, 0, 7, 0, 4, 0, 5, 0,
00785 13, 0, 57, 90, 58, 0, 90, 56, 62, 88,
00786 62, 0, 62, 88, 62, 0, 57, 92, 58, 0,
00787 92, 56, 62, 106, 62, 0, 62, 106, 62, 0,
00788 0, 95, 94, 101, 98, 0, 96, 0, 95, 12,
00789 0, 7, 0, 97, 0, 96, 97, 0, 63, 7,
00790 63, 0, 25, 52, 60, 0, 25, 7, 60, 0,
00791 64, 25, 52, 60, 0, 64, 25, 7, 60, 0,
00792 62, 7, 62, 0, 98, 99, 0, 99, 0, 104,
00793 0, 24, 103, 61, 0, 50, 100, 61, 0, 50,
00794 61, 0, 65, 0, 100, 56, 9, 0, 9, 0,
00795 101, 56, 102, 0, 102, 0, 0, 7, 0, 103,
00796 56, 106, 0, 106, 0, 0, 111, 106, 32, 107,
00797 42, 106, 0, 111, 107, 42, 106, 0, 14, 0,
00798 15, 0, 111, 106, 0, 52, 0, 53, 0, 66,
00799 106, 61, 0, 107, 0, 59, 106, 67, 106, 37,
00800 106, 60, 0, 40, 106, 61, 0, 18, 52, 56,
00801 52, 56, 106, 61, 0, 19, 106, 61, 0, 21,
00802 106, 61, 0, 14, 0, 15, 0, 20, 106, 61,
00803 0, 25, 7, 60, 0, 24, 103, 61, 0, 51,
00804 106, 61, 0, 106, 38, 0, 106, 108, 0, 29,
00805 106, 0, 30, 106, 0, 31, 106, 0, 106, 13,
00806 106, 0, 106, 5, 106, 0, 106, 4, 106, 0,
00807 106, 3, 106, 0, 106, 6, 106, 0, 106, 25,
00808 7, 60, 105, 0, 105, 0, 9, 0, 41, 106,
00809 60, 0, 10, 0, 43, 106, 60, 0, 7, 0,
00810 106, 39, 59, 106, 37, 106, 60, 0, 16, 0,
00811 107, 63, 0, 51, 106, 61, 0, 57, 52, 58,
00812 0, 26, 110, 0, 22, 0, 23, 0, 8, 0,
00813 46, 113, 0, 113, 56, 114, 0, 114, 0, 7,
00814 28, 7, 0
00815 };
00816
00817 #endif
00818
00819 #if YY_SSLParser_DEBUG != 0
00820 static const short yyrline[] = { 0,
00821 219, 223, 228, 231, 233, 236, 239, 244, 246, 249,
00822 253, 256, 259, 262, 266, 268, 271, 289, 306, 307,
00823 310, 314, 314, 317, 319, 320, 323, 329, 334, 368,
00824 390, 404, 415, 419, 426, 434, 441, 454, 460, 466,
00825 470, 476, 487, 492, 500, 503, 508, 512, 517, 523,
00826 526, 541, 558, 563, 567, 573, 579, 585, 592, 598,
00827 604, 610, 615, 621, 625, 648, 652, 655, 661, 665,
00828 678, 687, 698, 707, 712, 722, 729, 736, 752, 756,
00829 759, 764, 772, 782, 789, 793, 798, 803, 808, 813,
00830 818, 828, 834, 839, 846, 851, 856, 860, 864, 868,
00831 873, 878, 883, 888, 893, 896, 901, 907, 930, 956,
00832 961, 969, 978, 982, 986, 990, 994, 998, 1002, 1006,
00833 1013, 1036, 1041, 1068, 1072, 1078, 1082, 1099, 1103, 1108,
00834 1111, 1116, 1122, 1127, 1131, 1136, 1165, 1169, 1172, 1176
00835 };
00836
00837 static const char * const yytname[] = { "$","error","$illegal.","COND_OP",
00838 "BIT_OP","ARITH_OP","LOG_OP","NAME","ASSIGNTYPE","REG_ID","REG_NUM","COND_TNAME",
00839 "DECOR","FARITH_OP","FPUSH","FPOP","TEMP","SHARES","CONV_FUNC","TRUNC_FUNC",
00840 "TRANSCEND","FABS_FUNC","BIG","LITTLE","NAME_CALL","NAME_LOOKUP","ENDIANNESS",
00841 "COVERS","INDEX","NOT","LNOT","FNEG","THEN","LOOKUP_RDC","BOGUS","ASSIGN","TO",
00842 "COLON","S_E","AT","ADDR","REG_IDX","EQUATE","MEM_IDX","TOK_INTEGER","TOK_FLOAT",
00843 "FAST","OPERAND","FETCHEXEC","CAST_OP","FLAGMACRO","SUCCESSOR","NUM","FLOATNUM",
00844 "FCHS","';'","','","'{'","'}'","'['","']'","')'","'\"'","'\\''","'$'","'_'",
00845 "'('","'?'","specorasgn","specification","parts","operandlist","operand","func_parameter",
00846 "reglist","@1","@2","a_reglists","a_reglist","reg_table","flag_fnc","constants",
00847 "table_assign","table_expr","str_expr","str_array","str_term","name_expand",
00848 "bin_oper","opstr_expr","opstr_array","exprstr_expr","exprstr_array","instr",
00849 "@3","instr_name","instr_elem","name_contract","rt_list","rt","flag_list","list_parameter",
00850 "param","list_actualparameter","assign_rt","exp_term","exp","location","cast",
00851 "endianness","esize","assigntype","fastlist","fastentries","fastentry",""
00852 };
00853 #endif
00854
00855 static const short yyr1[] = { 0,
00856 68, 68, 68, 69, 69, 70, 70, 70, 70, 70,
00857 70, 70, 70, 70, 71, 71, 72, 72, 73, 73,
00858 75, 74, 76, 74, 77, 77, 78, 78, 78, 78,
00859 78, 78, 79, 79, 80, 81, 81, 82, 83, 83,
00860 83, 84, 84, 85, 85, 85, 86, 86, 87, 87,
00861 87, 87, 88, 88, 88, 89, 90, 90, 91, 92,
00862 92, 94, 93, 95, 95, 96, 96, 96, 97, 97,
00863 97, 97, 97, 97, 98, 98, 99, 99, 99, 99,
00864 99, 100, 100, 101, 101, 101, 102, 103, 103, 103,
00865 104, 104, 104, 104, 104, 105, 105, 105, 105, 105,
00866 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
00867 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
00868 106, 106, 107, 107, 107, 107, 107, 107, 107, 107,
00869 107, 108, 109, 110, 110, 111, 112, 113, 113, 114
00870 };
00871
00872 static const short yyr2[] = { 0,
00873 1, 1, 1, 3, 2, 1, 2, 1, 1, 1,
00874 1, 1, 1, 2, 3, 1, 5, 5, 3, 0,
00875 0, 3, 0, 3, 3, 1, 3, 6, 10, 14,
00876 10, 8, 3, 1, 6, 3, 5, 3, 1, 1,
00877 1, 2, 1, 3, 4, 1, 3, 1, 3, 3,
00878 2, 1, 1, 1, 1, 3, 5, 3, 3, 5,
00879 3, 0, 4, 1, 2, 1, 1, 2, 3, 3,
00880 3, 4, 4, 3, 2, 1, 1, 3, 3, 2,
00881 1, 3, 1, 3, 1, 0, 1, 3, 1, 0,
00882 6, 4, 1, 1, 2, 1, 1, 3, 1, 7,
00883 3, 7, 3, 3, 1, 1, 3, 3, 3, 3,
00884 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
00885 5, 1, 1, 3, 1, 3, 1, 7, 1, 2,
00886 3, 3, 2, 1, 1, 1, 2, 3, 1, 3
00887 };
00888
00889 static const short yydefact[] = { 0,
00890 66, 136, 123, 125, 105, 106, 129, 0, 0, 0,
00891 0, 86, 0, 0, 0, 0, 0, 0, 0, 0,
00892 21, 23, 0, 0, 0, 0, 96, 97, 0, 0,
00893 0, 0, 0, 3, 0, 12, 13, 8, 9, 6,
00894 62, 64, 67, 1, 122, 2, 99, 10, 0, 11,
00895 0, 0, 127, 105, 106, 90, 0, 0, 0, 0,
00896 127, 0, 85, 0, 89, 0, 0, 134, 135, 133,
00897 113, 114, 115, 0, 0, 0, 0, 0, 0, 137,
00898 139, 87, 14, 16, 86, 93, 94, 90, 0, 81,
00899 7, 76, 77, 0, 0, 0, 0, 0, 0, 66,
00900 86, 0, 0, 5, 65, 86, 68, 0, 0, 0,
00901 0, 0, 0, 111, 0, 0, 112, 130, 95, 99,
00902 52, 36, 0, 0, 0, 0, 38, 39, 43, 48,
00903 40, 41, 0, 0, 103, 107, 104, 0, 0, 0,
00904 109, 71, 70, 101, 124, 126, 0, 0, 22, 26,
00905 24, 0, 0, 0, 0, 20, 0, 83, 80, 0,
00906 75, 110, 0, 74, 69, 0, 0, 98, 0, 4,
00907 0, 119, 118, 117, 120, 116, 0, 0, 0, 0,
00908 0, 0, 0, 0, 46, 0, 0, 0, 0, 0,
00909 51, 42, 0, 108, 84, 0, 88, 0, 0, 34,
00910 0, 0, 140, 138, 15, 86, 86, 0, 78, 0,
00911 79, 0, 73, 72, 71, 63, 0, 0, 132, 0,
00912 99, 92, 37, 53, 54, 127, 55, 0, 0, 0,
00913 47, 0, 56, 0, 59, 50, 49, 0, 0, 27,
00914 0, 0, 0, 25, 0, 0, 0, 82, 0, 121,
00915 0, 0, 58, 61, 0, 44, 0, 0, 0, 35,
00916 0, 33, 0, 17, 19, 18, 0, 0, 91, 45,
00917 0, 0, 102, 0, 0, 100, 128, 57, 60, 28,
00918 0, 0, 0, 0, 0, 0, 32, 0, 0, 0,
00919 0, 29, 31, 0, 0, 0, 30, 0, 0, 0
00920 };
00921
00922 static const short yydefgoto[] = { 298,
00923 34, 35, 83, 84, 208, 36, 77, 78, 149, 150,
00924 201, 37, 38, 39, 127, 185, 186, 129, 130, 228,
00925 131, 187, 132, 188, 40, 106, 41, 42, 43, 91,
00926 92, 160, 62, 63, 64, 93, 45, 65, 47, 117,
00927 48, 70, 49, 50, 80, 81
00928 };
00929
00930 static const short yypact[] = { 146,
00931 463,-32768,-32768,-32768, 28, 35,-32768, -11, 246, 246,
00932 246, 299, 7, 108, 246, 246, 246, 246, 246, 246,
00933 -32768,-32768, 51, 93, 36, 246,-32768,-32768, 246, 106,
00934 131, 94, 246, 178, 90,-32768,-32768,-32768,-32768,-32768,
00935 156, 80,-32768,-32768,-32768, 610, 110,-32768, 246,-32768,
00936 84, 127,-32768,-32768,-32768, 246, 200, 343, 358, 373,
00937 140, 150,-32768, 159, 610, 158, 168,-32768,-32768,-32768,
00938 82, 82, 610, 388, 449, 478, -4, -4, 191, 174,
00939 -32768,-32768, 189,-32768, 5,-32768,-32768, 246, 4,-32768,
00940 36,-32768,-32768, 403, 18, 206, 209, 46, 418, 212,
00941 93, 47, 208,-32768,-32768, 93,-32768, 246, 246, 246,
00942 246, 246, 262,-32768, 214, 222,-32768,-32768, 552, -17,
00943 -32768, 273, 33, 272, 274, 275,-32768, 95,-32768,-32768,
00944 -32768,-32768, 228, 223,-32768,-32768,-32768, 93, 227, 246,
00945 -32768, 523,-32768,-32768,-32768,-32768, 2, 276, 232,-32768,
00946 232, 283, 51, 93, 234, 187, 160,-32768,-32768, 183,
00947 -32768, 3, 246,-32768,-32768, 233, 235,-32768, 236,-32768,
00948 24, 599, 112, 175, 599, 82, 244, 246, 249, 246,
00949 246, 240, 95, 63, 95, -22, 13, 192, 254, 231,
00950 -32768,-32768, 255,-32768,-32768, 36, 610, 269, 285,-32768,
00951 171, -4,-32768,-32768,-32768, 93, 93, 317,-32768, 318,
00952 -32768, 568,-32768,-32768,-32768, 36, 246, 595,-32768, 610,
00953 132, 610,-32768,-32768,-32768, 254,-32768, 264, 297, 172,
00954 -32768, 281,-32768, 282,-32768,-32768,-32768, 246, 529,-32768,
00955 278, 336, 296,-32768, 201, 177, 246,-32768, 246,-32768,
00956 246, 246,-32768,-32768, 1, 95, 119, 246, 433,-32768,
00957 329,-32768, 308,-32768,-32768, 610, 494, 509, 610,-32768,
00958 307, 328,-32768, 320, 310,-32768,-32768,-32768,-32768, 25,
00959 345, 365, 366, 332, 341, 351, 352, 330, 386, 347,
00960 350,-32768,-32768, 367, 353, 354,-32768, 410, 417,-32768
00961 };
00962
00963 static const short yypgoto[] = {-32768,
00964 -32768, 384,-32768, 266,-32768,-32768,-32768,-32768, 355, 230,
00965 -32768,-32768,-32768,-32768,-32768, -48,-32768, -121,-32768, 190,
00966 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 383, -134,
00967 -90,-32768, -79, -20, 356, 429, 218, 0, -47,-32768,
00968 -32768,-32768, 242,-32768,-32768, 287
00969 };
00970
00971
00972 #define YYLAST 667
00973
00974
00975 static const short yytable[] = { 46,
00976 161, 120, 128, 85, 147, 156, 192, 189, 58, 59,
00977 60, 82, 158, 66, 71, 72, 73, 74, 75, 76,
00978 108, 109, 110, 111, 181, 94, 171, -93, 95, 198,
00979 112, 2, 99, 230, -94, 231, 216, 86, 87, 121,
00980 52, 282, 113, 2, -131, 118, 155, 88, 119, 86,
00981 87, 283, 166, 169, 148, 114, 115, 79, 67, 88,
00982 199, 239, 270, 192, 159, -131, 224, 225, 232, 226,
00983 233, 3, 4, 89, 116, 227, 54, 55, 7, 138,
00984 8, 9, 10, 11, 163, 89, 56, 57, 90, 183,
00985 121, 15, 16, 17, 184, 125, 126, 167, 67, 82,
00986 90, 121, 18, 19, 102, 20, 113, 172, 173, 174,
00987 175, 176, 96, 26, 27, 28, 110, 195, 98, 114,
00988 115, 29, 224, 225, 112, 161, 245, 246, 33, 68,
00989 69, 227, 221, 85, 192, 122, 113, 97, 116, 197,
00990 123, 30, 31, 32, 104, 124, 125, 126, 161, 114,
00991 115, 183, 1, 2, 3, 4, 124, 125, 126, 5,
00992 6, 7, 212, 8, 9, 10, 11, 105, 116, 12,
00993 13, 14, 118, 252, 15, 16, 17, 218, 121, 220,
00994 222, 256, 133, 229, 100, 18, 19, 112, 20, 21,
00995 22, 23, 24, 25, 118, -87, 26, 27, 28, 113,
00996 -87, 101, 102, 14, 29, 138, 134, 30, 31, 32,
00997 139, 33, 114, 115, 140, 140, 220, 142, 152, 141,
00998 209, 21, 22, 23, 24, 25, 242, 143, 183, 153,
00999 243, 116, 138, 255, 125, 126, 265, 259, 210, 30,
01000 31, 32, 138, 211, 154, 207, 266, 234, 267, 235,
01001 268, 269, 53, 51, 3, 4, 138, 272, 264, 54,
01002 55, 7, 170, 8, 9, 10, 11, 164, 177, 56,
01003 57, 165, 178, 179, 15, 16, 17, 182, 189, 193,
01004 190, 191, 194, 196, 200, 18, 19, 202, 20, 203,
01005 206, 223, 213, 237, 214, 215, 26, 27, 28, 108,
01006 109, 110, 111, 217, 29, 61, 219, 3, 4, 112,
01007 238, 33, 54, 55, 7, 236, 8, 9, 10, 11,
01008 240, 113, 56, 57, 2, 253, 248, 15, 16, 17,
01009 108, 109, 110, 111, 114, 115, 241, 261, 18, 19,
01010 112, 20, 257, 258, 262, 108, 109, 110, 111, 26,
01011 27, 28, 113, 116, 263, 112, 274, 29, 254, 275,
01012 108, 109, 110, 111, 33, 114, 115, 113, 278, 281,
01013 112, 280, 284, 285, 286, 108, 109, 110, 111, 288,
01014 114, 115, 113, 287, 116, 112, 289, 290, 291, 279,
01015 108, 109, 110, 111, 292, 114, 115, 113, 293, 116,
01016 112, 294, 295, 135, 296, 108, 109, 110, 111, 299,
01017 114, 115, 113, 297, 116, 112, 300, 103, 136, 205,
01018 108, 109, 110, 111, 107, 114, 115, 113, 44, 116,
01019 112, 244, 151, 137, 250, 108, 109, 110, 111, 204,
01020 114, 115, 113, 157, 116, 112, 271, 0, 144, 247,
01021 0, 108, 109, 110, 111, 114, 115, 113, 0, 116,
01022 0, 112, -127, 162, 0, -127, -127, -127, -127, 0,
01023 114, 115, 0, 113, 116, -127, 0, 0, 168, 0,
01024 108, 109, 110, 111, 0, 0, 114, 115, 0, 116,
01025 112, 0, 0, 273, 0, 0, 108, 109, 110, 111,
01026 -127, -127, 113, 0, 51, 116, 112, 0, 145, 0,
01027 0, 108, 109, 110, 111, 114, 115, 0, 113, -127,
01028 0, 112, -108, 0, 0, -108, -108, -108, -108, 0,
01029 0, 114, 115, 113, 116, -108, 2, 146, 0, 0,
01030 0, 0, 86, 87, 0, 0, 114, 115, 0, 0,
01031 116, 0, 88, 276, 108, 109, 110, 111, 0, 0,
01032 -108, -108, 0, 0, 112, 116, 0, 0, 277, 0,
01033 108, 109, 110, 111, 0, 0, 113, 0, 89, -108,
01034 112, 0, 0, 180, 0, 0, 260, 0, 0, 114,
01035 115, 0, 113, 90, 0, 0, 0, 108, 109, 110,
01036 111, 108, 109, 110, 249, 114, 115, 112, 116, 0,
01037 0, 112, 108, 109, 110, 111, 0, 0, 0, 113,
01038 0, 0, 112, 113, 116, 0, 0, 0, 0, 0,
01039 0, 251, 114, 115, 113, 0, 114, 115, 0, 0,
01040 0, 0, 0, 0, 0, 0, 0, 114, 115, 0,
01041 0, 116, 0, 0, 0, 116, 0, 0, 0, 0,
01042 0, 0, 0, 0, 0, 0, 116
01043 };
01044
01045 static const short yycheck[] = { 0,
01046 91, 49, 51, 24, 9, 85, 128, 7, 9, 10,
01047 11, 7, 9, 7, 15, 16, 17, 18, 19, 20,
01048 3, 4, 5, 6, 42, 26, 106, 0, 29, 28,
01049 13, 8, 33, 56, 0, 58, 171, 14, 15, 7,
01050 52, 17, 25, 8, 42, 63, 42, 24, 49, 14,
01051 15, 27, 7, 7, 59, 38, 39, 7, 52, 24,
01052 59, 196, 62, 185, 61, 63, 4, 5, 56, 7,
01053 58, 9, 10, 50, 57, 13, 14, 15, 16, 56,
01054 18, 19, 20, 21, 67, 50, 24, 25, 65, 57,
01055 7, 29, 30, 31, 62, 63, 64, 52, 52, 7,
01056 65, 7, 40, 41, 25, 43, 25, 108, 109, 110,
01057 111, 112, 7, 51, 52, 53, 5, 138, 25, 38,
01058 39, 59, 4, 5, 13, 216, 206, 207, 66, 22,
01059 23, 13, 180, 154, 256, 52, 25, 7, 57, 140,
01060 57, 62, 63, 64, 55, 62, 63, 64, 239, 38,
01061 39, 57, 7, 8, 9, 10, 62, 63, 64, 14,
01062 15, 16, 163, 18, 19, 20, 21, 12, 57, 24,
01063 25, 26, 63, 42, 29, 30, 31, 178, 7, 180,
01064 181, 230, 56, 184, 7, 40, 41, 13, 43, 44,
01065 45, 46, 47, 48, 63, 56, 51, 52, 53, 25,
01066 61, 24, 25, 26, 59, 56, 7, 62, 63, 64,
01067 61, 66, 38, 39, 56, 56, 217, 60, 28, 61,
01068 61, 44, 45, 46, 47, 48, 56, 60, 57, 56,
01069 60, 57, 56, 62, 63, 64, 60, 238, 56, 62,
01070 63, 64, 56, 61, 56, 59, 247, 56, 249, 58,
01071 251, 252, 7, 42, 9, 10, 56, 258, 58, 14,
01072 15, 16, 55, 18, 19, 20, 21, 62, 7, 24,
01073 25, 63, 59, 52, 29, 30, 31, 5, 7, 52,
01074 7, 7, 60, 57, 9, 40, 41, 56, 43, 7,
01075 57, 52, 60, 63, 60, 60, 51, 52, 53, 3,
01076 4, 5, 6, 60, 59, 7, 58, 9, 10, 13,
01077 56, 66, 14, 15, 16, 62, 18, 19, 20, 21,
01078 52, 25, 24, 25, 8, 62, 9, 29, 30, 31,
01079 3, 4, 5, 6, 38, 39, 52, 60, 40, 41,
01080 13, 43, 62, 62, 9, 3, 4, 5, 6, 51,
01081 52, 53, 25, 57, 59, 13, 28, 59, 62, 52,
01082 3, 4, 5, 6, 66, 38, 39, 25, 62, 60,
01083 13, 52, 28, 9, 9, 3, 4, 5, 6, 39,
01084 38, 39, 25, 52, 57, 13, 36, 36, 59, 62,
01085 3, 4, 5, 6, 9, 38, 39, 25, 52, 57,
01086 13, 52, 36, 61, 52, 3, 4, 5, 6, 0,
01087 38, 39, 25, 60, 57, 13, 0, 34, 61, 154,
01088 3, 4, 5, 6, 42, 38, 39, 25, 0, 57,
01089 13, 202, 78, 61, 217, 3, 4, 5, 6, 153,
01090 38, 39, 25, 88, 57, 13, 257, -1, 61, 208,
01091 -1, 3, 4, 5, 6, 38, 39, 25, -1, 57,
01092 -1, 13, 0, 61, -1, 3, 4, 5, 6, -1,
01093 38, 39, -1, 25, 57, 13, -1, -1, 61, -1,
01094 3, 4, 5, 6, -1, -1, 38, 39, -1, 57,
01095 13, -1, -1, 61, -1, -1, 3, 4, 5, 6,
01096 38, 39, 25, -1, 42, 57, 13, -1, 60, -1,
01097 -1, 3, 4, 5, 6, 38, 39, -1, 25, 57,
01098 -1, 13, 0, -1, -1, 3, 4, 5, 6, -1,
01099 -1, 38, 39, 25, 57, 13, 8, 60, -1, -1,
01100 -1, -1, 14, 15, -1, -1, 38, 39, -1, -1,
01101 57, -1, 24, 60, 3, 4, 5, 6, -1, -1,
01102 38, 39, -1, -1, 13, 57, -1, -1, 60, -1,
01103 3, 4, 5, 6, -1, -1, 25, -1, 50, 57,
01104 13, -1, -1, 32, -1, -1, 58, -1, -1, 38,
01105 39, -1, 25, 65, -1, -1, -1, 3, 4, 5,
01106 6, 3, 4, 5, 37, 38, 39, 13, 57, -1,
01107 -1, 13, 3, 4, 5, 6, -1, -1, -1, 25,
01108 -1, -1, 13, 25, 57, -1, -1, -1, -1, -1,
01109 -1, 37, 38, 39, 25, -1, 38, 39, -1, -1,
01110 -1, -1, -1, -1, -1, -1, -1, 38, 39, -1,
01111 -1, 57, -1, -1, -1, 57, -1, -1, -1, -1,
01112 -1, -1, -1, -1, -1, -1, 57
01113 };
01114
01115 #line 325 "/usr/local/lib/bison.cc"
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127
01128
01129
01130 #if YY_SSLParser_USE_GOTO != 0
01131
01132
01133
01134
01135
01136
01137
01138 #define YYGOTO(lb) {yy_gotostate=lb;continue;}
01139 #define YYBEGINGOTO enum yy_labels yy_gotostate=yygotostart; \
01140 for(;;) switch(yy_gotostate) { case yygotostart: {
01141 #define YYLABEL(lb) } case lb: {
01142 #define YYENDGOTO } }
01143 #define YYBEGINDECLARELABEL enum yy_labels {yygotostart
01144 #define YYDECLARELABEL(lb) ,lb
01145 #define YYENDDECLARELABEL };
01146 #else
01147
01148 #define YYGOTO(lb) goto lb
01149 #define YYBEGINGOTO
01150 #define YYLABEL(lb) lb:
01151 #define YYENDGOTO
01152 #define YYBEGINDECLARELABEL
01153 #define YYDECLARELABEL(lb)
01154 #define YYENDDECLARELABEL
01155 #endif
01156
01157 YYBEGINDECLARELABEL
01158 YYDECLARELABEL(yynewstate)
01159 YYDECLARELABEL(yybackup)
01160
01161 YYDECLARELABEL(yydefault)
01162 YYDECLARELABEL(yyreduce)
01163 YYDECLARELABEL(yyerrlab)
01164 YYDECLARELABEL(yyerrlab1)
01165 YYDECLARELABEL(yyerrdefault)
01166 YYDECLARELABEL(yyerrpop)
01167 YYDECLARELABEL(yyerrhandle)
01168 YYENDDECLARELABEL
01169
01170
01171 #ifdef __HAVE_NO_ALLOCA
01172 static int __alloca_free_ptr(char *ptr,char *ref)
01173 {if(ptr!=ref) free(ptr);
01174 return 0;}
01175
01176 #define __ALLOCA_alloca(size) malloc(size)
01177 #define __ALLOCA_free(ptr,ref) __alloca_free_ptr((char *)ptr,(char *)ref)
01178
01179 #ifdef YY_SSLParser_LSP_NEEDED
01180 #define __ALLOCA_return(num) \
01181 return( __ALLOCA_free(yyss,yyssa)+\
01182 __ALLOCA_free(yyvs,yyvsa)+\
01183 __ALLOCA_free(yyls,yylsa)+\
01184 (num))
01185 #else
01186 #define __ALLOCA_return(num) \
01187 return( __ALLOCA_free(yyss,yyssa)+\
01188 __ALLOCA_free(yyvs,yyvsa)+\
01189 (num))
01190 #endif
01191 #else
01192 #define __ALLOCA_return(num) return(num)
01193 #define __ALLOCA_alloca(size) alloca(size)
01194 #define __ALLOCA_free(ptr,ref)
01195 #endif
01196
01197
01198
01199 #define yyerrok (yyerrstatus = 0)
01200 #define yyclearin (YY_SSLParser_CHAR = YYEMPTY)
01201 #define YYEMPTY -2
01202 #define YYEOF 0
01203 #define YYACCEPT __ALLOCA_return(0)
01204 #define YYABORT __ALLOCA_return(1)
01205 #define YYERROR YYGOTO(yyerrlab1)
01206
01207
01208
01209
01210 #define YYFAIL YYGOTO(yyerrlab)
01211 #define YYRECOVERING() (!!yyerrstatus)
01212 #define YYBACKUP(token, value) \
01213 do \
01214 if (YY_SSLParser_CHAR == YYEMPTY && yylen == 1) \
01215 { YY_SSLParser_CHAR = (token), YY_SSLParser_LVAL = (value); \
01216 yychar1 = YYTRANSLATE (YY_SSLParser_CHAR); \
01217 YYPOPSTACK; \
01218 YYGOTO(yybackup); \
01219 } \
01220 else \
01221 { YY_SSLParser_ERROR ("syntax error: cannot back up"); YYERROR; } \
01222 while (0)
01223
01224 #define YYTERROR 1
01225 #define YYERRCODE 256
01226
01227 #ifndef YY_SSLParser_PURE
01228
01229 #define YYLEX YY_SSLParser_LEX()
01230 #ifndef YY_USE_CLASS
01231
01232 int YY_SSLParser_CHAR;
01233 YY_SSLParser_STYPE YY_SSLParser_LVAL;
01234
01235 int YY_SSLParser_NERRS;
01236 #ifdef YY_SSLParser_LSP_NEEDED
01237 YY_SSLParser_LTYPE YY_SSLParser_LLOC;
01238
01239 #endif
01240 #endif
01241
01242
01243 #else
01244
01245 #ifdef YY_SSLParser_LSP_NEEDED
01246 #define YYLEX YY_SSLParser_LEX(&YY_SSLParser_LVAL, &YY_SSLParser_LLOC)
01247 #else
01248 #define YYLEX YY_SSLParser_LEX(&YY_SSLParser_LVAL)
01249 #endif
01250 #endif
01251 #ifndef YY_USE_CLASS
01252 #if YY_SSLParser_DEBUG != 0
01253 int YY_SSLParser_DEBUG_FLAG;
01254
01255
01256 #endif
01257 #endif
01258
01259
01260
01261
01262
01263 #ifndef YYINITDEPTH
01264 #define YYINITDEPTH 200
01265 #endif
01266
01267
01268
01269
01270 #if YYMAXDEPTH == 0
01271 #undef YYMAXDEPTH
01272 #endif
01273
01274 #ifndef YYMAXDEPTH
01275 #define YYMAXDEPTH 10000
01276 #endif
01277
01278
01279 #if __GNUC__ > 1
01280 #define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
01281 #else
01282
01283
01284
01285
01286 #ifdef __cplusplus
01287 static void __yy_bcopy (char *from, char *to, int count)
01288 #else
01289 #ifdef __STDC__
01290 static void __yy_bcopy (char *from, char *to, int count)
01291 #else
01292 static void __yy_bcopy (from, to, count)
01293 char *from;
01294 char *to;
01295 int count;
01296 #endif
01297 #endif
01298 {
01299 register char *f = from;
01300 register char *t = to;
01301 register int i = count;
01302
01303 while (i-- > 0)
01304 *t++ = *f++;
01305 }
01306 #endif
01307
01308 int
01309 #ifdef YY_USE_CLASS
01310 YY_SSLParser_CLASS::
01311 #endif
01312 YY_SSLParser_PARSE(YY_SSLParser_PARSE_PARAM)
01313 #ifndef __STDC__
01314 #ifndef __cplusplus
01315 #ifndef YY_USE_CLASS
01316
01317 YY_SSLParser_PARSE_PARAM_DEF
01318 #endif
01319 #endif
01320 #endif
01321 {
01322 register int yystate;
01323 register int yyn;
01324 register short *yyssp;
01325 register YY_SSLParser_STYPE *yyvsp;
01326 int yyerrstatus;
01327 int yychar1=0;
01328
01329 short yyssa[YYINITDEPTH];
01330 YY_SSLParser_STYPE yyvsa[YYINITDEPTH];
01331
01332 short *yyss = yyssa;
01333 YY_SSLParser_STYPE *yyvs = yyvsa;
01334
01335 #ifdef YY_SSLParser_LSP_NEEDED
01336 YY_SSLParser_LTYPE yylsa[YYINITDEPTH];
01337 YY_SSLParser_LTYPE *yyls = yylsa;
01338 YY_SSLParser_LTYPE *yylsp;
01339
01340 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
01341 #else
01342 #define YYPOPSTACK (yyvsp--, yyssp--)
01343 #endif
01344
01345 int yystacksize = YYINITDEPTH;
01346
01347 #ifdef YY_SSLParser_PURE
01348 int YY_SSLParser_CHAR;
01349 YY_SSLParser_STYPE YY_SSLParser_LVAL;
01350 int YY_SSLParser_NERRS;
01351 #ifdef YY_SSLParser_LSP_NEEDED
01352 YY_SSLParser_LTYPE YY_SSLParser_LLOC;
01353 #endif
01354 #endif
01355
01356 YY_SSLParser_STYPE yyval;
01357
01358
01359
01360 int yylen;
01361
01362 YYBEGINGOTO
01363
01364 #if YY_SSLParser_DEBUG != 0
01365 if (YY_SSLParser_DEBUG_FLAG)
01366 fprintf(stderr, "Starting parse\n");
01367 #endif
01368 yystate = 0;
01369 yyerrstatus = 0;
01370 YY_SSLParser_NERRS = 0;
01371 YY_SSLParser_CHAR = YYEMPTY;
01372
01373
01374
01375
01376
01377
01378 yyssp = yyss - 1;
01379 yyvsp = yyvs;
01380 #ifdef YY_SSLParser_LSP_NEEDED
01381 yylsp = yyls;
01382 #endif
01383
01384
01385
01386
01387 YYLABEL(yynewstate)
01388
01389 *++yyssp = yystate;
01390
01391 if (yyssp >= yyss + yystacksize - 1)
01392 {
01393
01394
01395 YY_SSLParser_STYPE *yyvs1 = yyvs;
01396 short *yyss1 = yyss;
01397 #ifdef YY_SSLParser_LSP_NEEDED
01398 YY_SSLParser_LTYPE *yyls1 = yyls;
01399 #endif
01400
01401
01402 int size = yyssp - yyss + 1;
01403
01404 #ifdef yyoverflow
01405
01406
01407 #ifdef YY_SSLParser_LSP_NEEDED
01408
01409
01410 yyoverflow("parser stack overflow",
01411 &yyss1, size * sizeof (*yyssp),
01412 &yyvs1, size * sizeof (*yyvsp),
01413 &yyls1, size * sizeof (*yylsp),
01414 &yystacksize);
01415 #else
01416 yyoverflow("parser stack overflow",
01417 &yyss1, size * sizeof (*yyssp),
01418 &yyvs1, size * sizeof (*yyvsp),
01419 &yystacksize);
01420 #endif
01421
01422 yyss = yyss1; yyvs = yyvs1;
01423 #ifdef YY_SSLParser_LSP_NEEDED
01424 yyls = yyls1;
01425 #endif
01426 #else
01427
01428 if (yystacksize >= YYMAXDEPTH)
01429 {
01430 YY_SSLParser_ERROR("parser stack overflow");
01431 __ALLOCA_return(2);
01432 }
01433 yystacksize *= 2;
01434 if (yystacksize > YYMAXDEPTH)
01435 yystacksize = YYMAXDEPTH;
01436 yyss = (short *) __ALLOCA_alloca (yystacksize * sizeof (*yyssp));
01437 __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
01438 __ALLOCA_free(yyss1,yyssa);
01439 yyvs = (YY_SSLParser_STYPE *) __ALLOCA_alloca (yystacksize * sizeof (*yyvsp));
01440 __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
01441 __ALLOCA_free(yyvs1,yyvsa);
01442 #ifdef YY_SSLParser_LSP_NEEDED
01443 yyls = (YY_SSLParser_LTYPE *) __ALLOCA_alloca (yystacksize * sizeof (*yylsp));
01444 __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
01445 __ALLOCA_free(yyls1,yylsa);
01446 #endif
01447 #endif
01448
01449 yyssp = yyss + size - 1;
01450 yyvsp = yyvs + size - 1;
01451 #ifdef YY_SSLParser_LSP_NEEDED
01452 yylsp = yyls + size - 1;
01453 #endif
01454
01455 #if YY_SSLParser_DEBUG != 0
01456 if (YY_SSLParser_DEBUG_FLAG)
01457 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
01458 #endif
01459
01460 if (yyssp >= yyss + yystacksize - 1)
01461 YYABORT;
01462 }
01463
01464 #if YY_SSLParser_DEBUG != 0
01465 if (YY_SSLParser_DEBUG_FLAG)
01466 fprintf(stderr, "Entering state %d\n", yystate);
01467 #endif
01468
01469 YYGOTO(yybackup);
01470 YYLABEL(yybackup)
01471
01472
01473
01474
01475
01476
01477
01478 yyn = yypact[yystate];
01479 if (yyn == YYFLAG)
01480 YYGOTO(yydefault);
01481
01482
01483
01484
01485
01486
01487 if (YY_SSLParser_CHAR == YYEMPTY)
01488 {
01489 #if YY_SSLParser_DEBUG != 0
01490 if (YY_SSLParser_DEBUG_FLAG)
01491 fprintf(stderr, "Reading a token: ");
01492 #endif
01493 YY_SSLParser_CHAR = YYLEX;
01494 }
01495
01496
01497
01498 if (YY_SSLParser_CHAR <= 0)
01499 {
01500 yychar1 = 0;
01501 YY_SSLParser_CHAR = YYEOF;
01502
01503 #if YY_SSLParser_DEBUG != 0
01504 if (YY_SSLParser_DEBUG_FLAG)
01505 fprintf(stderr, "Now at end of input.\n");
01506 #endif
01507 }
01508 else
01509 {
01510 yychar1 = YYTRANSLATE(YY_SSLParser_CHAR);
01511
01512 #if YY_SSLParser_DEBUG != 0
01513 if (YY_SSLParser_DEBUG_FLAG)
01514 {
01515 fprintf (stderr, "Next token is %d (%s", YY_SSLParser_CHAR, yytname[yychar1]);
01516
01517
01518 #ifdef YYPRINT
01519 YYPRINT (stderr, YY_SSLParser_CHAR, YY_SSLParser_LVAL);
01520 #endif
01521 fprintf (stderr, ")\n");
01522 }
01523 #endif
01524 }
01525
01526 yyn += yychar1;
01527 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
01528 YYGOTO(yydefault);
01529
01530 yyn = yytable[yyn];
01531
01532
01533
01534
01535
01536
01537
01538
01539 if (yyn < 0)
01540 {
01541 if (yyn == YYFLAG)
01542 YYGOTO(yyerrlab);
01543 yyn = -yyn;
01544 YYGOTO(yyreduce);
01545 }
01546 else if (yyn == 0)
01547 YYGOTO(yyerrlab);
01548
01549 if (yyn == YYFINAL)
01550 YYACCEPT;
01551
01552
01553
01554 #if YY_SSLParser_DEBUG != 0
01555 if (YY_SSLParser_DEBUG_FLAG)
01556 fprintf(stderr, "Shifting token %d (%s), ", YY_SSLParser_CHAR, yytname[yychar1]);
01557 #endif
01558
01559
01560 if (YY_SSLParser_CHAR != YYEOF)
01561 YY_SSLParser_CHAR = YYEMPTY;
01562
01563 *++yyvsp = YY_SSLParser_LVAL;
01564 #ifdef YY_SSLParser_LSP_NEEDED
01565 *++yylsp = YY_SSLParser_LLOC;
01566 #endif
01567
01568
01569 if (yyerrstatus) yyerrstatus--;
01570
01571 yystate = yyn;
01572 YYGOTO(yynewstate);
01573
01574
01575 YYLABEL(yydefault)
01576
01577 yyn = yydefact[yystate];
01578 if (yyn == 0)
01579 YYGOTO(yyerrlab);
01580
01581
01582 YYLABEL(yyreduce)
01583 yylen = yyr2[yyn];
01584 if (yylen > 0)
01585 yyval = yyvsp[1-yylen];
01586
01587 #if YY_SSLParser_DEBUG != 0
01588 if (YY_SSLParser_DEBUG_FLAG)
01589 {
01590 int i;
01591
01592 fprintf (stderr, "Reducing via rule %d (line %d), ",
01593 yyn, yyrline[yyn]);
01594
01595
01596 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
01597 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
01598 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
01599 }
01600 #endif
01601
01602
01603
01604 #line 1605 "sslparser.cpp"
01605
01606 switch (yyn) {
01607
01608 case 1:
01609 #line 220 "sslparser.y"
01610 {
01611 the_asgn = yyvsp[0].regtransfer;
01612 ;
01613 break;}
01614 case 2:
01615 #line 223 "sslparser.y"
01616 {
01617 the_asgn = new Assign(
01618 new Terminal(opNil),
01619 yyvsp[0].exp);
01620 ;
01621 break;}
01622 case 7:
01623 #line 239 "sslparser.y"
01624 {
01625 Dict.fetchExecCycle = yyvsp[0].rtlist;
01626 ;
01627 break;}
01628 case 14:
01629 #line 262 "sslparser.y"
01630 { Dict.fixupParams(); ;
01631 break;}
01632 case 17:
01633 #line 275 "sslparser.y"
01634 {
01635
01636 Dict.DetParamMap[yyvsp[-4].str].params = *yyvsp[-1].parmlist;
01637 Dict.DetParamMap[yyvsp[-4].str].kind = PARAM_VARIANT;
01638
01639 ;
01640 break;}
01641 case 18:
01642 #line 289 "sslparser.y"
01643 {
01644 std::map<std::string, InsNameElem*> m;
01645 ParamEntry ¶m = Dict.DetParamMap[yyvsp[-4].str];
01646 Statement* asgn = new Assign(yyvsp[-1].typ, new Terminal(opNil), yyvsp[0].exp);
01647
01648 param.params = *yyvsp[-3].parmlist;
01649 param.funcParams = *yyvsp[-2].parmlist;
01650 param.asgn = asgn;
01651 param.kind = PARAM_ASGN;
01652
01653 if( param.funcParams.size() != 0 )
01654 param.kind = PARAM_LAMBDA;
01655
01656
01657 ;
01658 break;}
01659 case 19:
01660 #line 306 "sslparser.y"
01661 { yyval.parmlist = yyvsp[-1].parmlist; ;
01662 break;}
01663 case 20:
01664 #line 307 "sslparser.y"
01665 { yyval.parmlist = new std::list<std::string>(); ;
01666 break;}
01667 case 21:
01668 #line 311 "sslparser.y"
01669 {
01670 bFloat = false;
01671 ;
01672 break;}
01673 case 23:
01674 #line 314 "sslparser.y"
01675 {
01676 bFloat = true;
01677 ;
01678 break;}
01679 case 27:
01680 #line 324 "sslparser.y"
01681 {
01682 if (Dict.RegMap.find(yyvsp[-2].str) != Dict.RegMap.end())
01683 yyerror("Name reglist decared twice\n");
01684 Dict.RegMap[yyvsp[-2].str] = yyvsp[0].num;
01685 ;
01686 break;}
01687 case 28:
01688 #line 329 "sslparser.y"
01689 {
01690 if (Dict.RegMap.find(yyvsp[-5].str) != Dict.RegMap.end())
01691 yyerror("Name reglist declared twice\n");
01692 Dict.addRegister( yyvsp[-5].str, yyvsp[0].num, yyvsp[-3].num, bFloat);
01693 ;
01694 break;}
01695 case 29:
01696 #line 334 "sslparser.y"
01697 {
01698 if (Dict.RegMap.find(yyvsp[-9].str) != Dict.RegMap.end())
01699 yyerror("Name reglist declared twice\n");
01700 Dict.RegMap[yyvsp[-9].str] = yyvsp[-4].num;
01701
01702 if (Dict.DetRegMap.find(yyvsp[-4].num) != Dict.DetRegMap.end())
01703 yyerror("Index used for more than one register\n");
01704 Dict.DetRegMap[yyvsp[-4].num].s_name(yyvsp[-9].str);
01705 Dict.DetRegMap[yyvsp[-4].num].s_size(yyvsp[-7].num);
01706 Dict.DetRegMap[yyvsp[-4].num].s_address(NULL);
01707
01708 if ((Dict.RegMap.find(yyvsp[-2].str) == Dict.RegMap.end()) || (Dict.RegMap.find(yyvsp[0].str) == Dict.RegMap.end()))
01709 yyerror("Undefined range\n");
01710 else {
01711 int bitsize = Dict.DetRegMap[Dict.RegMap[yyvsp[0].str]].g_size();
01712 for (int i = Dict.RegMap[yyvsp[-2].str]; i != Dict.RegMap[yyvsp[0].str]; i++) {
01713 if (Dict.DetRegMap.find(i) == Dict.DetRegMap.end()) {
01714 yyerror("Not all regesters in range defined\n");
01715 break;
01716 }
01717 bitsize += Dict.DetRegMap[i].g_size();
01718 if (bitsize > yyvsp[-7].num) {
01719 yyerror("Range exceeds size of register\n");
01720 break;
01721 }
01722 }
01723 if (bitsize < yyvsp[-7].num)
01724 yyerror("Register size is exceeds regesters in range\n");
01725
01726 }
01727 Dict.DetRegMap[yyvsp[-4].num].s_mappedIndex(Dict.RegMap[yyvsp[-2].str]);
01728 Dict.DetRegMap[yyvsp[-4].num].s_mappedOffset(0);
01729 Dict.DetRegMap[yyvsp[-4].num].s_float(bFloat);
01730 ;
01731 break;}
01732 case 30:
01733 #line 368 "sslparser.y"
01734 {
01735 if (Dict.RegMap.find(yyvsp[-13].str) != Dict.RegMap.end())
01736 yyerror("Name reglist declared twice\n");
01737 Dict.RegMap[yyvsp[-13].str] = yyvsp[-8].num;
01738
01739 if (Dict.DetRegMap.find(yyvsp[-8].num) != Dict.DetRegMap.end())
01740 yyerror("Index used for more than one register\n");
01741 Dict.DetRegMap[yyvsp[-8].num].s_name(yyvsp[-13].str);
01742 Dict.DetRegMap[yyvsp[-8].num].s_size(yyvsp[-11].num);
01743 Dict.DetRegMap[yyvsp[-8].num].s_address(NULL);
01744
01745 if (yyvsp[-11].num != (yyvsp[-1].num - yyvsp[-3].num) + 1)
01746 yyerror("Size does not equal range\n");
01747 if (Dict.RegMap.find(yyvsp[-6].str) != Dict.RegMap.end()) {
01748 if (yyvsp[-1].num >= Dict.DetRegMap[Dict.RegMap[yyvsp[-6].str]].g_size())
01749 yyerror("Range extends over target register\n");
01750 } else
01751 yyerror("Shared index not yet defined\n");
01752 Dict.DetRegMap[yyvsp[-8].num].s_mappedIndex(Dict.RegMap[yyvsp[-6].str]);
01753 Dict.DetRegMap[yyvsp[-8].num].s_mappedOffset(yyvsp[-3].num);
01754 Dict.DetRegMap[yyvsp[-8].num].s_float(bFloat);
01755 ;
01756 break;}
01757 case 31:
01758 #line 390 "sslparser.y"
01759 {
01760 if ((int)yyvsp[-8].strlist->size() != (yyvsp[0].num - yyvsp[-2].num + 1)) {
01761 std::cerr << "size of register array does not match mapping to r[" << yyvsp[-2].num << ".." << yyvsp[0].num << "]\n";
01762 exit(1);
01763 } else {
01764 std::list<std::string>::iterator loc = yyvsp[-8].strlist->begin();
01765 for (int x = yyvsp[-2].num; x <= yyvsp[0].num; x++, loc++) {
01766 if (Dict.RegMap.find(*loc) != Dict.RegMap.end())
01767 yyerror("Name reglist declared twice\n");
01768 Dict.addRegister( loc->c_str(), x, yyvsp[-5].num, bFloat);
01769 }
01770
01771 }
01772 ;
01773 break;}
01774 case 32:
01775 #line 404 "sslparser.y"
01776 {
01777 std::list<std::string>::iterator loc = yyvsp[-6].strlist->begin();
01778 for (; loc != yyvsp[-6].strlist->end(); loc++) {
01779 if (Dict.RegMap.find(*loc) != Dict.RegMap.end())
01780 yyerror("Name reglist declared twice\n");
01781 Dict.addRegister(loc->c_str(), yyvsp[0].num, yyvsp[-3].num, bFloat);
01782 }
01783
01784 ;
01785 break;}
01786 case 33:
01787 #line 416 "sslparser.y"
01788 {
01789 yyvsp[-2].strlist->push_back(yyvsp[0].str);
01790 ;
01791 break;}
01792 case 34:
01793 #line 419 "sslparser.y"
01794 {
01795 yyval.strlist = new std::list<std::string>;
01796 yyval.strlist->push_back(yyvsp[0].str);
01797 ;
01798 break;}
01799 case 35:
01800 #line 428 "sslparser.y"
01801 {
01802
01803 Dict.FlagFuncs[yyvsp[-5].str] = new FlagDef(listStrToExp(yyvsp[-4].parmlist), yyvsp[-1].rtlist);
01804 ;
01805 break;}
01806 case 36:
01807 #line 435 "sslparser.y"
01808 {
01809 if (ConstTable.find(yyvsp[-2].str) != ConstTable.end())
01810 yyerror("Constant declared twice");
01811 ConstTable[std::string(yyvsp[-2].str)] = yyvsp[0].num;
01812 ;
01813 break;}
01814 case 37:
01815 #line 441 "sslparser.y"
01816 {
01817 if (ConstTable.find(yyvsp[-4].str) != ConstTable.end())
01818 yyerror("Constant declared twice");
01819 else if (yyvsp[-1].str == std::string("-"))
01820 ConstTable[std::string(yyvsp[-4].str)] = yyvsp[-2].num - yyvsp[0].num;
01821 else if (yyvsp[-1].str == std::string("+"))
01822 ConstTable[std::string(yyvsp[-4].str)] = yyvsp[-2].num + yyvsp[0].num;
01823 else
01824 yyerror("Constant expression must be NUM + NUM or NUM - NUM");
01825 ;
01826 break;}
01827 case 38:
01828 #line 455 "sslparser.y"
01829 {
01830 TableDict[yyvsp[-2].str] = yyvsp[0].tab;
01831 ;
01832 break;}
01833 case 39:
01834 #line 461 "sslparser.y"
01835 {
01836 yyval.tab = new Table(*yyvsp[0].namelist);
01837
01838 ;
01839 break;}
01840 case 40:
01841 #line 466 "sslparser.y"
01842 {
01843 yyval.tab = new OpTable(*yyvsp[0].namelist);
01844
01845 ;
01846 break;}
01847 case 41:
01848 #line 470 "sslparser.y"
01849 {
01850 yyval.tab = new ExprTable(*yyvsp[0].exprlist);
01851
01852 ;
01853 break;}
01854 case 42:
01855 #line 477 "sslparser.y"
01856 {
01857
01858 std::deque<std::string>::iterator i, j;
01859 yyval.namelist = new std::deque<std::string>;
01860 for (i = yyvsp[-1].namelist->begin(); i != yyvsp[-1].namelist->end(); i++)
01861 for (j = yyvsp[0].namelist->begin(); j != yyvsp[0].namelist->end(); j++)
01862 yyval.namelist->push_back((*i) + (*j));
01863
01864
01865 ;
01866 break;}
01867 case 43:
01868 #line 487 "sslparser.y"
01869 {
01870 yyval.namelist = yyvsp[0].namelist;
01871 ;
01872 break;}
01873 case 44:
01874 #line 493 "sslparser.y"
01875 {
01876
01877
01878 yyvsp[-2].namelist->insert(yyvsp[-2].namelist->end(), yyvsp[0].namelist->begin(), yyvsp[0].namelist->end());
01879
01880 yyval.namelist = yyvsp[-2].namelist;
01881 ;
01882 break;}
01883 case 45:
01884 #line 500 "sslparser.y"
01885 {
01886 yyvsp[-3].namelist->push_back("");
01887 ;
01888 break;}
01889 case 46:
01890 #line 503 "sslparser.y"
01891 {
01892 yyval.namelist = yyvsp[0].namelist;
01893 ;
01894 break;}
01895 case 47:
01896 #line 509 "sslparser.y"
01897 {
01898 yyval.namelist = yyvsp[-1].namelist;
01899 ;
01900 break;}
01901 case 48:
01902 #line 512 "sslparser.y"
01903 {
01904 yyval.namelist = yyvsp[0].namelist;
01905 ;
01906 break;}
01907 case 49:
01908 #line 518 "sslparser.y"
01909 {
01910 yyval.namelist = new std::deque<std::string>;
01911 yyval.namelist->push_back("");
01912 yyval.namelist->push_back(yyvsp[-1].str);
01913 ;
01914 break;}
01915 case 50:
01916 #line 523 "sslparser.y"
01917 {
01918 yyval.namelist = new std::deque<std::string>(1, yyvsp[-1].str);
01919 ;
01920 break;}
01921 case 51:
01922 #line 526 "sslparser.y"
01923 {
01924 std::ostringstream o;
01925
01926 if (TableDict.find(yyvsp[0].str) != TableDict.end())
01927 if (TableDict[yyvsp[0].str]->getType() == NAMETABLE)
01928 yyval.namelist = new std::deque<std::string>(TableDict[yyvsp[0].str]->records);
01929 else {
01930 o << "name " << yyvsp[0].str << " is not a NAMETABLE.\n";
01931 yyerror(STR(o));
01932 }
01933 else {
01934 o << "could not dereference name " << yyvsp[0].str << "\n";
01935 yyerror(STR(o));
01936 }
01937 ;
01938 break;}
01939 case 52:
01940 #line 541 "sslparser.y"
01941 {
01942
01943 if (TableDict.find(yyvsp[0].str) != TableDict.end())
01944 if (TableDict[yyvsp[0].str]->getType() == NAMETABLE)
01945 yyval.namelist = new std::deque<std::string>(TableDict[yyvsp[0].str]->records);
01946 else {
01947 std::ostringstream o;
01948 o << "name " << yyvsp[0].str << " is not a NAMETABLE.\n";
01949 yyerror(STR(o));
01950 }
01951 else {
01952 yyval.namelist = new std::deque<std::string>;
01953 yyval.namelist->push_back(yyvsp[0].str);
01954 }
01955 ;
01956 break;}
01957 case 53:
01958 #line 559 "sslparser.y"
01959 {
01960 yyval.str = yyvsp[0].str;
01961 ;
01962 break;}
01963 case 54:
01964 #line 563 "sslparser.y"
01965 {
01966 yyval.str = yyvsp[0].str;
01967 ;
01968 break;}
01969 case 55:
01970 #line 567 "sslparser.y"
01971 {
01972 yyval.str = yyvsp[0].str;
01973 ;
01974 break;}
01975 case 56:
01976 #line 574 "sslparser.y"
01977 {
01978 yyval.namelist = yyvsp[-1].namelist;
01979 ;
01980 break;}
01981 case 57:
01982 #line 581 "sslparser.y"
01983 {
01984 yyval.namelist = yyvsp[-4].namelist;
01985 yyval.namelist->push_back(yyvsp[-1].str);
01986 ;
01987 break;}
01988 case 58:
01989 #line 585 "sslparser.y"
01990 {
01991 yyval.namelist = new std::deque<std::string>;
01992 yyval.namelist->push_back(yyvsp[-1].str);
01993 ;
01994 break;}
01995 case 59:
01996 #line 593 "sslparser.y"
01997 {
01998 yyval.exprlist = yyvsp[-1].exprlist;
01999 ;
02000 break;}
02001 case 60:
02002 #line 600 "sslparser.y"
02003 {
02004 yyval.exprlist = yyvsp[-4].exprlist;
02005 yyval.exprlist->push_back(yyvsp[-1].exp);
02006 ;
02007 break;}
02008 case 61:
02009 #line 604 "sslparser.y"
02010 {
02011 yyval.exprlist = new std::deque<Exp*>;
02012 yyval.exprlist->push_back(yyvsp[-1].exp);
02013 ;
02014 break;}
02015 case 62:
02016 #line 612 "sslparser.y"
02017 {
02018 yyvsp[0].insel->getrefmap(indexrefmap);
02019
02020 ;
02021 break;}
02022 case 63:
02023 #line 615 "sslparser.y"
02024 {
02025
02026 expandTables(yyvsp[-3].insel, yyvsp[-1].parmlist, yyvsp[0].rtlist, Dict);
02027 ;
02028 break;}
02029 case 64:
02030 #line 622 "sslparser.y"
02031 {
02032 yyval.insel = yyvsp[0].insel;
02033 ;
02034 break;}
02035 case 65:
02036 #line 625 "sslparser.y"
02037 {
02038 unsigned i;
02039 InsNameElem *temp;
02040 std::string nm = yyvsp[0].str;
02041
02042 if (nm[0] == '^')
02043 nm.replace(0, 1, "");
02044
02045
02046 while ((i = nm.find("\"")) != nm.npos)
02047 nm.replace(i,1,"");
02048
02049 while ((i = nm.find(".")) != nm.npos)
02050 nm.replace(i,1,"_");
02051 while ((i = nm.find("_")) != nm.npos)
02052 nm.replace(i,1,"");
02053
02054 temp = new InsNameElem(nm.c_str());
02055 yyval.insel = yyvsp[-1].insel;
02056 yyval.insel->append(temp);
02057 ;
02058 break;}
02059 case 66:
02060 #line 649 "sslparser.y"
02061 {
02062 yyval.insel = new InsNameElem(yyvsp[0].str);
02063 ;
02064 break;}
02065 case 67:
02066 #line 652 "sslparser.y"
02067 {
02068 yyval.insel = yyvsp[0].insel;
02069 ;
02070 break;}
02071 case 68:
02072 #line 655 "sslparser.y"
02073 {
02074 yyval.insel = yyvsp[-1].insel;
02075 yyval.insel->append(yyvsp[0].insel);
02076 ;
02077 break;}
02078 case 69:
02079 #line 662 "sslparser.y"
02080 {
02081 yyval.insel = new InsOptionElem(yyvsp[-1].str);
02082 ;
02083 break;}
02084 case 70:
02085 #line 665 "sslparser.y"
02086 {
02087 std::ostringstream o;
02088 if (TableDict.find(yyvsp[-2].str) == TableDict.end()) {
02089 o << "Table " << yyvsp[-2].str << " has not been declared.\n";
02090 yyerror(STR(o));
02091 } else if ((yyvsp[-1].num < 0) || (yyvsp[-1].num >= (int)TableDict[yyvsp[-2].str]->records.size())) {
02092 o << "Can't get element " << yyvsp[-1].num << " of table " << yyvsp[-2].str << ".\n";
02093 yyerror(STR(o));
02094 } else
02095 yyval.insel = new InsNameElem(TableDict[yyvsp[-2].str]->records[yyvsp[-1].num].c_str());
02096 ;
02097 break;}
02098 case 71:
02099 #line 678 "sslparser.y"
02100 {
02101 std::ostringstream o;
02102 if (TableDict.find(yyvsp[-2].str) == TableDict.end()) {
02103 o << "Table " << yyvsp[-2].str << " has not been declared.\n";
02104 yyerror(STR(o));
02105 } else
02106 yyval.insel = new InsListElem(yyvsp[-2].str, TableDict[yyvsp[-2].str], yyvsp[-1].str);
02107 ;
02108 break;}
02109 case 72:
02110 #line 687 "sslparser.y"
02111 {
02112 std::ostringstream o;
02113 if (TableDict.find(yyvsp[-2].str) == TableDict.end()) {
02114 o << "Table " << yyvsp[-2].str << " has not been declared.\n";
02115 yyerror(STR(o));
02116 } else if ((yyvsp[-1].num < 0) || (yyvsp[-1].num >= (int)TableDict[yyvsp[-2].str]->records.size())) {
02117 o << "Can't get element " << yyvsp[-1].num << " of table " << yyvsp[-2].str << ".\n";
02118 yyerror(STR(o));
02119 } else
02120 yyval.insel = new InsNameElem(TableDict[yyvsp[-2].str]->records[yyvsp[-1].num].c_str());
02121 ;
02122 break;}
02123 case 73:
02124 #line 698 "sslparser.y"
02125 {
02126 std::ostringstream o;
02127 if (TableDict.find(yyvsp[-2].str) == TableDict.end()) {
02128 o << "Table " << yyvsp[-2].str << " has not been declared.\n";
02129 yyerror(STR(o));
02130 } else
02131 yyval.insel = new InsListElem(yyvsp[-2].str, TableDict[yyvsp[-2].str], yyvsp[-1].str);
02132 ;
02133 break;}
02134 case 74:
02135 #line 707 "sslparser.y"
02136 {
02137 yyval.insel = new InsNameElem(yyvsp[-1].str);
02138 ;
02139 break;}
02140 case 75:
02141 #line 713 "sslparser.y"
02142 {
02143
02144
02145 if (yyvsp[0].regtransfer != NULL) {
02146 yyvsp[-1].rtlist->appendStmt(yyvsp[0].regtransfer);
02147 }
02148 yyval.rtlist = yyvsp[-1].rtlist;
02149 ;
02150 break;}
02151 case 76:
02152 #line 722 "sslparser.y"
02153 {
02154 yyval.rtlist = new RTL(STMT_ASSIGN);
02155 if (yyvsp[0].regtransfer != NULL)
02156 yyval.rtlist->appendStmt(yyvsp[0].regtransfer);
02157 ;
02158 break;}
02159 case 77:
02160 #line 730 "sslparser.y"
02161 {
02162 yyval.regtransfer = yyvsp[0].regtransfer;
02163 ;
02164 break;}
02165 case 78:
02166 #line 736 "sslparser.y"
02167 {
02168 std::ostringstream o;
02169 if (Dict.FlagFuncs.find(yyvsp[-2].str) != Dict.FlagFuncs.end()) {
02170
02171 bool bFloat = strcmp(yyvsp[-2].str, "SETFFLAGS") == 0;
02172 OPER op = bFloat ? opFflags : opFlags;
02173 yyval.regtransfer = new Assign(
02174 new Terminal(op),
02175 new Binary(opFlagCall,
02176 new Const(yyvsp[-2].str),
02177 listExpToExp(yyvsp[-1].explist)));
02178 } else {
02179 o << yyvsp[-2].str << " is not declared as a flag function.\n";
02180 yyerror(STR(o));
02181 }
02182 ;
02183 break;}
02184 case 79:
02185 #line 752 "sslparser.y"
02186 {
02187 yyval.regtransfer = 0;
02188 ;
02189 break;}
02190 case 80:
02191 #line 756 "sslparser.y"
02192 {
02193 yyval.regtransfer = 0;
02194 ;
02195 break;}
02196 case 81:
02197 #line 759 "sslparser.y"
02198 {
02199 yyval.regtransfer = NULL;
02200 ;
02201 break;}
02202 case 82:
02203 #line 765 "sslparser.y"
02204 {
02205
02206
02207
02208
02209 yyval.explist = 0;
02210 ;
02211 break;}
02212 case 83:
02213 #line 772 "sslparser.y"
02214 {
02215
02216
02217
02218
02219 yyval.explist = 0;
02220 ;
02221 break;}
02222 case 84:
02223 #line 783 "sslparser.y"
02224 {
02225 assert(yyvsp[0].str != 0);
02226 yyvsp[-2].parmlist->push_back(yyvsp[0].str);
02227 yyval.parmlist = yyvsp[-2].parmlist;
02228 ;
02229 break;}
02230 case 85:
02231 #line 789 "sslparser.y"
02232 {
02233 yyval.parmlist = new std::list<std::string>;
02234 yyval.parmlist->push_back(yyvsp[0].str);
02235 ;
02236 break;}
02237 case 86:
02238 #line 793 "sslparser.y"
02239 {
02240 yyval.parmlist = new std::list<std::string>;
02241 ;
02242 break;}
02243 case 87:
02244 #line 798 "sslparser.y"
02245 {
02246 Dict.ParamSet.insert(yyvsp[0].str);
02247 yyval.str = yyvsp[0].str;
02248 ;
02249 break;}
02250 case 88:
02251 #line 804 "sslparser.y"
02252 {
02253 yyval.explist->push_back(yyvsp[0].exp);
02254 ;
02255 break;}
02256 case 89:
02257 #line 808 "sslparser.y"
02258 {
02259 yyval.explist = new std::list<Exp*>;
02260 yyval.explist->push_back(yyvsp[0].exp);
02261 ;
02262 break;}
02263 case 90:
02264 #line 813 "sslparser.y"
02265 {
02266 yyval.explist = new std::list<Exp*>;
02267 ;
02268 break;}
02269 case 91:
02270 #line 821 "sslparser.y"
02271 {
02272 Assign* a = new Assign(yyvsp[-5].typ, yyvsp[-2].exp, yyvsp[0].exp);
02273 a->setGuard(yyvsp[-4].exp);
02274 yyval.regtransfer = a;
02275 ;
02276 break;}
02277 case 92:
02278 #line 828 "sslparser.y"
02279 {
02280
02281 yyval.regtransfer = new Assign(yyvsp[-3].typ, yyvsp[-2].exp, yyvsp[0].exp);
02282 ;
02283 break;}
02284 case 93:
02285 #line 834 "sslparser.y"
02286 {
02287 yyval.regtransfer = new Assign(
02288 new Terminal(opNil),
02289 new Terminal(opFpush));
02290 ;
02291 break;}
02292 case 94:
02293 #line 839 "sslparser.y"
02294 {
02295 yyval.regtransfer = new Assign(
02296 new Terminal(opNil),
02297 new Terminal(opFpop));
02298 ;
02299 break;}
02300 case 95:
02301 #line 846 "sslparser.y"
02302 {
02303 yyval.regtransfer = new Assign(yyvsp[-1].typ, NULL, yyvsp[0].exp);
02304 ;
02305 break;}
02306 case 96:
02307 #line 852 "sslparser.y"
02308 {
02309 yyval.exp = new Const(yyvsp[0].num);
02310 ;
02311 break;}
02312 case 97:
02313 #line 856 "sslparser.y"
02314 {
02315 yyval.exp = new Const(yyvsp[0].dbl);
02316 ;
02317 break;}
02318 case 98:
02319 #line 860 "sslparser.y"
02320 {
02321 yyval.exp = yyvsp[-1].exp;
02322 ;
02323 break;}
02324 case 99:
02325 #line 864 "sslparser.y"
02326 {
02327 yyval.exp = yyvsp[0].exp;
02328 ;
02329 break;}
02330 case 100:
02331 #line 868 "sslparser.y"
02332 {
02333 yyval.exp = new Ternary(opTern, yyvsp[-5].exp, yyvsp[-3].exp, yyvsp[-1].exp);
02334 ;
02335 break;}
02336 case 101:
02337 #line 873 "sslparser.y"
02338 {
02339 yyval.exp = new Unary(opAddrOf, yyvsp[-1].exp);
02340 ;
02341 break;}
02342 case 102:
02343 #line 878 "sslparser.y"
02344 {
02345 yyval.exp = new Ternary(strToOper(yyvsp[-6].str), new Const(yyvsp[-5].num), new Const(yyvsp[-3].num), yyvsp[-1].exp);
02346 ;
02347 break;}
02348 case 103:
02349 #line 883 "sslparser.y"
02350 {
02351 yyval.exp = new Unary(opFtrunc, yyvsp[-1].exp);
02352 ;
02353 break;}
02354 case 104:
02355 #line 888 "sslparser.y"
02356 {
02357 yyval.exp = new Unary(opFabs, yyvsp[-1].exp);
02358 ;
02359 break;}
02360 case 105:
02361 #line 893 "sslparser.y"
02362 {
02363 yyval.exp = new Terminal(opFpush);
02364 ;
02365 break;}
02366 case 106:
02367 #line 896 "sslparser.y"
02368 {
02369 yyval.exp = new Terminal(opFpop);
02370 ;
02371 break;}
02372 case 107:
02373 #line 901 "sslparser.y"
02374 {
02375 yyval.exp = new Unary(strToOper(yyvsp[-2].str), yyvsp[-1].exp);
02376 ;
02377 break;}
02378 case 108:
02379 #line 907 "sslparser.y"
02380 {
02381 std::ostringstream o;
02382 if (indexrefmap.find(yyvsp[-1].str) == indexrefmap.end()) {
02383 o << "index " << yyvsp[-1].str << " not declared for use.\n";
02384 yyerror(STR(o));
02385 } else if (TableDict.find(yyvsp[-2].str) == TableDict.end()) {
02386 o << "table " << yyvsp[-2].str << " not declared for use.\n";
02387 yyerror(STR(o));
02388 } else if (TableDict[yyvsp[-2].str]->getType() != EXPRTABLE) {
02389 o << "table " << yyvsp[-2].str << " is not an expression table but appears to be used as one.\n";
02390 yyerror(STR(o));
02391 } else if ((int)((ExprTable*)TableDict[yyvsp[-2].str])->expressions.size() < indexrefmap[yyvsp[-1].str]->ntokens()) {
02392 o << "table " << yyvsp[-2].str << " (" << ((ExprTable*)TableDict[yyvsp[-2].str])->expressions.size() <<
02393 ") is too small to use " << yyvsp[-1].str << " (" << indexrefmap[yyvsp[-1].str]->ntokens() << ") as an index.\n";
02394 yyerror(STR(o));
02395 }
02396
02397 yyval.exp = new Binary(opExpTable, new Const(yyvsp[-2].str), new Const(yyvsp[-1].str));
02398 ;
02399 break;}
02400 case 109:
02401 #line 930 "sslparser.y"
02402 {
02403 std::ostringstream o;
02404 if (Dict.ParamSet.find(yyvsp[-2].str) != Dict.ParamSet.end() ) {
02405 if (Dict.DetParamMap.find(yyvsp[-2].str) != Dict.DetParamMap.end()) {
02406 ParamEntry& param = Dict.DetParamMap[yyvsp[-2].str];
02407 if (yyvsp[-1].explist->size() != param.funcParams.size() ) {
02408 o << yyvsp[-2].str << " requires " << param.funcParams.size() << " parameters, but received " << yyvsp[-1].explist->size()
02409 << ".\n";
02410 yyerror(STR(o));
02411 } else {
02412
02413
02414 yyval.exp = new Binary(opFlagDef,
02415 new Const(yyvsp[-2].str),
02416 listExpToExp(yyvsp[-1].explist));
02417
02418 }
02419 } else {
02420 o << yyvsp[-2].str << " is not defined as a OPERAND function.\n";
02421 yyerror(STR(o));
02422 }
02423 } else {
02424 o << "Unrecognized name " << yyvsp[-2].str << " in lambda call.\n";
02425 }
02426 ;
02427 break;}
02428 case 110:
02429 #line 956 "sslparser.y"
02430 {
02431 yyval.exp = makeSuccessor(yyvsp[-1].exp);
02432 ;
02433 break;}
02434 case 111:
02435 #line 962 "sslparser.y"
02436 {
02437 yyval.exp = new Unary(opSignExt, yyvsp[-1].exp);
02438 ;
02439 break;}
02440 case 112:
02441 #line 969 "sslparser.y"
02442 {
02443
02444
02445 if (yyvsp[0].num == STD_SIZE)
02446 yyval.exp = yyvsp[-1].exp;
02447 else
02448 yyval.exp = new Binary(opSize, new Const(yyvsp[0].num), yyvsp[-1].exp);
02449 ;
02450 break;}
02451 case 113:
02452 #line 978 "sslparser.y"
02453 {
02454 yyval.exp = new Unary(opNot, yyvsp[0].exp);
02455 ;
02456 break;}
02457 case 114:
02458 #line 982 "sslparser.y"
02459 {
02460 yyval.exp = new Unary(opLNot, yyvsp[0].exp);
02461 ;
02462 break;}
02463 case 115:
02464 #line 986 "sslparser.y"
02465 {
02466 yyval.exp = new Unary(opFNeg, yyvsp[0].exp);
02467 ;
02468 break;}
02469 case 116:
02470 #line 990 "sslparser.y"
02471 {
02472 yyval.exp = new Binary(strToOper(yyvsp[-1].str), yyvsp[-2].exp, yyvsp[0].exp);
02473 ;
02474 break;}
02475 case 117:
02476 #line 994 "sslparser.y"
02477 {
02478 yyval.exp = new Binary(strToOper(yyvsp[-1].str), yyvsp[-2].exp, yyvsp[0].exp);
02479 ;
02480 break;}
02481 case 118:
02482 #line 998 "sslparser.y"
02483 {
02484 yyval.exp = new Binary(strToOper(yyvsp[-1].str), yyvsp[-2].exp, yyvsp[0].exp);
02485 ;
02486 break;}
02487 case 119:
02488 #line 1002 "sslparser.y"
02489 {
02490 yyval.exp = new Binary(strToOper(yyvsp[-1].str), yyvsp[-2].exp, yyvsp[0].exp);
02491 ;
02492 break;}
02493 case 120:
02494 #line 1006 "sslparser.y"
02495 {
02496 yyval.exp = new Binary(strToOper(yyvsp[-1].str), yyvsp[-2].exp, yyvsp[0].exp);
02497 ;
02498 break;}
02499 case 121:
02500 #line 1013 "sslparser.y"
02501 {
02502 std::ostringstream o;
02503 if (indexrefmap.find(yyvsp[-2].str) == indexrefmap.end()) {
02504 o << "index " << yyvsp[-2].str << " not declared for use.\n";
02505 yyerror(STR(o));
02506 } else if (TableDict.find(yyvsp[-3].str) == TableDict.end()) {
02507 o << "table " << yyvsp[-3].str << " not declared for use.\n";
02508 yyerror(STR(o));
02509 } else if (TableDict[yyvsp[-3].str]->getType() != OPTABLE) {
02510 o << "table " << yyvsp[-3].str << " is not an operator table but appears to be used as one.\n";
02511 yyerror(STR(o));
02512 } else if ((int)TableDict[yyvsp[-3].str]->records.size() < indexrefmap[yyvsp[-2].str]->ntokens()) {
02513 o << "table " << yyvsp[-3].str << " is too small to use with " << yyvsp[-2].str << " as an index.\n";
02514 yyerror(STR(o));
02515 }
02516 yyval.exp = new Ternary(opOpTable, new Const(yyvsp[-3].str), new Const(yyvsp[-2].str),
02517 new Binary(opList,
02518 yyvsp[-4].exp,
02519 new Binary(opList,
02520 yyvsp[0].exp,
02521 new Terminal(opNil))));
02522 ;
02523 break;}
02524 case 122:
02525 #line 1036 "sslparser.y"
02526 {
02527 yyval.exp = yyvsp[0].exp;
02528 ;
02529 break;}
02530 case 123:
02531 #line 1045 "sslparser.y"
02532 {
02533 bool isFlag = strstr(yyvsp[0].str, "flags") != 0;
02534 std::map<std::string, int>::const_iterator it = Dict.RegMap.find(yyvsp[0].str);
02535 if (it == Dict.RegMap.end() && !isFlag) {
02536 std::ostringstream ost;
02537 ost << "register `" << yyvsp[0].str << "' is undefined";
02538 yyerror(STR(ost));
02539 } else if (isFlag || it->second == -1) {
02540
02541 OPER op = strToTerm(yyvsp[0].str);
02542 if (op) {
02543 yyval.exp = new Terminal(op);
02544 } else {
02545 yyval.exp = new Unary(opMachFtr,
02546 new Const(yyvsp[0].str));
02547 }
02548 }
02549 else {
02550
02551 yyval.exp = Location::regOf(it->second);
02552 }
02553 ;
02554 break;}
02555 case 124:
02556 #line 1068 "sslparser.y"
02557 {
02558 yyval.exp = Location::regOf(yyvsp[-1].exp);
02559 ;
02560 break;}
02561 case 125:
02562 #line 1072 "sslparser.y"
02563 {
02564 int regNum;
02565 sscanf(yyvsp[0].str, "r%d", ®Num);
02566 yyval.exp = Location::regOf(regNum);
02567 ;
02568 break;}
02569 case 126:
02570 #line 1078 "sslparser.y"
02571 {
02572 yyval.exp = Location::memOf(yyvsp[-1].exp);
02573 ;
02574 break;}
02575 case 127:
02576 #line 1082 "sslparser.y"
02577 {
02578
02579 Exp* s;
02580 std::set<std::string>::iterator it = Dict.ParamSet.find(yyvsp[0].str);
02581 if (it != Dict.ParamSet.end()) {
02582 s = new Location(opParam, new Const(yyvsp[0].str), NULL);
02583 } else if (ConstTable.find(yyvsp[0].str) != ConstTable.end()) {
02584 s = new Const(ConstTable[yyvsp[0].str]);
02585 } else {
02586 std::ostringstream ost;
02587 ost << "`" << yyvsp[0].str << "' is not a constant, definition or a parameter of this instruction\n";
02588 yyerror(STR(ost));
02589 s = new Const(0);
02590 }
02591 yyval.exp = s;
02592 ;
02593 break;}
02594 case 128:
02595 #line 1099 "sslparser.y"
02596 {
02597 yyval.exp = new Ternary(opAt, yyvsp[-6].exp, yyvsp[-3].exp, yyvsp[-1].exp);
02598 ;
02599 break;}
02600 case 129:
02601 #line 1103 "sslparser.y"
02602 {
02603 yyval.exp = Location::tempOf(new Const(yyvsp[0].str));
02604 ;
02605 break;}
02606 case 130:
02607 #line 1108 "sslparser.y"
02608 {
02609 yyval.exp = new Unary(opPostVar, yyvsp[-1].exp);
02610 ;
02611 break;}
02612 case 131:
02613 #line 1111 "sslparser.y"
02614 {
02615 yyval.exp = makeSuccessor(yyvsp[-1].exp);
02616 ;
02617 break;}
02618 case 132:
02619 #line 1117 "sslparser.y"
02620 {
02621 yyval.num = yyvsp[-1].num;
02622 ;
02623 break;}
02624 case 133:
02625 #line 1123 "sslparser.y"
02626 {
02627 Dict.bigEndian = (strcmp(yyvsp[0].str, "BIG") == 0);
02628 ;
02629 break;}
02630 case 134:
02631 #line 1128 "sslparser.y"
02632 {
02633 yyval.str = yyvsp[0].str;
02634 ;
02635 break;}
02636 case 135:
02637 #line 1131 "sslparser.y"
02638 {
02639 yyval.str = yyvsp[0].str;
02640 ;
02641 break;}
02642 case 136:
02643 #line 1137 "sslparser.y"
02644 {
02645 char c = yyvsp[0].str[1];
02646 if (c == '*') yyval.typ = new SizeType(0);
02647 else if (isdigit(c)) {
02648 int size;
02649
02650 sscanf(yyvsp[0].str+1, "%d", &size);
02651 yyval.typ = new SizeType(size);
02652 } else {
02653 int size;
02654
02655 sscanf(yyvsp[0].str+2, "%d", &size);
02656 if (size == 0) size = STD_SIZE;
02657 switch (c) {
02658 case 'i': yyval.typ = new IntegerType(size, 1); break;
02659 case 'j': yyval.typ = new IntegerType(size, 0); break;
02660 case 'u': yyval.typ = new IntegerType(size, -1); break;
02661 case 'f': yyval.typ = new FloatType(size); break;
02662 case 'c': yyval.typ = new CharType; break;
02663 default:
02664 std::cerr << "Unexpected char " << c << " in assign type\n";
02665 yyval.typ = new IntegerType;
02666 }
02667 }
02668 ;
02669 break;}
02670 case 140:
02671 #line 1177 "sslparser.y"
02672 {
02673 Dict.fastMap[std::string(yyvsp[-2].str)] = std::string(yyvsp[0].str);
02674 ;
02675 break;}
02676 }
02677
02678 #line 811 "/usr/local/lib/bison.cc"
02679
02680 yyvsp -= yylen;
02681 yyssp -= yylen;
02682 #ifdef YY_SSLParser_LSP_NEEDED
02683 yylsp -= yylen;
02684 #endif
02685
02686 #if YY_SSLParser_DEBUG != 0
02687 if (YY_SSLParser_DEBUG_FLAG)
02688 {
02689 short *ssp1 = yyss - 1;
02690 fprintf (stderr, "state stack now");
02691 while (ssp1 != yyssp)
02692 fprintf (stderr, " %d", *++ssp1);
02693 fprintf (stderr, "\n");
02694 }
02695 #endif
02696
02697 *++yyvsp = yyval;
02698
02699 #ifdef YY_SSLParser_LSP_NEEDED
02700 yylsp++;
02701 if (yylen == 0)
02702 {
02703 yylsp->first_line = YY_SSLParser_LLOC.first_line;
02704 yylsp->first_column = YY_SSLParser_LLOC.first_column;
02705 yylsp->last_line = (yylsp-1)->last_line;
02706 yylsp->last_column = (yylsp-1)->last_column;
02707 yylsp->text = 0;
02708 }
02709 else
02710 {
02711 yylsp->last_line = (yylsp+yylen-1)->last_line;
02712 yylsp->last_column = (yylsp+yylen-1)->last_column;
02713 }
02714 #endif
02715
02716
02717
02718
02719
02720
02721 yyn = yyr1[yyn];
02722
02723 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
02724 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
02725 yystate = yytable[yystate];
02726 else
02727 yystate = yydefgoto[yyn - YYNTBASE];
02728
02729 YYGOTO(yynewstate);
02730
02731 YYLABEL(yyerrlab)
02732
02733 if (! yyerrstatus)
02734
02735 {
02736 ++YY_SSLParser_NERRS;
02737
02738 #ifdef YY_SSLParser_ERROR_VERBOSE
02739 yyn = yypact[yystate];
02740
02741 if (yyn > YYFLAG && yyn < YYLAST)
02742 {
02743 int size = 0;
02744 char *msg;
02745 int x, count;
02746
02747 count = 0;
02748
02749 for (x = (yyn < 0 ? -yyn : 0);
02750 x < (sizeof(yytname) / sizeof(char *)); x++)
02751 if (yycheck[x + yyn] == x)
02752 size += strlen(yytname[x]) + 15, count++;
02753 msg = (char *) malloc(size + 15);
02754 if (msg != 0)
02755 {
02756 strcpy(msg, "parse error");
02757
02758 if (count < 5)
02759 {
02760 count = 0;
02761 for (x = (yyn < 0 ? -yyn : 0);
02762 x < (sizeof(yytname) / sizeof(char *)); x++)
02763 if (yycheck[x + yyn] == x)
02764 {
02765 strcat(msg, count == 0 ? ", expecting `" : " or `");
02766 strcat(msg, yytname[x]);
02767 strcat(msg, "'");
02768 count++;
02769 }
02770 }
02771 YY_SSLParser_ERROR(msg);
02772 free(msg);
02773 }
02774 else
02775 YY_SSLParser_ERROR ("parse error; also virtual memory exceeded");
02776 }
02777 else
02778 #endif
02779 YY_SSLParser_ERROR("parse error");
02780 }
02781
02782 YYGOTO(yyerrlab1);
02783 YYLABEL(yyerrlab1)
02784
02785 if (yyerrstatus == 3)
02786 {
02787
02788
02789
02790 if (YY_SSLParser_CHAR == YYEOF)
02791 YYABORT;
02792
02793 #if YY_SSLParser_DEBUG != 0
02794 if (YY_SSLParser_DEBUG_FLAG)
02795 fprintf(stderr, "Discarding token %d (%s).\n", YY_SSLParser_CHAR, yytname[yychar1]);
02796 #endif
02797
02798 YY_SSLParser_CHAR = YYEMPTY;
02799 }
02800
02801
02802
02803
02804 yyerrstatus = 3;
02805
02806 YYGOTO(yyerrhandle);
02807
02808 YYLABEL(yyerrdefault)
02809
02810 #if 0
02811
02812
02813 yyn = yydefact[yystate];
02814 if (yyn) YYGOTO(yydefault);
02815 #endif
02816
02817 YYLABEL(yyerrpop)
02818
02819 if (yyssp == yyss) YYABORT;
02820 yyvsp--;
02821 yystate = *--yyssp;
02822 #ifdef YY_SSLParser_LSP_NEEDED
02823 yylsp--;
02824 #endif
02825
02826 #if YY_SSLParser_DEBUG != 0
02827 if (YY_SSLParser_DEBUG_FLAG)
02828 {
02829 short *ssp1 = yyss - 1;
02830 fprintf (stderr, "Error: state stack now");
02831 while (ssp1 != yyssp)
02832 fprintf (stderr, " %d", *++ssp1);
02833 fprintf (stderr, "\n");
02834 }
02835 #endif
02836
02837 YYLABEL(yyerrhandle)
02838
02839 yyn = yypact[yystate];
02840 if (yyn == YYFLAG)
02841 YYGOTO(yyerrdefault);
02842
02843 yyn += YYTERROR;
02844 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
02845 YYGOTO(yyerrdefault);
02846
02847 yyn = yytable[yyn];
02848 if (yyn < 0)
02849 {
02850 if (yyn == YYFLAG)
02851 YYGOTO(yyerrpop);
02852 yyn = -yyn;
02853 YYGOTO(yyreduce);
02854 }
02855 else if (yyn == 0)
02856 YYGOTO(yyerrpop);
02857
02858 if (yyn == YYFINAL)
02859 YYACCEPT;
02860
02861 #if YY_SSLParser_DEBUG != 0
02862 if (YY_SSLParser_DEBUG_FLAG)
02863 fprintf(stderr, "Shifting error token, ");
02864 #endif
02865
02866 *++yyvsp = YY_SSLParser_LVAL;
02867 #ifdef YY_SSLParser_LSP_NEEDED
02868 *++yylsp = YY_SSLParser_LLOC;
02869 #endif
02870
02871 yystate = yyn;
02872 YYGOTO(yynewstate);
02873
02874 YYENDGOTO
02875 }
02876
02877
02878
02879
02880 #line 2881 "sslparser.cpp"
02881 #line 1180 "sslparser.y"
02882
02883
02884
02885
02886
02887
02888
02889
02890 SSLParser::SSLParser(std::istream &in, bool trace) : sslFile("input"), bFloat(false)
02891 {
02892 theScanner = new SSLScanner(in, trace);
02893 if (trace) yydebug = 1; else yydebug=0;
02894 }
02895
02896
02897
02898
02899
02900
02901
02902 Statement* SSLParser::parseExp(const char *str) {
02903 std::istringstream ss(str);
02904 SSLParser p(ss, false);
02905 RTLInstDict d;
02906 p.yyparse(d);
02907 return p.the_asgn;
02908 }
02909
02910
02911
02912
02913
02914
02915
02916 SSLParser::~SSLParser()
02917 {
02918 std::map<std::string, Table*>::iterator loc;
02919 if (theScanner != NULL)
02920 delete theScanner;
02921 for(loc = TableDict.begin(); loc != TableDict.end(); loc++)
02922 delete loc->second;
02923 }
02924
02925
02926
02927
02928
02929
02930
02931 void SSLParser::yyerror(char* msg)
02932 {
02933 std::cerr << sslFile << ":" << theScanner->theLine << ": " << msg << std::endl;
02934 }
02935
02936
02937
02938
02939
02940
02941
02942 int SSLParser::yylex()
02943 {
02944 int token = theScanner->yylex(yylval);
02945 return token;
02946 }
02947
02948
02949
02950
02951
02952
02953
02954
02955
02956
02957 OPER SSLParser::strToOper(const char* s) {
02958 switch (s[0]) {
02959 case '*':
02960
02961 switch (s[1]) {
02962 case '\0': return opMult;
02963 case '!' : return opMults;
02964 case 'f' :
02965 if ((s[2] == 's') && (s[3] == 'd')) return opFMultsd;
02966 if ((s[2] == 'd') && (s[3] == 'q')) return opFMultdq;
02967 return opFMult;
02968 default: break;
02969 }
02970 break;
02971 case '/':
02972
02973 switch (s[1]) {
02974 case '\0': return opDiv;
02975 case '!' : return opDivs;
02976 case 'f' : return opFDiv;
02977 default: break;
02978 }
02979 break;
02980 case '%':
02981
02982 switch (s[1]) {
02983 case '\0': return opMod;
02984 case '!' : return opMods;
02985 default: break;
02986 }
02987 break;
02988 case '+':
02989
02990 switch (s[1]) {
02991 case '\0': return opPlus;
02992 case 'f' : return opFPlus;
02993 default: break;
02994 }
02995 break;
02996 case '-':
02997
02998 switch (s[1]) {
02999 case '\0': return opMinus;
03000 case 'f' : return opFMinus;
03001 default: break;
03002 }
03003 break;
03004 case 'a':
03005
03006 if (s[1] == 'n') return opAnd;
03007 if (s[1] == 'r') return opArcTan;
03008 if (s[1] == 'd') return opAddrOf;
03009 break;
03010 case 'c':
03011
03012 return opCos;
03013 case 'e':
03014
03015 return opExecute;
03016 case 'f':
03017
03018 if (s[1] == 's') return opFsize;
03019 if (s[1] == 't') return opFtoi;
03020 if (s[1] == 'r') return opFround;
03021 break;
03022 case 'i':
03023
03024 return opItof;
03025 case 'l':
03026
03027 if (s[3] == '2') return opLog2;
03028 if (s[3] == '1') return opLog10;
03029 if (s[3] == 'e') return opLoge;
03030 break;
03031 case 'o':
03032
03033 return opOr;
03034 case 'p':
03035
03036 return opPow;
03037 case 'r':
03038
03039 if (s[1] == 'l') {
03040 if (s[2] == 'c') return opRotateLC;
03041 return opRotateL;
03042 } else if (s[1] == 'r') {
03043 if (s[2] == 'c') return opRotateRC;
03044 return opRotateR;
03045 }
03046 break;
03047 case 's':
03048
03049 if (s[1] == 'g') return opSgnEx;
03050 if (s[1] == 'i') return opSin;
03051 if (s[1] == 'q') return opSqrt;
03052 break;
03053 case 't':
03054
03055
03056 if (s[1] == 'a') return opTan;
03057 if (s[5] == 'u') return opTruncu;
03058 if (s[5] == 's') return opTruncs;
03059 break;
03060 case 'z':
03061
03062 return opZfill;
03063
03064 case '>':
03065
03066 switch (s[1]) {
03067 case '\0': return opGtr;
03068 case 'u': return opGtrUns;
03069 case '=':
03070 if (s[2] == '\0') return opGtrEq;
03071 return opGtrEqUns;
03072 case '>':
03073 if (s[2] == '\0') return opShiftR;
03074 return opShiftRA;
03075 default: break;
03076 }
03077 break;
03078 case '<':
03079
03080 switch (s[1]) {
03081 case '\0': return opLess;
03082 case 'u': return opLessUns;
03083 case '=':
03084 if (s[2] == '\0') return opLessEq;
03085 return opLessEqUns;
03086 case '<':
03087 return opShiftL;
03088 default: break;
03089 }
03090 break;
03091 case '=':
03092
03093 return opEquals;
03094 case '!':
03095
03096 return opSgnEx;
03097 break;
03098 case '~':
03099
03100 if (s[1] == '=') return opNotEqual;
03101 return opNot;
03102 case '@': return opAt;
03103 case '&': return opBitAnd;
03104 case '|': return opBitOr;
03105 case '^': return opBitXor;
03106
03107 default: break;
03108 }
03109 std::ostringstream ost;
03110 ost << "Unknown operator " << s << std::endl;
03111 yyerror(STR(ost));
03112 return opWild;
03113 }
03114
03115 OPER strToTerm(char* s) {
03116
03117 if (s[2] == 'F') {
03118 if (s[1] <= 'N') {
03119 if (s[1] == 'C') return opCF;
03120 if (s[1] == 'N') return opNF;
03121 return opDF;
03122 } else {
03123 if (s[1] == 'O') return opOF;
03124 return opZF;
03125 }
03126 }
03127 if (s[1] == 'p') return opPC;
03128 if (s[1] == 'a') {
03129 if (s[2] == 'f') return opAFP;
03130 if (s[2] == 'g') return opAGP;
03131 } else if (s[1] == 'f') {
03132 if (s[2] == 'l') return opFlags;
03133 if (s[2] == 'f') return opFflags;
03134 }
03135 return (OPER) 0;
03136 }
03137
03138
03139
03140
03141
03142
03143
03144
03145
03146 Exp* listExpToExp(std::list<Exp*>* le) {
03147 Exp* e;
03148 Exp** cur = &e;
03149 Exp *end = new Terminal(opNil);
03150 for (std::list<Exp*>::iterator it = le->begin(); it != le->end(); it++) {
03151 *cur = new Binary(opList, *it, end);
03152
03153
03154
03155 cur = &(*cur)->refSubExp2();
03156 }
03157 return e;
03158 }
03159
03160
03161
03162
03163
03164
03165
03166
03167 Exp* listStrToExp(std::list<std::string>* ls) {
03168 Exp* e;
03169 Exp** cur = &e;
03170 Exp *end = new Terminal(opNil);
03171 for (std::list<std::string>::iterator it = ls->begin(); it != ls->end(); it++) {
03172 *cur = new Binary(opList, new Location(opParam, new Const((char*)(*it).c_str()), NULL), end);
03173 cur = &(*cur)->refSubExp2();
03174 }
03175 *cur = new Terminal(opNil);
03176 return e;
03177 }
03178
03179
03180
03181
03182
03183
03184
03185
03186
03187
03188
03189 static Exp* srchExpr = new Binary(opExpTable,
03190 new Terminal(opWild),
03191 new Terminal(opWild));
03192 static Exp* srchOp = new Ternary(opOpTable,
03193 new Terminal(opWild),
03194 new Terminal(opWild),
03195 new Terminal(opWild));
03196 void init_sslparser() {
03197 #ifndef NO_GARBAGE_COLLECTOR
03198 static Exp** gc_pointers = (Exp**) GC_MALLOC_UNCOLLECTABLE(2 * sizeof(Exp*));
03199 gc_pointers[0] = srchExpr;
03200 gc_pointers[1] = srchOp;
03201 #endif
03202 }
03203
03204 void SSLParser::expandTables(InsNameElem* iname, std::list<std::string>* params, RTL* o_rtlist, RTLInstDict& Dict) {
03205 int i, m;
03206 std::string nam;
03207 std::ostringstream o;
03208 m = iname->ninstructions();
03209
03210 for (i = 0, iname->reset(); i < m; i++, iname->increment()) {
03211 nam = iname->getinstruction();
03212
03213 RTL* rtl = o_rtlist->clone();
03214 int n = rtl->getNumStmt();
03215 for (int j=0; j < n; j++) {
03216 Statement* s = rtl->elementAt(j);
03217 std::list<Exp*> le;
03218
03219 assert(s->getKind() == STMT_ASSIGN);
03220 if (((Assign*)s)->searchAll(srchExpr, le)) {
03221 std::list<Exp*>::iterator it;
03222 for (it = le.begin(); it != le.end(); it++) {
03223 char* tbl = ((Const*)((Binary*)*it)->getSubExp1())->getStr();
03224 char* idx = ((Const*)((Binary*)*it)->getSubExp2())->getStr();
03225 Exp* repl =((ExprTable*)(TableDict[tbl]))->expressions[indexrefmap[idx]->getvalue()];
03226 s->searchAndReplace(*it, repl);
03227 }
03228 }
03229
03230 Exp* res;
03231 while (s->search(srchOp, res)) {
03232 Ternary* t;
03233 if (res->getOper() == opTypedExp)
03234 t = (Ternary *)res->getSubExp1();
03235 else
03236 t = (Ternary *)res;
03237 assert(t->getOper() == opOpTable);
03238
03239
03240 char* tbl = ((Const*)t->getSubExp1()) ->getStr();
03241 char* idx = ((Const*)t->getSubExp2()) ->getStr();
03242
03243 Binary* b = (Binary*)t->getSubExp3();
03244 assert(b->getOper() == opList);
03245 Exp* e1 = b->getSubExp1();
03246 Exp* e2 = b->getSubExp2();
03247 assert(b->getOper() == opList);
03248 e2 = ((Binary*)e2)->getSubExp1();
03249 const char* ops = ((OpTable*)(TableDict[tbl]))->records[indexrefmap[idx]->getvalue()].c_str();
03250 Exp* repl = new Binary(strToOper(ops), e1->clone(),
03251 e2->clone());
03252 s->searchAndReplace(res, repl);
03253 }
03254 }
03255
03256 if (Dict.appendToDict(nam, *params, *rtl) != 0) {
03257 o << "Pattern " << iname->getinspattern() << " conflicts with an earlier declaration of " << nam << ".\n";
03258 yyerror(STR(o));
03259 }
03260 }
03261 indexrefmap.erase(indexrefmap.begin(), indexrefmap.end());
03262 }
03263
03264
03265
03266
03267
03268
03269
03270
03271
03272
03273
03274
03275 Exp* SSLParser::makeSuccessor(Exp* e) {
03276 return new Unary(opSuccessor, e);
03277 }