/builds/wireshark/wireshark/build/epan/protobuf_lang_parser.c (2024)

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name protobuf_lang_parser.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -fno-delete-null-pointer-checks -mframe-pointer=all -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -ffloat16-excess-precision=fast -fbfloat16-excess-precision=fast -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/builds/wireshark/wireshark/build -fcoverage-compilation-dir=/builds/wireshark/wireshark/build -resource-dir /usr/lib/llvm-18/lib/clang/18 -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /builds/wireshark/wireshark/epan -isystem /builds/wireshark/wireshark/build/epan -isystem /usr/include/libxml2 -isystem /usr/include/lua5.4 -D G_DISABLE_DEPRECATED -D G_DISABLE_SINGLE_INCLUDES -D WS_BUILD_DLL -D WS_DEBUG -D WS_DEBUG_UTF_8 -D epan_EXPORTS -I /builds/wireshark/wireshark/build -I /builds/wireshark/wireshark -I /builds/wireshark/wireshark/include -I /builds/wireshark/wireshark/wiretap -D _GLIBCXX_ASSERTIONS -internal-isystem /usr/lib/llvm-18/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -Wno-format-truncation -Wno-format-nonliteral -Wno-pointer-sign -Wno-unused-parameter -std=gnu11 -ferror-limit 19 -fvisibility=hidden -fwrapv -fstrict-flex-arrays=3 -stack-protector 2 -fstack-clash-protection -fcf-protection=full -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fexceptions -fcolor-diagnostics -analyzer-output=html -dwarf-debug-flags /usr/lib/llvm-18/bin/clang -### --analyze -x c -D G_DISABLE_DEPRECATED -D G_DISABLE_SINGLE_INCLUDES -D WS_BUILD_DLL -D WS_DEBUG -D WS_DEBUG_UTF_8 -D epan_EXPORTS -I /builds/wireshark/wireshark/build -I /builds/wireshark/wireshark -I /builds/wireshark/wireshark/include -I /builds/wireshark/wireshark/wiretap -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /builds/wireshark/wireshark/epan -isystem /builds/wireshark/wireshark/build/epan -isystem /usr/include/libxml2 -isystem /usr/include/lua5.4 -fvisibility=hidden -fexcess-precision=fast -fstrict-flex-arrays=3 -fstack-clash-protection -fcf-protection=full -D _GLIBCXX_ASSERTIONS -fstack-protector-strong -fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -fexceptions -Wno-format-truncation -Wno-format-nonliteral -fdiagnostics-color=always -Wno-pointer-sign -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -std=gnu11 -fPIC -Wno-unused-parameter /builds/wireshark/wireshark/build/epan/protobuf_lang_parser.c -o /builds/wireshark/wireshark/sbout/2024-08-28-100346-3897-1 -Xclang -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /builds/wireshark/wireshark/sbout/2024-08-28-100346-3897-1 -x c /builds/wireshark/wireshark/build/epan/protobuf_lang_parser.c

1/* This file is automatically generated by Lemon from input grammar2** source file "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon". */3/* protobuf_lang_parser.lemon4 *5 * C Protocol Buffers Language (PBL) Parser (for *.proto files)6 * Copyright 2020, Huang Qiangxiong <[emailprotected]>7 *8 * SPDX-License-Identifier: GPL-2.0-or-later9 */10 11/* This parser is mainly to get MESSAGE, ENUM, and FIELD information from *.proto files.12 * There are two formats of *.proto files:13 * 1) Protocol Buffers Version 3 Language Specification:14 * https://developers.google.com/protocol-buffers/docs/reference/proto3-spec15 * 2) Protocol Buffers Version 2 Language Specification:16 * https://developers.google.com/protocol-buffers/docs/reference/proto2-spec17 * There are some errors about 'proto', 'option' (value) and 'reserved' (fieldName) definitions on that sites.18 * This parser is created because Wireshark is mainly implemented in plain ANSI C but the official19 * Protocol Buffers Language parser is implemented in C++.20 */21#include "config.h"22#include <stdio.h>23#include <stdlib.h>24#include <string.h>25#include <stdarg.h>26#include <glib.h>27#include <assert.h>28#include <ws_diag_control.h>29#include <wsutil/file_util.h>30#include "protobuf_lang_tree.h"31#include "protobuf_lang_parser.h"32#include "protobuf_lang_scanner_lex.h"33 34#define NAME_TO_BE_SET"<NAME_TO_BE_SET>" "<NAME_TO_BE_SET>"35#define NEED_NOT_NAME"<NEED_NOT_NAME>" "<NEED_NOT_NAME>"36 37static void *ProtobufLangParserAlloc(void *(*mallocProc)(size_t));38static void ProtobufLangParser(void *yyp, int yymajor, protobuf_lang_token_t *yyminor, protobuf_lang_state_t *state);39static void ProtobufLangParserFree(void *p, void (*freeProc)(void*));40 41/* Error handling function for parser */42void protobuf_lang_error(void* yyscanner, protobuf_lang_state_t *state, const char *msg);43 44/* Extended error handling function */45void pbl_parser_error(protobuf_lang_state_t *state, const char *fmt, ...);46 47/* It's just the approximate line number which is gotten when a grammar rule is reduced48 by the parser (lemon). That might be overridden by the lineno argument of49 pbl_set_node_name() later. */50#define CUR_LINENO(protobuf_lang_get_lineno(state->scanner)) (protobuf_lang_get_lineno(state->scanner))51 52DIAG_OFF_LEMON()clang diagnostic push clang diagnostic ignored "-Wunreachable-code"
53#line 79 "./protobuf_lang_parser.c"54/**************** End of %include directives **********************************/55/* These constants specify the various numeric values for terminal symbols.56***************** Begin token definitions *************************************/57#ifndef PT_IDENT158#define PT_IDENT1 159#define PT_SYNTAX2 260#define PT_IMPORT3 361#define PT_WEAK4 462#define PT_PUBLIC5 563#define PT_PACKAGE6 664#define PT_OPTION7 765#define PT_REQUIRED8 866#define PT_OPTIONAL9 967#define PT_REPEATED10 1068#define PT_ONEOF11 1169#define PT_MAP12 1270#define PT_RESERVED13 1371#define PT_ENUM14 1472#define PT_GROUP15 1573#define PT_EXTEND16 1674#define PT_EXTENSIONS17 1775#define PT_MESSAGE18 1876#define PT_SERVICE19 1977#define PT_RPC20 2078#define PT_STREAM21 2179#define PT_RETURNS22 2280#define PT_TO23 2381#define PT_ASSIGN24 2482#define PT_SEMICOLON25 2583#define PT_LPAREN26 2684#define PT_RPAREN27 2785#define PT_DOT28 2886#define PT_LCURLY29 2987#define PT_RCURLY30 3088#define PT_STRLIT31 3189#define PT_LBRACKET32 3290#define PT_RBRACKET33 3391#define PT_EQUAL34 3492#define PT_NOTEQUAL35 3593#define PT_NOTEQUAL236 3694#define PT_GEQUAL37 3795#define PT_LEQUAL38 3896#define PT_ASSIGN_PLUS39 3997#define PT_PLUS40 4098#define PT_MINUS41 4199#define PT_MULTIPLY42 42100#define PT_DIV43 43101#define PT_LOGIC_OR44 44102#define PT_OR45 45103#define PT_LOGIC_AND46 46104#define PT_AND47 47105#define PT_NOT48 48106#define PT_NEG49 49107#define PT_XOR50 50108#define PT_SHL51 51109#define PT_SHR52 52110#define PT_PERCENT53 53111#define PT_DOLLAR54 54112#define PT_COND55 55113#define PT_COMMA56 56114#define PT_COLON57 57115#define PT_LESS58 58116#define PT_GREATER59 59117#define PT_DECIMALLIT60 60118#define PT_OCTALLIT61 61119#define PT_HEXLIT62 62120#endif121/**************** End token definitions ***************************************/122 123/* The next sections is a series of control #defines.124** various aspects of the generated parser.125** YYCODETYPE is the data type used to store the integer codes126** that represent terminal and non-terminal symbols.127** "unsigned char" is used if there are fewer than128** 256 symbols. Larger types otherwise.129** YYNOCODE is a number of type YYCODETYPE that is not used for130** any terminal or nonterminal symbol.131** YYFALLBACK If defined, this indicates that one or more tokens132** (also known as: "terminal symbols") have fall-back133** values which should be used if the original symbol134** would not parse. This permits keywords to sometimes135** be used as identifiers, for example.136** YYACTIONTYPE is the data type used for "action codes" - numbers137** that indicate what to do in response to the next138** token.139** ProtobufLangParserTOKENTYPE is the data type used for minor type for terminal140** symbols. Background: A "minor type" is a semantic141** value associated with a terminal or non-terminal142** symbols. For example, for an "ID" terminal symbol,143** the minor type might be the name of the identifier.144** Each non-terminal can have a different minor type.145** Terminal symbols all have the same minor type, though.146** This macros defines the minor type for terminal147** symbols.148** YYMINORTYPE is the data type used for all minor types.149** This is typically a union of many types, one of150** which is ProtobufLangParserTOKENTYPE. The entry in the union151** for terminal symbols is called "yy0".152** YYSTACKDEPTH is the maximum depth of the parser's stack. If153** zero the stack is dynamically sized using realloc()154** ProtobufLangParserARG_SDECL A static variable declaration for the %extra_argument155** ProtobufLangParserARG_PDECL A parameter declaration for the %extra_argument156** ProtobufLangParserARG_PARAM Code to pass %extra_argument as a subroutine parameter157** ProtobufLangParserARG_STORE Code to store %extra_argument into yypParser158** ProtobufLangParserARG_FETCH Code to extract %extra_argument from yypParser159** ProtobufLangParserCTX_* As ProtobufLangParserARG_ except for %extra_context160** YYERRORSYMBOL is the code number of the error symbol. If not161** defined, then do no error processing.162** YYNSTATE the combined number of states.163** YYNRULE the number of rules in the grammar164** YYNTOKEN Number of terminal symbols165** YY_MAX_SHIFT Maximum value for shift actions166** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions167** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions168** YY_ERROR_ACTION The yy_action[] code for syntax error169** YY_ACCEPT_ACTION The yy_action[] code for accept170** YY_NO_ACTION The yy_action[] code for no-op171** YY_MIN_REDUCE Minimum value for reduce actions172** YY_MAX_REDUCE Maximum value for reduce actions173*/174#ifndef INTERFACE1175# define INTERFACE1 1176#endif177/************* Begin control #defines *****************************************/178#define YYCODETYPEunsigned char unsigned char179#define YYNOCODE126 126180#define YYACTIONTYPEunsigned short int unsigned short int181#define ProtobufLangParserTOKENTYPEprotobuf_lang_token_t* protobuf_lang_token_t* 182typedef union {183 int yyinit;184 ProtobufLangParserTOKENTYPEprotobuf_lang_token_t* yy0;185 int yy4;186 uint64_t yy122;187 protobuf_lang_token_t* yy140;188 gchar* yy148;189 pbl_node_t* yy205;190} YYMINORTYPE;191#ifndef YYSTACKDEPTH100192#define YYSTACKDEPTH100 100193#endif194#define ProtobufLangParserARG_SDECLprotobuf_lang_state_t *state ; protobuf_lang_state_t *state ;195#define ProtobufLangParserARG_PDECL, protobuf_lang_state_t *state , protobuf_lang_state_t *state 196#define ProtobufLangParserARG_PARAM,state ,state 197#define ProtobufLangParserARG_FETCHprotobuf_lang_state_t *state =yypParser->state ; protobuf_lang_state_t *state =yypParser->state ;198#define ProtobufLangParserARG_STOREyypParser->state =state ; yypParser->state =state ;199#define ProtobufLangParserCTX_SDECL200#define ProtobufLangParserCTX_PDECL201#define ProtobufLangParserCTX_PARAM202#define ProtobufLangParserCTX_FETCH203#define ProtobufLangParserCTX_STORE204#define YYFALLBACK1 1205#define YYNSTATE152 152206#define YYNRULE181 181207#define YYNRULE_WITH_ACTION77 77208#define YYNTOKEN63 63209#define YY_MAX_SHIFT151 151210#define YY_MIN_SHIFTREDUCE316 316211#define YY_MAX_SHIFTREDUCE496 496212#define YY_ERROR_ACTION497 497213#define YY_ACCEPT_ACTION498 498214#define YY_NO_ACTION499 499215#define YY_MIN_REDUCE500 500216#define YY_MAX_REDUCE680 680217/************* End control #defines *******************************************/218#define YY_NLOOKAHEAD((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))219 220/* Define the yytestcase() macro to be a no-op if is not already defined221** otherwise.222**223** Applications can choose to define yytestcase() in the %include section224** to a macro that can assist in verifying code coverage. For production225** code the yytestcase() macro should be turned off. But it is useful226** for testing.227*/228#ifndef yytestcase229# define yytestcase(X)230#endif231 232 233/* Next are the tables used to determine what action to take based on the234** current state and lookahead token. These tables are used to implement235** functions that take a state number and lookahead value and return an236** action integer.237**238** Suppose the action integer is N. Then the action is determined as239** follows240**241** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead242** token onto the stack and goto state N.243**244** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then245** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE.246**247** N == YY_ERROR_ACTION A syntax error has occurred.248**249** N == YY_ACCEPT_ACTION The parser accepts its input.250**251** N == YY_NO_ACTION No such action. Denotes unused252** slots in the yy_action[] table.253**254** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE255** and YY_MAX_REDUCE256**257** The action table is constructed as a single large table named yy_action[].258** Given state S and lookahead X, the action is computed as either:259**260** (A) N = yy_action[ yy_shift_ofst[S] + X ]261** (B) N = yy_default[S]262**263** The (A) formula is preferred. The B formula is used instead if264** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.265**266** The formulas above are for computing the action when the lookahead is267** a terminal symbol. If the lookahead is a non-terminal (as occurs after268** a reduce action) then the yy_reduce_ofst[] array is used in place of269** the yy_shift_ofst[] array.270**271** The following are the tables generated in this section:272**273** yy_action[] A single table containing all actions.274** yy_lookahead[] A table containing the lookahead for each entry in275** yy_action. Used to detect hash collisions.276** yy_shift_ofst[] For each state, the offset into yy_action for277** shifting terminals.278** yy_reduce_ofst[] For each state, the offset into yy_action for279** shifting non-terminals after a reduce.280** yy_default[] Default action for each state.281**282*********** Begin parsing tables **********************************************/283#define YY_ACTTAB_COUNT(477) (477)284static const YYACTIONTYPEunsigned short int yy_action[] = {285 /* 0 */ 139, 496, 525, 496, 141, 545, 90, 545, 92, 545,286 /* 10 */ 129, 545, 131, 545, 94, 545, 96, 59, 103, 509,287 /* 20 */ 88, 544, 88, 46, 420, 437, 410, 411, 438, 84,288 /* 30 */ 403, 406, 412, 413, 414, 415, 416, 417, 418, 419,289 /* 40 */ 421, 422, 423, 424, 425, 426, 427, 428, 429, 430,290 /* 50 */ 431, 432, 433, 434, 435, 436, 439, 440, 441, 442,291 /* 60 */ 382, 383, 384, 496, 511, 35, 35, 29, 29, 22,292 /* 70 */ 357, 358, 359, 56, 124, 12, 61, 57, 51, 21,293 /* 80 */ 62, 530, 87, 653, 654, 648, 649, 494, 496, 496,294 /* 90 */ 531, 86, 367, 89, 547, 22, 357, 358, 359, 56,295 /* 100 */ 124, 12, 61, 57, 51, 21, 62, 475, 643, 644,296 /* 110 */ 35, 146, 29, 494, 146, 496, 549, 569, 368, 641,297 /* 120 */ 569, 22, 357, 358, 359, 56, 124, 12, 61, 57,298 /* 130 */ 51, 21, 62, 122, 496, 42, 60, 544, 38, 494,299 /* 140 */ 544, 357, 358, 359, 328, 503, 503, 139, 57, 391,300 /* 150 */ 546, 570, 503, 516, 570, 503, 496, 514, 494, 515,301 /* 160 */ 666, 550, 527, 377, 642, 503, 73, 74, 518, 663,302 /* 170 */ 519, 517, 631, 579, 580, 581, 582, 496, 382, 383,303 /* 180 */ 384, 71, 633, 635, 382, 383, 384, 67, 632, 634,304 /* 190 */ 72, 22, 496, 391, 665, 496, 127, 55, 61, 137,305 /* 200 */ 51, 544, 62, 50, 496, 84, 58, 391, 22, 494,306 /* 210 */ 22, 357, 358, 359, 130, 48, 34, 33, 57, 555,307 /* 220 */ 42, 60, 29, 29, 130, 544, 494, 22, 494, 146,308 /* 230 */ 526, 467, 657, 369, 148, 569, 382, 383, 384, 139,309 /* 240 */ 49, 45, 563, 656, 658, 494, 496, 106, 91, 547,310 /* 250 */ 344, 106, 22, 108, 118, 565, 564, 142, 12, 98,311 /* 260 */ 97, 98, 118, 66, 65, 391, 71, 29, 669, 570,312 /* 270 */ 494, 29, 29, 32, 32, 336, 466, 4, 522, 147,313 /* 280 */ 75, 29, 29, 382, 383, 384, 589, 29, 29, 64,314 /* 290 */ 32, 32, 496, 496, 113, 128, 565, 93, 547, 637,315 /* 300 */ 638, 128, 496, 498, 151, 63, 636, 95, 547, 382,316 /* 310 */ 383, 384, 574, 496, 548, 8, 29, 71, 32, 70,317 /* 320 */ 592, 22, 573, 99, 99, 9, 29, 71, 496, 70,318 /* 330 */ 593, 123, 29, 591, 560, 32, 10, 102, 71, 494,319 /* 340 */ 70, 640, 117, 116, 462, 565, 572, 104, 47, 565,320 /* 350 */ 85, 117, 382, 383, 384, 105, 571, 565, 4, 138,321 /* 360 */ 107, 111, 565, 565, 112, 119, 565, 565, 121, 126,322 /* 370 */ 120, 132, 134, 136, 126, 121, 143, 134, 136, 143,323 /* 380 */ 144, 132, 144, 317, 461, 150, 125, 375, 76, 392,324 /* 390 */ 373, 355, 145, 19, 13, 353, 133, 14, 15, 477,325 /* 400 */ 135, 476, 16, 510, 140, 322, 321, 320, 149, 19,326 /* 410 */ 100, 392, 392, 392, 101, 6, 7, 36, 5, 19,327 /* 420 */ 11, 1, 68, 19, 2, 3, 37, 20, 352, 43,328 /* 430 */ 69, 18, 38, 44, 109, 351, 349, 39, 114, 77,329 /* 440 */ 110, 350, 348, 40, 52, 115, 41, 374, 78, 24,330 /* 450 */ 53, 54, 372, 25, 58, 79, 26, 80, 27, 81,331 /* 460 */ 356, 28, 392, 354, 30, 31, 339, 23, 17, 578,332 /* 470 */ 577, 400, 399, 82, 83, 324, 323,333};334static const YYCODETYPEunsigned char yy_lookahead[] = {335 /* 0 */ 103, 1, 103, 1, 105, 103, 104, 103, 104, 103,336 /* 10 */ 104, 103, 104, 103, 104, 103, 104, 65, 2, 69,337 /* 20 */ 123, 69, 125, 21, 24, 25, 26, 27, 28, 29,338 /* 30 */ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,339 /* 40 */ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,340 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,341 /* 60 */ 60, 61, 62, 1, 114, 69, 70, 69, 70, 7,342 /* 70 */ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,343 /* 80 */ 18, 84, 85, 111, 112, 111, 112, 25, 1, 1,344 /* 90 */ 93, 94, 30, 95, 96, 7, 8, 9, 10, 11,345 /* 100 */ 12, 13, 14, 15, 16, 17, 18, 25, 111, 112,346 /* 110 */ 114, 63, 114, 25, 63, 1, 68, 69, 30, 68,347 /* 120 */ 69, 7, 8, 9, 10, 11, 12, 13, 14, 15,348 /* 130 */ 16, 17, 18, 65, 1, 64, 65, 69, 56, 25,349 /* 140 */ 69, 8, 9, 10, 30, 81, 82, 103, 15, 31,350 /* 150 */ 103, 103, 88, 82, 103, 91, 1, 86, 25, 88,351 /* 160 */ 69, 113, 103, 30, 113, 101, 4, 5, 97, 125,352 /* 170 */ 99, 100, 101, 109, 110, 111, 112, 1, 60, 61,353 /* 180 */ 62, 26, 111, 112, 60, 61, 62, 3, 117, 118,354 /* 190 */ 6, 7, 1, 31, 103, 1, 64, 65, 14, 63,355 /* 200 */ 16, 69, 18, 19, 1, 29, 15, 31, 7, 25,356 /* 210 */ 7, 8, 9, 10, 69, 21, 40, 41, 15, 87,357 /* 220 */ 64, 65, 69, 70, 79, 69, 25, 7, 25, 63,358 /* 230 */ 103, 30, 100, 30, 68, 69, 60, 61, 62, 103,359 /* 240 */ 20, 21, 86, 111, 112, 25, 1, 69, 95, 96,360 /* 250 */ 30, 73, 7, 67, 69, 69, 100, 69, 13, 123,361 /* 260 */ 124, 125, 77, 40, 41, 31, 26, 114, 112, 103,362 /* 270 */ 25, 69, 70, 69, 70, 30, 25, 80, 90, 113,363 /* 280 */ 29, 69, 70, 60, 61, 62, 69, 69, 70, 40,364 /* 290 */ 69, 70, 1, 1, 67, 69, 69, 95, 96, 111,365 /* 300 */ 112, 75, 1, 106, 107, 108, 118, 95, 96, 60,366 /* 310 */ 61, 62, 69, 1, 96, 24, 114, 26, 114, 28,367 /* 320 */ 103, 7, 69, 119, 120, 24, 114, 26, 1, 28,368 /* 330 */ 113, 66, 114, 116, 69, 114, 24, 63, 26, 25,369 /* 340 */ 28, 120, 69, 67, 30, 69, 103, 67, 21, 69,370 /* 350 */ 63, 78, 60, 61, 62, 67, 103, 69, 80, 63,371 /* 360 */ 67, 67, 69, 69, 67, 67, 69, 69, 69, 69,372 /* 370 */ 33, 69, 69, 69, 74, 76, 69, 74, 74, 72,373 /* 380 */ 69, 79, 71, 25, 25, 107, 33, 25, 29, 31,374 /* 390 */ 25, 25, 69, 56, 32, 25, 33, 32, 32, 25,375 /* 400 */ 33, 25, 32, 114, 33, 25, 25, 25, 69, 56,376 /* 410 */ 63, 31, 31, 31, 63, 102, 92, 122, 98, 56,377 /* 420 */ 89, 83, 24, 56, 83, 83, 121, 56, 27, 56,378 /* 430 */ 56, 115, 56, 26, 22, 27, 27, 26, 22, 29,379 /* 440 */ 27, 27, 27, 26, 59, 27, 26, 25, 29, 24,380 /* 450 */ 56, 58, 25, 24, 15, 29, 24, 29, 24, 29,381 /* 460 */ 25, 24, 31, 25, 24, 23, 25, 24, 32, 0,382 /* 470 */ 0, 25, 25, 29, 29, 27, 25, 126, 126, 126,383 /* 480 */ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,384 /* 490 */ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,385 /* 500 */ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,386 /* 510 */ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,387 /* 520 */ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,388 /* 530 */ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,389};390#define YY_SHIFT_COUNT(151) (151)391#define YY_SHIFT_MIN(0) (0)392#define YY_SHIFT_MAX(470) (470)393static const unsigned short int yy_shift_ofst[] = {394 /* 0 */ 16, 62, 88, 114, 184, 203, 133, 220, 176, 176,395 /* 10 */ 176, 245, 118, 155, 155, 155, 155, 155, 0, 155,396 /* 20 */ 155, 124, 155, 223, 249, 249, 249, 249, 249, 291,397 /* 30 */ 249, 292, 301, 292, 292, 312, 201, 314, 124, 2,398 /* 40 */ 194, 327, 191, 87, 87, 87, 87, 87, 87, 87,399 /* 50 */ 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,400 /* 60 */ 87, 87, 87, 477, 124, 124, 124, 162, 234, 234,401 /* 70 */ 240, 87, 87, 234, 234, 477, 477, 477, 477, 477,402 /* 80 */ 477, 477, 477, 477, 477, 358, 251, 359, 82, 337,403 /* 90 */ 362, 353, 365, 363, 366, 367, 370, 374, 376, 371,404 /* 100 */ 380, 381, 382, 398, 401, 373, 407, 408, 409, 411,405 /* 110 */ 412, 413, 414, 415, 417, 416, 418, 420, 410, 419,406 /* 120 */ 422, 425, 385, 394, 393, 427, 429, 439, 426, 428,407 /* 130 */ 432, 430, 434, 435, 437, 438, 440, 431, 431, 442,408 /* 140 */ 441, 436, 443, 444, 445, 448, 431, 446, 447, 451,409 /* 150 */ 469, 470,410};411#define YY_REDUCE_COUNT(84) (84)412#define YY_REDUCE_MIN(-103) (-103)413#define YY_REDUCE_MAX(351) (351)414static const short yy_reduce_ofst[] = {415 /* 0 */ 197, 71, 71, 71, 64, 132, 156, -3, 48, 51,416 /* 10 */ 166, 188, 136, -2, 153, 202, 212, 204, 217, 218,417 /* 20 */ 221, -103, -4, -101, -98, -96, -94, -92, -90, -50,418 /* 30 */ -88, 91, -50, 243, 253, -50, -28, -26, 44, 186,419 /* 40 */ 227, 276, -48, 280, 288, 178, 293, 294, 297, 273,420 /* 50 */ 185, 298, 299, 68, 265, 300, 226, 145, 302, 303,421 /* 60 */ 304, 307, 311, 278, 47, 59, 127, 274, 287, 296,422 /* 70 */ 289, 323, 339, 347, 351, 295, 305, 324, 313, 320,423 /* 80 */ 338, 341, 331, 342, 316,424};425static const YYACTIONTYPEunsigned short int yy_default[] = {426 /* 0 */ 502, 497, 497, 497, 500, 497, 497, 497, 497, 497,427 /* 10 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,428 /* 20 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,429 /* 30 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,430 /* 40 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,431 /* 50 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,432 /* 60 */ 497, 497, 497, 502, 497, 497, 497, 497, 497, 497,433 /* 70 */ 497, 497, 497, 497, 497, 652, 647, 529, 562, 554,434 /* 80 */ 513, 513, 521, 513, 588, 497, 497, 497, 497, 497,435 /* 90 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,436 /* 100 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,437 /* 110 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,438 /* 120 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,439 /* 130 */ 497, 497, 497, 497, 497, 497, 497, 667, 668, 664,440 /* 140 */ 497, 524, 497, 497, 497, 497, 679, 497, 497, 497,441 /* 150 */ 497, 497,442};443/********** End of lemon-generated parsing tables *****************************/444 445/* The next table maps tokens (terminal symbols) into fallback tokens.446** If a construct like the following:447**448** %fallback ID X Y Z.449**450** appears in the grammar, then ID becomes a fallback token for X, Y,451** and Z. Whenever one of the tokens X, Y, or Z is input to the parser452** but it does not parse, the type of the token is changed to ID and453** the parse is retried before an error is thrown.454**455** This feature can be used, for example, to cause some keywords in a language456** to revert to identifiers if they keyword does not apply in the context where457** it appears.458*/459#ifdef YYFALLBACK1460static const YYCODETYPEunsigned char yyFallback[] = {461 0, /* $ => nothing */462 0, /* PT_IDENT => nothing */463 1, /* PT_SYNTAX => PT_IDENT */464 1, /* PT_IMPORT => PT_IDENT */465 1, /* PT_WEAK => PT_IDENT */466 1, /* PT_PUBLIC => PT_IDENT */467 1, /* PT_PACKAGE => PT_IDENT */468 1, /* PT_OPTION => PT_IDENT */469 1, /* PT_REQUIRED => PT_IDENT */470 1, /* PT_OPTIONAL => PT_IDENT */471 1, /* PT_REPEATED => PT_IDENT */472 1, /* PT_ONEOF => PT_IDENT */473 1, /* PT_MAP => PT_IDENT */474 1, /* PT_RESERVED => PT_IDENT */475 1, /* PT_ENUM => PT_IDENT */476 1, /* PT_GROUP => PT_IDENT */477 1, /* PT_EXTEND => PT_IDENT */478 1, /* PT_EXTENSIONS => PT_IDENT */479 1, /* PT_MESSAGE => PT_IDENT */480 1, /* PT_SERVICE => PT_IDENT */481 1, /* PT_RPC => PT_IDENT */482 1, /* PT_STREAM => PT_IDENT */483 1, /* PT_RETURNS => PT_IDENT */484 1, /* PT_TO => PT_IDENT */485 0, /* PT_ASSIGN => nothing */486 0, /* PT_SEMICOLON => nothing */487 0, /* PT_LPAREN => nothing */488 0, /* PT_RPAREN => nothing */489 0, /* PT_DOT => nothing */490 0, /* PT_LCURLY => nothing */491 0, /* PT_RCURLY => nothing */492 0, /* PT_STRLIT => nothing */493 0, /* PT_LBRACKET => nothing */494 0, /* PT_RBRACKET => nothing */495 0, /* PT_EQUAL => nothing */496 0, /* PT_NOTEQUAL => nothing */497 0, /* PT_NOTEQUAL2 => nothing */498 0, /* PT_GEQUAL => nothing */499 0, /* PT_LEQUAL => nothing */500 0, /* PT_ASSIGN_PLUS => nothing */501 0, /* PT_PLUS => nothing */502 0, /* PT_MINUS => nothing */503 0, /* PT_MULTIPLY => nothing */504 0, /* PT_DIV => nothing */505 0, /* PT_LOGIC_OR => nothing */506 0, /* PT_OR => nothing */507 0, /* PT_LOGIC_AND => nothing */508 0, /* PT_AND => nothing */509 0, /* PT_NOT => nothing */510 0, /* PT_NEG => nothing */511 0, /* PT_XOR => nothing */512 0, /* PT_SHL => nothing */513 0, /* PT_SHR => nothing */514 0, /* PT_PERCENT => nothing */515 0, /* PT_DOLLAR => nothing */516 0, /* PT_COND => nothing */517 0, /* PT_COMMA => nothing */518 0, /* PT_COLON => nothing */519 0, /* PT_LESS => nothing */520 0, /* PT_GREATER => nothing */521 0, /* PT_DECIMALLIT => nothing */522 0, /* PT_OCTALLIT => nothing */523 0, /* PT_HEXLIT => nothing */524};525#endif /* YYFALLBACK */526 527/* The following structure represents a single element of the528** parser's stack. Information stored includes:529**530** + The state number for the parser at this level of the stack.531**532** + The value of the token stored at this level of the stack.533** (In other words, the "major" token.)534**535** + The semantic value stored at this level of the stack. This is536** the information used by the action routines in the grammar.537** It is sometimes called the "minor" token.538**539** After the "shift" half of a SHIFTREDUCE action, the stateno field540** actually contains the reduce action for the second half of the541** SHIFTREDUCE.542*/543struct yyStackEntry {544 YYACTIONTYPEunsigned short int stateno; /* The state-number, or reduce action in SHIFTREDUCE */545 YYCODETYPEunsigned char major; /* The major token value. This is the code546 ** number for the token at this stack level */547 YYMINORTYPE minor; /* The user-supplied minor token value. This548 ** is the value of the token */549};550typedef struct yyStackEntry yyStackEntry;551 552/* The state of the parser is completely contained in an instance of553** the following structure */554struct yyParser {555 yyStackEntry *yytos; /* Pointer to top element of the stack */556#ifdef YYTRACKMAXSTACKDEPTH557 int yyhwm; /* High-water mark of the stack */558#endif559#ifndef YYNOERRORRECOVERY560 int yyerrcnt; /* Shifts left before out of the error */561#endif562 ProtobufLangParserARG_SDECLprotobuf_lang_state_t *state ; /* A place to hold %extra_argument */563 ProtobufLangParserCTX_SDECL /* A place to hold %extra_context */564#if YYSTACKDEPTH100<=0565 int yystksz; /* Current side of the stack */566 yyStackEntry *yystack; /* The parser's stack */567 yyStackEntry yystk0; /* First stack entry */568#else569 yyStackEntry yystack[YYSTACKDEPTH100]; /* The parser's stack */570 yyStackEntry *yystackEnd; /* Last entry in the stack */571#endif572};573typedef struct yyParser yyParser;574 575#include <assert.h>576#ifndef NDEBUG577#include <stdio.h>578static FILE *yyTraceFILE = 0;579static char *yyTracePrompt = 0;580#endif /* NDEBUG */581 582#ifndef NDEBUG583/*584** Turn parser tracing on by giving a stream to which to write the trace585** and a prompt to preface each trace message. Tracing is turned off586** by making either argument NULL587**588** Inputs:589** <ul>590** <li> A FILE* to which trace output should be written.591** If NULL, then tracing is turned off.592** <li> A prefix string written at the beginning of every593** line of trace output. If NULL, then tracing is594** turned off.595** </ul>596**597** Outputs:598** None.599*/600void ProtobufLangParserTrace(FILE *TraceFILE, char *zTracePrompt){601 yyTraceFILE = TraceFILE;602 yyTracePrompt = zTracePrompt;603 if( yyTraceFILE==0 ) yyTracePrompt = 0;604 else if( yyTracePrompt==0 ) yyTraceFILE = 0;605}606#endif /* NDEBUG */607 608#if defined(YYCOVERAGE) || !defined(NDEBUG)609/* For tracing shifts, the names of all terminals and nonterminals610** are required. The following table supplies these names */611static const char *const yyTokenName[] = {612 /* 0 */ "$",613 /* 1 */ "PT_IDENT",614 /* 2 */ "PT_SYNTAX",615 /* 3 */ "PT_IMPORT",616 /* 4 */ "PT_WEAK",617 /* 5 */ "PT_PUBLIC",618 /* 6 */ "PT_PACKAGE",619 /* 7 */ "PT_OPTION",620 /* 8 */ "PT_REQUIRED",621 /* 9 */ "PT_OPTIONAL",622 /* 10 */ "PT_REPEATED",623 /* 11 */ "PT_ONEOF",624 /* 12 */ "PT_MAP",625 /* 13 */ "PT_RESERVED",626 /* 14 */ "PT_ENUM",627 /* 15 */ "PT_GROUP",628 /* 16 */ "PT_EXTEND",629 /* 17 */ "PT_EXTENSIONS",630 /* 18 */ "PT_MESSAGE",631 /* 19 */ "PT_SERVICE",632 /* 20 */ "PT_RPC",633 /* 21 */ "PT_STREAM",634 /* 22 */ "PT_RETURNS",635 /* 23 */ "PT_TO",636 /* 24 */ "PT_ASSIGN",637 /* 25 */ "PT_SEMICOLON",638 /* 26 */ "PT_LPAREN",639 /* 27 */ "PT_RPAREN",640 /* 28 */ "PT_DOT",641 /* 29 */ "PT_LCURLY",642 /* 30 */ "PT_RCURLY",643 /* 31 */ "PT_STRLIT",644 /* 32 */ "PT_LBRACKET",645 /* 33 */ "PT_RBRACKET",646 /* 34 */ "PT_EQUAL",647 /* 35 */ "PT_NOTEQUAL",648 /* 36 */ "PT_NOTEQUAL2",649 /* 37 */ "PT_GEQUAL",650 /* 38 */ "PT_LEQUAL",651 /* 39 */ "PT_ASSIGN_PLUS",652 /* 40 */ "PT_PLUS",653 /* 41 */ "PT_MINUS",654 /* 42 */ "PT_MULTIPLY",655 /* 43 */ "PT_DIV",656 /* 44 */ "PT_LOGIC_OR",657 /* 45 */ "PT_OR",658 /* 46 */ "PT_LOGIC_AND",659 /* 47 */ "PT_AND",660 /* 48 */ "PT_NOT",661 /* 49 */ "PT_NEG",662 /* 50 */ "PT_XOR",663 /* 51 */ "PT_SHL",664 /* 52 */ "PT_SHR",665 /* 53 */ "PT_PERCENT",666 /* 54 */ "PT_DOLLAR",667 /* 55 */ "PT_COND",668 /* 56 */ "PT_COMMA",669 /* 57 */ "PT_COLON",670 /* 58 */ "PT_LESS",671 /* 59 */ "PT_GREATER",672 /* 60 */ "PT_DECIMALLIT",673 /* 61 */ "PT_OCTALLIT",674 /* 62 */ "PT_HEXLIT",675 /* 63 */ "strLit",676 /* 64 */ "label",677 /* 65 */ "type",678 /* 66 */ "keyType",679 /* 67 */ "messageType",680 /* 68 */ "constant",681 /* 69 */ "exIdent",682 /* 70 */ "optionName",683 /* 71 */ "messageName",684 /* 72 */ "enumName",685 /* 73 */ "streamName",686 /* 74 */ "fieldName",687 /* 75 */ "oneofName",688 /* 76 */ "mapName",689 /* 77 */ "serviceName",690 /* 78 */ "rpcName",691 /* 79 */ "groupName",692 /* 80 */ "protoBody",693 /* 81 */ "topLevelDef",694 /* 82 */ "message",695 /* 83 */ "messageBody",696 /* 84 */ "rpc",697 /* 85 */ "rpcDecl",698 /* 86 */ "field",699 /* 87 */ "oneofField",700 /* 88 */ "enum",701 /* 89 */ "enumBody",702 /* 90 */ "enumField",703 /* 91 */ "service",704 /* 92 */ "serviceBody",705 /* 93 */ "stream",706 /* 94 */ "streamDecl",707 /* 95 */ "fieldOptions",708 /* 96 */ "fieldOption",709 /* 97 */ "oneof",710 /* 98 */ "oneofBody",711 /* 99 */ "mapField",712 /* 100 */ "group",713 /* 101 */ "extend",714 /* 102 */ "extendBody",715 /* 103 */ "intLit",716 /* 104 */ "fieldNumber",717 /* 105 */ "enumNumber",718 /* 106 */ "proto",719 /* 107 */ "wholeProtoBody",720 /* 108 */ "syntax",721 /* 109 */ "import",722 /* 110 */ "package",723 /* 111 */ "option",724 /* 112 */ "emptyStatement",725 /* 113 */ "customOptionValue",726 /* 114 */ "extIdentInParentheses",727 /* 115 */ "customOptionBody",728 /* 116 */ "symbolsWithoutCurly",729 /* 117 */ "extensions",730 /* 118 */ "reserved",731 /* 119 */ "enumValueOptions",732 /* 120 */ "enumValueOption",733 /* 121 */ "rpcBody",734 /* 122 */ "streamBody",735 /* 123 */ "ranges",736 /* 124 */ "quoteFieldNames",737 /* 125 */ "range",738};739#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */740 741#ifndef NDEBUG742/* For tracing reduce actions, the names of all rules are required.743*/744static const char *const yyRuleName[] = {745 /* 0 */ "wholeProtoBody ::= protoBody",746 /* 1 */ "syntax ::= PT_SYNTAX PT_ASSIGN strLit PT_SEMICOLON",747 /* 2 */ "protoBody ::=",748 /* 3 */ "protoBody ::= protoBody topLevelDef",749 /* 4 */ "import ::= PT_IMPORT strLit PT_SEMICOLON",750 /* 5 */ "import ::= PT_IMPORT PT_PUBLIC strLit PT_SEMICOLON",751 /* 6 */ "import ::= PT_IMPORT PT_WEAK strLit PT_SEMICOLON",752 /* 7 */ "package ::= PT_PACKAGE exIdent PT_SEMICOLON",753 /* 8 */ "extIdentInParentheses ::= PT_LPAREN exIdent PT_RPAREN",754 /* 9 */ "optionName ::= optionName exIdent",755 /* 10 */ "optionName ::= optionName PT_DOT extIdentInParentheses",756 /* 11 */ "optionName ::= optionName extIdentInParentheses",757 /* 12 */ "message ::= PT_MESSAGE messageName PT_LCURLY messageBody PT_RCURLY",758 /* 13 */ "messageBody ::=",759 /* 14 */ "messageBody ::= messageBody field",760 /* 15 */ "messageBody ::= messageBody enum",761 /* 16 */ "messageBody ::= messageBody message",762 /* 17 */ "messageBody ::= messageBody group",763 /* 18 */ "messageBody ::= messageBody oneof",764 /* 19 */ "messageBody ::= messageBody mapField",765 /* 20 */ "enum ::= PT_ENUM enumName PT_LCURLY enumBody PT_RCURLY",766 /* 21 */ "enumBody ::=",767 /* 22 */ "enumBody ::= enumBody enumField",768 /* 23 */ "enumField ::= exIdent PT_ASSIGN enumNumber PT_LBRACKET enumValueOptions PT_RBRACKET PT_SEMICOLON",769 /* 24 */ "enumField ::= exIdent PT_ASSIGN enumNumber",770 /* 25 */ "enumNumber ::= intLit",771 /* 26 */ "enumNumber ::= PT_PLUS intLit",772 /* 27 */ "enumNumber ::= PT_MINUS intLit",773 /* 28 */ "service ::= PT_SERVICE serviceName PT_LCURLY serviceBody PT_RCURLY",774 /* 29 */ "serviceBody ::=",775 /* 30 */ "serviceBody ::= serviceBody rpc",776 /* 31 */ "serviceBody ::= serviceBody stream",777 /* 32 */ "rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN",778 /* 33 */ "rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN",779 /* 34 */ "rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN",780 /* 35 */ "rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN",781 /* 36 */ "streamDecl ::= PT_STREAM streamName PT_LPAREN messageType PT_COMMA messageType PT_RPAREN",782 /* 37 */ "field ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON",783 /* 38 */ "field ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON",784 /* 39 */ "field ::= label type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON",785 /* 40 */ "field ::= label type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON",786 /* 41 */ "label ::= PT_REQUIRED",787 /* 42 */ "label ::= PT_OPTIONAL",788 /* 43 */ "label ::= PT_REPEATED",789 /* 44 */ "type ::= exIdent",790 /* 45 */ "fieldNumber ::= intLit",791 /* 46 */ "fieldNumber ::= PT_PLUS intLit",792 /* 47 */ "fieldOptions ::= fieldOption",793 /* 48 */ "fieldOptions ::= fieldOptions PT_COMMA fieldOption",794 /* 49 */ "fieldOption ::= optionName PT_ASSIGN constant",795 /* 50 */ "fieldOption ::= optionName PT_ASSIGN customOptionValue",796 /* 51 */ "group ::= PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY",797 /* 52 */ "group ::= label PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY",798 /* 53 */ "oneof ::= PT_ONEOF oneofName PT_LCURLY oneofBody PT_RCURLY",799 /* 54 */ "oneofBody ::=",800 /* 55 */ "oneofBody ::= oneofBody oneofField",801 /* 56 */ "oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON",802 /* 57 */ "oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON",803 /* 58 */ "mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON",804 /* 59 */ "mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_SEMICOLON",805 /* 60 */ "keyType ::= exIdent",806 /* 61 */ "extend ::= PT_EXTEND messageType PT_LCURLY extendBody PT_RCURLY",807 /* 62 */ "extendBody ::=",808 /* 63 */ "extendBody ::= extendBody field",809 /* 64 */ "extendBody ::= extendBody group",810 /* 65 */ "messageType ::= exIdent",811 /* 66 */ "intLit ::= PT_DECIMALLIT",812 /* 67 */ "intLit ::= PT_OCTALLIT",813 /* 68 */ "intLit ::= PT_HEXLIT",814 /* 69 */ "constant ::= exIdent",815 /* 70 */ "constant ::= intLit",816 /* 71 */ "constant ::= PT_PLUS intLit",817 /* 72 */ "constant ::= PT_MINUS intLit",818 /* 73 */ "constant ::= PT_PLUS exIdent",819 /* 74 */ "constant ::= PT_MINUS exIdent",820 /* 75 */ "strLit ::= PT_STRLIT",821 /* 76 */ "strLit ::= strLit PT_STRLIT",822 /* 77 */ "proto ::= wholeProtoBody",823 /* 78 */ "proto ::= syntax wholeProtoBody",824 /* 79 */ "protoBody ::= protoBody import",825 /* 80 */ "protoBody ::= protoBody package",826 /* 81 */ "protoBody ::= protoBody option",827 /* 82 */ "protoBody ::= protoBody emptyStatement",828 /* 83 */ "option ::= PT_OPTION optionName PT_ASSIGN constant PT_SEMICOLON",829 /* 84 */ "option ::= PT_OPTION optionName PT_ASSIGN customOptionValue PT_SEMICOLON",830 /* 85 */ "optionName ::= exIdent",831 /* 86 */ "optionName ::= extIdentInParentheses",832 /* 87 */ "customOptionValue ::= PT_LCURLY customOptionBody PT_RCURLY",833 /* 88 */ "customOptionBody ::=",834 /* 89 */ "customOptionBody ::= customOptionBody exIdent",835 /* 90 */ "customOptionBody ::= customOptionBody PT_STRLIT",836 /* 91 */ "customOptionBody ::= customOptionBody symbolsWithoutCurly",837 /* 92 */ "customOptionBody ::= customOptionBody intLit",838 /* 93 */ "customOptionBody ::= customOptionBody customOptionValue",839 /* 94 */ "symbolsWithoutCurly ::= PT_LPAREN",840 /* 95 */ "symbolsWithoutCurly ::= PT_RPAREN",841 /* 96 */ "symbolsWithoutCurly ::= PT_LBRACKET",842 /* 97 */ "symbolsWithoutCurly ::= PT_RBRACKET",843 /* 98 */ "symbolsWithoutCurly ::= PT_EQUAL",844 /* 99 */ "symbolsWithoutCurly ::= PT_NOTEQUAL",845 /* 100 */ "symbolsWithoutCurly ::= PT_NOTEQUAL2",846 /* 101 */ "symbolsWithoutCurly ::= PT_GEQUAL",847 /* 102 */ "symbolsWithoutCurly ::= PT_LEQUAL",848 /* 103 */ "symbolsWithoutCurly ::= PT_ASSIGN_PLUS",849 /* 104 */ "symbolsWithoutCurly ::= PT_ASSIGN",850 /* 105 */ "symbolsWithoutCurly ::= PT_PLUS",851 /* 106 */ "symbolsWithoutCurly ::= PT_MINUS",852 /* 107 */ "symbolsWithoutCurly ::= PT_MULTIPLY",853 /* 108 */ "symbolsWithoutCurly ::= PT_DIV",854 /* 109 */ "symbolsWithoutCurly ::= PT_LOGIC_OR",855 /* 110 */ "symbolsWithoutCurly ::= PT_OR",856 /* 111 */ "symbolsWithoutCurly ::= PT_LOGIC_AND",857 /* 112 */ "symbolsWithoutCurly ::= PT_AND",858 /* 113 */ "symbolsWithoutCurly ::= PT_NOT",859 /* 114 */ "symbolsWithoutCurly ::= PT_NEG",860 /* 115 */ "symbolsWithoutCurly ::= PT_XOR",861 /* 116 */ "symbolsWithoutCurly ::= PT_SHL",862 /* 117 */ "symbolsWithoutCurly ::= PT_SHR",863 /* 118 */ "symbolsWithoutCurly ::= PT_PERCENT",864 /* 119 */ "symbolsWithoutCurly ::= PT_DOLLAR",865 /* 120 */ "symbolsWithoutCurly ::= PT_COND",866 /* 121 */ "symbolsWithoutCurly ::= PT_SEMICOLON",867 /* 122 */ "symbolsWithoutCurly ::= PT_DOT",868 /* 123 */ "symbolsWithoutCurly ::= PT_COMMA",869 /* 124 */ "symbolsWithoutCurly ::= PT_COLON",870 /* 125 */ "symbolsWithoutCurly ::= PT_LESS",871 /* 126 */ "symbolsWithoutCurly ::= PT_GREATER",872 /* 127 */ "topLevelDef ::= message",873 /* 128 */ "topLevelDef ::= enum",874 /* 129 */ "topLevelDef ::= extend",875 /* 130 */ "topLevelDef ::= service",876 /* 131 */ "messageBody ::= messageBody extend",877 /* 132 */ "messageBody ::= messageBody extensions",878 /* 133 */ "messageBody ::= messageBody option",879 /* 134 */ "messageBody ::= messageBody reserved",880 /* 135 */ "messageBody ::= messageBody emptyStatement",881 /* 136 */ "enumBody ::= enumBody reserved",882 /* 137 */ "enumBody ::= enumBody option",883 /* 138 */ "enumBody ::= enumBody emptyStatement",884 /* 139 */ "enumValueOptions ::= enumValueOption",885 /* 140 */ "enumValueOptions ::= enumValueOptions PT_COMMA enumValueOption",886 /* 141 */ "enumValueOption ::= optionName PT_ASSIGN constant",887 /* 142 */ "enumValueOption ::= optionName PT_ASSIGN customOptionValue",888 /* 143 */ "serviceBody ::= serviceBody option",889 /* 144 */ "serviceBody ::= serviceBody emptyStatement",890 /* 145 */ "rpc ::= rpcDecl PT_SEMICOLON",891 /* 146 */ "rpc ::= rpcDecl PT_LCURLY rpcBody PT_RCURLY",892 /* 147 */ "rpcBody ::=",893 /* 148 */ "rpcBody ::= rpcBody option",894 /* 149 */ "rpcBody ::= rpcBody emptyStatement",895 /* 150 */ "stream ::= streamDecl PT_SEMICOLON",896 /* 151 */ "stream ::= streamDecl PT_LCURLY streamBody PT_RCURLY",897 /* 152 */ "streamBody ::=",898 /* 153 */ "streamBody ::= streamBody option",899 /* 154 */ "streamBody ::= streamBody emptyStatement",900 /* 155 */ "groupName ::= exIdent",901 /* 156 */ "oneofBody ::= oneofBody option",902 /* 157 */ "oneofBody ::= oneofBody group",903 /* 158 */ "oneofBody ::= oneofBody emptyStatement",904 /* 159 */ "extensions ::= PT_EXTENSIONS ranges PT_SEMICOLON",905 /* 160 */ "reserved ::= PT_RESERVED ranges PT_SEMICOLON",906 /* 161 */ "reserved ::= PT_RESERVED quoteFieldNames PT_SEMICOLON",907 /* 162 */ "ranges ::= range",908 /* 163 */ "ranges ::= ranges PT_COMMA range",909 /* 164 */ "range ::= intLit",910 /* 165 */ "range ::= intLit PT_TO intLit",911 /* 166 */ "range ::= intLit PT_TO exIdent",912 /* 167 */ "quoteFieldNames ::= strLit",913 /* 168 */ "quoteFieldNames ::= quoteFieldNames PT_COMMA strLit",914 /* 169 */ "extendBody ::= extendBody emptyStatement",915 /* 170 */ "messageName ::= exIdent",916 /* 171 */ "enumName ::= exIdent",917 /* 172 */ "streamName ::= exIdent",918 /* 173 */ "fieldName ::= exIdent",919 /* 174 */ "oneofName ::= exIdent",920 /* 175 */ "mapName ::= exIdent",921 /* 176 */ "serviceName ::= exIdent",922 /* 177 */ "rpcName ::= exIdent",923 /* 178 */ "emptyStatement ::= PT_SEMICOLON",924 /* 179 */ "constant ::= strLit",925 /* 180 */ "exIdent ::= PT_IDENT",926};927#endif /* NDEBUG */928 929 930#if YYSTACKDEPTH100<=0931/*932** Try to increase the size of the parser stack. Return the number933** of errors. Return 0 on success.934*/935static int yyGrowStack(yyParser *p){936 int newSize;937 int idx;938 yyStackEntry *pNew;939 940 newSize = p->yystksz*2 + 100;941 idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;942 if( p->yystack==&p->yystk0 ){943 pNew = malloc(newSize*sizeof(pNew[0]));944 if( pNew ) pNew[0] = p->yystk0;945 }else{946 pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));947 }948 if( pNew ){949 p->yystack = pNew;950 p->yytos = &p->yystack[idx];951#ifndef NDEBUG952 if( yyTraceFILE ){953 fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",954 yyTracePrompt, p->yystksz, newSize);955 }956#endif957 p->yystksz = newSize;958 }959 return pNew==0;960}961#endif962 963/* Datatype of the argument to the memory allocated passed as the964** second argument to ProtobufLangParserAlloc() below. This can be changed by965** putting an appropriate #define in the %include section of the input966** grammar.967*/968#ifndef YYMALLOCARGTYPEsize_t969# define YYMALLOCARGTYPEsize_t size_t970#endif971 972/* Initialize a new parser that has already been allocated.973*/974void ProtobufLangParserInit(void *yypRawParser ProtobufLangParserCTX_PDECL){975 yyParser *yypParser = (yyParser*)yypRawParser;976 ProtobufLangParserCTX_STORE977#ifdef YYTRACKMAXSTACKDEPTH978 yypParser->yyhwm = 0;979#endif980#if YYSTACKDEPTH100<=0981 yypParser->yytos = NULL((void*)0);982 yypParser->yystack = NULL((void*)0);983 yypParser->yystksz = 0;984 if( yyGrowStack(yypParser) ){985 yypParser->yystack = &yypParser->yystk0;986 yypParser->yystksz = 1;987 }988#endif989#ifndef YYNOERRORRECOVERY990 yypParser->yyerrcnt = -1;991#endif992 yypParser->yytos = yypParser->yystack;993 yypParser->yystack[0].stateno = 0;994 yypParser->yystack[0].major = 0;995#if YYSTACKDEPTH100>0996 yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH100-1];997#endif998}999 1000#ifndef ProtobufLangParser_ENGINEALWAYSONSTACK1001/*1002** This function allocates a new parser.1003** The only argument is a pointer to a function which works like1004** malloc.1005**1006** Inputs:1007** A pointer to the function used to allocate memory.1008**1009** Outputs:1010** A pointer to a parser. This pointer is used in subsequent calls1011** to ProtobufLangParser and ProtobufLangParserFree.1012*/1013void *ProtobufLangParserAlloc(void *(*mallocProc)(YYMALLOCARGTYPEsize_t) ProtobufLangParserCTX_PDECL){1014 yyParser *yypParser;1015 yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPEsize_t)sizeof(yyParser) );1016 if( yypParser ){1017 ProtobufLangParserCTX_STORE1018 ProtobufLangParserInit(yypParser ProtobufLangParserCTX_PARAM);1019 }1020 return (void*)yypParser;1021}1022#endif /* ProtobufLangParser_ENGINEALWAYSONSTACK */1023 1024 1025/* The following function deletes the "minor type" or semantic value1026** associated with a symbol. The symbol can be either a terminal1027** or nonterminal. "yymajor" is the symbol code, and "yypminor" is1028** a pointer to the value to be deleted. The code used to do the1029** deletions is derived from the %destructor and/or %token_destructor1030** directives of the input grammar.1031*/1032static void yy_destructor(1033 yyParser *yypParser, /* The parser */1034 YYCODETYPEunsigned char yymajor, /* Type code for object to destroy */1035 YYMINORTYPE *yypminor /* The object to be destroyed */1036){1037 ProtobufLangParserARG_FETCHprotobuf_lang_state_t *state =yypParser->state ;1038 ProtobufLangParserCTX_FETCH1039 switch( yymajor ){1040 /* Here is inserted the actions which take place when a1041 ** terminal or non-terminal is destroyed. This can happen1042 ** when the symbol is popped from the stack during a1043 ** reduce or during error processing or when a parser is1044 ** being destroyed before it is finished parsing.1045 **1046 ** Note: during a reduce, the only symbols destroyed are those1047 ** which appear on the RHS of the rule, but which are *not* used1048 ** inside the C code.1049 */1050/********* Begin destructor definitions ***************************************/1051 /* TERMINAL Destructor */1052 case 1: /* PT_IDENT */1053 case 2: /* PT_SYNTAX */1054 case 3: /* PT_IMPORT */1055 case 4: /* PT_WEAK */1056 case 5: /* PT_PUBLIC */1057 case 6: /* PT_PACKAGE */1058 case 7: /* PT_OPTION */1059 case 8: /* PT_REQUIRED */1060 case 9: /* PT_OPTIONAL */1061 case 10: /* PT_REPEATED */1062 case 11: /* PT_ONEOF */1063 case 12: /* PT_MAP */1064 case 13: /* PT_RESERVED */1065 case 14: /* PT_ENUM */1066 case 15: /* PT_GROUP */1067 case 16: /* PT_EXTEND */1068 case 17: /* PT_EXTENSIONS */1069 case 18: /* PT_MESSAGE */1070 case 19: /* PT_SERVICE */1071 case 20: /* PT_RPC */1072 case 21: /* PT_STREAM */1073 case 22: /* PT_RETURNS */1074 case 23: /* PT_TO */1075 case 24: /* PT_ASSIGN */1076 case 25: /* PT_SEMICOLON */1077 case 26: /* PT_LPAREN */1078 case 27: /* PT_RPAREN */1079 case 28: /* PT_DOT */1080 case 29: /* PT_LCURLY */1081 case 30: /* PT_RCURLY */1082 case 31: /* PT_STRLIT */1083 case 32: /* PT_LBRACKET */1084 case 33: /* PT_RBRACKET */1085 case 34: /* PT_EQUAL */1086 case 35: /* PT_NOTEQUAL */1087 case 36: /* PT_NOTEQUAL2 */1088 case 37: /* PT_GEQUAL */1089 case 38: /* PT_LEQUAL */1090 case 39: /* PT_ASSIGN_PLUS */1091 case 40: /* PT_PLUS */1092 case 41: /* PT_MINUS */1093 case 42: /* PT_MULTIPLY */1094 case 43: /* PT_DIV */1095 case 44: /* PT_LOGIC_OR */1096 case 45: /* PT_OR */1097 case 46: /* PT_LOGIC_AND */1098 case 47: /* PT_AND */1099 case 48: /* PT_NOT */1100 case 49: /* PT_NEG */1101 case 50: /* PT_XOR */1102 case 51: /* PT_SHL */1103 case 52: /* PT_SHR */1104 case 53: /* PT_PERCENT */1105 case 54: /* PT_DOLLAR */1106 case 55: /* PT_COND */1107 case 56: /* PT_COMMA */1108 case 57: /* PT_COLON */1109 case 58: /* PT_LESS */1110 case 59: /* PT_GREATER */1111 case 60: /* PT_DECIMALLIT */1112 case 61: /* PT_OCTALLIT */1113 case 62: /* PT_HEXLIT */1114{1115#line 64 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1116 1117 /* We manage memory allocated for token values by ourself */1118 (void) state; /* Mark unused, similar to Q_UNUSED */1119 (void) (yypminor->yy0); /* Mark unused, similar to Q_UNUSED */1120 1121#line 1146 "./protobuf_lang_parser.c"1122}1123 break;1124/********* End destructor definitions *****************************************/1125 default: break; /* If no destructor action specified: do nothing */1126 }1127}1128 1129/*1130** Pop the parser's stack once.1131**1132** If there is a destructor routine associated with the token which1133** is popped from the stack, then call it.1134*/1135static void yy_pop_parser_stack(yyParser *pParser){1136 yyStackEntry *yytos;1137 assert( pParser->yytos!=0 )((void) sizeof ((pParser->yytos!=0) ? 1 : 0), __extension__
({ if (pParser->yytos!=0) ; else __assert_fail ("pParser->yytos!=0"
, "protobuf_lang_parser.c", 1161, __extension__ __PRETTY_FUNCTION__
); }))
;1138 assert( pParser->yytos > pParser->yystack )((void) sizeof ((pParser->yytos > pParser->yystack) ?
1 : 0), __extension__ ({ if (pParser->yytos > pParser->
yystack) ; else __assert_fail ("pParser->yytos > pParser->yystack"
, "protobuf_lang_parser.c", 1162, __extension__ __PRETTY_FUNCTION__
); }))
;1139 yytos = pParser->yytos--;1140#ifndef NDEBUG1141 if( yyTraceFILE ){1142 fprintf(yyTraceFILE,"%sPopping %s\n",1143 yyTracePrompt,1144 yyTokenName[yytos->major]);1145 }1146#endif1147 yy_destructor(pParser, yytos->major, &yytos->minor);1148}1149 1150/*1151** Clear all secondary memory allocations from the parser1152*/1153void ProtobufLangParserFinalize(void *p){1154 yyParser *pParser = (yyParser*)p;1155 while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);1156#if YYSTACKDEPTH100<=01157 if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);1158#endif1159}1160 1161#ifndef ProtobufLangParser_ENGINEALWAYSONSTACK1162/*1163** Deallocate and destroy a parser. Destructors are called for1164** all stack elements before shutting the parser down.1165**1166** If the YYPARSEFREENEVERNULL macro exists (for example because it1167** is defined in a %include section of the input grammar) then it is1168** assumed that the input pointer is never NULL.1169*/1170void ProtobufLangParserFree(1171 void *p, /* The parser to be deleted */1172 void (*freeProc)(void*) /* Function used to reclaim memory */1173){1174#ifndef YYPARSEFREENEVERNULL1175 if( p==0 ) return;1176#endif1177 ProtobufLangParserFinalize(p);1178 (*freeProc)(p);1179}1180#endif /* ProtobufLangParser_ENGINEALWAYSONSTACK */1181 1182/*1183** Return the peak depth of the stack for a parser.1184*/1185#ifdef YYTRACKMAXSTACKDEPTH1186int ProtobufLangParserStackPeak(void *p){1187 yyParser *pParser = (yyParser*)p;1188 return pParser->yyhwm;1189}1190#endif1191 1192/* This array of booleans keeps track of the parser statement1193** coverage. The element yycoverage[X][Y] is set when the parser1194** is in state X and has a lookahead token Y. In a well-tested1195** systems, every element of this matrix should end up being set.1196*/1197#if defined(YYCOVERAGE)1198static unsigned char yycoverage[YYNSTATE152][YYNTOKEN63];1199#endif1200 1201/*1202** Write into out a description of every state/lookahead combination that1203**1204** (1) has not been used by the parser, and1205** (2) is not a syntax error.1206**1207** Return the number of missed state/lookahead combinations.1208*/1209#if defined(YYCOVERAGE)1210int ProtobufLangParserCoverage(FILE *out){1211 int stateno, iLookAhead, i;1212 int nMissed = 0;1213 for(stateno=0; stateno<YYNSTATE152; stateno++){1214 i = yy_shift_ofst[stateno];1215 for(iLookAhead=0; iLookAhead<YYNTOKEN63; iLookAhead++){1216 if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;1217 if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;1218 if( out ){1219 fprintf(out,"State %d lookahead %s %s\n", stateno,1220 yyTokenName[iLookAhead],1221 yycoverage[stateno][iLookAhead] ? "ok" : "missed");1222 }1223 }1224 }1225 return nMissed;1226}1227#endif1228 1229/*1230** Find the appropriate action for a parser given the terminal1231** look-ahead token iLookAhead.1232*/1233static YYACTIONTYPEunsigned short int yy_find_shift_action(1234 YYCODETYPEunsigned char iLookAhead, /* The look-ahead token */1235 YYACTIONTYPEunsigned short int stateno /* Current state number */1236){1237 int i;1238 1239 if( stateno>YY_MAX_SHIFT151 ) return stateno;1240 assert( stateno <= YY_SHIFT_COUNT )((void) sizeof ((stateno <= (151)) ? 1 : 0), __extension__
({ if (stateno <= (151)) ; else __assert_fail ("stateno <= YY_SHIFT_COUNT"
, "protobuf_lang_parser.c", 1264, __extension__ __PRETTY_FUNCTION__
); }))
;1241#if defined(YYCOVERAGE)1242 yycoverage[stateno][iLookAhead] = 1;1243#endif1244 do{1245 i = yy_shift_ofst[stateno];1246 assert( i>=0 )((void) sizeof ((i>=0) ? 1 : 0), __extension__ ({ if (i>=
0) ; else __assert_fail ("i>=0", "protobuf_lang_parser.c",
1270, __extension__ __PRETTY_FUNCTION__); }))
;1247 assert( i<=YY_ACTTAB_COUNT )((void) sizeof ((i<=(477)) ? 1 : 0), __extension__ ({ if (
i<=(477)) ; else __assert_fail ("i<=YY_ACTTAB_COUNT", "protobuf_lang_parser.c"
, 1271, __extension__ __PRETTY_FUNCTION__); }))
;1248 assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD )((void) sizeof ((i+63<=(int)((int)(sizeof(yy_lookahead)/sizeof
(yy_lookahead[0])))) ? 1 : 0), __extension__ ({ if (i+63<=
(int)((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))) ;
else __assert_fail ("i+YYNTOKEN<=(int)YY_NLOOKAHEAD", "protobuf_lang_parser.c"
, 1272, __extension__ __PRETTY_FUNCTION__); }))
;1249 assert( iLookAhead!=YYNOCODE )((void) sizeof ((iLookAhead!=126) ? 1 : 0), __extension__ ({ if
(iLookAhead!=126) ; else __assert_fail ("iLookAhead!=YYNOCODE"
, "protobuf_lang_parser.c", 1273, __extension__ __PRETTY_FUNCTION__
); }))
;1250 assert( iLookAhead < YYNTOKEN )((void) sizeof ((iLookAhead < 63) ? 1 : 0), __extension__ (
{ if (iLookAhead < 63) ; else __assert_fail ("iLookAhead < YYNTOKEN"
, "protobuf_lang_parser.c", 1274, __extension__ __PRETTY_FUNCTION__
); }))
;1251 i += iLookAhead;1252 assert( i<(int)YY_NLOOKAHEAD )((void) sizeof ((i<(int)((int)(sizeof(yy_lookahead)/sizeof
(yy_lookahead[0])))) ? 1 : 0), __extension__ ({ if (i<(int
)((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))) ; else
__assert_fail ("i<(int)YY_NLOOKAHEAD", "protobuf_lang_parser.c"
, 1276, __extension__ __PRETTY_FUNCTION__); }))
;1253 if( yy_lookahead[i]!=iLookAhead ){1254#ifdef YYFALLBACK11255 YYCODETYPEunsigned char iFallback; /* Fallback token */1256 assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) )((void) sizeof ((iLookAhead<sizeof(yyFallback)/sizeof(yyFallback
[0])) ? 1 : 0), __extension__ ({ if (iLookAhead<sizeof(yyFallback
)/sizeof(yyFallback[0])) ; else __assert_fail ("iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])"
, "protobuf_lang_parser.c", 1280, __extension__ __PRETTY_FUNCTION__
); }))
;1257 iFallback = yyFallback[iLookAhead];1258 if( iFallback!=0 ){1259#ifndef NDEBUG1260 if( yyTraceFILE ){1261 fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",1262 yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);1263 }1264#endif1265 assert( yyFallback[iFallback]==0 )((void) sizeof ((yyFallback[iFallback]==0) ? 1 : 0), __extension__
({ if (yyFallback[iFallback]==0) ; else __assert_fail ("yyFallback[iFallback]==0"
, "protobuf_lang_parser.c", 1289, __extension__ __PRETTY_FUNCTION__
); }))
; /* Fallback loop must terminate */1266 iLookAhead = iFallback;1267 continue;1268 }1269#endif1270#ifdef YYWILDCARD1271 {1272 int j = i - iLookAhead + YYWILDCARD;1273 assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) )((void) sizeof ((j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead
[0]))) ? 1 : 0), __extension__ ({ if (j<(int)(sizeof(yy_lookahead
)/sizeof(yy_lookahead[0]))) ; else __assert_fail ("j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))"
, "protobuf_lang_parser.c", 1297, __extension__ __PRETTY_FUNCTION__
); }))
;1274 if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){1275#ifndef NDEBUG1276 if( yyTraceFILE ){1277 fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",1278 yyTracePrompt, yyTokenName[iLookAhead],1279 yyTokenName[YYWILDCARD]);1280 }1281#endif /* NDEBUG */1282 return yy_action[j];1283 }1284 }1285#endif /* YYWILDCARD */1286 return yy_default[stateno];1287 }else{1288 assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) )((void) sizeof ((i>=0 && i<(int)(sizeof(yy_action
)/sizeof(yy_action[0]))) ? 1 : 0), __extension__ ({ if (i>=
0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0]
))) ; else __assert_fail ("i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0]))"
, "protobuf_lang_parser.c", 1312, __extension__ __PRETTY_FUNCTION__
); }))
;1289 return yy_action[i];1290 }1291 }while(1);1292}1293 1294/*1295** Find the appropriate action for a parser given the non-terminal1296** look-ahead token iLookAhead.1297*/1298static YYACTIONTYPEunsigned short int yy_find_reduce_action(1299 YYACTIONTYPEunsigned short int stateno, /* Current state number */1300 YYCODETYPEunsigned char iLookAhead /* The look-ahead token */1301){1302 int i;1303#ifdef YYERRORSYMBOL1304 if( stateno>YY_REDUCE_COUNT(84) ){1305 return yy_default[stateno];1306 }1307#else1308 assert( stateno<=YY_REDUCE_COUNT )((void) sizeof ((stateno<=(84)) ? 1 : 0), __extension__ ({
if (stateno<=(84)) ; else __assert_fail ("stateno<=YY_REDUCE_COUNT"
, "protobuf_lang_parser.c", 1332, __extension__ __PRETTY_FUNCTION__
); }))
;1309#endif1310 i = yy_reduce_ofst[stateno];1311 assert( iLookAhead!=YYNOCODE )((void) sizeof ((iLookAhead!=126) ? 1 : 0), __extension__ ({ if
(iLookAhead!=126) ; else __assert_fail ("iLookAhead!=YYNOCODE"
, "protobuf_lang_parser.c", 1335, __extension__ __PRETTY_FUNCTION__
); }))
;1312 i += iLookAhead;1313#ifdef YYERRORSYMBOL1314 if( i<0 || i>=YY_ACTTAB_COUNT(477) || yy_lookahead[i]!=iLookAhead ){1315 return yy_default[stateno];1316 }1317#else1318 assert( i>=0 && i<YY_ACTTAB_COUNT )((void) sizeof ((i>=0 && i<(477)) ? 1 : 0), __extension__
({ if (i>=0 && i<(477)) ; else __assert_fail (
"i>=0 && i<YY_ACTTAB_COUNT", "protobuf_lang_parser.c"
, 1342, __extension__ __PRETTY_FUNCTION__); }))
;1319 assert( yy_lookahead[i]==iLookAhead )((void) sizeof ((yy_lookahead[i]==iLookAhead) ? 1 : 0), __extension__
({ if (yy_lookahead[i]==iLookAhead) ; else __assert_fail ("yy_lookahead[i]==iLookAhead"
, "protobuf_lang_parser.c", 1343, __extension__ __PRETTY_FUNCTION__
); }))
;1320#endif1321 return yy_action[i];1322}1323 1324/*1325** The following routine is called if the stack overflows.1326*/1327static void yyStackOverflow(yyParser *yypParser){1328 ProtobufLangParserARG_FETCHprotobuf_lang_state_t *state =yypParser->state ;1329 ProtobufLangParserCTX_FETCH1330#ifndef NDEBUG1331 if( yyTraceFILE ){1332 fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);1333 }1334#endif1335 while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);1336 /* Here code is inserted which will execute if the parser1337 ** stack every overflows */1338/******** Begin %stack_overflow code ******************************************/1339/******** End %stack_overflow code ********************************************/1340 ProtobufLangParserARG_STOREyypParser->state =state ; /* Suppress warning about unused %extra_argument var */1341 ProtobufLangParserCTX_STORE1342}1343 1344/*1345** Print tracing information for a SHIFT action1346*/1347#ifndef NDEBUG1348static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){1349 if( yyTraceFILE ){1350 if( yyNewState<YYNSTATE152 ){1351 fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",1352 yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],1353 yyNewState);1354 }else{1355 fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",1356 yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],1357 yyNewState - YY_MIN_REDUCE500);1358 }1359 }1360}1361#else1362# define yyTraceShift(X,Y,Z)1363#endif1364 1365/*1366** Perform a shift action.1367*/1368static void yy_shift(1369 yyParser *yypParser, /* The parser to be shifted */1370 YYACTIONTYPEunsigned short int yyNewState, /* The new state to shift in */1371 YYCODETYPEunsigned char yyMajor, /* The major token to shift in */1372 ProtobufLangParserTOKENTYPEprotobuf_lang_token_t* yyMinor /* The minor token to shift in */1373){1374 yyStackEntry *yytos;1375 yypParser->yytos++;1376#ifdef YYTRACKMAXSTACKDEPTH1377 if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){1378 yypParser->yyhwm++;1379 assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) )((void) sizeof ((yypParser->yyhwm == (int)(yypParser->yytos
- yypParser->yystack)) ? 1 : 0), __extension__ ({ if (yypParser
->yyhwm == (int)(yypParser->yytos - yypParser->yystack
)) ; else __assert_fail ("yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)"
, "protobuf_lang_parser.c", 1403, __extension__ __PRETTY_FUNCTION__
); }))
;1380 }1381#endif1382#if YYSTACKDEPTH100>01383 if( yypParser->yytos>yypParser->yystackEnd ){1384 yypParser->yytos--;1385 yyStackOverflow(yypParser);1386 return;1387 }1388#else1389 if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){1390 if( yyGrowStack(yypParser) ){1391 yypParser->yytos--;1392 yyStackOverflow(yypParser);1393 return;1394 }1395 }1396#endif1397 if( yyNewState > YY_MAX_SHIFT151 ){1398 yyNewState += YY_MIN_REDUCE500 - YY_MIN_SHIFTREDUCE316;1399 }1400 yytos = yypParser->yytos;1401 yytos->stateno = yyNewState;1402 yytos->major = yyMajor;1403 yytos->minor.yy0 = yyMinor;1404 yyTraceShift(yypParser, yyNewState, "Shift");1405}1406 1407/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side1408** of that rule */1409static const YYCODETYPEunsigned char yyRuleInfoLhs[] = {1410 107, /* (0) wholeProtoBody ::= protoBody */1411 108, /* (1) syntax ::= PT_SYNTAX PT_ASSIGN strLit PT_SEMICOLON */1412 80, /* (2) protoBody ::= */1413 80, /* (3) protoBody ::= protoBody topLevelDef */1414 109, /* (4) import ::= PT_IMPORT strLit PT_SEMICOLON */1415 109, /* (5) import ::= PT_IMPORT PT_PUBLIC strLit PT_SEMICOLON */1416 109, /* (6) import ::= PT_IMPORT PT_WEAK strLit PT_SEMICOLON */1417 110, /* (7) package ::= PT_PACKAGE exIdent PT_SEMICOLON */1418 114, /* (8) extIdentInParentheses ::= PT_LPAREN exIdent PT_RPAREN */1419 70, /* (9) optionName ::= optionName exIdent */1420 70, /* (10) optionName ::= optionName PT_DOT extIdentInParentheses */1421 70, /* (11) optionName ::= optionName extIdentInParentheses */1422 82, /* (12) message ::= PT_MESSAGE messageName PT_LCURLY messageBody PT_RCURLY */1423 83, /* (13) messageBody ::= */1424 83, /* (14) messageBody ::= messageBody field */1425 83, /* (15) messageBody ::= messageBody enum */1426 83, /* (16) messageBody ::= messageBody message */1427 83, /* (17) messageBody ::= messageBody group */1428 83, /* (18) messageBody ::= messageBody oneof */1429 83, /* (19) messageBody ::= messageBody mapField */1430 88, /* (20) enum ::= PT_ENUM enumName PT_LCURLY enumBody PT_RCURLY */1431 89, /* (21) enumBody ::= */1432 89, /* (22) enumBody ::= enumBody enumField */1433 90, /* (23) enumField ::= exIdent PT_ASSIGN enumNumber PT_LBRACKET enumValueOptions PT_RBRACKET PT_SEMICOLON */1434 90, /* (24) enumField ::= exIdent PT_ASSIGN enumNumber */1435 105, /* (25) enumNumber ::= intLit */1436 105, /* (26) enumNumber ::= PT_PLUS intLit */1437 105, /* (27) enumNumber ::= PT_MINUS intLit */1438 91, /* (28) service ::= PT_SERVICE serviceName PT_LCURLY serviceBody PT_RCURLY */1439 92, /* (29) serviceBody ::= */1440 92, /* (30) serviceBody ::= serviceBody rpc */1441 92, /* (31) serviceBody ::= serviceBody stream */1442 85, /* (32) rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */1443 85, /* (33) rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */1444 85, /* (34) rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */1445 85, /* (35) rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */1446 94, /* (36) streamDecl ::= PT_STREAM streamName PT_LPAREN messageType PT_COMMA messageType PT_RPAREN */1447 86, /* (37) field ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */1448 86, /* (38) field ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */1449 86, /* (39) field ::= label type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */1450 86, /* (40) field ::= label type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */1451 64, /* (41) label ::= PT_REQUIRED */1452 64, /* (42) label ::= PT_OPTIONAL */1453 64, /* (43) label ::= PT_REPEATED */1454 65, /* (44) type ::= exIdent */1455 104, /* (45) fieldNumber ::= intLit */1456 104, /* (46) fieldNumber ::= PT_PLUS intLit */1457 95, /* (47) fieldOptions ::= fieldOption */1458 95, /* (48) fieldOptions ::= fieldOptions PT_COMMA fieldOption */1459 96, /* (49) fieldOption ::= optionName PT_ASSIGN constant */1460 96, /* (50) fieldOption ::= optionName PT_ASSIGN customOptionValue */1461 100, /* (51) group ::= PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */1462 100, /* (52) group ::= label PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */1463 97, /* (53) oneof ::= PT_ONEOF oneofName PT_LCURLY oneofBody PT_RCURLY */1464 98, /* (54) oneofBody ::= */1465 98, /* (55) oneofBody ::= oneofBody oneofField */1466 87, /* (56) oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */1467 87, /* (57) oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */1468 99, /* (58) mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */1469 99, /* (59) mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_SEMICOLON */1470 66, /* (60) keyType ::= exIdent */1471 101, /* (61) extend ::= PT_EXTEND messageType PT_LCURLY extendBody PT_RCURLY */1472 102, /* (62) extendBody ::= */1473 102, /* (63) extendBody ::= extendBody field */1474 102, /* (64) extendBody ::= extendBody group */1475 67, /* (65) messageType ::= exIdent */1476 103, /* (66) intLit ::= PT_DECIMALLIT */1477 103, /* (67) intLit ::= PT_OCTALLIT */1478 103, /* (68) intLit ::= PT_HEXLIT */1479 68, /* (69) constant ::= exIdent */1480 68, /* (70) constant ::= intLit */1481 68, /* (71) constant ::= PT_PLUS intLit */1482 68, /* (72) constant ::= PT_MINUS intLit */1483 68, /* (73) constant ::= PT_PLUS exIdent */1484 68, /* (74) constant ::= PT_MINUS exIdent */1485 63, /* (75) strLit ::= PT_STRLIT */1486 63, /* (76) strLit ::= strLit PT_STRLIT */1487 106, /* (77) proto ::= wholeProtoBody */1488 106, /* (78) proto ::= syntax wholeProtoBody */1489 80, /* (79) protoBody ::= protoBody import */1490 80, /* (80) protoBody ::= protoBody package */1491 80, /* (81) protoBody ::= protoBody option */1492 80, /* (82) protoBody ::= protoBody emptyStatement */1493 111, /* (83) option ::= PT_OPTION optionName PT_ASSIGN constant PT_SEMICOLON */1494 111, /* (84) option ::= PT_OPTION optionName PT_ASSIGN customOptionValue PT_SEMICOLON */1495 70, /* (85) optionName ::= exIdent */1496 70, /* (86) optionName ::= extIdentInParentheses */1497 113, /* (87) customOptionValue ::= PT_LCURLY customOptionBody PT_RCURLY */1498 115, /* (88) customOptionBody ::= */1499 115, /* (89) customOptionBody ::= customOptionBody exIdent */1500 115, /* (90) customOptionBody ::= customOptionBody PT_STRLIT */1501 115, /* (91) customOptionBody ::= customOptionBody symbolsWithoutCurly */1502 115, /* (92) customOptionBody ::= customOptionBody intLit */1503 115, /* (93) customOptionBody ::= customOptionBody customOptionValue */1504 116, /* (94) symbolsWithoutCurly ::= PT_LPAREN */1505 116, /* (95) symbolsWithoutCurly ::= PT_RPAREN */1506 116, /* (96) symbolsWithoutCurly ::= PT_LBRACKET */1507 116, /* (97) symbolsWithoutCurly ::= PT_RBRACKET */1508 116, /* (98) symbolsWithoutCurly ::= PT_EQUAL */1509 116, /* (99) symbolsWithoutCurly ::= PT_NOTEQUAL */1510 116, /* (100) symbolsWithoutCurly ::= PT_NOTEQUAL2 */1511 116, /* (101) symbolsWithoutCurly ::= PT_GEQUAL */1512 116, /* (102) symbolsWithoutCurly ::= PT_LEQUAL */1513 116, /* (103) symbolsWithoutCurly ::= PT_ASSIGN_PLUS */1514 116, /* (104) symbolsWithoutCurly ::= PT_ASSIGN */1515 116, /* (105) symbolsWithoutCurly ::= PT_PLUS */1516 116, /* (106) symbolsWithoutCurly ::= PT_MINUS */1517 116, /* (107) symbolsWithoutCurly ::= PT_MULTIPLY */1518 116, /* (108) symbolsWithoutCurly ::= PT_DIV */1519 116, /* (109) symbolsWithoutCurly ::= PT_LOGIC_OR */1520 116, /* (110) symbolsWithoutCurly ::= PT_OR */1521 116, /* (111) symbolsWithoutCurly ::= PT_LOGIC_AND */1522 116, /* (112) symbolsWithoutCurly ::= PT_AND */1523 116, /* (113) symbolsWithoutCurly ::= PT_NOT */1524 116, /* (114) symbolsWithoutCurly ::= PT_NEG */1525 116, /* (115) symbolsWithoutCurly ::= PT_XOR */1526 116, /* (116) symbolsWithoutCurly ::= PT_SHL */1527 116, /* (117) symbolsWithoutCurly ::= PT_SHR */1528 116, /* (118) symbolsWithoutCurly ::= PT_PERCENT */1529 116, /* (119) symbolsWithoutCurly ::= PT_DOLLAR */1530 116, /* (120) symbolsWithoutCurly ::= PT_COND */1531 116, /* (121) symbolsWithoutCurly ::= PT_SEMICOLON */1532 116, /* (122) symbolsWithoutCurly ::= PT_DOT */1533 116, /* (123) symbolsWithoutCurly ::= PT_COMMA */1534 116, /* (124) symbolsWithoutCurly ::= PT_COLON */1535 116, /* (125) symbolsWithoutCurly ::= PT_LESS */1536 116, /* (126) symbolsWithoutCurly ::= PT_GREATER */1537 81, /* (127) topLevelDef ::= message */1538 81, /* (128) topLevelDef ::= enum */1539 81, /* (129) topLevelDef ::= extend */1540 81, /* (130) topLevelDef ::= service */1541 83, /* (131) messageBody ::= messageBody extend */1542 83, /* (132) messageBody ::= messageBody extensions */1543 83, /* (133) messageBody ::= messageBody option */1544 83, /* (134) messageBody ::= messageBody reserved */1545 83, /* (135) messageBody ::= messageBody emptyStatement */1546 89, /* (136) enumBody ::= enumBody reserved */1547 89, /* (137) enumBody ::= enumBody option */1548 89, /* (138) enumBody ::= enumBody emptyStatement */1549 119, /* (139) enumValueOptions ::= enumValueOption */1550 119, /* (140) enumValueOptions ::= enumValueOptions PT_COMMA enumValueOption */1551 120, /* (141) enumValueOption ::= optionName PT_ASSIGN constant */1552 120, /* (142) enumValueOption ::= optionName PT_ASSIGN customOptionValue */1553 92, /* (143) serviceBody ::= serviceBody option */1554 92, /* (144) serviceBody ::= serviceBody emptyStatement */1555 84, /* (145) rpc ::= rpcDecl PT_SEMICOLON */1556 84, /* (146) rpc ::= rpcDecl PT_LCURLY rpcBody PT_RCURLY */1557 121, /* (147) rpcBody ::= */1558 121, /* (148) rpcBody ::= rpcBody option */1559 121, /* (149) rpcBody ::= rpcBody emptyStatement */1560 93, /* (150) stream ::= streamDecl PT_SEMICOLON */1561 93, /* (151) stream ::= streamDecl PT_LCURLY streamBody PT_RCURLY */1562 122, /* (152) streamBody ::= */1563 122, /* (153) streamBody ::= streamBody option */1564 122, /* (154) streamBody ::= streamBody emptyStatement */1565 79, /* (155) groupName ::= exIdent */1566 98, /* (156) oneofBody ::= oneofBody option */1567 98, /* (157) oneofBody ::= oneofBody group */1568 98, /* (158) oneofBody ::= oneofBody emptyStatement */1569 117, /* (159) extensions ::= PT_EXTENSIONS ranges PT_SEMICOLON */1570 118, /* (160) reserved ::= PT_RESERVED ranges PT_SEMICOLON */1571 118, /* (161) reserved ::= PT_RESERVED quoteFieldNames PT_SEMICOLON */1572 123, /* (162) ranges ::= range */1573 123, /* (163) ranges ::= ranges PT_COMMA range */1574 125, /* (164) range ::= intLit */1575 125, /* (165) range ::= intLit PT_TO intLit */1576 125, /* (166) range ::= intLit PT_TO exIdent */1577 124, /* (167) quoteFieldNames ::= strLit */1578 124, /* (168) quoteFieldNames ::= quoteFieldNames PT_COMMA strLit */1579 102, /* (169) extendBody ::= extendBody emptyStatement */1580 71, /* (170) messageName ::= exIdent */1581 72, /* (171) enumName ::= exIdent */1582 73, /* (172) streamName ::= exIdent */1583 74, /* (173) fieldName ::= exIdent */1584 75, /* (174) oneofName ::= exIdent */1585 76, /* (175) mapName ::= exIdent */1586 77, /* (176) serviceName ::= exIdent */1587 78, /* (177) rpcName ::= exIdent */1588 112, /* (178) emptyStatement ::= PT_SEMICOLON */1589 68, /* (179) constant ::= strLit */1590 69, /* (180) exIdent ::= PT_IDENT */1591};1592 1593/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number1594** of symbols on the right-hand side of that rule. */1595static const signed char yyRuleInfoNRhs[] = {1596 -1, /* (0) wholeProtoBody ::= protoBody */1597 -4, /* (1) syntax ::= PT_SYNTAX PT_ASSIGN strLit PT_SEMICOLON */1598 0, /* (2) protoBody ::= */1599 -2, /* (3) protoBody ::= protoBody topLevelDef */1600 -3, /* (4) import ::= PT_IMPORT strLit PT_SEMICOLON */1601 -4, /* (5) import ::= PT_IMPORT PT_PUBLIC strLit PT_SEMICOLON */1602 -4, /* (6) import ::= PT_IMPORT PT_WEAK strLit PT_SEMICOLON */1603 -3, /* (7) package ::= PT_PACKAGE exIdent PT_SEMICOLON */1604 -3, /* (8) extIdentInParentheses ::= PT_LPAREN exIdent PT_RPAREN */1605 -2, /* (9) optionName ::= optionName exIdent */1606 -3, /* (10) optionName ::= optionName PT_DOT extIdentInParentheses */1607 -2, /* (11) optionName ::= optionName extIdentInParentheses */1608 -5, /* (12) message ::= PT_MESSAGE messageName PT_LCURLY messageBody PT_RCURLY */1609 0, /* (13) messageBody ::= */1610 -2, /* (14) messageBody ::= messageBody field */1611 -2, /* (15) messageBody ::= messageBody enum */1612 -2, /* (16) messageBody ::= messageBody message */1613 -2, /* (17) messageBody ::= messageBody group */1614 -2, /* (18) messageBody ::= messageBody oneof */1615 -2, /* (19) messageBody ::= messageBody mapField */1616 -5, /* (20) enum ::= PT_ENUM enumName PT_LCURLY enumBody PT_RCURLY */1617 0, /* (21) enumBody ::= */1618 -2, /* (22) enumBody ::= enumBody enumField */1619 -7, /* (23) enumField ::= exIdent PT_ASSIGN enumNumber PT_LBRACKET enumValueOptions PT_RBRACKET PT_SEMICOLON */1620 -3, /* (24) enumField ::= exIdent PT_ASSIGN enumNumber */1621 -1, /* (25) enumNumber ::= intLit */1622 -2, /* (26) enumNumber ::= PT_PLUS intLit */1623 -2, /* (27) enumNumber ::= PT_MINUS intLit */1624 -5, /* (28) service ::= PT_SERVICE serviceName PT_LCURLY serviceBody PT_RCURLY */1625 0, /* (29) serviceBody ::= */1626 -2, /* (30) serviceBody ::= serviceBody rpc */1627 -2, /* (31) serviceBody ::= serviceBody stream */1628 -9, /* (32) rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */1629 -10, /* (33) rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */1630 -10, /* (34) rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */1631 -11, /* (35) rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */1632 -7, /* (36) streamDecl ::= PT_STREAM streamName PT_LPAREN messageType PT_COMMA messageType PT_RPAREN */1633 -5, /* (37) field ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */1634 -8, /* (38) field ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */1635 -6, /* (39) field ::= label type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */1636 -9, /* (40) field ::= label type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */1637 -1, /* (41) label ::= PT_REQUIRED */1638 -1, /* (42) label ::= PT_OPTIONAL */1639 -1, /* (43) label ::= PT_REPEATED */1640 -1, /* (44) type ::= exIdent */1641 -1, /* (45) fieldNumber ::= intLit */1642 -2, /* (46) fieldNumber ::= PT_PLUS intLit */1643 -1, /* (47) fieldOptions ::= fieldOption */1644 -3, /* (48) fieldOptions ::= fieldOptions PT_COMMA fieldOption */1645 -3, /* (49) fieldOption ::= optionName PT_ASSIGN constant */1646 -3, /* (50) fieldOption ::= optionName PT_ASSIGN customOptionValue */1647 -7, /* (51) group ::= PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */1648 -8, /* (52) group ::= label PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */1649 -5, /* (53) oneof ::= PT_ONEOF oneofName PT_LCURLY oneofBody PT_RCURLY */1650 0, /* (54) oneofBody ::= */1651 -2, /* (55) oneofBody ::= oneofBody oneofField */1652 -8, /* (56) oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */1653 -5, /* (57) oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */1654 -13, /* (58) mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */1655 -10, /* (59) mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_SEMICOLON */1656 -1, /* (60) keyType ::= exIdent */1657 -5, /* (61) extend ::= PT_EXTEND messageType PT_LCURLY extendBody PT_RCURLY */1658 0, /* (62) extendBody ::= */1659 -2, /* (63) extendBody ::= extendBody field */1660 -2, /* (64) extendBody ::= extendBody group */1661 -1, /* (65) messageType ::= exIdent */1662 -1, /* (66) intLit ::= PT_DECIMALLIT */1663 -1, /* (67) intLit ::= PT_OCTALLIT */1664 -1, /* (68) intLit ::= PT_HEXLIT */1665 -1, /* (69) constant ::= exIdent */1666 -1, /* (70) constant ::= intLit */1667 -2, /* (71) constant ::= PT_PLUS intLit */1668 -2, /* (72) constant ::= PT_MINUS intLit */1669 -2, /* (73) constant ::= PT_PLUS exIdent */1670 -2, /* (74) constant ::= PT_MINUS exIdent */1671 -1, /* (75) strLit ::= PT_STRLIT */1672 -2, /* (76) strLit ::= strLit PT_STRLIT */1673 -1, /* (77) proto ::= wholeProtoBody */1674 -2, /* (78) proto ::= syntax wholeProtoBody */1675 -2, /* (79) protoBody ::= protoBody import */1676 -2, /* (80) protoBody ::= protoBody package */1677 -2, /* (81) protoBody ::= protoBody option */1678 -2, /* (82) protoBody ::= protoBody emptyStatement */1679 -5, /* (83) option ::= PT_OPTION optionName PT_ASSIGN constant PT_SEMICOLON */1680 -5, /* (84) option ::= PT_OPTION optionName PT_ASSIGN customOptionValue PT_SEMICOLON */1681 -1, /* (85) optionName ::= exIdent */1682 -1, /* (86) optionName ::= extIdentInParentheses */1683 -3, /* (87) customOptionValue ::= PT_LCURLY customOptionBody PT_RCURLY */1684 0, /* (88) customOptionBody ::= */1685 -2, /* (89) customOptionBody ::= customOptionBody exIdent */1686 -2, /* (90) customOptionBody ::= customOptionBody PT_STRLIT */1687 -2, /* (91) customOptionBody ::= customOptionBody symbolsWithoutCurly */1688 -2, /* (92) customOptionBody ::= customOptionBody intLit */1689 -2, /* (93) customOptionBody ::= customOptionBody customOptionValue */1690 -1, /* (94) symbolsWithoutCurly ::= PT_LPAREN */1691 -1, /* (95) symbolsWithoutCurly ::= PT_RPAREN */1692 -1, /* (96) symbolsWithoutCurly ::= PT_LBRACKET */1693 -1, /* (97) symbolsWithoutCurly ::= PT_RBRACKET */1694 -1, /* (98) symbolsWithoutCurly ::= PT_EQUAL */1695 -1, /* (99) symbolsWithoutCurly ::= PT_NOTEQUAL */1696 -1, /* (100) symbolsWithoutCurly ::= PT_NOTEQUAL2 */1697 -1, /* (101) symbolsWithoutCurly ::= PT_GEQUAL */1698 -1, /* (102) symbolsWithoutCurly ::= PT_LEQUAL */1699 -1, /* (103) symbolsWithoutCurly ::= PT_ASSIGN_PLUS */1700 -1, /* (104) symbolsWithoutCurly ::= PT_ASSIGN */1701 -1, /* (105) symbolsWithoutCurly ::= PT_PLUS */1702 -1, /* (106) symbolsWithoutCurly ::= PT_MINUS */1703 -1, /* (107) symbolsWithoutCurly ::= PT_MULTIPLY */1704 -1, /* (108) symbolsWithoutCurly ::= PT_DIV */1705 -1, /* (109) symbolsWithoutCurly ::= PT_LOGIC_OR */1706 -1, /* (110) symbolsWithoutCurly ::= PT_OR */1707 -1, /* (111) symbolsWithoutCurly ::= PT_LOGIC_AND */1708 -1, /* (112) symbolsWithoutCurly ::= PT_AND */1709 -1, /* (113) symbolsWithoutCurly ::= PT_NOT */1710 -1, /* (114) symbolsWithoutCurly ::= PT_NEG */1711 -1, /* (115) symbolsWithoutCurly ::= PT_XOR */1712 -1, /* (116) symbolsWithoutCurly ::= PT_SHL */1713 -1, /* (117) symbolsWithoutCurly ::= PT_SHR */1714 -1, /* (118) symbolsWithoutCurly ::= PT_PERCENT */1715 -1, /* (119) symbolsWithoutCurly ::= PT_DOLLAR */1716 -1, /* (120) symbolsWithoutCurly ::= PT_COND */1717 -1, /* (121) symbolsWithoutCurly ::= PT_SEMICOLON */1718 -1, /* (122) symbolsWithoutCurly ::= PT_DOT */1719 -1, /* (123) symbolsWithoutCurly ::= PT_COMMA */1720 -1, /* (124) symbolsWithoutCurly ::= PT_COLON */1721 -1, /* (125) symbolsWithoutCurly ::= PT_LESS */1722 -1, /* (126) symbolsWithoutCurly ::= PT_GREATER */1723 -1, /* (127) topLevelDef ::= message */1724 -1, /* (128) topLevelDef ::= enum */1725 -1, /* (129) topLevelDef ::= extend */1726 -1, /* (130) topLevelDef ::= service */1727 -2, /* (131) messageBody ::= messageBody extend */1728 -2, /* (132) messageBody ::= messageBody extensions */1729 -2, /* (133) messageBody ::= messageBody option */1730 -2, /* (134) messageBody ::= messageBody reserved */1731 -2, /* (135) messageBody ::= messageBody emptyStatement */1732 -2, /* (136) enumBody ::= enumBody reserved */1733 -2, /* (137) enumBody ::= enumBody option */1734 -2, /* (138) enumBody ::= enumBody emptyStatement */1735 -1, /* (139) enumValueOptions ::= enumValueOption */1736 -3, /* (140) enumValueOptions ::= enumValueOptions PT_COMMA enumValueOption */1737 -3, /* (141) enumValueOption ::= optionName PT_ASSIGN constant */1738 -3, /* (142) enumValueOption ::= optionName PT_ASSIGN customOptionValue */1739 -2, /* (143) serviceBody ::= serviceBody option */1740 -2, /* (144) serviceBody ::= serviceBody emptyStatement */1741 -2, /* (145) rpc ::= rpcDecl PT_SEMICOLON */1742 -4, /* (146) rpc ::= rpcDecl PT_LCURLY rpcBody PT_RCURLY */1743 0, /* (147) rpcBody ::= */1744 -2, /* (148) rpcBody ::= rpcBody option */1745 -2, /* (149) rpcBody ::= rpcBody emptyStatement */1746 -2, /* (150) stream ::= streamDecl PT_SEMICOLON */1747 -4, /* (151) stream ::= streamDecl PT_LCURLY streamBody PT_RCURLY */1748 0, /* (152) streamBody ::= */1749 -2, /* (153) streamBody ::= streamBody option */1750 -2, /* (154) streamBody ::= streamBody emptyStatement */1751 -1, /* (155) groupName ::= exIdent */1752 -2, /* (156) oneofBody ::= oneofBody option */1753 -2, /* (157) oneofBody ::= oneofBody group */1754 -2, /* (158) oneofBody ::= oneofBody emptyStatement */1755 -3, /* (159) extensions ::= PT_EXTENSIONS ranges PT_SEMICOLON */1756 -3, /* (160) reserved ::= PT_RESERVED ranges PT_SEMICOLON */1757 -3, /* (161) reserved ::= PT_RESERVED quoteFieldNames PT_SEMICOLON */1758 -1, /* (162) ranges ::= range */1759 -3, /* (163) ranges ::= ranges PT_COMMA range */1760 -1, /* (164) range ::= intLit */1761 -3, /* (165) range ::= intLit PT_TO intLit */1762 -3, /* (166) range ::= intLit PT_TO exIdent */1763 -1, /* (167) quoteFieldNames ::= strLit */1764 -3, /* (168) quoteFieldNames ::= quoteFieldNames PT_COMMA strLit */1765 -2, /* (169) extendBody ::= extendBody emptyStatement */1766 -1, /* (170) messageName ::= exIdent */1767 -1, /* (171) enumName ::= exIdent */1768 -1, /* (172) streamName ::= exIdent */1769 -1, /* (173) fieldName ::= exIdent */1770 -1, /* (174) oneofName ::= exIdent */1771 -1, /* (175) mapName ::= exIdent */1772 -1, /* (176) serviceName ::= exIdent */1773 -1, /* (177) rpcName ::= exIdent */1774 -1, /* (178) emptyStatement ::= PT_SEMICOLON */1775 -1, /* (179) constant ::= strLit */1776 -1, /* (180) exIdent ::= PT_IDENT */1777};1778 1779static void yy_accept(yyParser*); /* Forward Declaration */1780 1781/*1782** Perform a reduce action and the shift that must immediately1783** follow the reduce.1784**1785** The yyLookahead and yyLookaheadToken parameters provide reduce actions1786** access to the lookahead token (if any). The yyLookahead will be YYNOCODE1787** if the lookahead token has already been consumed. As this procedure is1788** only called from one place, optimizing compilers will in-line it, which1789** means that the extra parameters have no performance impact.1790*/1791static YYACTIONTYPEunsigned short int yy_reduce(1792 yyParser *yypParser, /* The parser */1793 unsigned int yyruleno, /* Number of the rule by which to reduce */1794 int yyLookahead, /* Lookahead token, or YYNOCODE if none */1795 ProtobufLangParserTOKENTYPEprotobuf_lang_token_t* yyLookaheadToken /* Value of the lookahead token */1796 ProtobufLangParserCTX_PDECL /* %extra_context */1797){1798 int yygoto; /* The next state */1799 YYACTIONTYPEunsigned short int yyact; /* The next action */1800 yyStackEntry *yymsp; /* The top of the parser's stack */1801 int yysize; /* Amount to pop the stack */1802 ProtobufLangParserARG_FETCHprotobuf_lang_state_t *state =yypParser->state ;1803 (void)yyLookahead;1804 (void)yyLookaheadToken;1805 yymsp = yypParser->yytos;1806 1807 switch( yyruleno ){1808 /* Beginning here are the reduction cases. A typical example1809 ** follows:1810 ** case 0:1811 ** #line <lineno> <grammarfile>1812 ** { ... } // User supplied code1813 ** #line <lineno> <thisfile>1814 ** break;1815 */1816/********** Begin reduce actions **********************************************/1817 YYMINORTYPE yylhsminor;1818 case 0: /* wholeProtoBody ::= protoBody */1819#line 148 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1820{1821 /* set real package name */1822 pbl_set_node_name(yymsp[0].minor.yy205, state->file->package_name_lineno, state->file->package_name);1823 /* use the allocate mem of the name of the package node */1824 state->file->package_name = pbl_get_node_name(yymsp[0].minor.yy205);1825 /* put this file data into package tables */1826 pbl_node_t* packnode = (pbl_node_t*)g_hash_table_lookup(state->pool->packages, state->file->package_name);1827 if (packnode) {1828 pbl_merge_children(packnode, yymsp[0].minor.yy205);1829 pbl_free_node(yymsp[0].minor.yy205);1830 } else {1831 g_hash_table_insert(state->pool->packages, g_strdup(state->file->package_name)g_strdup_inline (state->file->package_name), yymsp[0].minor.yy205);1832 }1833 }1834#line 1859 "./protobuf_lang_parser.c"1835 break;1836 case 1: /* syntax ::= PT_SYNTAX PT_ASSIGN strLit PT_SEMICOLON */1837{ yy_destructor(yypParser,2,&yymsp[-3].minor);1838#line 166 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1839{1840 if (!strcmp(yymsp[-1].minor.yy148, "proto3")) {1841 state->file->syntax_version = 3;1842 } else if (!strcmp(yymsp[-1].minor.yy148, "proto2")) {1843 state->file->syntax_version = 2;1844 } else {1845 pbl_parser_error(state, "Unrecognized syntax identifier [%s]. This parser only recognizes \"proto3\" or \"proto2\"!", yymsp[-1].minor.yy148);1846 state->grammar_error = TRUE(!(0));1847 }1848 }1849#line 1874 "./protobuf_lang_parser.c"1850 yy_destructor(yypParser,24,&yymsp[-2].minor);1851 yy_destructor(yypParser,25,&yymsp[0].minor);1852}1853 break;1854 case 2: /* protoBody ::= */1855#line 177 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1856{ yymsp[1].minor.yy205 = pbl_create_node(state->file, CUR_LINENO(protobuf_lang_get_lineno(state->scanner)), PBL_PACKAGE, NAME_TO_BE_SET"<NAME_TO_BE_SET>"); }1857#line 1882 "./protobuf_lang_parser.c"1858 break;1859 case 3: /* protoBody ::= protoBody topLevelDef */1860 case 14: /* messageBody ::= messageBody field */ yytestcase(yyruleno==14);1861 case 15: /* messageBody ::= messageBody enum */ yytestcase(yyruleno==15);1862 case 16: /* messageBody ::= messageBody message */ yytestcase(yyruleno==16);1863 case 17: /* messageBody ::= messageBody group */ yytestcase(yyruleno==17);1864 case 19: /* messageBody ::= messageBody mapField */ yytestcase(yyruleno==19);1865 case 22: /* enumBody ::= enumBody enumField */ yytestcase(yyruleno==22);1866 case 30: /* serviceBody ::= serviceBody rpc */ yytestcase(yyruleno==30);1867 case 31: /* serviceBody ::= serviceBody stream */ yytestcase(yyruleno==31);1868 case 55: /* oneofBody ::= oneofBody oneofField */ yytestcase(yyruleno==55);1869 case 63: /* extendBody ::= extendBody field */ yytestcase(yyruleno==63);1870 case 64: /* extendBody ::= extendBody group */ yytestcase(yyruleno==64);1871#line 181 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1872{ yylhsminor.yy205 = yymsp[-1].minor.yy205; pbl_add_child(yylhsminor.yy205, yymsp[0].minor.yy205); }1873#line 1898 "./protobuf_lang_parser.c"1874 yymsp[-1].minor.yy205 = yylhsminor.yy205;1875 break;1876 case 4: /* import ::= PT_IMPORT strLit PT_SEMICOLON */1877{ yy_destructor(yypParser,3,&yymsp[-2].minor);1878#line 185 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1879{ pbl_add_proto_file_to_be_parsed(state->pool, yymsp[-1].minor.yy148); }1880#line 1905 "./protobuf_lang_parser.c"1881 yy_destructor(yypParser,25,&yymsp[0].minor);1882}1883 break;1884 case 5: /* import ::= PT_IMPORT PT_PUBLIC strLit PT_SEMICOLON */1885{ yy_destructor(yypParser,3,&yymsp[-3].minor);1886#line 186 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1887{ pbl_add_proto_file_to_be_parsed(state->pool, yymsp[-1].minor.yy148); }1888#line 1913 "./protobuf_lang_parser.c"1889 yy_destructor(yypParser,5,&yymsp[-2].minor);1890 yy_destructor(yypParser,25,&yymsp[0].minor);1891}1892 break;1893 case 6: /* import ::= PT_IMPORT PT_WEAK strLit PT_SEMICOLON */1894{ yy_destructor(yypParser,3,&yymsp[-3].minor);1895#line 187 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1896{ pbl_add_proto_file_to_be_parsed(state->pool, yymsp[-1].minor.yy148); }1897#line 1922 "./protobuf_lang_parser.c"1898 yy_destructor(yypParser,4,&yymsp[-2].minor);1899 yy_destructor(yypParser,25,&yymsp[0].minor);1900}1901 break;1902 case 7: /* package ::= PT_PACKAGE exIdent PT_SEMICOLON */1903{ yy_destructor(yypParser,6,&yymsp[-2].minor);1904#line 191 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1905{ /* The memory of (yymsp[-1].minor.yy140) will be freed after parsing, but the package_name will1906 be replaced by the new-allocated name of package node late */1907 state->file->package_name = yymsp[-1].minor.yy140->v;1908 state->file->package_name_lineno = yymsp[-1].minor.yy140->ln;1909 }1910#line 1935 "./protobuf_lang_parser.c"1911 yy_destructor(yypParser,25,&yymsp[0].minor);1912}1913 break;1914 case 8: /* extIdentInParentheses ::= PT_LPAREN exIdent PT_RPAREN */1915{ yy_destructor(yypParser,26,&yymsp[-2].minor);1916#line 205 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1917{ yymsp[-2].minor.yy0 = yymsp[-1].minor.yy140; yymsp[-2].minor.yy0->v = pbl_store_string_token(state, g_strconcat("(", yymsp[-1].minor.yy140->v, ")", NULL((void*)0))); }1918#line 1943 "./protobuf_lang_parser.c"1919 yy_destructor(yypParser,27,&yymsp[0].minor);1920}1921 break;1922 case 9: /* optionName ::= optionName exIdent */1923#line 209 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1924{ yylhsminor.yy140 = yymsp[-1].minor.yy140; yylhsminor.yy140->v = pbl_store_string_token(state, g_strconcat(yymsp[-1].minor.yy140->v, yymsp[0].minor.yy140->v, NULL((void*)0))); }1925#line 1950 "./protobuf_lang_parser.c"1926 yymsp[-1].minor.yy140 = yylhsminor.yy140;1927 break;1928 case 10: /* optionName ::= optionName PT_DOT extIdentInParentheses */1929#line 211 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1930{ yylhsminor.yy140 = yymsp[-2].minor.yy140; yylhsminor.yy140->v = pbl_store_string_token(state, g_strconcat(yymsp[-2].minor.yy140->v, ".", yymsp[0].minor.yy0->v, NULL((void*)0))); }1931#line 1956 "./protobuf_lang_parser.c"1932 yy_destructor(yypParser,28,&yymsp[-1].minor);1933 yymsp[-2].minor.yy140 = yylhsminor.yy140;1934 break;1935 case 11: /* optionName ::= optionName extIdentInParentheses */1936#line 213 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1937{ yylhsminor.yy140 = yymsp[-1].minor.yy140; yylhsminor.yy140->v = pbl_store_string_token(state, g_strconcat(yymsp[-1].minor.yy140->v, ".", yymsp[0].minor.yy0->v, NULL((void*)0))); }1938#line 1963 "./protobuf_lang_parser.c"1939 yymsp[-1].minor.yy140 = yylhsminor.yy140;1940 break;1941 case 12: /* message ::= PT_MESSAGE messageName PT_LCURLY messageBody PT_RCURLY */1942{ yy_destructor(yypParser,18,&yymsp[-4].minor);1943#line 293 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1944{ yymsp[-4].minor.yy205 = yymsp[-1].minor.yy205; pbl_set_node_name(yymsp[-4].minor.yy205, yymsp[-3].minor.yy140->ln, yymsp[-3].minor.yy140->v); }1945#line 1970 "./protobuf_lang_parser.c"1946 yy_destructor(yypParser,29,&yymsp[-2].minor);1947 yy_destructor(yypParser,30,&yymsp[0].minor);1948}1949 break;1950 case 13: /* messageBody ::= */1951 case 62: /* extendBody ::= */ yytestcase(yyruleno==62);1952#line 297 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1953{ yymsp[1].minor.yy205 = pbl_create_node(state->file, CUR_LINENO(protobuf_lang_get_lineno(state->scanner)), PBL_MESSAGE, NAME_TO_BE_SET"<NAME_TO_BE_SET>"); }1954#line 1979 "./protobuf_lang_parser.c"1955 break;1956 case 18: /* messageBody ::= messageBody oneof */1957#line 305 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1958{ yylhsminor.yy205 = yymsp[-1].minor.yy205; pbl_merge_children(yylhsminor.yy205, yymsp[0].minor.yy205); pbl_free_node(yymsp[0].minor.yy205); }1959#line 1984 "./protobuf_lang_parser.c"1960 yymsp[-1].minor.yy205 = yylhsminor.yy205;1961 break;1962 case 20: /* enum ::= PT_ENUM enumName PT_LCURLY enumBody PT_RCURLY */1963{ yy_destructor(yypParser,14,&yymsp[-4].minor);1964#line 312 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1965{ yymsp[-4].minor.yy205 = yymsp[-1].minor.yy205; pbl_set_node_name(yymsp[-4].minor.yy205, yymsp[-3].minor.yy140->ln, yymsp[-3].minor.yy140->v); }1966#line 1991 "./protobuf_lang_parser.c"1967 yy_destructor(yypParser,29,&yymsp[-2].minor);1968 yy_destructor(yypParser,30,&yymsp[0].minor);1969}1970 break;1971 case 21: /* enumBody ::= */1972#line 316 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1973{ yymsp[1].minor.yy205 = pbl_create_node(state->file, CUR_LINENO(protobuf_lang_get_lineno(state->scanner)), PBL_ENUM, NAME_TO_BE_SET"<NAME_TO_BE_SET>"); }1974#line 1999 "./protobuf_lang_parser.c"1975 break;1976 case 23: /* enumField ::= exIdent PT_ASSIGN enumNumber PT_LBRACKET enumValueOptions PT_RBRACKET PT_SEMICOLON */1977#line 324 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1978{ yylhsminor.yy205 = pbl_create_enum_value_node(state->file, yymsp[-6].minor.yy140->ln, yymsp[-6].minor.yy140->v, yymsp[-4].minor.yy4); }1979#line 2004 "./protobuf_lang_parser.c"1980 yy_destructor(yypParser,24,&yymsp[-5].minor);1981 yy_destructor(yypParser,32,&yymsp[-3].minor);1982 yy_destructor(yypParser,33,&yymsp[-1].minor);1983 yy_destructor(yypParser,25,&yymsp[0].minor);1984 yymsp[-6].minor.yy205 = yylhsminor.yy205;1985 break;1986 case 24: /* enumField ::= exIdent PT_ASSIGN enumNumber */1987#line 326 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1988{ yylhsminor.yy205 = pbl_create_enum_value_node(state->file, yymsp[-2].minor.yy140->ln, yymsp[-2].minor.yy140->v, yymsp[0].minor.yy4); }1989#line 2014 "./protobuf_lang_parser.c"1990 yy_destructor(yypParser,24,&yymsp[-1].minor);1991 yymsp[-2].minor.yy205 = yylhsminor.yy205;1992 break;1993 case 25: /* enumNumber ::= intLit */1994 case 45: /* fieldNumber ::= intLit */ yytestcase(yyruleno==45);1995#line 329 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"1996{ yylhsminor.yy4 = (int)yymsp[0].minor.yy122; }1997#line 2022 "./protobuf_lang_parser.c"1998 yymsp[0].minor.yy4 = yylhsminor.yy4;1999 break;2000 case 26: /* enumNumber ::= PT_PLUS intLit */2001 case 46: /* fieldNumber ::= PT_PLUS intLit */ yytestcase(yyruleno==46);2002{ yy_destructor(yypParser,40,&yymsp[-1].minor);2003#line 330 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2004{ yymsp[-1].minor.yy4 = (int)yymsp[0].minor.yy122; }2005#line 2030 "./protobuf_lang_parser.c"2006}2007 break;2008 case 27: /* enumNumber ::= PT_MINUS intLit */2009{ yy_destructor(yypParser,41,&yymsp[-1].minor);2010#line 331 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2011{ yymsp[-1].minor.yy4 = -(int)yymsp[0].minor.yy122; }2012#line 2037 "./protobuf_lang_parser.c"2013}2014 break;2015 case 28: /* service ::= PT_SERVICE serviceName PT_LCURLY serviceBody PT_RCURLY */2016{ yy_destructor(yypParser,19,&yymsp[-4].minor);2017#line 345 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2018{ yymsp[-4].minor.yy205 = yymsp[-1].minor.yy205; pbl_set_node_name(yymsp[-4].minor.yy205, yymsp[-3].minor.yy140->ln, yymsp[-3].minor.yy140->v); }2019#line 2044 "./protobuf_lang_parser.c"2020 yy_destructor(yypParser,29,&yymsp[-2].minor);2021 yy_destructor(yypParser,30,&yymsp[0].minor);2022}2023 break;2024 case 29: /* serviceBody ::= */2025#line 347 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2026{ yymsp[1].minor.yy205 = pbl_create_node(state->file, CUR_LINENO(protobuf_lang_get_lineno(state->scanner)), PBL_SERVICE, NAME_TO_BE_SET"<NAME_TO_BE_SET>"); }2027#line 2052 "./protobuf_lang_parser.c"2028 break;2029 case 32: /* rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */2030{ yy_destructor(yypParser,20,&yymsp[-8].minor);2031#line 359 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2032{ yymsp[-8].minor.yy205 = pbl_create_method_node(state->file, yymsp[-7].minor.yy140->ln, yymsp[-7].minor.yy140->v, yymsp[-5].minor.yy148, FALSE(0), yymsp[-1].minor.yy148, FALSE(0)); }2033#line 2058 "./protobuf_lang_parser.c"2034 yy_destructor(yypParser,26,&yymsp[-6].minor);2035 yy_destructor(yypParser,27,&yymsp[-4].minor);2036 yy_destructor(yypParser,22,&yymsp[-3].minor);2037 yy_destructor(yypParser,26,&yymsp[-2].minor);2038 yy_destructor(yypParser,27,&yymsp[0].minor);2039}2040 break;2041 case 33: /* rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */2042{ yy_destructor(yypParser,20,&yymsp[-9].minor);2043#line 361 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2044{ yymsp[-9].minor.yy205 = pbl_create_method_node(state->file, yymsp[-8].minor.yy140->ln, yymsp[-8].minor.yy140->v, yymsp[-5].minor.yy148, TRUE(!(0)), yymsp[-1].minor.yy148, FALSE(0)); }2045#line 2070 "./protobuf_lang_parser.c"2046 yy_destructor(yypParser,26,&yymsp[-7].minor);2047 yy_destructor(yypParser,21,&yymsp[-6].minor);2048 yy_destructor(yypParser,27,&yymsp[-4].minor);2049 yy_destructor(yypParser,22,&yymsp[-3].minor);2050 yy_destructor(yypParser,26,&yymsp[-2].minor);2051 yy_destructor(yypParser,27,&yymsp[0].minor);2052}2053 break;2054 case 34: /* rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */2055{ yy_destructor(yypParser,20,&yymsp[-9].minor);2056#line 363 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2057{ yymsp[-9].minor.yy205 = pbl_create_method_node(state->file, yymsp[-8].minor.yy140->ln, yymsp[-8].minor.yy140->v, yymsp[-6].minor.yy148, FALSE(0), yymsp[-1].minor.yy148, TRUE(!(0))); }2058#line 2083 "./protobuf_lang_parser.c"2059 yy_destructor(yypParser,26,&yymsp[-7].minor);2060 yy_destructor(yypParser,27,&yymsp[-5].minor);2061 yy_destructor(yypParser,22,&yymsp[-4].minor);2062 yy_destructor(yypParser,26,&yymsp[-3].minor);2063 yy_destructor(yypParser,21,&yymsp[-2].minor);2064 yy_destructor(yypParser,27,&yymsp[0].minor);2065}2066 break;2067 case 35: /* rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */2068{ yy_destructor(yypParser,20,&yymsp[-10].minor);2069#line 365 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2070{ yymsp[-10].minor.yy205 = pbl_create_method_node(state->file, yymsp[-9].minor.yy140->ln, yymsp[-9].minor.yy140->v, yymsp[-6].minor.yy148, TRUE(!(0)), yymsp[-1].minor.yy148, TRUE(!(0))); }2071#line 2096 "./protobuf_lang_parser.c"2072 yy_destructor(yypParser,26,&yymsp[-8].minor);2073 yy_destructor(yypParser,21,&yymsp[-7].minor);2074 yy_destructor(yypParser,27,&yymsp[-5].minor);2075 yy_destructor(yypParser,22,&yymsp[-4].minor);2076 yy_destructor(yypParser,26,&yymsp[-3].minor);2077 yy_destructor(yypParser,21,&yymsp[-2].minor);2078 yy_destructor(yypParser,27,&yymsp[0].minor);2079}2080 break;2081 case 36: /* streamDecl ::= PT_STREAM streamName PT_LPAREN messageType PT_COMMA messageType PT_RPAREN */2082{ yy_destructor(yypParser,21,&yymsp[-6].minor);2083#line 377 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2084{ yymsp[-6].minor.yy205 = pbl_create_method_node(state->file, yymsp[-5].minor.yy140->ln, yymsp[-5].minor.yy140->v, yymsp[-3].minor.yy148, TRUE(!(0)), yymsp[-1].minor.yy148, TRUE(!(0))); }2085#line 2110 "./protobuf_lang_parser.c"2086 yy_destructor(yypParser,26,&yymsp[-4].minor);2087 yy_destructor(yypParser,56,&yymsp[-2].minor);2088 yy_destructor(yypParser,27,&yymsp[0].minor);2089}2090 break;2091 case 37: /* field ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */2092 case 57: /* oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */ yytestcase(yyruleno==57);2093#line 387 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2094{ yylhsminor.yy205 = pbl_create_field_node(state->file, yymsp[-3].minor.yy140->ln, NULL((void*)0), yymsp[-4].minor.yy148, yymsp[-3].minor.yy140->v, yymsp[-1].minor.yy4, NULL((void*)0)); }2095#line 2120 "./protobuf_lang_parser.c"2096 yy_destructor(yypParser,24,&yymsp[-2].minor);2097 yy_destructor(yypParser,25,&yymsp[0].minor);2098 yymsp[-4].minor.yy205 = yylhsminor.yy205;2099 break;2100 case 38: /* field ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */2101 case 56: /* oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */ yytestcase(yyruleno==56);2102#line 389 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2103{ yylhsminor.yy205 = pbl_create_field_node(state->file, yymsp[-6].minor.yy140->ln, NULL((void*)0), yymsp[-7].minor.yy148, yymsp[-6].minor.yy140->v, yymsp[-4].minor.yy4, yymsp[-2].minor.yy205); }2104#line 2129 "./protobuf_lang_parser.c"2105 yy_destructor(yypParser,24,&yymsp[-5].minor);2106 yy_destructor(yypParser,32,&yymsp[-3].minor);2107 yy_destructor(yypParser,33,&yymsp[-1].minor);2108 yy_destructor(yypParser,25,&yymsp[0].minor);2109 yymsp[-7].minor.yy205 = yylhsminor.yy205;2110 break;2111 case 39: /* field ::= label type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */2112#line 391 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2113{ yylhsminor.yy205 = pbl_create_field_node(state->file, yymsp[-3].minor.yy140->ln, yymsp[-5].minor.yy148, yymsp[-4].minor.yy148, yymsp[-3].minor.yy140->v, yymsp[-1].minor.yy4, NULL((void*)0)); }2114#line 2139 "./protobuf_lang_parser.c"2115 yy_destructor(yypParser,24,&yymsp[-2].minor);2116 yy_destructor(yypParser,25,&yymsp[0].minor);2117 yymsp[-5].minor.yy205 = yylhsminor.yy205;2118 break;2119 case 40: /* field ::= label type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */2120#line 393 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2121{ yylhsminor.yy205 = pbl_create_field_node(state->file, yymsp[-6].minor.yy140->ln, yymsp[-8].minor.yy148, yymsp[-7].minor.yy148, yymsp[-6].minor.yy140->v, yymsp[-4].minor.yy4, yymsp[-2].minor.yy205); }2122#line 2147 "./protobuf_lang_parser.c"2123 yy_destructor(yypParser,24,&yymsp[-5].minor);2124 yy_destructor(yypParser,32,&yymsp[-3].minor);2125 yy_destructor(yypParser,33,&yymsp[-1].minor);2126 yy_destructor(yypParser,25,&yymsp[0].minor);2127 yymsp[-8].minor.yy205 = yylhsminor.yy205;2128 break;2129 case 41: /* label ::= PT_REQUIRED */2130 case 42: /* label ::= PT_OPTIONAL */ yytestcase(yyruleno==42);2131 case 43: /* label ::= PT_REPEATED */ yytestcase(yyruleno==43);2132#line 396 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2133{ yylhsminor.yy148 = yymsp[0].minor.yy0->v; }2134#line 2159 "./protobuf_lang_parser.c"2135 yymsp[0].minor.yy148 = yylhsminor.yy148;2136 break;2137 case 44: /* type ::= exIdent */2138 case 60: /* keyType ::= exIdent */ yytestcase(yyruleno==60);2139 case 65: /* messageType ::= exIdent */ yytestcase(yyruleno==65);2140 case 69: /* constant ::= exIdent */ yytestcase(yyruleno==69);2141#line 404 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2142{ yylhsminor.yy148 = yymsp[0].minor.yy140->v; }2143#line 2168 "./protobuf_lang_parser.c"2144 yymsp[0].minor.yy148 = yylhsminor.yy148;2145 break;2146 case 47: /* fieldOptions ::= fieldOption */2147#line 412 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2148{ yylhsminor.yy205 = pbl_create_node(state->file, CUR_LINENO(protobuf_lang_get_lineno(state->scanner)), PBL_OPTIONS, NEED_NOT_NAME"<NEED_NOT_NAME>"); pbl_add_child(yylhsminor.yy205, yymsp[0].minor.yy205); }2149#line 2174 "./protobuf_lang_parser.c"2150 yymsp[0].minor.yy205 = yylhsminor.yy205;2151 break;2152 case 48: /* fieldOptions ::= fieldOptions PT_COMMA fieldOption */2153#line 414 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2154{ yylhsminor.yy205 = yymsp[-2].minor.yy205; pbl_add_child(yylhsminor.yy205, yymsp[0].minor.yy205); }2155#line 2180 "./protobuf_lang_parser.c"2156 yy_destructor(yypParser,56,&yymsp[-1].minor);2157 yymsp[-2].minor.yy205 = yylhsminor.yy205;2158 break;2159 case 49: /* fieldOption ::= optionName PT_ASSIGN constant */2160#line 419 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2161{ yylhsminor.yy205 = pbl_create_option_node(state->file, yymsp[-2].minor.yy140->ln, yymsp[-2].minor.yy140->v, yymsp[0].minor.yy148); }2162#line 2187 "./protobuf_lang_parser.c"2163 yy_destructor(yypParser,24,&yymsp[-1].minor);2164 yymsp[-2].minor.yy205 = yylhsminor.yy205;2165 break;2166 case 50: /* fieldOption ::= optionName PT_ASSIGN customOptionValue */2167#line 421 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2168{ yylhsminor.yy205 = pbl_create_option_node(state->file, yymsp[-2].minor.yy140->ln, yymsp[-2].minor.yy140->v, pbl_store_string_token(state, g_strdup("{ ... }")g_strdup_inline ("{ ... }"))); }2169#line 2194 "./protobuf_lang_parser.c"2170 yy_destructor(yypParser,24,&yymsp[-1].minor);2171 yymsp[-2].minor.yy205 = yylhsminor.yy205;2172 break;2173 case 51: /* group ::= PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */2174{ yy_destructor(yypParser,15,&yymsp[-6].minor);2175#line 426 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2176{ yymsp[-6].minor.yy205 = yymsp[-1].minor.yy205; pbl_set_node_name(yymsp[-6].minor.yy205, yymsp[-5].minor.yy140->ln, yymsp[-5].minor.yy140->v); }2177#line 2202 "./protobuf_lang_parser.c"2178 yy_destructor(yypParser,24,&yymsp[-4].minor);2179 yy_destructor(yypParser,29,&yymsp[-2].minor);2180 yy_destructor(yypParser,30,&yymsp[0].minor);2181}2182 break;2183 case 52: /* group ::= label PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */2184#line 428 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2185{ yymsp[-7].minor.yy205 = yymsp[-1].minor.yy205; pbl_set_node_name(yymsp[-7].minor.yy205, yymsp[-5].minor.yy140->ln, yymsp[-5].minor.yy140->v); }2186#line 2211 "./protobuf_lang_parser.c"2187 yy_destructor(yypParser,15,&yymsp[-6].minor);2188 yy_destructor(yypParser,24,&yymsp[-4].minor);2189 yy_destructor(yypParser,29,&yymsp[-2].minor);2190 yy_destructor(yypParser,30,&yymsp[0].minor);2191 break;2192 case 53: /* oneof ::= PT_ONEOF oneofName PT_LCURLY oneofBody PT_RCURLY */2193{ yy_destructor(yypParser,11,&yymsp[-4].minor);2194#line 435 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2195{ yymsp[-4].minor.yy205 = yymsp[-1].minor.yy205; pbl_set_node_name(yymsp[-4].minor.yy205, yymsp[-3].minor.yy140->ln, yymsp[-3].minor.yy140->v); }2196#line 2221 "./protobuf_lang_parser.c"2197 yy_destructor(yypParser,29,&yymsp[-2].minor);2198 yy_destructor(yypParser,30,&yymsp[0].minor);2199}2200 break;2201 case 54: /* oneofBody ::= */2202#line 437 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2203{ yymsp[1].minor.yy205 = pbl_create_node(state->file, CUR_LINENO(protobuf_lang_get_lineno(state->scanner)), PBL_ONEOF, NAME_TO_BE_SET"<NAME_TO_BE_SET>"); }2204#line 2229 "./protobuf_lang_parser.c"2205 break;2206 case 58: /* mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */2207{ yy_destructor(yypParser,12,&yymsp[-12].minor);2208#line 451 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2209{2210 yymsp[-12].minor.yy205 = pbl_create_map_field_node(state->file, yymsp[-6].minor.yy140->ln, yymsp[-6].minor.yy140->v, yymsp[-4].minor.yy4, yymsp[-2].minor.yy205);2211 pbl_add_child(yymsp[-12].minor.yy205, pbl_create_field_node(state->file, yymsp[-6].minor.yy140->ln, NULL((void*)0), yymsp[-10].minor.yy148, "key", 1, NULL((void*)0))); /* add key field */2212 pbl_add_child(yymsp[-12].minor.yy205, pbl_create_field_node(state->file, yymsp[-6].minor.yy140->ln, NULL((void*)0), yymsp[-8].minor.yy148, "value", 2, NULL((void*)0))); /* add value field */2213 }2214#line 2239 "./protobuf_lang_parser.c"2215 yy_destructor(yypParser,58,&yymsp[-11].minor);2216 yy_destructor(yypParser,56,&yymsp[-9].minor);2217 yy_destructor(yypParser,59,&yymsp[-7].minor);2218 yy_destructor(yypParser,24,&yymsp[-5].minor);2219 yy_destructor(yypParser,32,&yymsp[-3].minor);2220 yy_destructor(yypParser,33,&yymsp[-1].minor);2221 yy_destructor(yypParser,25,&yymsp[0].minor);2222}2223 break;2224 case 59: /* mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_SEMICOLON */2225{ yy_destructor(yypParser,12,&yymsp[-9].minor);2226#line 457 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2227{2228 yymsp[-9].minor.yy205 = pbl_create_map_field_node(state->file, yymsp[-3].minor.yy140->ln, yymsp[-3].minor.yy140->v, yymsp[-1].minor.yy4, NULL((void*)0));2229 pbl_add_child(yymsp[-9].minor.yy205, pbl_create_field_node(state->file, yymsp[-3].minor.yy140->ln, NULL((void*)0), yymsp[-7].minor.yy148, "key", 1, NULL((void*)0))); /* add key field */2230 pbl_add_child(yymsp[-9].minor.yy205, pbl_create_field_node(state->file, yymsp[-3].minor.yy140->ln, NULL((void*)0), yymsp[-5].minor.yy148, "value", 2, NULL((void*)0))); /* add value field */2231 }2232#line 2257 "./protobuf_lang_parser.c"2233 yy_destructor(yypParser,58,&yymsp[-8].minor);2234 yy_destructor(yypParser,56,&yymsp[-6].minor);2235 yy_destructor(yypParser,59,&yymsp[-4].minor);2236 yy_destructor(yypParser,24,&yymsp[-2].minor);2237 yy_destructor(yypParser,25,&yymsp[0].minor);2238}2239 break;2240 case 61: /* extend ::= PT_EXTEND messageType PT_LCURLY extendBody PT_RCURLY */2241{ yy_destructor(yypParser,16,&yymsp[-4].minor);2242#line 494 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2243{ yymsp[-4].minor.yy205 = NULL((void*)0); pbl_free_node(yymsp[-1].minor.yy205); }2244#line 2269 "./protobuf_lang_parser.c"2245 yy_destructor(yypParser,29,&yymsp[-2].minor);2246 yy_destructor(yypParser,30,&yymsp[0].minor);2247}2248 break;2249 case 66: /* intLit ::= PT_DECIMALLIT */2250#line 517 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2251{ yylhsminor.yy122 = g_ascii_strtoull(yymsp[0].minor.yy0->v, NULL((void*)0), 10); }2252#line 2277 "./protobuf_lang_parser.c"2253 yymsp[0].minor.yy122 = yylhsminor.yy122;2254 break;2255 case 67: /* intLit ::= PT_OCTALLIT */2256#line 518 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2257{ yylhsminor.yy122 = g_ascii_strtoull(yymsp[0].minor.yy0->v+1, NULL((void*)0), 8); }2258#line 2283 "./protobuf_lang_parser.c"2259 yymsp[0].minor.yy122 = yylhsminor.yy122;2260 break;2261 case 68: /* intLit ::= PT_HEXLIT */2262#line 519 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2263{ yylhsminor.yy122 = g_ascii_strtoull(yymsp[0].minor.yy0->v+2, NULL((void*)0), 16); }2264#line 2289 "./protobuf_lang_parser.c"2265 yymsp[0].minor.yy122 = yylhsminor.yy122;2266 break;2267 case 70: /* constant ::= intLit */2268#line 527 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2269{ yylhsminor.yy148 = pbl_store_string_token(state, ws_strdup_printf("%" PRIu64, yymsp[0].minor.yy122)wmem_strdup_printf(((void*)0), "%" "l" "u", yymsp[0].minor.yy122
)
); }2270#line 2295 "./protobuf_lang_parser.c"2271 yymsp[0].minor.yy148 = yylhsminor.yy148;2272 break;2273 case 71: /* constant ::= PT_PLUS intLit */2274{ yy_destructor(yypParser,40,&yymsp[-1].minor);2275#line 528 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2276{ yymsp[-1].minor.yy148 = pbl_store_string_token(state, ws_strdup_printf("%" PRIu64, yymsp[0].minor.yy122)wmem_strdup_printf(((void*)0), "%" "l" "u", yymsp[0].minor.yy122
)
); }2277#line 2302 "./protobuf_lang_parser.c"2278}2279 break;2280 case 72: /* constant ::= PT_MINUS intLit */2281{ yy_destructor(yypParser,41,&yymsp[-1].minor);2282#line 529 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2283{ yymsp[-1].minor.yy148 = pbl_store_string_token(state, ws_strdup_printf("-%" PRIu64, yymsp[0].minor.yy122)wmem_strdup_printf(((void*)0), "-%" "l" "u", yymsp[0].minor.yy122
)
); }2284#line 2309 "./protobuf_lang_parser.c"2285}2286 break;2287 case 73: /* constant ::= PT_PLUS exIdent */2288{ yy_destructor(yypParser,40,&yymsp[-1].minor);2289#line 530 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2290{ yymsp[-1].minor.yy148 = pbl_store_string_token(state, g_strconcat("+", yymsp[0].minor.yy140->v, NULL((void*)0))); }2291#line 2316 "./protobuf_lang_parser.c"2292}2293 break;2294 case 74: /* constant ::= PT_MINUS exIdent */2295{ yy_destructor(yypParser,41,&yymsp[-1].minor);2296#line 531 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2297{ yymsp[-1].minor.yy148 = pbl_store_string_token(state, g_strconcat("-", yymsp[0].minor.yy140->v, NULL((void*)0))); }2298#line 2323 "./protobuf_lang_parser.c"2299}2300 break;2301 case 75: /* strLit ::= PT_STRLIT */2302#line 535 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2303{ yylhsminor.yy148 = pbl_store_string_token(state, g_strndup(yymsp[0].minor.yy0->v + 1, strlen(yymsp[0].minor.yy0->v) - 2)); }2304#line 2329 "./protobuf_lang_parser.c"2305 yymsp[0].minor.yy148 = yylhsminor.yy148;2306 break;2307 case 76: /* strLit ::= strLit PT_STRLIT */2308#line 537 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2309{ gchar *v = g_strndup(yymsp[0].minor.yy0->v + 1, strlen(yymsp[0].minor.yy0->v) - 2); yylhsminor.yy148 = pbl_store_string_token(state, g_strconcat(yymsp[-1].minor.yy148, v, NULL((void*)0))); g_free(v); }2310#line 2335 "./protobuf_lang_parser.c"2311 yymsp[-1].minor.yy148 = yylhsminor.yy148;2312 break;2313 case 83: /* option ::= PT_OPTION optionName PT_ASSIGN constant PT_SEMICOLON */2314 case 84: /* option ::= PT_OPTION optionName PT_ASSIGN customOptionValue PT_SEMICOLON */ yytestcase(yyruleno==84);2315{ yy_destructor(yypParser,7,&yymsp[-4].minor);2316#line 199 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2317{2318}2319#line 2344 "./protobuf_lang_parser.c"2320 yy_destructor(yypParser,24,&yymsp[-2].minor);2321 yy_destructor(yypParser,25,&yymsp[0].minor);2322}2323 break;2324 case 87: /* customOptionValue ::= PT_LCURLY customOptionBody PT_RCURLY */2325{ yy_destructor(yypParser,29,&yymsp[-2].minor);2326#line 220 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2327{2328}2329#line 2354 "./protobuf_lang_parser.c"2330 yy_destructor(yypParser,30,&yymsp[0].minor);2331}2332 break;2333 case 90: /* customOptionBody ::= customOptionBody PT_STRLIT */2334#line 245 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2335{2336}2337#line 2362 "./protobuf_lang_parser.c"2338 yy_destructor(yypParser,31,&yymsp[0].minor);2339 break;2340 case 94: /* symbolsWithoutCurly ::= PT_LPAREN */2341{ yy_destructor(yypParser,26,&yymsp[0].minor);2342#line 250 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2343{2344}2345#line 2370 "./protobuf_lang_parser.c"2346}2347 break;2348 case 95: /* symbolsWithoutCurly ::= PT_RPAREN */2349{ yy_destructor(yypParser,27,&yymsp[0].minor);2350#line 251 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2351{2352}2353#line 2378 "./protobuf_lang_parser.c"2354}2355 break;2356 case 96: /* symbolsWithoutCurly ::= PT_LBRACKET */2357{ yy_destructor(yypParser,32,&yymsp[0].minor);2358#line 252 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2359{2360}2361#line 2386 "./protobuf_lang_parser.c"2362}2363 break;2364 case 97: /* symbolsWithoutCurly ::= PT_RBRACKET */2365{ yy_destructor(yypParser,33,&yymsp[0].minor);2366#line 253 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2367{2368}2369#line 2394 "./protobuf_lang_parser.c"2370}2371 break;2372 case 98: /* symbolsWithoutCurly ::= PT_EQUAL */2373{ yy_destructor(yypParser,34,&yymsp[0].minor);2374#line 254 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2375{2376}2377#line 2402 "./protobuf_lang_parser.c"2378}2379 break;2380 case 99: /* symbolsWithoutCurly ::= PT_NOTEQUAL */2381{ yy_destructor(yypParser,35,&yymsp[0].minor);2382#line 255 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2383{2384}2385#line 2410 "./protobuf_lang_parser.c"2386}2387 break;2388 case 100: /* symbolsWithoutCurly ::= PT_NOTEQUAL2 */2389{ yy_destructor(yypParser,36,&yymsp[0].minor);2390#line 256 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2391{2392}2393#line 2418 "./protobuf_lang_parser.c"2394}2395 break;2396 case 101: /* symbolsWithoutCurly ::= PT_GEQUAL */2397{ yy_destructor(yypParser,37,&yymsp[0].minor);2398#line 257 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2399{2400}2401#line 2426 "./protobuf_lang_parser.c"2402}2403 break;2404 case 102: /* symbolsWithoutCurly ::= PT_LEQUAL */2405{ yy_destructor(yypParser,38,&yymsp[0].minor);2406#line 258 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2407{2408}2409#line 2434 "./protobuf_lang_parser.c"2410}2411 break;2412 case 103: /* symbolsWithoutCurly ::= PT_ASSIGN_PLUS */2413{ yy_destructor(yypParser,39,&yymsp[0].minor);2414#line 259 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2415{2416}2417#line 2442 "./protobuf_lang_parser.c"2418}2419 break;2420 case 104: /* symbolsWithoutCurly ::= PT_ASSIGN */2421{ yy_destructor(yypParser,24,&yymsp[0].minor);2422#line 260 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2423{2424}2425#line 2450 "./protobuf_lang_parser.c"2426}2427 break;2428 case 105: /* symbolsWithoutCurly ::= PT_PLUS */2429{ yy_destructor(yypParser,40,&yymsp[0].minor);2430#line 261 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2431{2432}2433#line 2458 "./protobuf_lang_parser.c"2434}2435 break;2436 case 106: /* symbolsWithoutCurly ::= PT_MINUS */2437{ yy_destructor(yypParser,41,&yymsp[0].minor);2438#line 262 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2439{2440}2441#line 2466 "./protobuf_lang_parser.c"2442}2443 break;2444 case 107: /* symbolsWithoutCurly ::= PT_MULTIPLY */2445{ yy_destructor(yypParser,42,&yymsp[0].minor);2446#line 263 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2447{2448}2449#line 2474 "./protobuf_lang_parser.c"2450}2451 break;2452 case 108: /* symbolsWithoutCurly ::= PT_DIV */2453{ yy_destructor(yypParser,43,&yymsp[0].minor);2454#line 264 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2455{2456}2457#line 2482 "./protobuf_lang_parser.c"2458}2459 break;2460 case 109: /* symbolsWithoutCurly ::= PT_LOGIC_OR */2461{ yy_destructor(yypParser,44,&yymsp[0].minor);2462#line 265 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2463{2464}2465#line 2490 "./protobuf_lang_parser.c"2466}2467 break;2468 case 110: /* symbolsWithoutCurly ::= PT_OR */2469{ yy_destructor(yypParser,45,&yymsp[0].minor);2470#line 266 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2471{2472}2473#line 2498 "./protobuf_lang_parser.c"2474}2475 break;2476 case 111: /* symbolsWithoutCurly ::= PT_LOGIC_AND */2477{ yy_destructor(yypParser,46,&yymsp[0].minor);2478#line 267 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2479{2480}2481#line 2506 "./protobuf_lang_parser.c"2482}2483 break;2484 case 112: /* symbolsWithoutCurly ::= PT_AND */2485{ yy_destructor(yypParser,47,&yymsp[0].minor);2486#line 268 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2487{2488}2489#line 2514 "./protobuf_lang_parser.c"2490}2491 break;2492 case 113: /* symbolsWithoutCurly ::= PT_NOT */2493{ yy_destructor(yypParser,48,&yymsp[0].minor);2494#line 269 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2495{2496}2497#line 2522 "./protobuf_lang_parser.c"2498}2499 break;2500 case 114: /* symbolsWithoutCurly ::= PT_NEG */2501{ yy_destructor(yypParser,49,&yymsp[0].minor);2502#line 270 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2503{2504}2505#line 2530 "./protobuf_lang_parser.c"2506}2507 break;2508 case 115: /* symbolsWithoutCurly ::= PT_XOR */2509{ yy_destructor(yypParser,50,&yymsp[0].minor);2510#line 271 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2511{2512}2513#line 2538 "./protobuf_lang_parser.c"2514}2515 break;2516 case 116: /* symbolsWithoutCurly ::= PT_SHL */2517{ yy_destructor(yypParser,51,&yymsp[0].minor);2518#line 272 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2519{2520}2521#line 2546 "./protobuf_lang_parser.c"2522}2523 break;2524 case 117: /* symbolsWithoutCurly ::= PT_SHR */2525{ yy_destructor(yypParser,52,&yymsp[0].minor);2526#line 273 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2527{2528}2529#line 2554 "./protobuf_lang_parser.c"2530}2531 break;2532 case 118: /* symbolsWithoutCurly ::= PT_PERCENT */2533{ yy_destructor(yypParser,53,&yymsp[0].minor);2534#line 274 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2535{2536}2537#line 2562 "./protobuf_lang_parser.c"2538}2539 break;2540 case 119: /* symbolsWithoutCurly ::= PT_DOLLAR */2541{ yy_destructor(yypParser,54,&yymsp[0].minor);2542#line 275 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2543{2544}2545#line 2570 "./protobuf_lang_parser.c"2546}2547 break;2548 case 120: /* symbolsWithoutCurly ::= PT_COND */2549{ yy_destructor(yypParser,55,&yymsp[0].minor);2550#line 276 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2551{2552}2553#line 2578 "./protobuf_lang_parser.c"2554}2555 break;2556 case 121: /* symbolsWithoutCurly ::= PT_SEMICOLON */2557 case 178: /* emptyStatement ::= PT_SEMICOLON */ yytestcase(yyruleno==178);2558{ yy_destructor(yypParser,25,&yymsp[0].minor);2559#line 277 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2560{2561}2562#line 2587 "./protobuf_lang_parser.c"2563}2564 break;2565 case 122: /* symbolsWithoutCurly ::= PT_DOT */2566{ yy_destructor(yypParser,28,&yymsp[0].minor);2567#line 278 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2568{2569}2570#line 2595 "./protobuf_lang_parser.c"2571}2572 break;2573 case 123: /* symbolsWithoutCurly ::= PT_COMMA */2574{ yy_destructor(yypParser,56,&yymsp[0].minor);2575#line 279 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2576{2577}2578#line 2603 "./protobuf_lang_parser.c"2579}2580 break;2581 case 124: /* symbolsWithoutCurly ::= PT_COLON */2582{ yy_destructor(yypParser,57,&yymsp[0].minor);2583#line 280 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2584{2585}2586#line 2611 "./protobuf_lang_parser.c"2587}2588 break;2589 case 125: /* symbolsWithoutCurly ::= PT_LESS */2590{ yy_destructor(yypParser,58,&yymsp[0].minor);2591#line 281 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2592{2593}2594#line 2619 "./protobuf_lang_parser.c"2595}2596 break;2597 case 126: /* symbolsWithoutCurly ::= PT_GREATER */2598{ yy_destructor(yypParser,59,&yymsp[0].minor);2599#line 282 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2600{2601}2602#line 2627 "./protobuf_lang_parser.c"2603}2604 break;2605 case 140: /* enumValueOptions ::= enumValueOptions PT_COMMA enumValueOption */2606 case 163: /* ranges ::= ranges PT_COMMA range */ yytestcase(yyruleno==163);2607 case 168: /* quoteFieldNames ::= quoteFieldNames PT_COMMA strLit */ yytestcase(yyruleno==168);2608#line 335 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2609{2610}2611#line 2636 "./protobuf_lang_parser.c"2612 yy_destructor(yypParser,56,&yymsp[-1].minor);2613 break;2614 case 141: /* enumValueOption ::= optionName PT_ASSIGN constant */2615 case 142: /* enumValueOption ::= optionName PT_ASSIGN customOptionValue */ yytestcase(yyruleno==142);2616#line 339 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2617{2618}2619#line 2644 "./protobuf_lang_parser.c"2620 yy_destructor(yypParser,24,&yymsp[-1].minor);2621 break;2622 case 145: /* rpc ::= rpcDecl PT_SEMICOLON */2623 case 150: /* stream ::= streamDecl PT_SEMICOLON */ yytestcase(yyruleno==150);2624#line 354 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2625{2626}2627#line 2652 "./protobuf_lang_parser.c"2628 yy_destructor(yypParser,25,&yymsp[0].minor);2629 break;2630 case 146: /* rpc ::= rpcDecl PT_LCURLY rpcBody PT_RCURLY */2631 case 151: /* stream ::= streamDecl PT_LCURLY streamBody PT_RCURLY */ yytestcase(yyruleno==151);2632#line 355 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2633{2634}2635#line 2660 "./protobuf_lang_parser.c"2636 yy_destructor(yypParser,29,&yymsp[-2].minor);2637 yy_destructor(yypParser,30,&yymsp[0].minor);2638 break;2639 case 159: /* extensions ::= PT_EXTENSIONS ranges PT_SEMICOLON */2640{ yy_destructor(yypParser,17,&yymsp[-2].minor);2641#line 468 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2642{2643}2644#line 2669 "./protobuf_lang_parser.c"2645 yy_destructor(yypParser,25,&yymsp[0].minor);2646}2647 break;2648 case 160: /* reserved ::= PT_RESERVED ranges PT_SEMICOLON */2649 case 161: /* reserved ::= PT_RESERVED quoteFieldNames PT_SEMICOLON */ yytestcase(yyruleno==161);2650{ yy_destructor(yypParser,13,&yymsp[-2].minor);2651#line 471 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2652{2653}2654#line 2679 "./protobuf_lang_parser.c"2655 yy_destructor(yypParser,25,&yymsp[0].minor);2656}2657 break;2658 case 165: /* range ::= intLit PT_TO intLit */2659 case 166: /* range ::= intLit PT_TO exIdent */ yytestcase(yyruleno==166);2660#line 480 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2661{2662}2663#line 2688 "./protobuf_lang_parser.c"2664 yy_destructor(yypParser,23,&yymsp[-1].minor);2665 break;2666 case 180: /* exIdent ::= PT_IDENT */2667{ yy_destructor(yypParser,1,&yymsp[0].minor);2668#line 533 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2669{2670}2671#line 2696 "./protobuf_lang_parser.c"2672}2673 break;2674 default:2675 /* (77) proto ::= wholeProtoBody */ yytestcase(yyruleno==77);2676 /* (78) proto ::= syntax wholeProtoBody */ yytestcase(yyruleno==78);2677 /* (79) protoBody ::= protoBody import */ yytestcase(yyruleno==79);2678 /* (80) protoBody ::= protoBody package */ yytestcase(yyruleno==80);2679 /* (81) protoBody ::= protoBody option */ yytestcase(yyruleno==81);2680 /* (82) protoBody ::= protoBody emptyStatement */ yytestcase(yyruleno==82);2681 /* (85) optionName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=85)((void) sizeof ((yyruleno!=85) ? 1 : 0), __extension__ ({ if (
yyruleno!=85) ; else __assert_fail ("yyruleno!=85", "protobuf_lang_parser.c"
, 2705, __extension__ __PRETTY_FUNCTION__); }))
;2682 /* (86) optionName ::= extIdentInParentheses (OPTIMIZED OUT) */ assert(yyruleno!=86)((void) sizeof ((yyruleno!=86) ? 1 : 0), __extension__ ({ if (
yyruleno!=86) ; else __assert_fail ("yyruleno!=86", "protobuf_lang_parser.c"
, 2706, __extension__ __PRETTY_FUNCTION__); }))
;2683 /* (88) customOptionBody ::= */ yytestcase(yyruleno==88);2684 /* (89) customOptionBody ::= customOptionBody exIdent */ yytestcase(yyruleno==89);2685 /* (91) customOptionBody ::= customOptionBody symbolsWithoutCurly */ yytestcase(yyruleno==91);2686 /* (92) customOptionBody ::= customOptionBody intLit */ yytestcase(yyruleno==92);2687 /* (93) customOptionBody ::= customOptionBody customOptionValue */ yytestcase(yyruleno==93);2688 /* (127) topLevelDef ::= message (OPTIMIZED OUT) */ assert(yyruleno!=127)((void) sizeof ((yyruleno!=127) ? 1 : 0), __extension__ ({ if
(yyruleno!=127) ; else __assert_fail ("yyruleno!=127", "protobuf_lang_parser.c"
, 2712, __extension__ __PRETTY_FUNCTION__); }))
;2689 /* (128) topLevelDef ::= enum (OPTIMIZED OUT) */ assert(yyruleno!=128)((void) sizeof ((yyruleno!=128) ? 1 : 0), __extension__ ({ if
(yyruleno!=128) ; else __assert_fail ("yyruleno!=128", "protobuf_lang_parser.c"
, 2713, __extension__ __PRETTY_FUNCTION__); }))
;2690 /* (129) topLevelDef ::= extend (OPTIMIZED OUT) */ assert(yyruleno!=129)((void) sizeof ((yyruleno!=129) ? 1 : 0), __extension__ ({ if
(yyruleno!=129) ; else __assert_fail ("yyruleno!=129", "protobuf_lang_parser.c"
, 2714, __extension__ __PRETTY_FUNCTION__); }))
;2691 /* (130) topLevelDef ::= service (OPTIMIZED OUT) */ assert(yyruleno!=130)((void) sizeof ((yyruleno!=130) ? 1 : 0), __extension__ ({ if
(yyruleno!=130) ; else __assert_fail ("yyruleno!=130", "protobuf_lang_parser.c"
, 2715, __extension__ __PRETTY_FUNCTION__); }))
;2692 /* (131) messageBody ::= messageBody extend */ yytestcase(yyruleno==131);2693 /* (132) messageBody ::= messageBody extensions */ yytestcase(yyruleno==132);2694 /* (133) messageBody ::= messageBody option */ yytestcase(yyruleno==133);2695 /* (134) messageBody ::= messageBody reserved */ yytestcase(yyruleno==134);2696 /* (135) messageBody ::= messageBody emptyStatement */ yytestcase(yyruleno==135);2697 /* (136) enumBody ::= enumBody reserved */ yytestcase(yyruleno==136);2698 /* (137) enumBody ::= enumBody option */ yytestcase(yyruleno==137);2699 /* (138) enumBody ::= enumBody emptyStatement */ yytestcase(yyruleno==138);2700 /* (139) enumValueOptions ::= enumValueOption (OPTIMIZED OUT) */ assert(yyruleno!=139)((void) sizeof ((yyruleno!=139) ? 1 : 0), __extension__ ({ if
(yyruleno!=139) ; else __assert_fail ("yyruleno!=139", "protobuf_lang_parser.c"
, 2724, __extension__ __PRETTY_FUNCTION__); }))
;2701 /* (143) serviceBody ::= serviceBody option */ yytestcase(yyruleno==143);2702 /* (144) serviceBody ::= serviceBody emptyStatement */ yytestcase(yyruleno==144);2703 /* (147) rpcBody ::= */ yytestcase(yyruleno==147);2704 /* (148) rpcBody ::= rpcBody option */ yytestcase(yyruleno==148);2705 /* (149) rpcBody ::= rpcBody emptyStatement */ yytestcase(yyruleno==149);2706 /* (152) streamBody ::= */ yytestcase(yyruleno==152);2707 /* (153) streamBody ::= streamBody option */ yytestcase(yyruleno==153);2708 /* (154) streamBody ::= streamBody emptyStatement */ yytestcase(yyruleno==154);2709 /* (155) groupName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=155)((void) sizeof ((yyruleno!=155) ? 1 : 0), __extension__ ({ if
(yyruleno!=155) ; else __assert_fail ("yyruleno!=155", "protobuf_lang_parser.c"
, 2733, __extension__ __PRETTY_FUNCTION__); }))
;2710 /* (156) oneofBody ::= oneofBody option */ yytestcase(yyruleno==156);2711 /* (157) oneofBody ::= oneofBody group */ yytestcase(yyruleno==157);2712 /* (158) oneofBody ::= oneofBody emptyStatement */ yytestcase(yyruleno==158);2713 /* (162) ranges ::= range (OPTIMIZED OUT) */ assert(yyruleno!=162)((void) sizeof ((yyruleno!=162) ? 1 : 0), __extension__ ({ if
(yyruleno!=162) ; else __assert_fail ("yyruleno!=162", "protobuf_lang_parser.c"
, 2737, __extension__ __PRETTY_FUNCTION__); }))
;2714 /* (164) range ::= intLit */ yytestcase(yyruleno==164);2715 /* (167) quoteFieldNames ::= strLit */ yytestcase(yyruleno==167);2716 /* (169) extendBody ::= extendBody emptyStatement */ yytestcase(yyruleno==169);2717 /* (170) messageName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=170)((void) sizeof ((yyruleno!=170) ? 1 : 0), __extension__ ({ if
(yyruleno!=170) ; else __assert_fail ("yyruleno!=170", "protobuf_lang_parser.c"
, 2741, __extension__ __PRETTY_FUNCTION__); }))
;2718 /* (171) enumName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=171)((void) sizeof ((yyruleno!=171) ? 1 : 0), __extension__ ({ if
(yyruleno!=171) ; else __assert_fail ("yyruleno!=171", "protobuf_lang_parser.c"
, 2742, __extension__ __PRETTY_FUNCTION__); }))
;2719 /* (172) streamName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=172)((void) sizeof ((yyruleno!=172) ? 1 : 0), __extension__ ({ if
(yyruleno!=172) ; else __assert_fail ("yyruleno!=172", "protobuf_lang_parser.c"
, 2743, __extension__ __PRETTY_FUNCTION__); }))
;2720 /* (173) fieldName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=173)((void) sizeof ((yyruleno!=173) ? 1 : 0), __extension__ ({ if
(yyruleno!=173) ; else __assert_fail ("yyruleno!=173", "protobuf_lang_parser.c"
, 2744, __extension__ __PRETTY_FUNCTION__); }))
;2721 /* (174) oneofName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=174)((void) sizeof ((yyruleno!=174) ? 1 : 0), __extension__ ({ if
(yyruleno!=174) ; else __assert_fail ("yyruleno!=174", "protobuf_lang_parser.c"
, 2745, __extension__ __PRETTY_FUNCTION__); }))
;2722 /* (175) mapName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=175)((void) sizeof ((yyruleno!=175) ? 1 : 0), __extension__ ({ if
(yyruleno!=175) ; else __assert_fail ("yyruleno!=175", "protobuf_lang_parser.c"
, 2746, __extension__ __PRETTY_FUNCTION__); }))
;2723 /* (176) serviceName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=176)((void) sizeof ((yyruleno!=176) ? 1 : 0), __extension__ ({ if
(yyruleno!=176) ; else __assert_fail ("yyruleno!=176", "protobuf_lang_parser.c"
, 2747, __extension__ __PRETTY_FUNCTION__); }))
;2724 /* (177) rpcName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=177)((void) sizeof ((yyruleno!=177) ? 1 : 0), __extension__ ({ if
(yyruleno!=177) ; else __assert_fail ("yyruleno!=177", "protobuf_lang_parser.c"
, 2748, __extension__ __PRETTY_FUNCTION__); }))
;2725 /* (179) constant ::= strLit */ yytestcase(yyruleno==179);2726 break;2727/********** End reduce actions ************************************************/2728 };2729 assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) )((void) sizeof ((yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs
[0])) ? 1 : 0), __extension__ ({ if (yyruleno<sizeof(yyRuleInfoLhs
)/sizeof(yyRuleInfoLhs[0])) ; else __assert_fail ("yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0])"
, "protobuf_lang_parser.c", 2753, __extension__ __PRETTY_FUNCTION__
); }))
;2730 yygoto = yyRuleInfoLhs[yyruleno];2731 yysize = yyRuleInfoNRhs[yyruleno];2732 yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPEunsigned char)yygoto);2733 2734 /* There are no SHIFTREDUCE actions on nonterminals because the table2735 ** generator has simplified them to pure REDUCE actions. */2736 assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) )((void) sizeof ((!(yyact>151 && yyact<=496)) ? 1
: 0), __extension__ ({ if (!(yyact>151 && yyact<=
496)) ; else __assert_fail ("!(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE)"
, "protobuf_lang_parser.c", 2760, __extension__ __PRETTY_FUNCTION__
); }))
;2737 2738 /* It is not possible for a REDUCE to be followed by an error */2739 assert( yyact!=YY_ERROR_ACTION )((void) sizeof ((yyact!=497) ? 1 : 0), __extension__ ({ if (yyact
!=497) ; else __assert_fail ("yyact!=YY_ERROR_ACTION", "protobuf_lang_parser.c"
, 2763, __extension__ __PRETTY_FUNCTION__); }))
;2740 2741 yymsp += yysize+1;2742 yypParser->yytos = yymsp;2743 yymsp->stateno = (YYACTIONTYPEunsigned short int)yyact;2744 yymsp->major = (YYCODETYPEunsigned char)yygoto;2745 yyTraceShift(yypParser, yyact, "... then shift");2746 return yyact;2747}2748 2749/*2750** The following code executes when the parse fails2751*/2752#ifndef YYNOERRORRECOVERY2753static void yy_parse_failed(2754 yyParser *yypParser /* The parser */2755){2756 ProtobufLangParserARG_FETCHprotobuf_lang_state_t *state =yypParser->state ;2757 ProtobufLangParserCTX_FETCH2758#ifndef NDEBUG2759 if( yyTraceFILE ){2760 fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);2761 }2762#endif2763 while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);2764 /* Here code is inserted which will be executed whenever the2765 ** parser fails */2766/************ Begin %parse_failure code ***************************************/2767#line 75 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2768 2769 pbl_parser_error(state, "Parse Error");2770 state->grammar_error = TRUE(!(0));2771#line 2796 "./protobuf_lang_parser.c"2772/************ End %parse_failure code *****************************************/2773 ProtobufLangParserARG_STOREyypParser->state =state ; /* Suppress warning about unused %extra_argument variable */2774 ProtobufLangParserCTX_STORE2775}2776#endif /* YYNOERRORRECOVERY */2777 2778/*2779** The following code executes when a syntax error first occurs.2780*/2781static void yy_syntax_error(2782 yyParser *yypParser, /* The parser */2783 int yymajor, /* The major type of the error token */2784 ProtobufLangParserTOKENTYPEprotobuf_lang_token_t* yyminor /* The minor type of the error token */2785){2786 ProtobufLangParserARG_FETCHprotobuf_lang_state_t *state =yypParser->state ;2787 ProtobufLangParserCTX_FETCH2788#define TOKENyyminor yyminor2789/************ Begin %syntax_error code ****************************************/2790#line 70 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"2791 2792 pbl_parser_error(state, "Syntax Error: unexpected token \"%s\"!", yyminor->v);

33

Access to field 'v' results in a dereference of a null pointer (loaded from variable 'yyminor')
2793 state->grammar_error = TRUE(!(0));2794#line 2819 "./protobuf_lang_parser.c"2795/************ End %syntax_error code ******************************************/2796 ProtobufLangParserARG_STOREyypParser->state =state ; /* Suppress warning about unused %extra_argument variable */2797 ProtobufLangParserCTX_STORE2798}2799 2800/*2801** The following is executed when the parser accepts2802*/2803static void yy_accept(2804 yyParser *yypParser /* The parser */2805){2806 ProtobufLangParserARG_FETCHprotobuf_lang_state_t *state =yypParser->state ;2807 ProtobufLangParserCTX_FETCH2808#ifndef NDEBUG2809 if( yyTraceFILE ){2810 fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);2811 }2812#endif2813#ifndef YYNOERRORRECOVERY2814 yypParser->yyerrcnt = -1;2815#endif2816 assert( yypParser->yytos==yypParser->yystack )((void) sizeof ((yypParser->yytos==yypParser->yystack) ?
1 : 0), __extension__ ({ if (yypParser->yytos==yypParser->
yystack) ; else __assert_fail ("yypParser->yytos==yypParser->yystack"
, "protobuf_lang_parser.c", 2840, __extension__ __PRETTY_FUNCTION__
); }))
;2817 /* Here code is inserted which will be executed whenever the2818 ** parser accepts */2819/*********** Begin %parse_accept code *****************************************/2820/*********** End %parse_accept code *******************************************/2821 ProtobufLangParserARG_STOREyypParser->state =state ; /* Suppress warning about unused %extra_argument variable */2822 ProtobufLangParserCTX_STORE2823}2824 2825/* The main parser program.2826** The first argument is a pointer to a structure obtained from2827** "ProtobufLangParserAlloc" which describes the current state of the parser.2828** The second argument is the major token number. The third is2829** the minor token. The fourth optional argument is whatever the2830** user wants (and specified in the grammar) and is available for2831** use by the action routines.2832**2833** Inputs:2834** <ul>2835** <li> A pointer to the parser (an opaque structure.)2836** <li> The major token number.2837** <li> The minor token number.2838** <li> An option argument of a grammar-specified type.2839** </ul>2840**2841** Outputs:2842** None.2843*/2844void ProtobufLangParser(2845 void *yyp, /* The parser */2846 int yymajor, /* The major token code number */2847 ProtobufLangParserTOKENTYPEprotobuf_lang_token_t* yyminor /* The value for the token */2848 ProtobufLangParserARG_PDECL, protobuf_lang_state_t *state /* Optional %extra_argument parameter */2849){2850 YYMINORTYPE yyminorunion;2851 YYACTIONTYPEunsigned short int yyact; /* The parser action. */2852#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)2853 int yyendofinput; /* True if we are at the end of input */2854#endif2855#ifdef YYERRORSYMBOL2856 int yyerrorhit = 0; /* True if yymajor has invoked an error */2857#endif2858 yyParser *yypParser = (yyParser*)yyp; /* The parser */2859 ProtobufLangParserCTX_FETCH2860 ProtobufLangParserARG_STOREyypParser->state =state ;2861 2862 assert( yypParser->yytos!=0 )((void) sizeof ((yypParser->yytos!=0) ? 1 : 0), __extension__
({ if (yypParser->yytos!=0) ; else __assert_fail ("yypParser->yytos!=0"
, "protobuf_lang_parser.c", 2886, __extension__ __PRETTY_FUNCTION__
); }))
;

12

Assuming field 'yytos' is not equal to null

13

Taking true branch

2863#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)2864 yyendofinput = (yymajor==0);2865#endif2866 2867 yyact = yypParser->yytos->stateno;2868#ifndef NDEBUG2869 if( yyTraceFILE ){

14

Assuming 'yyTraceFILE' is null

15

Taking false branch

2870 if( yyact < YY_MIN_REDUCE500 ){2871 fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",2872 yyTracePrompt,yyTokenName[yymajor],yyact);2873 }else{2874 fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",2875 yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE500);2876 }2877 }2878#endif2879 2880 while(1){ /* Exit by "break" */

16

Loop condition is true. Entering loop body

2881 assert( yypParser->yytos>=yypParser->yystack )((void) sizeof ((yypParser->yytos>=yypParser->yystack
) ? 1 : 0), __extension__ ({ if (yypParser->yytos>=yypParser
->yystack) ; else __assert_fail ("yypParser->yytos>=yypParser->yystack"
, "protobuf_lang_parser.c", 2905, __extension__ __PRETTY_FUNCTION__
); }))
;

18

Taking true branch

2882 assert( yyact==yypParser->yytos->stateno )((void) sizeof ((yyact==yypParser->yytos->stateno) ? 1 :
0), __extension__ ({ if (yyact==yypParser->yytos->stateno
) ; else __assert_fail ("yyact==yypParser->yytos->stateno"
, "protobuf_lang_parser.c", 2906, __extension__ __PRETTY_FUNCTION__
); }))
;

19

Taking true branch

2883 yyact = yy_find_shift_action((YYCODETYPEunsigned char)yymajor,yyact);2884 if( yyact >= YY_MIN_REDUCE500 ){

20

Assuming 'yyact' is < YY_MIN_REDUCE

21

Taking false branch

2885 unsigned int yyruleno = yyact - YY_MIN_REDUCE500; /* Reduce by this rule */2886#ifndef NDEBUG2887 assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) )((void) sizeof ((yyruleno<(int)(sizeof(yyRuleName)/sizeof(
yyRuleName[0]))) ? 1 : 0), __extension__ ({ if (yyruleno<(
int)(sizeof(yyRuleName)/sizeof(yyRuleName[0]))) ; else __assert_fail
("yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0]))"
, "protobuf_lang_parser.c", 2911, __extension__ __PRETTY_FUNCTION__
); }))
;2888 if( yyTraceFILE ){2889 int yysize = yyRuleInfoNRhs[yyruleno];2890 if( yysize ){2891 fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",2892 yyTracePrompt,2893 yyruleno, yyRuleName[yyruleno],2894 yyruleno<YYNRULE_WITH_ACTION77 ? "" : " without external action",2895 yypParser->yytos[yysize].stateno);2896 }else{2897 fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",2898 yyTracePrompt, yyruleno, yyRuleName[yyruleno],2899 yyruleno<YYNRULE_WITH_ACTION77 ? "" : " without external action");2900 }2901 }2902#endif /* NDEBUG */2903 2904 /* Check that the stack is large enough to grow by a single entry2905 ** if the RHS of the rule is empty. This ensures that there is room2906 ** enough on the stack to push the LHS value */2907 if( yyRuleInfoNRhs[yyruleno]==0 ){2908#ifdef YYTRACKMAXSTACKDEPTH2909 if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){2910 yypParser->yyhwm++;2911 assert( yypParser->yyhwm ==((void) sizeof ((yypParser->yyhwm == (int)(yypParser->yytos
- yypParser->yystack)) ? 1 : 0), __extension__ ({ if (yypParser
->yyhwm == (int)(yypParser->yytos - yypParser->yystack
)) ; else __assert_fail ("yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)"
, "protobuf_lang_parser.c", 2936, __extension__ __PRETTY_FUNCTION__
); }))
2912 (int)(yypParser->yytos - yypParser->yystack))((void) sizeof ((yypParser->yyhwm == (int)(yypParser->yytos
- yypParser->yystack)) ? 1 : 0), __extension__ ({ if (yypParser
->yyhwm == (int)(yypParser->yytos - yypParser->yystack
)) ; else __assert_fail ("yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)"
, "protobuf_lang_parser.c", 2936, __extension__ __PRETTY_FUNCTION__
); }))
;2913 }2914#endif2915#if YYSTACKDEPTH100>02916 if( yypParser->yytos>=yypParser->yystackEnd ){2917 yyStackOverflow(yypParser);2918 break;2919 }2920#else2921 if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){2922 if( yyGrowStack(yypParser) ){2923 yyStackOverflow(yypParser);2924 break;2925 }2926 }2927#endif2928 }2929 yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ProtobufLangParserCTX_PARAM);2930 }else if( yyact <= YY_MAX_SHIFTREDUCE496 ){

22

Assuming 'yyact' is > YY_MAX_SHIFTREDUCE

23

Taking false branch

2931 yy_shift(yypParser,yyact,(YYCODETYPEunsigned char)yymajor,yyminor);2932#ifndef YYNOERRORRECOVERY2933 yypParser->yyerrcnt--;2934#endif2935 break;2936 }else if( yyact==YY_ACCEPT_ACTION498 ){

24

Assuming 'yyact' is not equal to YY_ACCEPT_ACTION

25

Taking false branch

2937 yypParser->yytos--;2938 yy_accept(yypParser);2939 return;2940 }else{2941 assert( yyact == YY_ERROR_ACTION )((void) sizeof ((yyact == 497) ? 1 : 0), __extension__ ({ if (
yyact == 497) ; else __assert_fail ("yyact == YY_ERROR_ACTION"
, "protobuf_lang_parser.c", 2965, __extension__ __PRETTY_FUNCTION__
); }))
;

26

Assuming 'yyact' is equal to 497

27

Taking true branch

2942 yyminorunion.yy0 = yyminor;2943#ifdef YYERRORSYMBOL2944 int yymx;2945#endif2946#ifndef NDEBUG2947 if( yyTraceFILE

27.1

'yyTraceFILE' is null
){

28

Taking false branch

2948 fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);2949 }2950#endif2951#ifdef YYERRORSYMBOL2952 /* A syntax error has occurred.2953 ** The response to an error depends upon whether or not the2954 ** grammar defines an error token "ERROR".2955 **2956 ** This is what we do if the grammar does define ERROR:2957 **2958 ** * Call the %syntax_error function.2959 **2960 ** * Begin popping the stack until we enter a state where2961 ** it is legal to shift the error symbol, then shift2962 ** the error symbol.2963 **2964 ** * Set the error count to three.2965 **2966 ** * Begin accepting and shifting new tokens. No new error2967 ** processing will occur until three tokens have been2968 ** shifted successfully.2969 **2970 */2971 if( yypParser->yyerrcnt<0 ){2972 yy_syntax_error(yypParser,yymajor,yyminor);2973 }2974 yymx = yypParser->yytos->major;2975 if( yymx==YYERRORSYMBOL || yyerrorhit ){2976#ifndef NDEBUG2977 if( yyTraceFILE ){2978 fprintf(yyTraceFILE,"%sDiscard input token %s\n",2979 yyTracePrompt,yyTokenName[yymajor]);2980 }2981#endif2982 yy_destructor(yypParser, (YYCODETYPEunsigned char)yymajor, &yyminorunion);2983 yymajor = YYNOCODE126;2984 }else{2985 while( yypParser->yytos > yypParser->yystack ){2986 yyact = yy_find_reduce_action(yypParser->yytos->stateno,2987 YYERRORSYMBOL);2988 if( yyact<=YY_MAX_SHIFTREDUCE496 ) break;2989 yy_pop_parser_stack(yypParser);2990 }2991 if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){2992 yy_destructor(yypParser,(YYCODETYPEunsigned char)yymajor,&yyminorunion);2993 yy_parse_failed(yypParser);2994#ifndef YYNOERRORRECOVERY2995 yypParser->yyerrcnt = -1;2996#endif2997 yymajor = YYNOCODE126;2998 }else if( yymx!=YYERRORSYMBOL ){2999 yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);3000 }3001 }3002 yypParser->yyerrcnt = 3;3003 yyerrorhit = 1;3004 if( yymajor==YYNOCODE126 ) break;3005 yyact = yypParser->yytos->stateno;3006#elif defined(YYNOERRORRECOVERY)3007 /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to3008 ** do any kind of error recovery. Instead, simply invoke the syntax3009 ** error routine and continue going as if nothing had happened.3010 **3011 ** Applications can set this macro (for example inside %include) if3012 ** they intend to abandon the parse upon the first syntax error seen.3013 */3014 yy_syntax_error(yypParser,yymajor, yyminor);3015 yy_destructor(yypParser,(YYCODETYPEunsigned char)yymajor,&yyminorunion);3016 break;3017#else /* YYERRORSYMBOL is not defined */3018 /* This is what we do if the grammar does not define ERROR:3019 **3020 ** * Report an error message, and throw away the input token.3021 **3022 ** * If the input token is $, then fail the parse.3023 **3024 ** As before, subsequent error messages are suppressed until3025 ** three input tokens have been successfully shifted.3026 */3027 if( yypParser->yyerrcnt<=0 ){

29

Assuming field 'yyerrcnt' is <= 0

30

Taking true branch

3028 yy_syntax_error(yypParser,yymajor, yyminor);

31

Passing null pointer value via 3rd parameter 'yyminor'

32

Calling 'yy_syntax_error'

3029 }3030 yypParser->yyerrcnt = 3;3031 yy_destructor(yypParser,(YYCODETYPEunsigned char)yymajor,&yyminorunion);3032 if( yyendofinput ){3033 yy_parse_failed(yypParser);3034#ifndef YYNOERRORRECOVERY3035 yypParser->yyerrcnt = -1;3036#endif3037 }3038 break;3039#endif3040 }3041 }3042#ifndef NDEBUG3043 if( yyTraceFILE ){3044 yyStackEntry *i;3045 char cDiv = '[';3046 fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);3047 for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){3048 fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);3049 cDiv = ' ';3050 }3051 fprintf(yyTraceFILE,"]\n");3052 }3053#endif3054 return;3055}3056 3057/*3058** Return the fallback token corresponding to canonical token iToken, or3059** 0 if iToken has no fallback.3060*/3061int ProtobufLangParserFallback(int iToken){3062#ifdef YYFALLBACK13063 assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) )((void) sizeof ((iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback
[0]))) ? 1 : 0), __extension__ ({ if (iToken<(int)(sizeof(
yyFallback)/sizeof(yyFallback[0]))) ; else __assert_fail ("iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0]))"
, "protobuf_lang_parser.c", 3087, __extension__ __PRETTY_FUNCTION__
); }))
;3064 return yyFallback[iToken];3065#else3066 (void)iToken;3067 return 0;3068#endif3069}3070#line 54 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"3071 3072DIAG_ON_LEMON()clang diagnostic pop3073#line 539 "/builds/wireshark/wireshark/epan/protobuf_lang_parser.lemon"3074 3075 3076void3077protobuf_lang_error(void* yyscanner, protobuf_lang_state_t *state, const char *msg)3078{3079 int lineno;3080 void(*error_cb)(const char *format, ...);3081 const char* filepath = (state && state->file) ?3082 state->file->filename : "UNKNOWN";3083 3084 error_cb = (state && state->pool->error_cb) ?3085 state->pool->error_cb : pbl_printf;3086 3087 lineno = yyscanner ? protobuf_lang_get_lineno(yyscanner) : -1;3088 3089 if (lineno > -1) {3090 error_cb("Protobuf: Parsing file [%s:%d] failed: %s\n", filepath, lineno, msg);3091 } else {3092 error_cb("Protobuf: Parsing file [%s] failed: %s\n", filepath, msg);3093 }3094}3095 3096void3097pbl_parser_error(protobuf_lang_state_t *state, const char *fmt, ...)3098{3099 char* msg;3100 void* scanner;3101 va_list ap;3102 va_start(ap, fmt)__builtin_va_start(ap, fmt);3103 msg = ws_strdup_vprintf(fmt, ap)wmem_strdup_vprintf(((void*)0), fmt, ap);3104 scanner = state ? state->scanner : NULL((void*)0);3105 protobuf_lang_error(scanner, state, msg);3106 va_end(ap)__builtin_va_end(ap);3107 g_free(msg);3108}3109 3110static void3111pbl_clear_state(protobuf_lang_state_t *state, pbl_descriptor_pool_t* pool)3112{3113 if (state == NULL((void*)0)) {3114 return;3115 }3116 3117 state->pool = NULL((void*)0);3118 state->file = NULL((void*)0);3119 state->grammar_error = FALSE(0);3120 state->tmp_token = NULL((void*)0);3121 3122 if (state->scanner) {3123 protobuf_lang_lex_destroy(state->scanner);3124 state->scanner = NULL((void*)0);3125 }3126 3127 if (state->pParser) {3128 ProtobufLangParserFree(state->pParser, g_free);3129 state->pParser = NULL((void*)0);3130 }3131 3132 if (state->lex_string_tokens) {3133 g_slist_free_full(state->lex_string_tokens, g_free);3134 state->lex_string_tokens = NULL((void*)0);3135 }3136 3137 if (state->lex_struct_tokens) {3138 g_slist_free_full(state->lex_struct_tokens, g_free);3139 state->lex_struct_tokens = NULL((void*)0);3140 }3141 3142 if (pool) {3143 pool->parser_state = NULL((void*)0);3144 }3145}3146 3147static void3148pbl_reinit_state(protobuf_lang_state_t *state, pbl_descriptor_pool_t* pool, const char* filepath)3149{3150 if (state == NULL((void*)0)) {3151 return;3152 }3153 pbl_clear_state(state, pool);3154 3155 state->pool = pool;3156 state->file = (pbl_file_descriptor_t*) g_hash_table_lookup(pool->proto_files, filepath);3157 state->pParser = ProtobufLangParserAlloc(g_malloc);3158 3159 if (pool) {3160 pool->parser_state = state;3161 }3162}3163 3164int run_pbl_parser(pbl_descriptor_pool_t* pool)3165{3166 protobuf_lang_state_t state = {0};3167 yyscan_t scanner;3168 FILE * fp;3169 int status = 0;3170 int token_id;3171 const char* filepath;3172 3173 while (!g_queue_is_empty(pool->proto_files_to_be_parsed)) {

