📄 asn1p_y.c
字号:
/* A Bison parser, made from asn1p_y.y by GNU Bison version 1.28 */#define YYBISON 1 /* Identify Bison output. */#define yyparse asn1p_parse#define yylex asn1p_lex#define yyerror asn1p_error#define yylval asn1p_lval#define yychar asn1p_char#define yydebug asn1p_debug#define yynerrs asn1p_nerrs#define TOK_PPEQ 257#define TOK_opaque 258#define TOK_bstring 259#define TOK_cstring 260#define TOK_hstring 261#define TOK_identifier 262#define TOK_number 263#define TOK_number_negative 264#define TOK_typereference 265#define TOK_capitalreference 266#define TOK_typefieldreference 267#define TOK_valuefieldreference 268#define TOK_ABSENT 269#define TOK_ABSTRACT_SYNTAX 270#define TOK_ALL 271#define TOK_ANY 272#define TOK_APPLICATION 273#define TOK_AUTOMATIC 274#define TOK_BEGIN 275#define TOK_BIT 276#define TOK_BMPString 277#define TOK_BOOLEAN 278#define TOK_BY 279#define TOK_CHARACTER 280#define TOK_CHOICE 281#define TOK_CLASS 282#define TOK_COMPONENT 283#define TOK_COMPONENTS 284#define TOK_CONSTRAINED 285#define TOK_CONTAINING 286#define TOK_DEFAULT 287#define TOK_DEFINITIONS 288#define TOK_DEFINED 289#define TOK_EMBEDDED 290#define TOK_ENCODED 291#define TOK_ENCODING_CONTROL 292#define TOK_END 293#define TOK_ENUMERATED 294#define TOK_EXPLICIT 295#define TOK_EXPORTS 296#define TOK_EXTENSIBILITY 297#define TOK_EXTERNAL 298#define TOK_FALSE 299#define TOK_FROM 300#define TOK_GeneralizedTime 301#define TOK_GeneralString 302#define TOK_GraphicString 303#define TOK_IA5String 304#define TOK_IDENTIFIER 305#define TOK_IMPLICIT 306#define TOK_IMPLIED 307#define TOK_IMPORTS 308#define TOK_INCLUDES 309#define TOK_INSTANCE 310#define TOK_INSTRUCTIONS 311#define TOK_INTEGER 312#define TOK_ISO646String 313#define TOK_MAX 314#define TOK_MIN 315#define TOK_MINUS_INFINITY 316#define TOK_NULL 317#define TOK_NumericString 318#define TOK_OBJECT 319#define TOK_ObjectDescriptor 320#define TOK_OCTET 321#define TOK_OF 322#define TOK_OPTIONAL 323#define TOK_PATTERN 324#define TOK_PDV 325#define TOK_PLUS_INFINITY 326#define TOK_PRESENT 327#define TOK_PrintableString 328#define TOK_PRIVATE 329#define TOK_REAL 330#define TOK_RELATIVE_OID 331#define TOK_SEQUENCE 332#define TOK_SET 333#define TOK_SIZE 334#define TOK_STRING 335#define TOK_SYNTAX 336#define TOK_T61String 337#define TOK_TAGS 338#define TOK_TeletexString 339#define TOK_TRUE 340#define TOK_TYPE_IDENTIFIER 341#define TOK_UNIQUE 342#define TOK_UNIVERSAL 343#define TOK_UniversalString 344#define TOK_UTCTime 345#define TOK_UTF8String 346#define TOK_VideotexString 347#define TOK_VisibleString 348#define TOK_WITH 349#define TOK_EXCEPT 350#define TOK_INTERSECTION 351#define TOK_UNION 352#define TOK_TwoDots 353#define TOK_ThreeDots 354#line 1 "asn1p_y.y"#include <stdlib.h>#include <stdio.h>#include <string.h>#include <errno.h>#include <assert.h>#include "asn1parser.h"#define YYPARSE_PARAM param#define YYERROR_VERBOSEint yylex(void);int yyerror(const char *msg);void asn1p_lexer_hack_push_opaque_state(void);void asn1p_lexer_hack_enable_with_syntax(void);void asn1p_lexer_hack_push_encoding_control(void);#define yylineno asn1p_linenoextern int asn1p_lineno;static asn1p_value_t * _convert_bitstring2binary(char *str, int base);#define checkmem(ptr) do { \ if(!(ptr)) \ return yyerror("Memory failure"); \ } while(0)#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \ if(arg1->type != constr_type) { \ int __ret; \ root = asn1p_constraint_new(yylineno); \ checkmem(root); \ root->type = constr_type; \ __ret = asn1p_constraint_insert(root, \ arg1); \ checkmem(__ret == 0); \ } else { \ root = arg1; \ } \ if(arg2) { \ int __ret \ = asn1p_constraint_insert(root, arg2); \ checkmem(__ret == 0); \ } \ } while(0)#line 58 "asn1p_y.y"typedef union { asn1p_t *a_grammar; asn1p_module_flags_e a_module_flags; asn1p_module_t *a_module; asn1p_expr_type_e a_type; /* ASN.1 Type */ asn1p_expr_t *a_expr; /* Constructed collection */ asn1p_constraint_t *a_constr; /* Constraint */ enum asn1p_constraint_type_e a_ctype;/* Constraint type */ asn1p_xports_t *a_xports; /* IMports/EXports */ asn1p_oid_t *a_oid; /* Object Identifier */ asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */ struct asn1p_type_tag_s a_tag; /* A tag */ asn1p_ref_t *a_ref; /* Reference to custom type */ asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */ asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */ struct asn1p_ref_component_s a_refcomp; /* Component of a reference */ asn1p_value_t *a_value; /* Number, DefinedValue, etc */ struct asn1p_param_s a_parg; /* A parameter argument */ asn1p_paramlist_t *a_plist; /* A pargs list */ struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */ enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */ asn1c_integer_t a_int; char *tv_str; struct { char *buf; int len; } tv_opaque; struct { char *name; struct asn1p_type_tag_s tag; } tv_nametag;} YYSTYPE;#include <stdio.h>#ifndef __cplusplus#ifndef __STDC__#define const#endif#endif#define YYFINAL 417#define YYFLAG -32768#define YYNTBASE 116#define YYTRANSLATE(x) ((unsigned)(x) <= 354 ? yytranslate[x] : 217)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, 110, 2, 2, 2, 2, 2, 2, 105, 106, 2, 2, 108, 2, 111, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 109, 107, 112, 2, 2, 2, 113, 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, 114, 2, 115, 97, 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, 103, 99, 104, 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, 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, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98, 100, 101, 102};#if YYDEBUG != 0static const short yyprhs[] = { 0, 0, 2, 4, 7, 16, 17, 19, 23, 26, 28, 31, 33, 38, 40, 41, 43, 45, 48, 51, 54, 57, 60, 63, 64, 66, 68, 71, 73, 75, 77, 79, 81, 82, 86, 88, 92, 95, 97, 100, 105, 107, 111, 113, 117, 119, 123, 127, 130, 132, 136, 138, 142, 144, 151, 153, 155, 156, 158, 160, 164, 166, 168, 173, 177, 181, 188, 190, 194, 196, 200, 204, 208, 210, 214, 216, 218, 219, 221, 223, 227, 231, 235, 237, 239, 243, 246, 248, 254, 255, 257, 259, 263, 266, 271, 276, 277, 279, 280, 287, 289, 292, 294, 296, 298, 302, 306, 310, 312, 314, 319, 324, 329, 336, 343, 345, 350, 355, 357, 361, 363, 367, 371, 375, 377, 381, 383, 387, 389, 391, 393, 395, 400, 404, 405, 409, 411, 413, 415, 417, 419, 421, 423, 425, 427, 431, 433, 436, 438, 440, 442, 444, 447, 450, 452, 454, 457, 460, 462, 464, 466, 468, 471, 473, 476, 478, 480, 482, 484, 486, 488, 490, 492, 494, 496, 498, 500, 502, 504, 506, 508, 510, 512, 514, 515, 517, 519, 524, 528, 533, 535, 539, 545, 547, 551, 555, 559, 564, 568, 570, 574, 578, 582, 586, 588, 590, 592, 595, 598, 602, 604, 606, 608, 610, 612, 614, 616, 618, 624, 626, 630, 632, 636, 637, 639, 641, 643, 645, 647, 649, 653, 658, 660, 664, 667, 671, 673, 677, 678, 680, 682, 685, 688, 692, 694, 698, 700, 705, 710, 712, 714, 716, 718, 719, 721, 724, 729, 730, 732, 734, 736, 737, 739, 741, 743, 745, 747, 748, 750};static const short yyrhs[] = { 117, 0, 118, 0, 117, 118, 0, 213, 119, 34, 123, 3, 21, 126, 39, 0, 0, 120, 0, 103, 121, 104, 0, 103, 104, 0, 122, 0, 121, 122, 0, 216, 0, 216, 105, 9, 106, 0, 9, 0, 0, 124, 0, 125, 0, 124, 125, 0, 41, 84, 0, 52, 84, 0, 20, 84, 0, 43, 53, 0, 12, 57, 0, 0, 127, 0, 128, 0, 127, 128, 0, 130, 0, 135, 0, 143, 0, 170, 0, 138, 0, 0, 38, 12, 129, 0, 178, 0, 54, 131, 107, 0, 54, 46, 0, 132, 0, 131, 132, 0, 133, 46, 213, 119, 0, 134, 0, 133, 108, 134, 0, 213, 0, 213, 103, 104, 0, 216, 0, 42, 136, 107, 0, 42, 17, 107, 0, 42, 107, 0, 137, 0, 136, 108, 137, 0, 213, 0, 213, 103, 104, 0, 216, 0, 213, 139, 3, 103, 140, 104, 0, 165, 0, 175, 0, 0, 141, 0, 142, 0, 141, 108, 142, 0, 102, 0, 186, 0, 213, 3, 208, 87, 0, 213, 3, 163, 0, 213, 3, 153, 0, 213, 103, 144, 104, 3, 163, 0, 145, 0, 144, 108, 145, 0, 213, 0, 213, 109, 216, 0, 213, 109, 213, 0, 175, 109, 216, 0, 147, 0, 146, 108, 147, 0, 163, 0, 216, 0, 0, 149, 0, 150, 0, 149, 108, 150, 0, 216, 163, 202, 0, 30, 68, 163, 0, 162, 0, 152, 0, 151, 108, 152, 0, 216, 163, 0, 162, 0, 28, 103, 155, 104, 157, 0, 0, 88, 0, 156, 0, 155, 108, 156, 0, 168, 202, 0, 168, 163, 154, 202, 0, 168, 168, 154, 202, 0, 0, 158, 0, 0, 95, 82, 103, 159, 160, 104, 0, 161, 0, 160, 161, 0, 4, 0, 168, 0, 102, 0, 102, 110, 173, 0, 102, 110, 207, 0, 208, 164, 182, 0, 177, 0, 178, 0, 27, 103, 151, 104, 0, 78, 103, 148, 104, 0, 79, 103, 148, 104, 0, 78, 182, 68, 215, 208, 164, 0, 79, 182, 68, 215, 208, 164, 0, 18, 0, 18, 35, 25, 216, 0, 213, 103, 146, 104, 0, 165, 0, 56, 68, 165, 0, 11, 0, 11, 111, 213, 0, 214, 111, 213, 0, 11, 111, 216, 0, 214, 0, 214, 111, 166, 0, 167, 0, 166, 111, 167, 0, 169, 0, 169, 0, 13, 0, 14, 0, 216, 139, 3, 171, 0, 216, 109, 171, 0, 0, 103, 172, 174, 0, 63, 0, 45, 0, 86, 0, 5, 0, 7, 0, 6, 0, 207, 0, 173, 0, 216, 0, 213, 111, 216, 0, 4, 0, 174, 4, 0, 24, 0, 63, 0, 76, 0, 176, 0, 67, 81, 0, 65, 51, 0, 77, 0, 44, 0, 36, 71, 0, 26, 81, 0, 91, 0, 47, 0, 58, 0, 40, 0, 22, 81, 0, 175, 0, 176, 204, 0, 23, 0, 48, 0, 49, 0, 50, 0, 59, 0, 64, 0, 74, 0, 83, 0, 85, 0, 90, 0, 92, 0, 93, 0, 94, 0, 66, 0, 99, 0, 100, 0, 97, 0, 98, 0, 96, 0, 0, 183, 0, 184, 0, 80, 105, 185, 106, 0, 105, 185, 106, 0, 184, 105, 185, 106, 0, 186, 0, 186, 108, 102, 0, 186, 108, 102, 108, 186, 0, 187, 0, 186, 179, 187, 0, 186, 180, 187, 0, 187, 181, 187, 0, 189, 105, 185, 106, 0, 105, 185, 106, 0, 190, 0, 190, 188, 190, 0, 61, 188, 190, 0, 190, 188, 60, 0, 61, 188, 60, 0, 196, 0, 191, 0, 101, 0, 101, 112, 0, 112, 101, 0, 112, 101, 112, 0, 80, 0, 46, 0, 45, 0, 86, 0, 207, 0, 6, 0, 216, 0, 213, 0, 95, 30, 103, 192, 104, 0, 193, 0, 192, 108, 193, 0, 102,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -