📄 parser.c
字号:
/* A Bison parser, made from ./parser.y by GNU Bison version 1.27 */#define YYBISON 1 /* Identify Bison output. */#define TOK_ANY 257#define TOK_ATTRIBUTE 258#define TOK_BOOLEAN 259#define TOK_CASE 260#define TOK_CHAR 261#define TOK_CONST 262#define TOK_CONTEXT 263#define TOK_DEFAULT 264#define TOK_DOUBLE 265#define TOK_ENUM 266#define TOK_EXCEPTION 267#define TOK_FALSE 268#define TOK_FIXED 269#define TOK_FLOAT 270#define TOK_IN 271#define TOK_INOUT 272#define TOK_INTERFACE 273#define TOK_LONG 274#define TOK_MODULE 275#define TOK_NATIVE 276#define TOK_OBJECT 277#define TOK_OCTET 278#define TOK_ONEWAY 279#define TOK_OP_SCOPE 280#define TOK_OP_SHL 281#define TOK_OP_SHR 282#define TOK_OUT 283#define TOK_RAISES 284#define TOK_READONLY 285#define TOK_SEQUENCE 286#define TOK_SHORT 287#define TOK_STRING 288#define TOK_STRUCT 289#define TOK_SWITCH 290#define TOK_TRUE 291#define TOK_TYPECODE 292#define TOK_TYPEDEF 293#define TOK_UNION 294#define TOK_UNSIGNED 295#define TOK_VARARGS 296#define TOK_VOID 297#define TOK_WCHAR 298#define TOK_WSTRING 299#define TOK_FLOATP 300#define TOK_INTEGER 301#define TOK_DECLSPEC 302#define TOK_PROP_KEY 303#define TOK_PROP_VALUE 304#define TOK_NATIVE_TYPE 305#define TOK_IDENT 306#define TOK_SQSTRING 307#define TOK_DQSTRING 308#define TOK_FIXEDP 309#define TOK_CODEFRAG 310#line 24 "./parser.y"#include <assert.h>#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <ctype.h>#include <string.h>#include <errno.h>#include "rename.h"#include "util.h"#define REF_IDENTS#define do_binop(rv,op,a,b) do { \ if (IDL_binop_chktypes (op, a, b)) \ YYABORT; \ if (!(__IDL_flags & IDLF_NO_EVAL_CONST)) { \ rv = IDL_binop_eval (op, a, b); \ IDL_tree_free (a); \ IDL_tree_free (b); \ if (!rv) YYABORT; \ } else { \ rv = IDL_binop_new (op, a, b); \ } \} while (0)#define do_unaryop(rv,op,a) do { \ if (IDL_unaryop_chktypes (op, a)) \ YYABORT; \ if (!(__IDL_flags & IDLF_NO_EVAL_CONST)) { \ rv = IDL_unaryop_eval (op, a); \ IDL_tree_free (a); \ if (!rv) YYABORT; \ } else { \ rv = IDL_unaryop_new (op, a); \ } \} while (0)#define assign_declspec(tree,declspec) do { \ IDL_NODE_DECLSPEC (tree) = declspec; \ if (__IDL_inhibits > 0 || \ (__IDL_flags & IDLF_INHIBIT_INCLUDES && \ __IDL_flagsi & IDLFP_IN_INCLUDES)) { \ IDL_NODE_DECLSPEC (tree) |= \ IDLF_DECLSPEC_EXIST | \ IDLF_DECLSPEC_INHIBIT; \ } \} while (0)#define assign_props(tree,props) do { \ if (__IDL_flags & IDLF_PROPERTIES) \ IDL_NODE_PROPERTIES (tree) = (props); \ else \ __IDL_free_properties (props); \} while (0)extern int yylex (void);static IDL_declspec_t IDL_parse_declspec (const char *strspec);static int IDL_binop_chktypes (enum IDL_binop op, IDL_tree a, IDL_tree b);static int IDL_unaryop_chktypes (enum IDL_unaryop op, IDL_tree a);static IDL_tree IDL_binop_eval (enum IDL_binop op, IDL_tree a, IDL_tree b);static IDL_tree IDL_unaryop_eval (enum IDL_unaryop op, IDL_tree a);static IDL_tree list_start (IDL_tree a, gboolean filter_null);static IDL_tree list_chain (IDL_tree a, IDL_tree b, gboolean filter_null);static IDL_tree zlist_chain (IDL_tree a, IDL_tree b, gboolean filter_null);static int do_token_error (IDL_tree p, const char *message, gboolean prev);static void illegal_context_type_error (IDL_tree p, const char *what);static void illegal_type_error (IDL_tree p, const char *message);#line 109 "./parser.y"typedef union { IDL_tree tree; struct { IDL_tree tree; gpointer data; } treedata; GHashTable *hash_table; char *str; gboolean boolean; IDL_declspec_t declspec; IDL_longlong_t integer; double floatp; enum IDL_unaryop unaryop; enum IDL_param_attr paramattr;} YYSTYPE;#include <stdio.h>#ifndef __cplusplus#ifndef __STDC__#define const#endif#endif#define YYFINAL 394#define YYFLAG -32768#define YYNTBASE 78#define YYTRANSLATE(x) ((unsigned)(x) <= 310 ? yytranslate[x] : 224)static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 72, 67, 2, 62, 63, 70, 68, 58, 69, 2, 71, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 61, 57, 74, 64, 75, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 76, 2, 77, 66, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 59, 65, 60, 73, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56};#if YYDEBUG != 0static const short yyprhs[] = { 0, 0, 1, 3, 4, 6, 8, 11, 13, 14, 16, 18, 19, 21, 24, 27, 30, 33, 36, 38, 40, 42, 45, 46, 54, 56, 58, 60, 61, 62, 75, 81, 82, 85, 87, 91, 93, 94, 97, 100, 103, 106, 109, 112, 114, 116, 119, 123, 125, 127, 129, 133, 134, 141, 144, 146, 148, 150, 152, 154, 156, 158, 160, 161, 163, 164, 166, 167, 168, 178, 179, 180, 194, 196, 198, 200, 202, 204, 206, 208, 211, 215, 218, 220, 223, 227, 230, 233, 239, 242, 249, 250, 253, 254, 256, 259, 260, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 288, 290, 293, 302, 303, 306, 308, 309, 311, 312, 315, 320, 324, 326, 330, 331, 337, 339, 341, 343, 345, 346, 348, 349, 351, 356, 361, 363, 365, 367, 369, 371, 373, 375, 377, 379, 381, 383, 387, 389, 393, 395, 399, 401, 405, 409, 411, 415, 419, 421, 425, 429, 433, 436, 438, 440, 442, 444, 446, 448, 452, 454, 456, 458, 460, 462, 464, 465, 473, 475, 477, 480, 484, 486, 490, 492, 495, 499, 501, 503, 505, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 532, 537, 539, 541, 544, 551, 553, 555, 557, 559, 561, 563, 565, 567, 570, 572, 574, 576, 579, 582, 586, 588, 590, 592, 594, 596, 598, 600, 605, 607, 612, 614, 616, 620, 622, 624, 626, 628, 630, 634, 637, 639, 642, 646, 649, 652, 657, 659, 663, 665, 667, 669, 671, 672, 674, 676, 678, 680, 682, 686, 688, 689, 691, 692, 693, 698, 700, 702, 704, 706, 708, 710, 712, 715, 717, 720, 722};static const short yyrhs[] = { -1, 80, 0, 0, 80, 0, 85, 0, 80, 85, 0, 57, 0, 0, 57, 0, 58, 0, 0, 162, 0, 98, 81, 0, 120, 81, 0, 122, 81, 0, 90, 81, 0, 87, 81, 0, 220, 0, 84, 0, 82, 0, 211, 21, 0, 0, 86, 203, 88, 59, 79, 60, 204, 0, 203, 0, 23, 0, 38, 0, 0, 0, 211, 212, 19, 89, 91, 204, 93, 92, 59, 95, 60, 204, 0, 211, 212, 19, 89, 204, 0, 0, 61, 94, 0, 162, 0, 94, 83, 162, 0, 96, 0, 0, 96, 97, 0, 98, 81, 0, 122, 81, 0, 133, 81, 0, 126, 81, 0, 120, 81, 0, 220, 0, 82, 0, 211, 99, 0, 212, 39, 101, 0, 107, 0, 110, 0, 160, 0, 212, 22, 193, 0, 0, 212, 22, 193, 62, 100, 51, 0, 102, 191, 0, 103, 0, 104, 0, 167, 0, 168, 0, 162, 0, 107, 0, 110, 0, 160, 0, 0, 201, 0, 0, 202, 0, 0, 0, 212, 35, 108, 106, 59, 109, 165, 60, 204, 0, 0, 0, 212, 40, 111, 106, 36, 62, 113, 63, 59, 112, 114, 60, 204, 0, 173, 0, 182, 0, 184, 0, 160, 0, 162, 0, 115, 0, 116, 0, 115, 116, 0, 118, 117, 81, 0, 102, 192, 0, 119, 0, 118, 119, 0, 6, 149, 61, 0, 10, 61, 0, 211, 121, 0, 8, 148, 201, 64, 149, 0, 211, 123, 0, 13, 202, 59, 124, 60, 204, 0, 0, 124, 166, 0, 0, 31, 0, 211, 127, 0, 0, 212, 125, 4, 128, 129, 195, 0, 131, 0, 43, 0, 169, 0, 104, 0, 167, 0, 189, 0, 190, 0, 171, 0, 162, 0, 130, 0, 0, 25, 0, 211, 134, 0, 212, 132, 135, 202, 139, 204, 144, 145, 0, 0, 136, 131, 0, 43, 0, 0, 42, 0, 0, 58, 42, 0, 62, 140, 138, 63, 0, 62, 137, 63, 0, 141, 0, 140, 83, 141, 0, 0, 212, 143, 142, 129, 193, 0, 17, 0, 29, 0, 18, 0, 129, 0, 0, 146, 0, 0, 147, 0, 30, 62, 94, 63, 0, 9, 62, 209, 63, 0, 173, 0, 182, 0, 183, 0, 184, 0, 170, 0, 189, 0, 190, 0, 172, 0, 162, 0, 150, 0, 151, 0, 150, 65, 151, 0, 152, 0, 151, 66, 152, 0, 153, 0, 152, 67, 153, 0, 154, 0, 153, 28, 154, 0, 153, 27, 154, 0, 155, 0, 154, 68, 155, 0, 154, 69, 155, 0, 156, 0, 155, 70, 156, 0, 155, 71, 156, 0, 155, 72, 156, 0, 157, 158, 0, 158, 0, 69, 0, 68, 0, 73, 0, 162, 0, 159, 0, 62, 149, 63, 0, 214, 0, 215, 0, 216, 0, 217, 0, 218, 0, 219, 0, 0, 212, 12, 161, 105, 59, 164, 60, 0, 163, 0, 206, 0, 26, 208, 0, 163, 26, 200, 0, 201, 0, 164, 83, 201, 0, 166, 0, 165, 166, 0, 102, 191, 81, 0, 170, 0, 173, 0, 182, 0, 183, 0, 184, 0, 185, 0, 186, 0, 187, 0, 188, 0, 169, 0, 189, 0, 190, 0, 171, 0, 32, 74, 103, 58, 210, 75, 0, 32, 74, 103, 75, 0, 16, 0, 11, 0, 20, 11, 0, 15, 74, 210, 58, 214, 75, 0, 15, 0, 174, 0, 178, 0, 175, 0, 176, 0, 177, 0, 33, 0, 20, 0, 20, 20, 0, 179, 0, 180, 0, 181, 0, 41, 33, 0, 41, 20, 0, 41, 20, 20, 0, 7, 0, 44, 0, 5, 0, 24, 0, 3, 0, 23, 0, 38, 0, 34, 74, 210, 75, 0, 34, 0, 45, 74, 210, 75, 0, 45, 0, 192, 0, 191, 83, 192, 0, 193, 0, 194, 0, 201, 0, 196, 0, 193, 0, 195, 83, 193, 0, 201, 197, 0, 198, 0, 197, 198, 0, 76, 210, 77, 0, 76, 77, 0, 49, 50, 0, 199, 58, 49, 50, 0, 49, 0, 199, 58, 49, 0, 52, 0, 205, 0, 205, 0, 207, 0, 0, 200, 0, 200, 0, 200, 0, 200, 0, 215, 0, 209, 83, 215, 0, 149, 0, 0, 48, 0, 0, 0, 76, 213, 199, 77, 0, 47, 0, 221, 0, 223, 0, 55, 0, 46, 0, 37, 0, 14, 0, 211, 56, 0, 222, 0, 221, 222, 0, 54, 0, 53, 0};#endif#if YYDEBUG != 0static const short yyrline[] = { 0, 299, 300, 303, 304, 307, 308, 311, 312, 318, 324, 325, 331, 340, 341, 342, 343, 344, 345, 346, 347, 350, 353, 362, 389, 390, 394, 400, 426, 432, 438, 451, 452, 498, 499, 503, 506, 507, 510, 511, 512, 513, 514, 515, 516, 519, 525, 538, 539, 540, 541, 546, 555, 562, 565, 566, 569, 570, 571, 574, 575, 576, 579, 583, 586, 590, 593, 595, 599, 608, 610, 616, 625, 626, 627, 628, 629, 632, 635, 636, 639, 643, 657, 658, 661, 662, 665, 671, 678, 684, 689, 690, 693, 694, 697, 703, 708, 722, 723, 729, 731, 734, 735, 736, 737, 738, 739, 745, 746, 749, 755,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -