Fennel: /home/pub/open/dev/fennel/calculator/CalcGrammar.cpp File Reference (original) (raw)
Go to the source code of this file.
| Classes | |
|---|---|
| struct | YYLTYPE |
| union | yyalloc |
| Typedefs | |
| typedef int | YYSTYPE |
| typedef YYTYPE_UINT8 | yytype_uint8 |
| typedef unsigned char | yytype_uint8 |
| typedef YYTYPE_INT8 | yytype_int8 |
| typedef signed char | yytype_int8 |
| typedef short int | yytype_int8 |
| typedef YYTYPE_UINT16 | yytype_uint16 |
| typedef unsigned short int | yytype_uint16 |
| typedef YYTYPE_INT16 | yytype_int16 |
| typedef short int | yytype_int16 |
| Enumerations | |
| enum | yytokentype { UNSIGNED_INTEGER = 258, NEGATIVE_INTEGER = 259, REAL = 260, STRING = 261, UNKNOWN_TOKEN = 262, COMMA = 263, TERM = 264, CODE_START = 265, LPAREN = 266, RPAREN = 267, WS = 268, AT = 269, REG_LOCAL = 270, REG_STATUS = 271, REG_LITERAL = 272, REG_INPUT = 273, REG_OUTPUT = 274, VALUES = 275, TYPE_FIXED = 276, TYPE_VARIABLE = 277, OPCODE = 278, NAME = 279, UNSIGNED_INTEGER = 258, NEGATIVE_INTEGER = 259, REAL = 260, STRING = 261, UNKNOWN_TOKEN = 262, COMMA = 263, TERM = 264, CODE_START = 265, LPAREN = 266, RPAREN = 267, WS = 268, AT = 269, REG_LOCAL = 270, REG_STATUS = 271, REG_LITERAL = 272, REG_INPUT = 273, REG_OUTPUT = 274, VALUES = 275, TYPE_FIXED = 276, TYPE_VARIABLE = 277, OPCODE = 278, NAME = 279, UNSIGNED_INTEGER = 258, NEGATIVE_INTEGER = 259, REAL = 260, STRING = 261, UNKNOWN_TOKEN = 262, COMMA = 263, TERM = 264, CODE_START = 265, LPAREN = 266, RPAREN = 267, WS = 268, AT = 269, REG_LOCAL = 270, REG_STATUS = 271, REG_LITERAL = 272, REG_INPUT = 273, REG_OUTPUT = 274, VALUES = 275, TYPE_FIXED = 276, TYPE_VARIABLE = 277, OPCODE = 278, NAME = 279, UNSIGNED_INTEGER = 258, NEGATIVE_INTEGER = 259, REAL = 260, STRING = 261, UNKNOWN_TOKEN = 262, COMMA = 263, TERM = 264, CODE_START = 265, LPAREN = 266, RPAREN = 267, WS = 268, AT = 269, REG_LOCAL = 270, REG_STATUS = 271, REG_LITERAL = 272, REG_INPUT = 273, REG_OUTPUT = 274, VALUES = 275, TYPE_FIXED = 276, TYPE_VARIABLE = 277, OPCODE = 278, NAME = 279, UNSIGNED_INTEGER = 258, NEGATIVE_INTEGER = 259, REAL = 260, STRING = 261, UNKNOWN_TOKEN = 262, COMMA = 263, TERM = 264, CODE_START = 265, LPAREN = 266, RPAREN = 267, WS = 268, AT = 269, REG_LOCAL = 270, REG_STATUS = 271, REG_LITERAL = 272, REG_INPUT = 273, REG_OUTPUT = 274, VALUES = 275, TYPE_FIXED = 276, TYPE_VARIABLE = 277, OPCODE = 278, NAME = 279, UNSIGNED_INTEGER = 258, NEGATIVE_INTEGER = 259, REAL = 260, STRING = 261, UNKNOWN_TOKEN = 262, COMMA = 263, TERM = 264, CODE_START = 265, LPAREN = 266, RPAREN = 267, WS = 268, AT = 269, REG_LOCAL = 270, REG_STATUS = 271, REG_LITERAL = 272, REG_INPUT = 273, REG_OUTPUT = 274, VALUES = 275, TYPE_FIXED = 276, TYPE_VARIABLE = 277, OPCODE = 278, NAME = 279 } |
| Functions | |
| FENNEL_BEGIN_CPPFILE ("$Id: //open/dev/fennel/calculator/CalcGrammar.ypp#2 $") | |
| int | CalcYYlex (YYSTYPE *, YYLTYPE *, void *) |
| void | CalcYYerror (const char *) |
| static int | YYID (int i) static int YYID(i) int i |
| void | free (void *) |
| static void | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep, YYLTYPE const *const yylocationp) static void yy_symbol_value_print(yyoutput |
| static YYSIZE_T | yystrlen (const char *yystr) static YYSIZE_T yystrlen(yystr) const char *yystr |
| int | yyparse () |
| int | yyparse (void *YYPARSE_PARAM) int yyparse(YYPARSE_PARAM) void *YYPARSE_PARAM |
| FENNEL_END_CPPFILE ("$Id: //open/dev/fennel/calculator/CalcGrammar.ypp#2 $") | |
| Variables | |
| static const yytype_uint8 | yytranslate [] |
| static const yytype_uint8 | yyprhs [] |
| static const yytype_int8 | yyrhs [] |
| static const yytype_uint8 | yyrline [] |
| static const char *const | yytname [] |
| static const yytype_uint16 | yytoknum [] |
| static const yytype_uint8 | yyr1 [] |
| static const yytype_uint8 | yyr2 [] |
| static const yytype_uint8 | yydefact [] |
| static const yytype_int8 | yydefgoto [] |
| static const yytype_int8 | yypact [] |
| static const yytype_int8 | yypgoto [] |
| static const yytype_int8 | yytable [] |
| static const yytype_int8 | yycheck [] |
| static const yytype_uint8 | yystos [] |
| static void | yytype |
| static void | yyvaluep |
| static void yylocationp FILE * | yyoutput |
| int | yytype |
| YYSTYPE const *const | yyvaluep |
| YYLTYPE const *const | yylocationp |
| int | yytype |
| YYSTYPE const *const | yyvaluep |
| YYLTYPE const *const | yylocationp |
| yytype_int16 * | top |
| YYLTYPE * | yylsp |
| int | yyrule |
| const char * | yysrc |
| int | yytype |
| YYSTYPE * | yyvaluep |
| YYLTYPE * | yylocationp |
Typedef Documentation
Enumeration Type Documentation
Enumerator:
| UNSIGNED_INTEGER | | | ------------------- | | | NEGATIVE_INTEGER | | | REAL | | | STRING | | | UNKNOWN_TOKEN | | | COMMA | | | TERM | | | CODE_START | | | LPAREN | | | RPAREN | | | WS | | | AT | | | REG_LOCAL | | | REG_STATUS | | | REG_LITERAL | | | REG_INPUT | | | REG_OUTPUT | | | VALUES | | | TYPE_FIXED | | | TYPE_VARIABLE | | | OPCODE | | | NAME | | | UNSIGNED_INTEGER | | | NEGATIVE_INTEGER | | | REAL | | | STRING | | | UNKNOWN_TOKEN | | | COMMA | | | TERM | | | CODE_START | | | LPAREN | | | RPAREN | | | WS | | | AT | | | REG_LOCAL | | | REG_STATUS | | | REG_LITERAL | | | REG_INPUT | | | REG_OUTPUT | | | VALUES | | | TYPE_FIXED | | | TYPE_VARIABLE | | | OPCODE | | | NAME | | | UNSIGNED_INTEGER | | | NEGATIVE_INTEGER | | | REAL | | | STRING | | | UNKNOWN_TOKEN | | | COMMA | | | TERM | | | CODE_START | | | LPAREN | | | RPAREN | | | WS | | | AT | | | REG_LOCAL | | | REG_STATUS | | | REG_LITERAL | | | REG_INPUT | | | REG_OUTPUT | | | VALUES | | | TYPE_FIXED | | | TYPE_VARIABLE | | | OPCODE | | | NAME | | | UNSIGNED_INTEGER | | | NEGATIVE_INTEGER | | | REAL | | | STRING | | | UNKNOWN_TOKEN | | | COMMA | | | TERM | | | CODE_START | | | LPAREN | | | RPAREN | | | WS | | | AT | | | REG_LOCAL | | | REG_STATUS | | | REG_LITERAL | | | REG_INPUT | | | REG_OUTPUT | | | VALUES | | | TYPE_FIXED | | | TYPE_VARIABLE | | | OPCODE | | | NAME | | | UNSIGNED_INTEGER | | | NEGATIVE_INTEGER | | | REAL | | | STRING | | | UNKNOWN_TOKEN | | | COMMA | | | TERM | | | CODE_START | | | LPAREN | | | RPAREN | | | WS | | | AT | | | REG_LOCAL | | | REG_STATUS | | | REG_LITERAL | | | REG_INPUT | | | REG_OUTPUT | | | VALUES | | | TYPE_FIXED | | | TYPE_VARIABLE | | | OPCODE | | | NAME | | | UNSIGNED_INTEGER | | | NEGATIVE_INTEGER | | | REAL | | | STRING | | | UNKNOWN_TOKEN | | | COMMA | | | TERM | | | CODE_START | | | LPAREN | | | RPAREN | | | WS | | | AT | | | REG_LOCAL | | | REG_STATUS | | | REG_LITERAL | | | REG_INPUT | | | REG_OUTPUT | | | VALUES | | | TYPE_FIXED | | | TYPE_VARIABLE | | | OPCODE | | | NAME | |
Definition at line 76 of file CalcGrammar.cpp.
00076 { 00077 UNSIGNED_INTEGER = 258, 00078 NEGATIVE_INTEGER = 259, 00079 REAL = 260, 00080 STRING = 261, 00081 UNKNOWN_TOKEN = 262, 00082 COMMA = 263, 00083 TERM = 264, 00084 CODE_START = 265, 00085 LPAREN = 266, 00086 RPAREN = 267, 00087 WS = 268, 00088 AT = 269, 00089 REG_LOCAL = 270, 00090 REG_STATUS = 271, 00091 REG_LITERAL = 272, 00092 REG_INPUT = 273, 00093 REG_OUTPUT = 274, 00094 VALUES = 275, 00095 TYPE_FIXED = 276, 00096 TYPE_VARIABLE = 277, 00097 OPCODE = 278, 00098 NAME = 279 00099 };
Function Documentation
| void CalcYYerror | ( | const char * | | ) | | ---------------- | - | ------------- | | - |
| FENNEL_BEGIN_CPPFILE | ( | "$Id: //open/dev/fennel/calculator/CalcGrammar.ypp#2 $" | | ) | | ---------------------- | - | ------------------------------------------------------- | | - |
| FENNEL_END_CPPFILE | ( | "$Id: //open/dev/fennel/calculator/CalcGrammar.ypp#2 $" | | ) | | -------------------- | - | ------------------------------------------------------- | | - |
| static void yy_symbol_value_print | ( | FILE * | yyoutput, |
|---|---|---|---|
| int | yytype, | ||
| YYSTYPE const *const | yyvaluep, | ||
| YYLTYPE const *const | yylocationp | ||
| ) | [static] |
| static int YYID | ( | int | i | ) | [static] |
|---|
| int yyparse | ( | void * | YYPARSE_PARAM | ) |
|---|
Definition at line 1227 of file CalcGrammar.cpp.
References YYLTYPE::first_column, YYLTYPE::first_line, YYLTYPE::last_column, YYLTYPE::last_line, YYID(), yyalloc::yyls, and yylsp.
01234 {
01235
01236 int yychar;
01237
01238
01239 YYSTYPE yylval;
01240
01241
01242 int yynerrs;
01243
01244 YYLTYPE yylloc;
01245
01246 int yystate;
01247 int yyn;
01248 int yyresult;
01249
01250 int yyerrstatus;
01251
01252 int yytoken = 0;
01253 #if YYERROR_VERBOSE
01254
01255 char yymsgbuf[128];
01256 char yymsg = yymsgbuf;
01257 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01258 #endif
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269 yytype_int16 yyssa[YYINITDEPTH];
01270 yytype_int16 yyss = yyssa;
01271 yytype_int16 yyssp;
01272
01273
01274 YYSTYPE yyvsa[YYINITDEPTH];
01275 YYSTYPE yyvs = yyvsa;
01276 YYSTYPE yyvsp;
01277
01278
01279 YYLTYPE yylsa[YYINITDEPTH];
01280 YYLTYPE yyls = yylsa;
01281 YYLTYPE yylsp;
01282
01283 YYLTYPE yyerror_range[2];
01284
01285 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
01286
01287 YYSIZE_T yystacksize = YYINITDEPTH;
01288
01289
01290
01291 YYSTYPE yyval;
01292 YYLTYPE yyloc;
01293
01294
01295
01296 int yylen = 0;
01297
01298 YYDPRINTF ((stderr, "Starting parse\n"));
01299
01300 yystate = 0;
01301 yyerrstatus = 0;
01302 yynerrs = 0;
01303 yychar = YYEMPTY;
01304
01305
01306
01307
01308
01309
01310 yyssp = yyss;
01311 yyvsp = yyvs;
01312 yylsp = yyls;
01313 #if YYLTYPE_IS_TRIVIAL
01314
01315 yylloc.first_line = yylloc.last_line = 1;
01316 yylloc.first_column = yylloc.last_column = 0;
01317 #endif
01318
01319 goto yysetstate;
01320
01321
01322
01323
01324 yynewstate:
01325
01326
01327 yyssp++;
01328
01329 yysetstate:
01330 yyssp = yystate;
01331
01332 if (yyss + yystacksize - 1 <= yyssp)
01333 {
01334
01335 YYSIZE_T yysize = yyssp - yyss + 1;
01336
01337 #ifdef yyoverflow
01338 {
01339
01340
01341
01342 YYSTYPE *yyvs1 = yyvs;
01343 yytype_int16 *yyss1 = yyss;
01344 YYLTYPE *yyls1 = yyls;
01345
01346
01347
01348
01349
01350 yyoverflow (YY_("memory exhausted"),
01351 &yyss1, yysize * sizeof (*yyssp),
01352 &yyvs1, yysize * sizeof (*yyvsp),
01353 &yyls1, yysize * sizeof (*yylsp),
01354 &yystacksize);
01355 yyls = yyls1;
01356 yyss = yyss1;
01357 yyvs = yyvs1;
01358 }
01359 #else
01360 # ifndef YYSTACK_RELOCATE
01361 goto yyexhaustedlab;
01362 # else
01363
01364 if (YYMAXDEPTH <= yystacksize)
01365 goto yyexhaustedlab;
01366 yystacksize *= 2;
01367 if (YYMAXDEPTH < yystacksize)
01368 yystacksize = YYMAXDEPTH;
01369
01370 {
01371 yytype_int16 *yyss1 = yyss;
01372 union yyalloc *yyptr =
01373 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01374 if (! yyptr)
01375 goto yyexhaustedlab;
01376 YYSTACK_RELOCATE (yyss);
01377 YYSTACK_RELOCATE (yyvs);
01378 YYSTACK_RELOCATE (yyls);
01379 # undef YYSTACK_RELOCATE
01380 if (yyss1 != yyssa)
01381 YYSTACK_FREE (yyss1);
01382 }
01383 # endif
01384 #endif
01385
01386 yyssp = yyss + yysize - 1;
01387 yyvsp = yyvs + yysize - 1;
01388 yylsp = yyls + yysize - 1;
01389
01390 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01391 (unsigned long int) yystacksize));
01392
01393 if (yyss + yystacksize - 1 <= yyssp)
01394 YYABORT;
01395 }
01396
01397 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01398
01399 goto yybackup;
01400
01401
01402
01403
01404 yybackup:
01405
01406
01407
01408
01409
01410 yyn = yypact[yystate];
01411 if (yyn == YYPACT_NINF)
01412 goto yydefault;
01413
01414
01415
01416
01417 if (yychar == YYEMPTY)
01418 {
01419 YYDPRINTF ((stderr, "Reading a token: "));
01420 yychar = YYLEX;
01421 }
01422
01423 if (yychar <= YYEOF)
01424 {
01425 yychar = yytoken = YYEOF;
01426 YYDPRINTF ((stderr, "Now at end of input.\n"));
01427 }
01428 else
01429 {
01430 yytoken = YYTRANSLATE (yychar);
01431 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01432 }
01433
01434
01435
01436 yyn += yytoken;
01437 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01438 goto yydefault;
01439 yyn = yytable[yyn];
01440 if (yyn <= 0)
01441 {
01442 if (yyn == 0 || yyn == YYTABLE_NINF)
01443 goto yyerrlab;
01444 yyn = -yyn;
01445 goto yyreduce;
01446 }
01447
01448 if (yyn == YYFINAL)
01449 YYACCEPT;
01450
01451
01452
01453 if (yyerrstatus)
01454 yyerrstatus--;
01455
01456
01457 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01458
01459
01460 if (yychar != YYEOF)
01461 yychar = YYEMPTY;
01462
01463 yystate = yyn;
01464 *++yyvsp = yylval;
01465 *++yylsp = yylloc;
01466 goto yynewstate;
01467
01468
01469
01470
01471
01472 yydefault:
01473 yyn = yydefact[yystate];
01474 if (yyn == 0)
01475 goto yyerrlab;
01476 goto yyreduce;
01477
01478
01479
01480
01481
01482 yyreduce:
01483
01484 yylen = yyr2[yyn];
01485
01486
01487
01488
01489
01490
01491
01492
01493
01494 yyval = yyvsp[1-yylen];
01495
01496
01497 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
01498 YY_REDUCE_PRINT (yyn);
01499 switch (yyn)
01500 {
01501 case 2:
01502 #line 107 "CalcGrammar.ypp"
01503 { ((CalcAssembler*) parm)->init(); ;}
01504 break;
01505
01506 case 3:
01507 #line 109 "CalcGrammar.ypp"
01508 { ((CalcAssembler) parm)->bindRegisters(); ;}
01509 break;
01510
01511 case 8:
01512 #line 120 "CalcGrammar.ypp"
01513 { ((CalcAssembler) parm)->selectRegisterSet((yyvsp[(1) - (1)].u.v_regset)); ;}
01514 break;
01515
01516 case 10:
01517 #line 124 "CalcGrammar.ypp"
01518 { ((CalcAssembler) parm)->allocateTuples(); ;}
01519 break;
01520
01521 case 11:
01522 #line 125 "CalcGrammar.ypp"
01523 { ((CalcAssembler) parm)->allocateTuples(); ;}
01524 break;
01525
01526 case 13:
01527 #line 128 "CalcGrammar.ypp"
01528 { ((CalcAssembler) parm)->selectRegisterSet((yyvsp[(1) - (1)].u.v_regset)); ;}
01529 break;
01530
01531 case 15:
01532 #line 132 "CalcGrammar.ypp"
01533 { ((CalcAssembler) parm)->bindLiteralDone(); ;}
01534 break;
01535
01536 case 19:
01537 #line 138 "CalcGrammar.ypp"
01538 { ((CalcAssembler) parm)->bindNextLiteral<uint64_t>((yyvsp[(1) - (1)].u.v_uint64)); ;}
01539 break;
01540
01541 case 20:
01542 #line 139 "CalcGrammar.ypp"
01543 { ((CalcAssembler) parm)->bindNextLiteral<int64_t>((yyvsp[(1) - (1)].u.v_int64)); ;}
01544 break;
01545
01546 case 21:
01547 #line 140 "CalcGrammar.ypp"
01548 { ((CalcAssembler) parm)->bindNextLiteral((yyvsp[(1) - (1)].u.v_double)); ;}
01549 break;
01550
01551 case 22:
01552 #line 141 "CalcGrammar.ypp"
01553 { ((CalcAssembler) parm)->bindNextLiteral((yyvsp[(1) - (1)].v_string)); ;}
01554 break;
01555
01556 case 23:
01557 #line 142 "CalcGrammar.ypp"
01558 { ((CalcAssembler) parm)->bindNextLiteral<PConstBuffer>(NULL); ;}
01559 break;
01560
01561 case 28:
01562 #line 148 "CalcGrammar.ypp"
01563 { ((CalcAssembler) parm)->addRegister((yyvsp[(1) - (1)].u.v_type)); ;}
01564 break;
01565
01566 case 29:
01567 #line 150 "CalcGrammar.ypp"
01568 { ((CalcAssembler) parm)->addRegister((yyvsp[(1) - (3)].u.v_type), (yyvsp[(3) - (3)].u.v_uint64)); ;}
01569 break;
01570
01571 case 33:
01572 #line 160 "CalcGrammar.ypp"
01573 { ((CalcAssembler) parm)->addInstruction((yyvsp[(1) - (1)].u.p_inst)); ;}
01574 break;
01575
01576 case 34:
01577 #line 162 "CalcGrammar.ypp"
01578 { ((CalcAssembler) parm)->addInstruction((yyvsp[(2) - (2)].u.p_inst)); ;}
01579 break;
01580
01581 case 35:
01582 #line 166 "CalcGrammar.ypp"
01583 {
01584 (yyval.u.p_inst) = ((CalcAssembler) parm)->createInstruction((yyvsp[(1) - (7)].v_opcode), (yyvsp[(2) - (7)].u.p_regref), (yyvsp[(4) - (7)].u.p_regref), (yyvsp[(6) - (7)].u.p_regref), (yyloc));
01585 ;}
01586 break;
01587
01588 case 36:
01589 #line 171 "CalcGrammar.ypp"
01590 {
01591 (yyval.u.p_inst) = ((CalcAssembler) parm)->createInstruction((yyvsp[(1) - (5)].v_opcode), (yyvsp[(2) - (5)].u.p_regref), (yyvsp[(4) - (5)].u.p_regref), (yyloc));
01592 ;}
01593 break;
01594
01595 case 37:
01596 #line 176 "CalcGrammar.ypp"
01597 {
01598 (yyval.u.p_inst) = ((CalcAssembler) parm)->createInstruction((yyvsp[(1) - (3)].v_opcode), (yyvsp[(2) - (3)].u.p_regref), (yyloc));
01599 ;}
01600 break;
01601
01602 case 38:
01603 #line 181 "CalcGrammar.ypp"
01604 {
01605 (yyval.u.p_inst) = ((CalcAssembler) parm)->createInstruction((yyvsp[(1) - (3)].v_opcode), (yyvsp[(2) - (3)].u.v_pc), (yyloc));
01606 ;}
01607 break;
01608
01609 case 39:
01610 #line 186 "CalcGrammar.ypp"
01611 {
01612 (yyval.u.p_inst) = ((CalcAssembler) parm)->createInstruction((yyvsp[(1) - (5)].v_opcode), (yyvsp[(2) - (5)].u.v_pc), (yyvsp[(4) - (5)].u.p_regref), (yyloc));
01613 ;}
01614 break;
01615
01616 case 40:
01617 #line 191 "CalcGrammar.ypp"
01618 {
01619 (yyval.u.p_inst) = ((CalcAssembler) parm)->createInstruction((yyvsp[(1) - (6)].v_opcode), (yyvsp[(2) - (6)].v_string), (yyvsp[(4) - (6)].v_register_list), (yyloc));
01620 ;}
01621 break;
01622
01623 case 41:
01624 #line 196 "CalcGrammar.ypp"
01625 {
01626 (yyval.u.p_inst) = ((CalcAssembler) parm)->createInstruction((yyvsp[(1) - (2)].v_opcode), (yyloc));
01627 ;}
01628 break;
01629
01630 case 43:
01631 #line 204 "CalcGrammar.ypp"
01632 { (yyval.u.v_pc) = (yyvsp[(2) - (2)].u.v_uint64); ((CalcAssembler) parm)->saveMaxPC((yyval.u.v_pc)); ;}
01633 break;
01634
01635 case 52:
01636 #line 213 "CalcGrammar.ypp"
01637 { (yyval.v_register_list).push_back((yyvsp[(1) - (1)].u.p_regref)); ;}
01638 break;
01639
01640 case 53:
01641 #line 214 "CalcGrammar.ypp"
01642 { (yyval.v_register_list) = (yyvsp[(1) - (3)].v_register_list); (yyval.v_register_list).push_back((yyvsp[(3) - (3)].u.p_regref)); ;}
01643 break;
01644
01645 case 54:
01646 #line 217 "CalcGrammar.ypp"
01647 { (yyval.u.p_regref) = ((CalcAssembler) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); ;}
01648 break;
01649
01650 case 55:
01651 #line 218 "CalcGrammar.ypp"
01652 { (yyval.u.p_regref) = ((CalcAssembler) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); ;}
01653 break;
01654
01655 case 56:
01656 #line 219 "CalcGrammar.ypp"
01657 { (yyval.u.p_regref) = ((CalcAssembler) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); ;}
01658 break;
01659
01660 case 57:
01661 #line 220 "CalcGrammar.ypp"
01662 { (yyval.u.p_regref) = ((CalcAssembler) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); ;}
01663 break;
01664
01665 case 58:
01666 #line 221 "CalcGrammar.ypp"
01667 { (yyval.u.p_regref) = ((CalcAssembler) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); ;}
01668 break;
01669
01670
01671
01672 #line 1673 "CalcGrammar.tab.cpp"
01673 default: break;
01674 }
01675 YY_SYMBOL_PRINT ("-> =", yyr1[yyn], &yyval, &yyloc);
01676
01677 YYPOPSTACK (yylen);
01678 yylen = 0;
01679 YY_STACK_PRINT (yyss, yyssp);
01680
01681 *++yyvsp = yyval;
01682 *++yylsp = yyloc;
01683
01684
01685
01686
01687
01688 yyn = yyr1[yyn];
01689
01690 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01691 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01692 yystate = yytable[yystate];
01693 else
01694 yystate = yydefgoto[yyn - YYNTOKENS];
01695
01696 goto yynewstate;
01697
01698
01699
01700
01701
01702 yyerrlab:
01703
01704 if (!yyerrstatus)
01705 {
01706 ++yynerrs;
01707 #if ! YYERROR_VERBOSE
01708 yyerror (YY_("syntax error"));
01709 #else
01710 {
01711 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
01712 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
01713 {
01714 YYSIZE_T yyalloc = 2 * yysize;
01715 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
01716 yyalloc = YYSTACK_ALLOC_MAXIMUM;
01717 if (yymsg != yymsgbuf)
01718 YYSTACK_FREE (yymsg);
01719 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
01720 if (yymsg)
01721 yymsg_alloc = yyalloc;
01722 else
01723 {
01724 yymsg = yymsgbuf;
01725 yymsg_alloc = sizeof yymsgbuf;
01726 }
01727 }
01728
01729 if (0 < yysize && yysize <= yymsg_alloc)
01730 {
01731 (void) yysyntax_error (yymsg, yystate, yychar);
01732 yyerror (yymsg);
01733 }
01734 else
01735 {
01736 yyerror (YY_("syntax error"));
01737 if (yysize != 0)
01738 goto yyexhaustedlab;
01739 }
01740 }
01741 #endif
01742 }
01743
01744 yyerror_range[0] = yylloc;
01745
01746 if (yyerrstatus == 3)
01747 {
01748
01749
01750
01751 if (yychar <= YYEOF)
01752 {
01753
01754 if (yychar == YYEOF)
01755 YYABORT;
01756 }
01757 else
01758 {
01759 yydestruct ("Error: discarding",
01760 yytoken, &yylval, &yylloc);
01761 yychar = YYEMPTY;
01762 }
01763 }
01764
01765
01766
01767 goto yyerrlab1;
01768
01769
01770
01771
01772
01773 yyerrorlab:
01774
01775
01776
01777
01778 if ( 0)
01779 goto yyerrorlab;
01780
01781 yyerror_range[0] = yylsp[1-yylen];
01782
01783
01784 YYPOPSTACK (yylen);
01785 yylen = 0;
01786 YY_STACK_PRINT (yyss, yyssp);
01787 yystate = *yyssp;
01788 goto yyerrlab1;
01789
01790
01791
01792
01793
01794 yyerrlab1:
01795 yyerrstatus = 3;
01796
01797 for (;;)
01798 {
01799 yyn = yypact[yystate];
01800 if (yyn != YYPACT_NINF)
01801 {
01802 yyn += YYTERROR;
01803 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01804 {
01805 yyn = yytable[yyn];
01806 if (0 < yyn)
01807 break;
01808 }
01809 }
01810
01811
01812 if (yyssp == yyss)
01813 YYABORT;
01814
01815 yyerror_range[0] = *yylsp;
01816 yydestruct ("Error: popping",
01817 yystos[yystate], yyvsp, yylsp);
01818 YYPOPSTACK (1);
01819 yystate = *yyssp;
01820 YY_STACK_PRINT (yyss, yyssp);
01821 }
01822
01823 if (yyn == YYFINAL)
01824 YYACCEPT;
01825
01826 *++yyvsp = yylval;
01827
01828 yyerror_range[1] = yylloc;
01829
01830
01831 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
01832 *++yylsp = yyloc;
01833
01834
01835 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01836
01837 yystate = yyn;
01838 goto yynewstate;
01839
01840
01841
01842
01843
01844 yyacceptlab:
01845 yyresult = 0;
01846 goto yyreturn;
01847
01848
01849
01850
01851 yyabortlab:
01852 yyresult = 1;
01853 goto yyreturn;
01854
01855 #ifndef yyoverflow
01856
01857
01858
01859 yyexhaustedlab:
01860 yyerror (YY_("memory exhausted"));
01861 yyresult = 2;
01862
01863 #endif
01864
01865 yyreturn:
01866 if (yychar != YYEOF && yychar != YYEMPTY)
01867 yydestruct ("Cleanup: discarding lookahead",
01868 yytoken, &yylval, &yylloc);
01869
01870
01871 YYPOPSTACK (yylen);
01872 YY_STACK_PRINT (yyss, yyssp);
01873 while (yyssp != yyss)
01874 {
01875 yydestruct ("Cleanup: popping",
01876 yystos[*yyssp], yyvsp, yylsp);
01877 YYPOPSTACK (1);
01878 }
01879 #ifndef yyoverflow
01880 if (yyss != yyssa)
01881 YYSTACK_FREE (yyss);
01882 #endif
01883 #if YYERROR_VERBOSE
01884 if (yymsg != yymsgbuf)
01885 YYSTACK_FREE (yymsg);
01886 #endif
01887
01888 return YYID (yyresult);
01889 }
| static YYSIZE_T yystrlen | ( | const char * | yystr | ) | const [static] |
|---|
Variable Documentation
Initial value:
{ 71, 72, 0, 74, 15, 16, 17, 18, 19, 21, 22, 8, 20, 9, 85, 12, 10, 88, 14, 15, 16, 17, 18, 19, 3, 4, 5, 6, 24, 15, 16, 17, 18, 19, 47, 48, 49, 50, 51, 15, 16, 9, 18, 19, 8, 9, 8, 9, 8, 9, 8, 9, 8, 23, 3, 8, 3, 11, 8, 62, 34, 9, 19, 9, 9, 9, 9, 9, 9, 9, 9, 30, -1, -1, -1, -1, -1, 32, -1, -1, 32, 32 }
Definition at line 639 of file CalcGrammar.cpp.
Initial value:
{ 2, 0, 0, 1, 24, 25, 26, 27, 3, 10, 6, 8, 0, 13, 7, 5, 11, 0, 0, 0, 0, 28, 0, 30, 0, 0, 0, 23, 12, 0, 0, 9, 0, 4, 32, 33, 14, 19, 20, 21, 22, 15, 17, 29, 31, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 49, 46, 51, 45, 34, 23, 0, 42, 43, 58, 56, 57, 55, 54, 0, 0, 38, 0, 37, 18, 16, 52, 0, 47, 50, 48, 0, 0, 0, 0, 39, 0, 36, 53, 40, 0, 35 }
Definition at line 572 of file CalcGrammar.cpp.
Initial value:
{ -1, 1, 2, 12, 8, 9, 10, 17, 15, 20, 16, 19, 28, 63, 41, 42, 11, 23, 24, 33, 34, 35, 65, 53, 54, 55, 79, 80, 57, 81, 59, 82 }
Definition at line 587 of file CalcGrammar.cpp.
Initial value:
{ -72, 2, 24, -72, -72, -72, -72, -72, -72, -11, -72, -72, 6, -72, -72, -72, -72, -12, 32, -12, -8, -72, 44, -72, 36, 30, 38, 21, -72, 51, -12, -72, 4, -72, 30, -72, -72, -72, -72, -72, -72, 47, -72, -72, -72, -72, 53, 53, 53, 53, 53, 53, 46, 40, 50, 52, 54, -72, 55, -72, 56, -72, 21, 57, -72, -72, -72, -72, -72, -72, -72, 14, 14, -72, 14, -72, -72, -72, -72, 3, -72, -72, -72, 58, 42, 14, 59, -72, 14, -72, -72, -72, 60, -72 }
Definition at line 598 of file CalcGrammar.cpp.
Initial value:
{ -72, -72, -72, -72, -72, -72, 61, -72, -72, -72, -72, -72, -72, -72, -72, -3, -72, 41, 43, -72, -72, 26, -13, -72, -72, -71, -72, 45, -72, 48, -72, 49 }
Definition at line 613 of file CalcGrammar.cpp.
Initial value:
{ 0, 0, 3, 4, 5, 12, 15, 17, 20, 21, 26, 27, 28, 32, 33, 38, 39, 44, 46, 50, 52, 54, 56, 58, 59, 61, 63, 65, 67, 69, 73, 75, 79, 81, 83, 86, 94, 100, 104, 108, 114, 121, 124, 126, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 151, 154, 157, 160, 163 }
Definition at line 473 of file CalcGrammar.cpp.
Initial value:
{ 0, 25, 27, 28, 26, 29, 30, 30, 32, 31, 33, 34, 33, 36, 35, 38, 37, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 43, 43, 44, 45, 45, 46, 46, 46, 46, 46, 46, 46, 47, 48, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 52, 53, 54, 55, 56 }
Definition at line 548 of file CalcGrammar.cpp.
Initial value:
{ 0, 2, 0, 0, 6, 2, 1, 2, 0, 4, 0, 0, 3, 0, 4, 0, 4, 1, 3, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 2, 7, 5, 3, 3, 5, 6, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, 2 }
Definition at line 559 of file CalcGrammar.cpp.
Initial value:
{ 26, 0, -1, -1, -1, 27, 29, 28, 10, 9, 44, -1, 30, 33, -1, 31, -1, 30, 31, -1, -1, 41, 32, 43, 9, -1, -1, -1, 35, 34, 37, -1, -1, 17, 36, 43, 9, -1, -1, 20, 39, 38, 9, -1, 40, -1, 39, 8, 40, -1, 3, -1, 4, -1, 5, -1, 6, -1, -1, 15, -1, 16, -1, 18, -1, 19, -1, 21, -1, 22, 8, 3, -1, 42, -1, 43, 8, 42, -1, 45, -1, 46, -1, 45, 46, -1, 23, 49, 8, 50, 8, 50, 9, -1, 23, 49, 8, 50, 9, -1, 23, 50, 9, -1, 23, 48, 9, -1, 23, 48, 8, 50, 9, -1, 23, 24, 11, 51, 12, 9, -1, 23, 9, -1, 3, -1, 14, 47, -1, 52, -1, 56, -1, 54, -1, 52, -1, 56, -1, 53, -1, 54, -1, 55, -1, 50, -1, 51, 8, 50, -1, 19, 47, -1, 18, 47, -1, 16, 47, -1, 17, 47, -1, 15, 47, -1 }
Definition at line 484 of file CalcGrammar.cpp.
Initial value:
{ 0, 107, 107, 109, 107, 114, 117, 117, 120, 120, 124, 125, 125, 128, 128, 132, 132, 135, 135, 138, 139, 140, 141, 142, 145, 145, 145, 145, 148, 149, 153, 154, 157, 160, 161, 165, 170, 175, 180, 185, 190, 195, 201, 204, 207, 207, 207, 210, 210, 210, 210, 210, 213, 214, 217, 218, 219, 220, 221 }
Definition at line 506 of file CalcGrammar.cpp.
Initial value:
{ 0, 26, 27, 0, 15, 16, 18, 19, 29, 30, 31, 41, 28, 17, 31, 33, 35, 32, 10, 36, 34, 21, 22, 42, 43, 9, 43, 20, 37, 8, 8, 9, 23, 44, 45, 46, 9, 3, 4, 5, 6, 39, 40, 3, 42, 9, 14, 15, 16, 17, 18, 19, 24, 48, 49, 50, 52, 53, 54, 55, 56, 46, 8, 38, 3, 47, 47, 47, 47, 47, 47, 11, 8, 9, 8, 9, 40, 9, 50, 51, 52, 54, 56, 50, 50, 8, 12, 9, 8, 9, 50, 9, 50, 9 }
Definition at line 654 of file CalcGrammar.cpp.
Initial value:
{ 78, 83, 3, 84, 4, 5, 13, 6, 7, 21, 22, 85, 27, 45, 90, 86, 18, 92, 46, 47, 48, 49, 50, 51, 37, 38, 39, 40, 52, 47, 48, 49, 50, 51, 66, 67, 68, 69, 70, 4, 5, 25, 6, 7, 30, 31, 30, 36, 72, 73, 88, 89, 29, 32, 43, 62, 64, 71, 74, 76, 61, 75, 26, -47, -50, -48, 77, 87, 91, 93, 14, 44, 0, 0, 0, 0, 0, 56, 0, 0, 58, 60 }
Definition at line 626 of file CalcGrammar.cpp.
const char* const yytname[] [static]
Initial value:
{ "$end", "error", "$undefined", "UNSIGNED_INTEGER", "NEGATIVE_INTEGER", "REAL", "STRING", "UNKNOWN_TOKEN", "COMMA", "TERM", "CODE_START", "LPAREN", "RPAREN", "WS", "AT", "REG_LOCAL", "REG_STATUS", "REG_LITERAL", "REG_INPUT", "REG_OUTPUT", "VALUES", "TYPE_FIXED", "TYPE_VARIABLE", "OPCODE", "NAME", "$accept", "program", "@1", "@2", "preamble", "register_sets", "register_set", "@3", "literal_set_values", "@4", "literal_set", "@5", "literal_values", "@6", "literal_defs", "literal_def", "set_name", "type_size", "type_size_list", "program_text", "instructions", "instruction", "index", "location", "result", "operand", "operand_list", "output_reg", "input_reg", "status_reg", "literal_reg", "local_reg", 0 }
Definition at line 520 of file CalcGrammar.cpp.
Initial value:
{ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279 }
Definition at line 539 of file CalcGrammar.cpp.