1

Assuming the condition is true

2

Loop condition is true. Entering loop body

3174 filepath = (const char*) g_queue_peek_head(pool->proto_files_to_be_parsed);3175 /* reinit state and scanner */3176 pbl_reinit_state(&state, pool, filepath);3177 scanner = NULL((void*)0);3178 3179 /* Note that filepath is absolute path in proto_files */3180 fp = ws_fopenfopen(filepath, "r");3181 if (fp == NULL((void*)0)) {

3

Assuming 'fp' is not equal to NULL

4

Taking false branch

3182 pbl_parser_error(&state, "File does not exists!");3183 status = -1;3184 goto finish;3185 }3186 3187 status = protobuf_lang_lex_init(&scanner);3188 if (status != 0) {

5

Assuming 'status' is equal to 0

6

Taking false branch

3189 pbl_parser_error(&state, "Initialize Protocol Buffers Language scanner failed!\n");3190 fclose(fp);3191 goto finish;3192 }3193 3194 /* associate the parser state with the lexical analyzer state */3195 protobuf_lang_set_extra(&state, scanner);3196 state.scanner = scanner;3197 3198 protobuf_lang_restart(fp, scanner);3199 /* uncomment the next line for debugging */3200 /* ProtobufLangParserTrace(stdout, ">>>"); */3201 while (!state.grammar_error && (token_id = protobuf_lang_lex(scanner))) {

7

Assuming field 'grammar_error' is false

8

Loop condition is false. Execution continues on line 3205

3202 /* state.tmp_token contains token string value and lineno information */3203 ProtobufLangParser(state.pParser, token_id, state.tmp_token, &state);3204 }3205 fclose(fp);3206 3207 if (state.grammar_error

8.1

Field 'grammar_error' is false
) {

9

Taking false branch

3208 status = -2;3209 goto finish;3210 } else {3211 ProtobufLangParser(state.pParser, 0, NULL((void*)0), &state);

10

Passing null pointer value via 3rd parameter 'yyminor'

11

Calling 'ProtobufLangParser'

3212 }3213 3214 /* remove the parsed file from list */3215 g_queue_pop_head(pool->proto_files_to_be_parsed);3216 }3217 3218finish:3219 pbl_clear_state(&state, pool);3220 return status;3221}3222 3223#line 3248 "./protobuf_lang_parser.c"
/builds/wireshark/wireshark/build/epan/protobuf_lang_parser.c (2024)

References

Top Articles
Latest Posts
Article information

Author: Greg O'Connell

Last Updated:

Views: 6628

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Greg O'Connell

Birthday: 1992-01-10

Address: Suite 517 2436 Jefferey Pass, Shanitaside, UT 27519

Phone: +2614651609714

Job: Education Developer

Hobby: Cooking, Gambling, Pottery, Shooting, Baseball, Singing, Snowboarding

Introduction: My name is Greg O'Connell, I am a delightful, colorful, talented, kind, lively, modern, tender person who loves writing and wants to share my knowledge and understanding with you.