Coverage Report

Created: 2025-12-27 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/work/build/epan/protobuf_lang_parser.c
Line
Count
Source
1
/* This file is automatically generated by Lemon from input grammar
2
** source file "/src/wireshark/epan/protobuf_lang_parser.lemon". */
3
/* protobuf_lang_parser.lemon
4
 *
5
 * C Protocol Buffers Language (PBL) Parser (for *.proto files)
6
 * Copyright 2020, Huang Qiangxiong <qiangxiong.huang@qq.com>
7
 *
8
 * SPDX-License-Identifier: GPL-2.0-or-later
9
 */
10
11
/* This parser is mainly to get MESSAGE, ENUM, and FIELD information from *.proto files.
12
 * There are three formats of *.proto files:
13
 * 1) Protocol Buffers Edition 2023 Language Specification
14
 *      https://protobuf.dev/reference/protobuf/edition-2023-spec
15
 * 2) Protocol Buffers Version 3 Language Specification:
16
 *      https://developers.google.com/protocol-buffers/docs/reference/proto3-spec
17
 * 3) Protocol Buffers Version 2 Language Specification:
18
 *      https://developers.google.com/protocol-buffers/docs/reference/proto2-spec
19
 * There are some errors about 'proto', 'option' (value), 'extensions',  and 'reserved' (fieldName) definitions on that sites.
20
 * This parser is created because Wireshark is mainly implemented in plain ANSI C but the official
21
 * Protocol Buffers Language parser is implemented in C++.
22
 */
23
#include "config.h"
24
#include <stdio.h>
25
#include <stdlib.h>
26
#include <string.h>
27
#include <stdarg.h>
28
#include <glib.h>
29
#include <assert.h>
30
#include <ws_diag_control.h>
31
#include <wsutil/file_util.h>
32
#include "protobuf_lang_tree.h"
33
#include "protobuf_lang_parser.h"
34
#include "protobuf_lang_scanner_lex.h"
35
36
0
#define NAME_TO_BE_SET "<NAME_TO_BE_SET>"
37
0
#define NEED_NOT_NAME "<NEED_NOT_NAME>"
38
39
static void *ProtobufLangParserAlloc(void *(*mallocProc)(size_t));
40
static void ProtobufLangParser(void *yyp, int yymajor, protobuf_lang_token_t *yyminor, protobuf_lang_state_t *state);
41
static void ProtobufLangParserFree(void *p, void (*freeProc)(void*));
42
43
/* Error handling function for parser */
44
void protobuf_lang_error(void* yyscanner, protobuf_lang_state_t *state, const char *msg);
45
46
/* Extended error handling function */
47
void pbl_parser_error(protobuf_lang_state_t *state, const char *fmt, ...);
48
49
/* It's just the approximate line number which is gotten when a grammar rule is reduced
50
   by the parser (lemon). That might be overridden by the lineno argument of
51
   pbl_set_node_name() later. */
52
0
#define CUR_LINENO (protobuf_lang_get_lineno(state->scanner))
53
54
DIAG_OFF_LEMON()
55
#line 81 "./protobuf_lang_parser.c"
56
/**************** End of %include directives **********************************/
57
/* These constants specify the various numeric values for terminal symbols.
58
***************** Begin token definitions *************************************/
59
#ifndef PT_IDENT
60
#define PT_IDENT                        1
61
#define PT_SYNTAX                       2
62
#define PT_EDITION                      3
63
#define PT_IMPORT                       4
64
#define PT_WEAK                         5
65
#define PT_PUBLIC                       6
66
#define PT_PACKAGE                      7
67
#define PT_OPTION                       8
68
#define PT_REQUIRED                     9
69
#define PT_OPTIONAL                    10
70
#define PT_REPEATED                    11
71
#define PT_ONEOF                       12
72
#define PT_MAP                         13
73
#define PT_RESERVED                    14
74
#define PT_ENUM                        15
75
#define PT_GROUP                       16
76
#define PT_EXTEND                      17
77
#define PT_EXTENSIONS                  18
78
#define PT_MESSAGE                     19
79
#define PT_SERVICE                     20
80
#define PT_RPC                         21
81
#define PT_STREAM                      22
82
#define PT_RETURNS                     23
83
#define PT_TO                          24
84
#define PT_ASSIGN                      25
85
#define PT_SEMICOLON                   26
86
#define PT_LPAREN                      27
87
#define PT_RPAREN                      28
88
#define PT_DOT                         29
89
#define PT_LCURLY                      30
90
#define PT_RCURLY                      31
91
#define PT_STRLIT                      32
92
#define PT_LBRACKET                    33
93
#define PT_RBRACKET                    34
94
#define PT_EQUAL                       35
95
#define PT_NOTEQUAL                    36
96
#define PT_NOTEQUAL2                   37
97
#define PT_GEQUAL                      38
98
#define PT_LEQUAL                      39
99
#define PT_ASSIGN_PLUS                 40
100
#define PT_PLUS                        41
101
#define PT_MINUS                       42
102
#define PT_MULTIPLY                    43
103
#define PT_DIV                         44
104
#define PT_LOGIC_OR                    45
105
#define PT_OR                          46
106
#define PT_LOGIC_AND                   47
107
#define PT_AND                         48
108
#define PT_NOT                         49
109
#define PT_NEG                         50
110
#define PT_XOR                         51
111
#define PT_SHL                         52
112
#define PT_SHR                         53
113
#define PT_PERCENT                     54
114
#define PT_DOLLAR                      55
115
#define PT_COND                        56
116
#define PT_COMMA                       57
117
#define PT_COLON                       58
118
#define PT_LESS                        59
119
#define PT_GREATER                     60
120
#define PT_DECIMALLIT                  61
121
#define PT_OCTALLIT                    62
122
#define PT_HEXLIT                      63
123
#endif
124
/**************** End token definitions ***************************************/
125
126
/* The next sections is a series of control #defines.
127
** various aspects of the generated parser.
128
**    YYCODETYPE         is the data type used to store the integer codes
129
**                       that represent terminal and non-terminal symbols.
130
**                       "unsigned char" is used if there are fewer than
131
**                       256 symbols.  Larger types otherwise.
132
**    YYNOCODE           is a number of type YYCODETYPE that is not used for
133
**                       any terminal or nonterminal symbol.
134
**    YYFALLBACK         If defined, this indicates that one or more tokens
135
**                       (also known as: "terminal symbols") have fall-back
136
**                       values which should be used if the original symbol
137
**                       would not parse.  This permits keywords to sometimes
138
**                       be used as identifiers, for example.
139
**    YYACTIONTYPE       is the data type used for "action codes" - numbers
140
**                       that indicate what to do in response to the next
141
**                       token.
142
**    ProtobufLangParserTOKENTYPE     is the data type used for minor type for terminal
143
**                       symbols.  Background: A "minor type" is a semantic
144
**                       value associated with a terminal or non-terminal
145
**                       symbols.  For example, for an "ID" terminal symbol,
146
**                       the minor type might be the name of the identifier.
147
**                       Each non-terminal can have a different minor type.
148
**                       Terminal symbols all have the same minor type, though.
149
**                       This macros defines the minor type for terminal
150
**                       symbols.
151
**    YYMINORTYPE        is the data type used for all minor types.
152
**                       This is typically a union of many types, one of
153
**                       which is ProtobufLangParserTOKENTYPE.  The entry in the union
154
**                       for terminal symbols is called "yy0".
155
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
156
**                       zero the stack is dynamically sized using realloc()
157
**    ProtobufLangParserARG_SDECL     A static variable declaration for the %extra_argument
158
**    ProtobufLangParserARG_PDECL     A parameter declaration for the %extra_argument
159
**    ProtobufLangParserARG_PARAM     Code to pass %extra_argument as a subroutine parameter
160
**    ProtobufLangParserARG_STORE     Code to store %extra_argument into yypParser
161
**    ProtobufLangParserARG_FETCH     Code to extract %extra_argument from yypParser
162
**    ProtobufLangParserCTX_*         As ProtobufLangParserARG_ except for %extra_context
163
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
164
**                       defined, then do no error processing.
165
**    YYNSTATE           the combined number of states.
166
**    YYNRULE            the number of rules in the grammar
167
**    YYNTOKEN           Number of terminal symbols
168
**    YY_MAX_SHIFT       Maximum value for shift actions
169
**    YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
170
**    YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
171
**    YY_ERROR_ACTION    The yy_action[] code for syntax error
172
**    YY_ACCEPT_ACTION   The yy_action[] code for accept
173
**    YY_NO_ACTION       The yy_action[] code for no-op
174
**    YY_MIN_REDUCE      Minimum value for reduce actions
175
**    YY_MAX_REDUCE      Maximum value for reduce actions
176
*/
177
#ifndef INTERFACE
178
# define INTERFACE 1
179
#endif
180
/************* Begin control #defines *****************************************/
181
0
#define YYCODETYPE unsigned char
182
#define YYNOCODE 131
183
0
#define YYACTIONTYPE unsigned short int
184
#define ProtobufLangParserTOKENTYPE  protobuf_lang_token_t* 
185
typedef union {
186
  int yyinit;
187
  ProtobufLangParserTOKENTYPE yy0;
188
  pbl_node_t* yy93;
189
  int yy116;
190
  protobuf_lang_token_t* yy118;
191
  uint64_t yy180;
192
  gchar* yy254;
193
} YYMINORTYPE;
194
#ifndef YYSTACKDEPTH
195
0
#define YYSTACKDEPTH 100
196
#endif
197
#define ProtobufLangParserARG_SDECL  protobuf_lang_state_t *state ;
198
#define ProtobufLangParserARG_PDECL , protobuf_lang_state_t *state 
199
#define ProtobufLangParserARG_PARAM ,state 
200
0
#define ProtobufLangParserARG_FETCH  protobuf_lang_state_t *state =yypParser->state ;
201
0
#define ProtobufLangParserARG_STORE yypParser->state =state ;
202
#define ProtobufLangParserCTX_SDECL
203
#define ProtobufLangParserCTX_PDECL
204
#define ProtobufLangParserCTX_PARAM
205
#define ProtobufLangParserCTX_FETCH
206
#define ProtobufLangParserCTX_STORE
207
#define YYFALLBACK 1
208
#define YYNSTATE             166
209
#define YYNRULE              191
210
#define YYNRULE_WITH_ACTION  78
211
#define YYNTOKEN             64
212
0
#define YY_MAX_SHIFT         165
213
0
#define YY_MIN_SHIFTREDUCE   338
214
0
#define YY_MAX_SHIFTREDUCE   528
215
#define YY_ERROR_ACTION      529
216
0
#define YY_ACCEPT_ACTION     530
217
#define YY_NO_ACTION         531
218
0
#define YY_MIN_REDUCE        532
219
#define YY_MAX_REDUCE        722
220
/************* End control #defines *******************************************/
221
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
222
223
/* Define the yytestcase() macro to be a no-op if is not already defined
224
** otherwise.
225
**
226
** Applications can choose to define yytestcase() in the %include section
227
** to a macro that can assist in verifying code coverage.  For production
228
** code the yytestcase() macro should be turned off.  But it is useful
229
** for testing.
230
*/
231
#ifndef yytestcase
232
# define yytestcase(X)
233
#endif
234
235
236
/* Next are the tables used to determine what action to take based on the
237
** current state and lookahead token.  These tables are used to implement
238
** functions that take a state number and lookahead value and return an
239
** action integer.
240
**
241
** Suppose the action integer is N.  Then the action is determined as
242
** follows
243
**
244
**   0 <= N <= YY_MAX_SHIFT             Shift N.  That is, push the lookahead
245
**                                      token onto the stack and goto state N.
246
**
247
**   N between YY_MIN_SHIFTREDUCE       Shift to an arbitrary state then
248
**     and YY_MAX_SHIFTREDUCE           reduce by rule N-YY_MIN_SHIFTREDUCE.
249
**
250
**   N == YY_ERROR_ACTION               A syntax error has occurred.
251
**
252
**   N == YY_ACCEPT_ACTION              The parser accepts its input.
253
**
254
**   N == YY_NO_ACTION                  No such action.  Denotes unused
255
**                                      slots in the yy_action[] table.
256
**
257
**   N between YY_MIN_REDUCE            Reduce by rule N-YY_MIN_REDUCE
258
**     and YY_MAX_REDUCE
259
**
260
** The action table is constructed as a single large table named yy_action[].
261
** Given state S and lookahead X, the action is computed as either:
262
**
263
**    (A)   N = yy_action[ yy_shift_ofst[S] + X ]
264
**    (B)   N = yy_default[S]
265
**
266
** The (A) formula is preferred.  The B formula is used instead if
267
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
268
**
269
** The formulas above are for computing the action when the lookahead is
270
** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
271
** a reduce action) then the yy_reduce_ofst[] array is used in place of
272
** the yy_shift_ofst[] array.
273
**
274
** The following are the tables generated in this section:
275
**
276
**  yy_action[]        A single table containing all actions.
277
**  yy_lookahead[]     A table containing the lookahead for each entry in
278
**                     yy_action.  Used to detect hash collisions.
279
**  yy_shift_ofst[]    For each state, the offset into yy_action for
280
**                     shifting terminals.
281
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
282
**                     shifting non-terminals after a reduce.
283
**  yy_default[]       Default action for each state.
284
**
285
*********** Begin parsing tables **********************************************/
286
#define YY_ACTTAB_COUNT (518)
287
static const YYACTIONTYPE yy_action[] = {
288
 /*     0 */   558,  528,  155,  579,  113,  112,  578,   99,  578,  101,
289
 /*    10 */   578,  141,  578,  143,  578,  103,  578,  105,  135,   39,
290
 /*    20 */    39,  593,  687,  688,  528,  444,  461,  434,  435,  462,
291
 /*    30 */    91,  427,  430,  436,  437,  438,  439,  440,  441,  442,
292
 /*    40 */   443,  445,  446,  447,  448,  449,  450,  451,  452,  453,
293
 /*    50 */   454,  455,  456,  457,  458,  459,  460,  463,  464,  465,
294
 /*    60 */   466,  405,  406,  407,  528,   39,  528,   27,   27,   33,
295
 /*    70 */    33,   25,  380,  381,  382,   60,  136,    5,   66,   61,
296
 /*    80 */    55,   24,   67,  563,   96,  682,  683,   50,  119,  526,
297
 /*    90 */   598,  528,  564,   95,  390,   98,  580,  560,   25,  380,
298
 /*   100 */   381,  382,   60,  136,    5,   66,   61,   55,   24,   67,
299
 /*   110 */   133,  677,  678,   27,  160,   33,  526,  133,  528,  697,
300
 /*   120 */   602,  391,  528,    4,  696,   25,  380,  381,  382,   60,
301
 /*   130 */   136,    5,   66,   61,   55,   24,   67,   46,   64,  405,
302
 /*   140 */   406,  407,  577,  526,   25,   25,  536,  536,  351,  530,
303
 /*   150 */   165,   69,   68,  536,  603,  549,  536,   53,   49,  547,
304
 /*   160 */   528,  548,  526,  526,  499,  698,  536,  367,  491,  111,
305
 /*   170 */   551,   14,  552,  550,  665,  613,  614,  615,  616,  542,
306
 /*   180 */   528,   52,  405,  406,  407,  667,  669,  124,  559,  598,
307
 /*   190 */    73,  666,  668,   79,   25,   42,  150,   27,   27,  139,
308
 /*   200 */    59,   66,  149,   55,  577,   67,   54,  149,  528,   91,
309
 /*   210 */   414,  414,  526,  528,  528,   25,  380,  381,  382,  528,
310
 /*   220 */    38,   37,  588,   61,   93,  544,  160,  380,  381,  382,
311
 /*   230 */   153,  582,  602,  526,   61,  691,  153,  623,  392,   78,
312
 /*   240 */   405,  406,  407,   27,  526,  414,  153,  690,  692,  400,
313
 /*   250 */   706,   92,   94,   97,   97,  142,   92,  107,   46,   64,
314
 /*   260 */   106,  151,  107,  577,  160,  142,  603,  156,   25,  675,
315
 /*   270 */   602,  626,  703,  160,  405,  406,  407,  583,  162,  602,
316
 /*   280 */   596,  528,  627,   63,  705,  625,  526,  577,  555,   36,
317
 /*   290 */    36,  486,   33,   33,  597,  127,  528,  598,   80,   81,
318
 /*   300 */    33,   33,   51,   25,  603,   33,   33,  711,  117,    5,
319
 /*   310 */   671,  672,  117,  603,  607,  676,  606,  670,  100,  580,
320
 /*   320 */   144,  526,   72,   71,  161,  414,  359,  581,   33,   33,
321
 /*   330 */   144,  102,  580,   36,   36,   36,  528,  528,   33,  152,
322
 /*   340 */   108,  108,  405,  406,  407,   70,   33,  528,  605,  128,
323
 /*   350 */   604,   33,   62,  129,  104,  580,  528,  115,  128,  598,
324
 /*   360 */     9,  129,   78,    4,   77,  405,  406,  407,  528,   78,
325
 /*   370 */   116,   10,  598,   78,   33,   77,  118,  543,  598,   36,
326
 /*   380 */    11,  122,   78,  598,   77,  674,  123,  130,  598,  598,
327
 /*   390 */   114,  134,   12,  138,   78,  577,   77,  140,  138,  146,
328
 /*   400 */   148,  710,    4,  140,  146,  148,  710,  157,  340,  158,
329
 /*   410 */   157,  158,  339,  490,  415,  485,  109,   82,  415,   83,
330
 /*   420 */   398,  396,  131,  378,  132,  137,  145,   15,   16,  164,
331
 /*   430 */    17,  376,  147,  506,  505,  154,  345,  344,   18,  159,
332
 /*   440 */   343,  163,  415,  415,  110,   21,  415,   22,   22,   22,
333
 /*   450 */    40,   41,    8,    7,    1,   22,    6,    2,   23,    3,
334
 /*   460 */    20,   74,   13,   75,   76,   42,  612,  375,   48,   47,
335
 /*   470 */   374,  372,   43,  120,  121,  373,  371,  125,   44,   84,
336
 /*   480 */   126,   28,   45,   85,  500,  397,   56,   57,   58,  395,
337
 /*   490 */    29,   62,   86,   30,   87,   31,   32,   88,  379,  377,
338
 /*   500 */   611,   34,   35,  507,  610,  362,  415,   26,  531,  424,
339
 /*   510 */   531,   89,  347,   19,   65,   90,  423,  346,
340
};
341
static const YYCODETYPE yy_lookahead[] = {
342
 /*     0 */   104,    1,  106,  104,    2,    3,  104,  105,  104,  105,
343
 /*    10 */   104,  105,  104,  105,  104,  105,  104,  105,   67,   70,
344
 /*    20 */    71,   70,  113,  114,    1,   25,   26,   27,   28,   29,
345
 /*    30 */    30,   31,   32,   33,   34,   35,   36,   37,   38,   39,
346
 /*    40 */    40,   41,   42,   43,   44,   45,   46,   47,   48,   49,
347
 /*    50 */    50,   51,   52,   53,   54,   55,   56,   57,   58,   59,
348
 /*    60 */    60,   61,   62,   63,    1,  116,    1,   70,   71,   70,
349
 /*    70 */    71,    8,    9,   10,   11,   12,   13,   14,   15,   16,
350
 /*    80 */    17,   18,   19,   85,   86,  113,  114,   22,   68,   26,
351
 /*    90 */    70,    1,   94,   95,   31,   96,   97,  104,    8,    9,
352
 /*   100 */    10,   11,   12,   13,   14,   15,   16,   17,   18,   19,
353
 /*   110 */    70,  113,  114,  116,   64,  116,   26,   77,    1,   69,
354
 /*   120 */    70,   31,    1,   81,  127,    8,    9,   10,   11,   12,
355
 /*   130 */    13,   14,   15,   16,   17,   18,   19,   65,   66,   61,
356
 /*   140 */    62,   63,   70,   26,    8,    8,   82,   83,   31,  107,
357
 /*   150 */   108,  109,  110,   89,  104,   83,   92,   21,   22,   87,
358
 /*   160 */     1,   89,   26,   26,   26,  115,  102,   31,   31,   64,
359
 /*   170 */    98,   33,  100,  101,  102,  111,  112,  113,  114,   70,
360
 /*   180 */     1,   22,   61,   62,   63,  113,  114,   68,  104,   70,
361
 /*   190 */     4,  119,  120,    7,    8,   57,   64,   70,   71,   65,
362
 /*   200 */    66,   15,   70,   17,   70,   19,   20,   75,    1,   30,
363
 /*   210 */    32,   32,   26,    1,    1,    8,    9,   10,   11,    1,
364
 /*   220 */    41,   42,   88,   16,   64,  116,   64,    9,   10,   11,
365
 /*   230 */   104,   69,   70,   26,   16,  101,  104,   70,   31,   27,
366
 /*   240 */    61,   62,   63,  116,   26,   32,  104,  113,  114,   31,
367
 /*   250 */    70,  125,   64,  126,  127,   70,  130,  125,   65,   66,
368
 /*   260 */   128,  129,  130,   70,   64,   80,  104,   70,    8,   69,
369
 /*   270 */    70,  104,  130,   64,   61,   62,   63,  115,   69,   70,
370
 /*   280 */    87,    1,  115,   66,  104,  118,   26,   70,   91,   70,
371
 /*   290 */    71,   31,   70,   71,  101,   68,    1,   70,    5,    6,
372
 /*   300 */    70,   71,   22,    8,  104,   70,   71,  114,   70,   14,
373
 /*   310 */   113,  114,   74,  104,   70,  115,   70,  120,   96,   97,
374
 /*   320 */    70,   26,   41,   42,  115,   32,   31,   97,   70,   71,
375
 /*   330 */    80,   96,   97,   70,   71,  116,    1,    1,  116,   64,
376
 /*   340 */   121,  122,   61,   62,   63,   41,  116,    1,  104,   70,
377
 /*   350 */   104,  116,   16,   70,   96,   97,    1,   68,   79,   70,
378
 /*   360 */    25,   78,   27,   81,   29,   61,   62,   63,    1,   27,
379
 /*   370 */    68,   25,   70,   27,  116,   29,   68,  116,   70,  116,
380
 /*   380 */    25,   68,   27,   70,   29,  122,   68,   68,   70,   70,
381
 /*   390 */   108,   66,   25,   70,   27,   70,   29,   70,   75,   70,
382
 /*   400 */    70,   70,   81,   76,   75,   75,   75,   70,   26,   70,
383
 /*   410 */    73,   72,   26,   26,   32,   26,   64,   30,   32,   30,
384
 /*   420 */    26,   26,   34,   26,   34,   34,   34,   33,   33,  108,
385
 /*   430 */    33,   26,   34,   26,   26,   34,   26,   26,   33,   70,
386
 /*   440 */    26,   70,   32,   32,   64,   57,   32,   57,   57,   57,
387
 /*   450 */   124,  123,   93,  103,   84,   57,   99,   84,   57,   84,
388
 /*   460 */   117,   25,   90,   25,   57,   57,    0,   28,   27,   57,
389
 /*   470 */    28,   28,   27,   23,   28,   28,   28,   23,   27,   30,
390
 /*   480 */    28,   25,   27,   30,   26,   26,   60,   57,   59,   26,
391
 /*   490 */    25,   16,   30,   25,   30,   25,   25,   30,   26,   26,
392
 /*   500 */     0,   25,   24,   26,    0,   26,   32,   25,  131,   26,
393
 /*   510 */   131,   30,   28,   33,   57,   30,   26,   26,  131,  131,
394
 /*   520 */   131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
395
 /*   530 */   131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
396
 /*   540 */   131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
397
 /*   550 */   131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
398
 /*   560 */   131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
399
 /*   570 */   131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
400
 /*   580 */   131,  131,
401
};
402
#define YY_SHIFT_COUNT    (165)
403
#define YY_SHIFT_MIN      (0)
404
#define YY_SHIFT_MAX      (504)
405
static const unsigned short int yy_shift_ofst[] = {
406
 /*     0 */     2,   63,   90,  117,  186,  213,  207,  218,  136,  179,
407
 /*    10 */   179,  179,  179,  295,  212,  212,  212,  212,  212,  212,
408
 /*    20 */     0,  212,  212,  212,   78,  212,  281,  335,  304,  304,
409
 /*    30 */   304,  304,  304,  346,  304,  121,  355,  121,  121,  367,
410
 /*    40 */   137,  260,   78,   65,  159,  280,  336,   23,   23,   23,
411
 /*    50 */    23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
412
 /*    60 */    23,   23,   23,   23,   23,   23,   23,   23,  518,  518,
413
 /*    70 */    78,   78,   78,  293,  178,  178,  178,  342,   23,   23,
414
 /*    80 */   178,  178,  518,  518,  518,  518,  518,  518,  518,  518,
415
 /*    90 */   518,  518,  138,  382,  386,  387,  389,  388,  390,  394,
416
 /*   100 */   391,  395,  392,  397,  398,  405,  407,  408,  401,  410,
417
 /*   110 */   411,  414,  436,  438,  466,  439,  412,  441,  442,  443,
418
 /*   120 */   445,  450,  446,  447,  448,  451,  454,  452,  455,  449,
419
 /*   130 */   453,  458,  459,  456,  426,  430,  429,  463,  465,  475,
420
 /*   140 */   462,  464,  468,  467,  470,  472,  471,  473,  476,  457,
421
 /*   150 */   474,  477,  474,  478,  479,  480,  482,  481,  485,  484,
422
 /*   160 */   474,  483,  490,  491,  500,  504,
423
};
424
#define YY_REDUCE_COUNT (91)
425
#define YY_REDUCE_MIN   (-104)
426
#define YY_REDUCE_MAX   (380)
427
static const short yy_reduce_ofst[] = {
428
 /*     0 */    42,   72,   72,   72,   64,  132,  134,  193,   -2,   50,
429
 /*    10 */   162,  200,  209,  197,  127,   -1,  222,  235,  258,  219,
430
 /*    20 */   167,   -3,  230,  263,  126,  -51, -104,  109,  -98,  -96,
431
 /*    30 */   -94,  -92,  -90,  109,  -88,  180,  109,  244,  246,  109,
432
 /*    40 */   -91,  -28,  142,   20,  119,  227,  217,  289,  302,  238,
433
 /*    50 */   308,  313,  318,  279,  283,  319,   40,  325,  -49,  323,
434
 /*    60 */   327,  185,  250,  329,  330,  331,  337,  339,  282,  321,
435
 /*    70 */  -101,   -7,   84,  105,  160,  188,  275,  261,  369,  371,
436
 /*    80 */   352,  380,  326,  328,  359,  350,  357,  370,  373,  372,
437
 /*    90 */   375,  343,
438
};
439
static const YYACTIONTYPE yy_default[] = {
440
 /*     0 */   535,  529,  529,  529,  532,  529,  529,  529,  529,  529,
441
 /*    10 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
442
 /*    20 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
443
 /*    30 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
444
 /*    40 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
445
 /*    50 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
446
 /*    60 */   529,  529,  529,  529,  529,  529,  529,  529,  535,  535,
447
 /*    70 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
448
 /*    80 */   529,  529,  686,  681,  562,  595,  587,  546,  546,  554,
449
 /*    90 */   546,  622,  529,  529,  529,  529,  529,  529,  529,  529,
450
 /*   100 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
451
 /*   110 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
452
 /*   120 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
453
 /*   130 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
454
 /*   140 */   529,  529,  529,  529,  529,  529,  529,  529,  529,  709,
455
 /*   150 */   707,  529,  708,  704,  529,  557,  529,  529,  529,  529,
456
 /*   160 */   721,  529,  529,  529,  529,  529,
457
};
458
/********** End of lemon-generated parsing tables *****************************/
459
460
/* The next table maps tokens (terminal symbols) into fallback tokens.
461
** If a construct like the following:
462
**
463
**      %fallback ID X Y Z.
464
**
465
** appears in the grammar, then ID becomes a fallback token for X, Y,
466
** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
467
** but it does not parse, the type of the token is changed to ID and
468
** the parse is retried before an error is thrown.
469
**
470
** This feature can be used, for example, to cause some keywords in a language
471
** to revert to identifiers if they keyword does not apply in the context where
472
** it appears.
473
*/
474
#ifdef YYFALLBACK
475
static const YYCODETYPE yyFallback[] = {
476
    0,  /*          $ => nothing */
477
    0,  /*   PT_IDENT => nothing */
478
    1,  /*  PT_SYNTAX => PT_IDENT */
479
    1,  /* PT_EDITION => PT_IDENT */
480
    1,  /*  PT_IMPORT => PT_IDENT */
481
    1,  /*    PT_WEAK => PT_IDENT */
482
    1,  /*  PT_PUBLIC => PT_IDENT */
483
    1,  /* PT_PACKAGE => PT_IDENT */
484
    1,  /*  PT_OPTION => PT_IDENT */
485
    1,  /* PT_REQUIRED => PT_IDENT */
486
    1,  /* PT_OPTIONAL => PT_IDENT */
487
    1,  /* PT_REPEATED => PT_IDENT */
488
    1,  /*   PT_ONEOF => PT_IDENT */
489
    1,  /*     PT_MAP => PT_IDENT */
490
    1,  /* PT_RESERVED => PT_IDENT */
491
    1,  /*    PT_ENUM => PT_IDENT */
492
    1,  /*   PT_GROUP => PT_IDENT */
493
    1,  /*  PT_EXTEND => PT_IDENT */
494
    1,  /* PT_EXTENSIONS => PT_IDENT */
495
    1,  /* PT_MESSAGE => PT_IDENT */
496
    1,  /* PT_SERVICE => PT_IDENT */
497
    1,  /*     PT_RPC => PT_IDENT */
498
    1,  /*  PT_STREAM => PT_IDENT */
499
    1,  /* PT_RETURNS => PT_IDENT */
500
    1,  /*      PT_TO => PT_IDENT */
501
    0,  /*  PT_ASSIGN => nothing */
502
    0,  /* PT_SEMICOLON => nothing */
503
    0,  /*  PT_LPAREN => nothing */
504
    0,  /*  PT_RPAREN => nothing */
505
    0,  /*     PT_DOT => nothing */
506
    0,  /*  PT_LCURLY => nothing */
507
    0,  /*  PT_RCURLY => nothing */
508
    0,  /*  PT_STRLIT => nothing */
509
    0,  /* PT_LBRACKET => nothing */
510
    0,  /* PT_RBRACKET => nothing */
511
    0,  /*   PT_EQUAL => nothing */
512
    0,  /* PT_NOTEQUAL => nothing */
513
    0,  /* PT_NOTEQUAL2 => nothing */
514
    0,  /*  PT_GEQUAL => nothing */
515
    0,  /*  PT_LEQUAL => nothing */
516
    0,  /* PT_ASSIGN_PLUS => nothing */
517
    0,  /*    PT_PLUS => nothing */
518
    0,  /*   PT_MINUS => nothing */
519
    0,  /* PT_MULTIPLY => nothing */
520
    0,  /*     PT_DIV => nothing */
521
    0,  /* PT_LOGIC_OR => nothing */
522
    0,  /*      PT_OR => nothing */
523
    0,  /* PT_LOGIC_AND => nothing */
524
    0,  /*     PT_AND => nothing */
525
    0,  /*     PT_NOT => nothing */
526
    0,  /*     PT_NEG => nothing */
527
    0,  /*     PT_XOR => nothing */
528
    0,  /*     PT_SHL => nothing */
529
    0,  /*     PT_SHR => nothing */
530
    0,  /* PT_PERCENT => nothing */
531
    0,  /*  PT_DOLLAR => nothing */
532
    0,  /*    PT_COND => nothing */
533
    0,  /*   PT_COMMA => nothing */
534
    0,  /*   PT_COLON => nothing */
535
    0,  /*    PT_LESS => nothing */
536
    0,  /* PT_GREATER => nothing */
537
    0,  /* PT_DECIMALLIT => nothing */
538
    0,  /* PT_OCTALLIT => nothing */
539
    0,  /*  PT_HEXLIT => nothing */
540
};
541
#endif /* YYFALLBACK */
542
543
/* The following structure represents a single element of the
544
** parser's stack.  Information stored includes:
545
**
546
**   +  The state number for the parser at this level of the stack.
547
**
548
**   +  The value of the token stored at this level of the stack.
549
**      (In other words, the "major" token.)
550
**
551
**   +  The semantic value stored at this level of the stack.  This is
552
**      the information used by the action routines in the grammar.
553
**      It is sometimes called the "minor" token.
554
**
555
** After the "shift" half of a SHIFTREDUCE action, the stateno field
556
** actually contains the reduce action for the second half of the
557
** SHIFTREDUCE.
558
*/
559
struct yyStackEntry {
560
  YYACTIONTYPE stateno;  /* The state-number, or reduce action in SHIFTREDUCE */
561
  YYCODETYPE major;      /* The major token value.  This is the code
562
                         ** number for the token at this stack level */
563
  YYMINORTYPE minor;     /* The user-supplied minor token value.  This
564
                         ** is the value of the token  */
565
};
566
typedef struct yyStackEntry yyStackEntry;
567
568
/* The state of the parser is completely contained in an instance of
569
** the following structure */
570
struct yyParser {
571
  yyStackEntry *yytos;          /* Pointer to top element of the stack */
572
#ifdef YYTRACKMAXSTACKDEPTH
573
  int yyhwm;                    /* High-water mark of the stack */
574
#endif
575
#ifndef YYNOERRORRECOVERY
576
  int yyerrcnt;                 /* Shifts left before out of the error */
577
#endif
578
  ProtobufLangParserARG_SDECL                /* A place to hold %extra_argument */
579
  ProtobufLangParserCTX_SDECL                /* A place to hold %extra_context */
580
#if YYSTACKDEPTH<=0
581
  int yystksz;                  /* Current side of the stack */
582
  yyStackEntry *yystack;        /* The parser's stack */
583
  yyStackEntry yystk0;          /* First stack entry */
584
#else
585
  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
586
  yyStackEntry *yystackEnd;            /* Last entry in the stack */
587
#endif
588
};
589
typedef struct yyParser yyParser;
590
591
#include <assert.h>
592
#ifndef NDEBUG
593
#include <stdio.h>
594
static FILE *yyTraceFILE = 0;
595
static char *yyTracePrompt = 0;
596
#endif /* NDEBUG */
597
598
#ifndef NDEBUG
599
/*
600
** Turn parser tracing on by giving a stream to which to write the trace
601
** and a prompt to preface each trace message.  Tracing is turned off
602
** by making either argument NULL
603
**
604
** Inputs:
605
** <ul>
606
** <li> A FILE* to which trace output should be written.
607
**      If NULL, then tracing is turned off.
608
** <li> A prefix string written at the beginning of every
609
**      line of trace output.  If NULL, then tracing is
610
**      turned off.
611
** </ul>
612
**
613
** Outputs:
614
** None.
615
*/
616
void ProtobufLangParserTrace(FILE *TraceFILE, char *zTracePrompt){
617
  yyTraceFILE = TraceFILE;
618
  yyTracePrompt = zTracePrompt;
619
  if( yyTraceFILE==0 ) yyTracePrompt = 0;
620
  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
621
}
622
#endif /* NDEBUG */
623
624
#if defined(YYCOVERAGE) || !defined(NDEBUG)
625
/* For tracing shifts, the names of all terminals and nonterminals
626
** are required.  The following table supplies these names */
627
static const char *const yyTokenName[] = {
628
  /*    0 */ "$",
629
  /*    1 */ "PT_IDENT",
630
  /*    2 */ "PT_SYNTAX",
631
  /*    3 */ "PT_EDITION",
632
  /*    4 */ "PT_IMPORT",
633
  /*    5 */ "PT_WEAK",
634
  /*    6 */ "PT_PUBLIC",
635
  /*    7 */ "PT_PACKAGE",
636
  /*    8 */ "PT_OPTION",
637
  /*    9 */ "PT_REQUIRED",
638
  /*   10 */ "PT_OPTIONAL",
639
  /*   11 */ "PT_REPEATED",
640
  /*   12 */ "PT_ONEOF",
641
  /*   13 */ "PT_MAP",
642
  /*   14 */ "PT_RESERVED",
643
  /*   15 */ "PT_ENUM",
644
  /*   16 */ "PT_GROUP",
645
  /*   17 */ "PT_EXTEND",
646
  /*   18 */ "PT_EXTENSIONS",
647
  /*   19 */ "PT_MESSAGE",
648
  /*   20 */ "PT_SERVICE",
649
  /*   21 */ "PT_RPC",
650
  /*   22 */ "PT_STREAM",
651
  /*   23 */ "PT_RETURNS",
652
  /*   24 */ "PT_TO",
653
  /*   25 */ "PT_ASSIGN",
654
  /*   26 */ "PT_SEMICOLON",
655
  /*   27 */ "PT_LPAREN",
656
  /*   28 */ "PT_RPAREN",
657
  /*   29 */ "PT_DOT",
658
  /*   30 */ "PT_LCURLY",
659
  /*   31 */ "PT_RCURLY",
660
  /*   32 */ "PT_STRLIT",
661
  /*   33 */ "PT_LBRACKET",
662
  /*   34 */ "PT_RBRACKET",
663
  /*   35 */ "PT_EQUAL",
664
  /*   36 */ "PT_NOTEQUAL",
665
  /*   37 */ "PT_NOTEQUAL2",
666
  /*   38 */ "PT_GEQUAL",
667
  /*   39 */ "PT_LEQUAL",
668
  /*   40 */ "PT_ASSIGN_PLUS",
669
  /*   41 */ "PT_PLUS",
670
  /*   42 */ "PT_MINUS",
671
  /*   43 */ "PT_MULTIPLY",
672
  /*   44 */ "PT_DIV",
673
  /*   45 */ "PT_LOGIC_OR",
674
  /*   46 */ "PT_OR",
675
  /*   47 */ "PT_LOGIC_AND",
676
  /*   48 */ "PT_AND",
677
  /*   49 */ "PT_NOT",
678
  /*   50 */ "PT_NEG",
679
  /*   51 */ "PT_XOR",
680
  /*   52 */ "PT_SHL",
681
  /*   53 */ "PT_SHR",
682
  /*   54 */ "PT_PERCENT",
683
  /*   55 */ "PT_DOLLAR",
684
  /*   56 */ "PT_COND",
685
  /*   57 */ "PT_COMMA",
686
  /*   58 */ "PT_COLON",
687
  /*   59 */ "PT_LESS",
688
  /*   60 */ "PT_GREATER",
689
  /*   61 */ "PT_DECIMALLIT",
690
  /*   62 */ "PT_OCTALLIT",
691
  /*   63 */ "PT_HEXLIT",
692
  /*   64 */ "strLit",
693
  /*   65 */ "label",
694
  /*   66 */ "type",
695
  /*   67 */ "keyType",
696
  /*   68 */ "messageType",
697
  /*   69 */ "constant",
698
  /*   70 */ "exIdent",
699
  /*   71 */ "optionName",
700
  /*   72 */ "messageName",
701
  /*   73 */ "enumName",
702
  /*   74 */ "streamName",
703
  /*   75 */ "fieldName",
704
  /*   76 */ "oneofName",
705
  /*   77 */ "mapName",
706
  /*   78 */ "serviceName",
707
  /*   79 */ "rpcName",
708
  /*   80 */ "groupName",
709
  /*   81 */ "protoBody",
710
  /*   82 */ "topLevelDef",
711
  /*   83 */ "message",
712
  /*   84 */ "messageBody",
713
  /*   85 */ "rpc",
714
  /*   86 */ "rpcDecl",
715
  /*   87 */ "field",
716
  /*   88 */ "oneofField",
717
  /*   89 */ "enum",
718
  /*   90 */ "enumBody",
719
  /*   91 */ "enumField",
720
  /*   92 */ "service",
721
  /*   93 */ "serviceBody",
722
  /*   94 */ "stream",
723
  /*   95 */ "streamDecl",
724
  /*   96 */ "fieldOptions",
725
  /*   97 */ "fieldOption",
726
  /*   98 */ "oneof",
727
  /*   99 */ "oneofBody",
728
  /*  100 */ "mapField",
729
  /*  101 */ "group",
730
  /*  102 */ "extend",
731
  /*  103 */ "extendBody",
732
  /*  104 */ "intLit",
733
  /*  105 */ "fieldNumber",
734
  /*  106 */ "enumNumber",
735
  /*  107 */ "proto",
736
  /*  108 */ "wholeProtoBody",
737
  /*  109 */ "syntax",
738
  /*  110 */ "edition",
739
  /*  111 */ "import",
740
  /*  112 */ "package",
741
  /*  113 */ "option",
742
  /*  114 */ "emptyStatement",
743
  /*  115 */ "customOptionValue",
744
  /*  116 */ "extIdentInParentheses",
745
  /*  117 */ "customOptionBody",
746
  /*  118 */ "symbolsWithoutCurly",
747
  /*  119 */ "extensions",
748
  /*  120 */ "reserved",
749
  /*  121 */ "enumValueOptions",
750
  /*  122 */ "enumValueOption",
751
  /*  123 */ "rpcBody",
752
  /*  124 */ "streamBody",
753
  /*  125 */ "ranges",
754
  /*  126 */ "declarations",
755
  /*  127 */ "declaration",
756
  /*  128 */ "quoteFieldNames",
757
  /*  129 */ "reservedIdent",
758
  /*  130 */ "range",
759
};
760
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
761
762
#ifndef NDEBUG
763
/* For tracing reduce actions, the names of all rules are required.
764
*/
765
static const char *const yyRuleName[] = {
766
 /*   0 */ "wholeProtoBody ::= protoBody",
767
 /*   1 */ "syntax ::= PT_SYNTAX PT_ASSIGN strLit PT_SEMICOLON",
768
 /*   2 */ "edition ::= PT_EDITION PT_ASSIGN strLit PT_SEMICOLON",
769
 /*   3 */ "protoBody ::=",
770
 /*   4 */ "protoBody ::= protoBody topLevelDef",
771
 /*   5 */ "import ::= PT_IMPORT strLit PT_SEMICOLON",
772
 /*   6 */ "import ::= PT_IMPORT PT_PUBLIC strLit PT_SEMICOLON",
773
 /*   7 */ "import ::= PT_IMPORT PT_WEAK strLit PT_SEMICOLON",
774
 /*   8 */ "package ::= PT_PACKAGE exIdent PT_SEMICOLON",
775
 /*   9 */ "extIdentInParentheses ::= PT_LPAREN exIdent PT_RPAREN",
776
 /*  10 */ "optionName ::= optionName exIdent",
777
 /*  11 */ "optionName ::= optionName PT_DOT extIdentInParentheses",
778
 /*  12 */ "optionName ::= optionName extIdentInParentheses",
779
 /*  13 */ "message ::= PT_MESSAGE messageName PT_LCURLY messageBody PT_RCURLY",
780
 /*  14 */ "messageBody ::=",
781
 /*  15 */ "messageBody ::= messageBody field",
782
 /*  16 */ "messageBody ::= messageBody enum",
783
 /*  17 */ "messageBody ::= messageBody message",
784
 /*  18 */ "messageBody ::= messageBody group",
785
 /*  19 */ "messageBody ::= messageBody oneof",
786
 /*  20 */ "messageBody ::= messageBody mapField",
787
 /*  21 */ "enum ::= PT_ENUM enumName PT_LCURLY enumBody PT_RCURLY",
788
 /*  22 */ "enumBody ::=",
789
 /*  23 */ "enumBody ::= enumBody enumField",
790
 /*  24 */ "enumField ::= exIdent PT_ASSIGN enumNumber PT_LBRACKET enumValueOptions PT_RBRACKET PT_SEMICOLON",
791
 /*  25 */ "enumField ::= exIdent PT_ASSIGN enumNumber",
792
 /*  26 */ "enumNumber ::= intLit",
793
 /*  27 */ "enumNumber ::= PT_PLUS intLit",
794
 /*  28 */ "enumNumber ::= PT_MINUS intLit",
795
 /*  29 */ "service ::= PT_SERVICE serviceName PT_LCURLY serviceBody PT_RCURLY",
796
 /*  30 */ "serviceBody ::=",
797
 /*  31 */ "serviceBody ::= serviceBody rpc",
798
 /*  32 */ "serviceBody ::= serviceBody stream",
799
 /*  33 */ "rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN",
800
 /*  34 */ "rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN",
801
 /*  35 */ "rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN",
802
 /*  36 */ "rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN",
803
 /*  37 */ "streamDecl ::= PT_STREAM streamName PT_LPAREN messageType PT_COMMA messageType PT_RPAREN",
804
 /*  38 */ "field ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON",
805
 /*  39 */ "field ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON",
806
 /*  40 */ "field ::= label type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON",
807
 /*  41 */ "field ::= label type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON",
808
 /*  42 */ "label ::= PT_REQUIRED",
809
 /*  43 */ "label ::= PT_OPTIONAL",
810
 /*  44 */ "label ::= PT_REPEATED",
811
 /*  45 */ "type ::= exIdent",
812
 /*  46 */ "fieldNumber ::= intLit",
813
 /*  47 */ "fieldNumber ::= PT_PLUS intLit",
814
 /*  48 */ "fieldOptions ::= fieldOption",
815
 /*  49 */ "fieldOptions ::= fieldOptions PT_COMMA fieldOption",
816
 /*  50 */ "fieldOption ::= optionName PT_ASSIGN constant",
817
 /*  51 */ "fieldOption ::= optionName PT_ASSIGN customOptionValue",
818
 /*  52 */ "group ::= PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY",
819
 /*  53 */ "group ::= label PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY",
820
 /*  54 */ "oneof ::= PT_ONEOF oneofName PT_LCURLY oneofBody PT_RCURLY",
821
 /*  55 */ "oneofBody ::=",
822
 /*  56 */ "oneofBody ::= oneofBody oneofField",
823
 /*  57 */ "oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON",
824
 /*  58 */ "oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON",
825
 /*  59 */ "mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON",
826
 /*  60 */ "mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_SEMICOLON",
827
 /*  61 */ "keyType ::= exIdent",
828
 /*  62 */ "extend ::= PT_EXTEND messageType PT_LCURLY extendBody PT_RCURLY",
829
 /*  63 */ "extendBody ::=",
830
 /*  64 */ "extendBody ::= extendBody field",
831
 /*  65 */ "extendBody ::= extendBody group",
832
 /*  66 */ "messageType ::= exIdent",
833
 /*  67 */ "intLit ::= PT_DECIMALLIT",
834
 /*  68 */ "intLit ::= PT_OCTALLIT",
835
 /*  69 */ "intLit ::= PT_HEXLIT",
836
 /*  70 */ "constant ::= exIdent",
837
 /*  71 */ "constant ::= intLit",
838
 /*  72 */ "constant ::= PT_PLUS intLit",
839
 /*  73 */ "constant ::= PT_MINUS intLit",
840
 /*  74 */ "constant ::= PT_PLUS exIdent",
841
 /*  75 */ "constant ::= PT_MINUS exIdent",
842
 /*  76 */ "strLit ::= PT_STRLIT",
843
 /*  77 */ "strLit ::= strLit PT_STRLIT",
844
 /*  78 */ "proto ::= wholeProtoBody",
845
 /*  79 */ "proto ::= syntax wholeProtoBody",
846
 /*  80 */ "proto ::= edition wholeProtoBody",
847
 /*  81 */ "protoBody ::= protoBody import",
848
 /*  82 */ "protoBody ::= protoBody package",
849
 /*  83 */ "protoBody ::= protoBody option",
850
 /*  84 */ "protoBody ::= protoBody emptyStatement",
851
 /*  85 */ "option ::= PT_OPTION optionName PT_ASSIGN constant PT_SEMICOLON",
852
 /*  86 */ "option ::= PT_OPTION optionName PT_ASSIGN customOptionValue PT_SEMICOLON",
853
 /*  87 */ "optionName ::= exIdent",
854
 /*  88 */ "optionName ::= extIdentInParentheses",
855
 /*  89 */ "customOptionValue ::= PT_LCURLY customOptionBody PT_RCURLY",
856
 /*  90 */ "customOptionBody ::=",
857
 /*  91 */ "customOptionBody ::= customOptionBody exIdent",
858
 /*  92 */ "customOptionBody ::= customOptionBody PT_STRLIT",
859
 /*  93 */ "customOptionBody ::= customOptionBody symbolsWithoutCurly",
860
 /*  94 */ "customOptionBody ::= customOptionBody intLit",
861
 /*  95 */ "customOptionBody ::= customOptionBody customOptionValue",
862
 /*  96 */ "symbolsWithoutCurly ::= PT_LPAREN",
863
 /*  97 */ "symbolsWithoutCurly ::= PT_RPAREN",
864
 /*  98 */ "symbolsWithoutCurly ::= PT_LBRACKET",
865
 /*  99 */ "symbolsWithoutCurly ::= PT_RBRACKET",
866
 /* 100 */ "symbolsWithoutCurly ::= PT_EQUAL",
867
 /* 101 */ "symbolsWithoutCurly ::= PT_NOTEQUAL",
868
 /* 102 */ "symbolsWithoutCurly ::= PT_NOTEQUAL2",
869
 /* 103 */ "symbolsWithoutCurly ::= PT_GEQUAL",
870
 /* 104 */ "symbolsWithoutCurly ::= PT_LEQUAL",
871
 /* 105 */ "symbolsWithoutCurly ::= PT_ASSIGN_PLUS",
872
 /* 106 */ "symbolsWithoutCurly ::= PT_ASSIGN",
873
 /* 107 */ "symbolsWithoutCurly ::= PT_PLUS",
874
 /* 108 */ "symbolsWithoutCurly ::= PT_MINUS",
875
 /* 109 */ "symbolsWithoutCurly ::= PT_MULTIPLY",
876
 /* 110 */ "symbolsWithoutCurly ::= PT_DIV",
877
 /* 111 */ "symbolsWithoutCurly ::= PT_LOGIC_OR",
878
 /* 112 */ "symbolsWithoutCurly ::= PT_OR",
879
 /* 113 */ "symbolsWithoutCurly ::= PT_LOGIC_AND",
880
 /* 114 */ "symbolsWithoutCurly ::= PT_AND",
881
 /* 115 */ "symbolsWithoutCurly ::= PT_NOT",
882
 /* 116 */ "symbolsWithoutCurly ::= PT_NEG",
883
 /* 117 */ "symbolsWithoutCurly ::= PT_XOR",
884
 /* 118 */ "symbolsWithoutCurly ::= PT_SHL",
885
 /* 119 */ "symbolsWithoutCurly ::= PT_SHR",
886
 /* 120 */ "symbolsWithoutCurly ::= PT_PERCENT",
887
 /* 121 */ "symbolsWithoutCurly ::= PT_DOLLAR",
888
 /* 122 */ "symbolsWithoutCurly ::= PT_COND",
889
 /* 123 */ "symbolsWithoutCurly ::= PT_SEMICOLON",
890
 /* 124 */ "symbolsWithoutCurly ::= PT_DOT",
891
 /* 125 */ "symbolsWithoutCurly ::= PT_COMMA",
892
 /* 126 */ "symbolsWithoutCurly ::= PT_COLON",
893
 /* 127 */ "symbolsWithoutCurly ::= PT_LESS",
894
 /* 128 */ "symbolsWithoutCurly ::= PT_GREATER",
895
 /* 129 */ "topLevelDef ::= message",
896
 /* 130 */ "topLevelDef ::= enum",
897
 /* 131 */ "topLevelDef ::= extend",
898
 /* 132 */ "topLevelDef ::= service",
899
 /* 133 */ "messageBody ::= messageBody extend",
900
 /* 134 */ "messageBody ::= messageBody extensions",
901
 /* 135 */ "messageBody ::= messageBody option",
902
 /* 136 */ "messageBody ::= messageBody reserved",
903
 /* 137 */ "messageBody ::= messageBody emptyStatement",
904
 /* 138 */ "enumBody ::= enumBody reserved",
905
 /* 139 */ "enumBody ::= enumBody option",
906
 /* 140 */ "enumBody ::= enumBody emptyStatement",
907
 /* 141 */ "enumValueOptions ::= enumValueOption",
908
 /* 142 */ "enumValueOptions ::= enumValueOptions PT_COMMA enumValueOption",
909
 /* 143 */ "enumValueOption ::= optionName PT_ASSIGN constant",
910
 /* 144 */ "enumValueOption ::= optionName PT_ASSIGN customOptionValue",
911
 /* 145 */ "serviceBody ::= serviceBody option",
912
 /* 146 */ "serviceBody ::= serviceBody emptyStatement",
913
 /* 147 */ "rpc ::= rpcDecl PT_SEMICOLON",
914
 /* 148 */ "rpc ::= rpcDecl PT_LCURLY rpcBody PT_RCURLY",
915
 /* 149 */ "rpcBody ::=",
916
 /* 150 */ "rpcBody ::= rpcBody option",
917
 /* 151 */ "rpcBody ::= rpcBody emptyStatement",
918
 /* 152 */ "stream ::= streamDecl PT_SEMICOLON",
919
 /* 153 */ "stream ::= streamDecl PT_LCURLY streamBody PT_RCURLY",
920
 /* 154 */ "streamBody ::=",
921
 /* 155 */ "streamBody ::= streamBody option",
922
 /* 156 */ "streamBody ::= streamBody emptyStatement",
923
 /* 157 */ "groupName ::= exIdent",
924
 /* 158 */ "oneofBody ::= oneofBody option",
925
 /* 159 */ "oneofBody ::= oneofBody group",
926
 /* 160 */ "oneofBody ::= oneofBody emptyStatement",
927
 /* 161 */ "extensions ::= PT_EXTENSIONS ranges PT_SEMICOLON",
928
 /* 162 */ "extensions ::= PT_EXTENSIONS ranges PT_LBRACKET declarations PT_RBRACKET PT_SEMICOLON",
929
 /* 163 */ "declarations ::= declaration",
930
 /* 164 */ "declarations ::= declarations PT_COMMA declaration",
931
 /* 165 */ "declaration ::= optionName PT_ASSIGN constant",
932
 /* 166 */ "declaration ::= optionName PT_ASSIGN customOptionValue",
933
 /* 167 */ "reserved ::= PT_RESERVED ranges PT_SEMICOLON",
934
 /* 168 */ "reserved ::= PT_RESERVED quoteFieldNames PT_SEMICOLON",
935
 /* 169 */ "reserved ::= PT_RESERVED reservedIdent PT_SEMICOLON",
936
 /* 170 */ "ranges ::= range",
937
 /* 171 */ "ranges ::= ranges PT_COMMA range",
938
 /* 172 */ "range ::= intLit",
939
 /* 173 */ "range ::= intLit PT_TO intLit",
940
 /* 174 */ "range ::= intLit PT_TO exIdent",
941
 /* 175 */ "quoteFieldNames ::= strLit",
942
 /* 176 */ "quoteFieldNames ::= quoteFieldNames PT_COMMA strLit",
943
 /* 177 */ "reservedIdent ::= fieldName",
944
 /* 178 */ "reservedIdent ::= fieldName PT_COMMA fieldName",
945
 /* 179 */ "extendBody ::= extendBody emptyStatement",
946
 /* 180 */ "messageName ::= exIdent",
947
 /* 181 */ "enumName ::= exIdent",
948
 /* 182 */ "streamName ::= exIdent",
949
 /* 183 */ "fieldName ::= exIdent",
950
 /* 184 */ "oneofName ::= exIdent",
951
 /* 185 */ "mapName ::= exIdent",
952
 /* 186 */ "serviceName ::= exIdent",
953
 /* 187 */ "rpcName ::= exIdent",
954
 /* 188 */ "emptyStatement ::= PT_SEMICOLON",
955
 /* 189 */ "constant ::= strLit",
956
 /* 190 */ "exIdent ::= PT_IDENT",
957
};
958
#endif /* NDEBUG */
959
960
961
#if YYSTACKDEPTH<=0
962
/*
963
** Try to increase the size of the parser stack.  Return the number
964
** of errors.  Return 0 on success.
965
*/
966
static int yyGrowStack(yyParser *p){
967
  int newSize;
968
  int idx;
969
  yyStackEntry *pNew;
970
971
  newSize = p->yystksz*2 + 100;
972
  idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
973
  if( p->yystack==&p->yystk0 ){
974
    pNew = malloc(newSize*sizeof(pNew[0]));
975
    if( pNew ) pNew[0] = p->yystk0;
976
  }else{
977
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
978
  }
979
  if( pNew ){
980
    p->yystack = pNew;
981
    p->yytos = &p->yystack[idx];
982
#ifndef NDEBUG
983
    if( yyTraceFILE ){
984
      fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",
985
              yyTracePrompt, p->yystksz, newSize);
986
    }
987
#endif
988
    p->yystksz = newSize;
989
  }
990
  return pNew==0;
991
}
992
#endif
993
994
/* Datatype of the argument to the memory allocated passed as the
995
** second argument to ProtobufLangParserAlloc() below.  This can be changed by
996
** putting an appropriate #define in the %include section of the input
997
** grammar.
998
*/
999
#ifndef YYMALLOCARGTYPE
1000
# define YYMALLOCARGTYPE size_t
1001
#endif
1002
1003
/* Initialize a new parser that has already been allocated.
1004
*/
1005
0
void ProtobufLangParserInit(void *yypRawParser ProtobufLangParserCTX_PDECL){
1006
0
  yyParser *yypParser = (yyParser*)yypRawParser;
1007
0
  ProtobufLangParserCTX_STORE
1008
#ifdef YYTRACKMAXSTACKDEPTH
1009
  yypParser->yyhwm = 0;
1010
#endif
1011
#if YYSTACKDEPTH<=0
1012
  yypParser->yytos = NULL;
1013
  yypParser->yystack = NULL;
1014
  yypParser->yystksz = 0;
1015
  if( yyGrowStack(yypParser) ){
1016
    yypParser->yystack = &yypParser->yystk0;
1017
    yypParser->yystksz = 1;
1018
  }
1019
#endif
1020
0
#ifndef YYNOERRORRECOVERY
1021
0
  yypParser->yyerrcnt = -1;
1022
0
#endif
1023
0
  yypParser->yytos = yypParser->yystack;
1024
0
  yypParser->yystack[0].stateno = 0;
1025
0
  yypParser->yystack[0].major = 0;
1026
0
#if YYSTACKDEPTH>0
1027
0
  yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1];
1028
0
#endif
1029
0
}
1030
1031
#ifndef ProtobufLangParser_ENGINEALWAYSONSTACK
1032
/*
1033
** This function allocates a new parser.
1034
** The only argument is a pointer to a function which works like
1035
** malloc.
1036
**
1037
** Inputs:
1038
** A pointer to the function used to allocate memory.
1039
**
1040
** Outputs:
1041
** A pointer to a parser.  This pointer is used in subsequent calls
1042
** to ProtobufLangParser and ProtobufLangParserFree.
1043
*/
1044
0
void *ProtobufLangParserAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ProtobufLangParserCTX_PDECL){
1045
0
  yyParser *yypParser;
1046
0
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
1047
0
  if( yypParser ){
1048
0
    ProtobufLangParserCTX_STORE
1049
0
    ProtobufLangParserInit(yypParser ProtobufLangParserCTX_PARAM);
1050
0
  }
1051
0
  return (void*)yypParser;
1052
0
}
1053
#endif /* ProtobufLangParser_ENGINEALWAYSONSTACK */
1054
1055
1056
/* The following function deletes the "minor type" or semantic value
1057
** associated with a symbol.  The symbol can be either a terminal
1058
** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
1059
** a pointer to the value to be deleted.  The code used to do the
1060
** deletions is derived from the %destructor and/or %token_destructor
1061
** directives of the input grammar.
1062
*/
1063
static void yy_destructor(
1064
  yyParser *yypParser,    /* The parser */
1065
  YYCODETYPE yymajor,     /* Type code for object to destroy */
1066
  YYMINORTYPE *yypminor   /* The object to be destroyed */
1067
0
){
1068
0
  ProtobufLangParserARG_FETCH
1069
0
  ProtobufLangParserCTX_FETCH
1070
0
  switch( yymajor ){
1071
    /* Here is inserted the actions which take place when a
1072
    ** terminal or non-terminal is destroyed.  This can happen
1073
    ** when the symbol is popped from the stack during a
1074
    ** reduce or during error processing or when a parser is
1075
    ** being destroyed before it is finished parsing.
1076
    **
1077
    ** Note: during a reduce, the only symbols destroyed are those
1078
    ** which appear on the RHS of the rule, but which are *not* used
1079
    ** inside the C code.
1080
    */
1081
/********* Begin destructor definitions ***************************************/
1082
      /* TERMINAL Destructor */
1083
0
    case 1: /* PT_IDENT */
1084
0
    case 2: /* PT_SYNTAX */
1085
0
    case 3: /* PT_EDITION */
1086
0
    case 4: /* PT_IMPORT */
1087
0
    case 5: /* PT_WEAK */
1088
0
    case 6: /* PT_PUBLIC */
1089
0
    case 7: /* PT_PACKAGE */
1090
0
    case 8: /* PT_OPTION */
1091
0
    case 9: /* PT_REQUIRED */
1092
0
    case 10: /* PT_OPTIONAL */
1093
0
    case 11: /* PT_REPEATED */
1094
0
    case 12: /* PT_ONEOF */
1095
0
    case 13: /* PT_MAP */
1096
0
    case 14: /* PT_RESERVED */
1097
0
    case 15: /* PT_ENUM */
1098
0
    case 16: /* PT_GROUP */
1099
0
    case 17: /* PT_EXTEND */
1100
0
    case 18: /* PT_EXTENSIONS */
1101
0
    case 19: /* PT_MESSAGE */
1102
0
    case 20: /* PT_SERVICE */
1103
0
    case 21: /* PT_RPC */
1104
0
    case 22: /* PT_STREAM */
1105
0
    case 23: /* PT_RETURNS */
1106
0
    case 24: /* PT_TO */
1107
0
    case 25: /* PT_ASSIGN */
1108
0
    case 26: /* PT_SEMICOLON */
1109
0
    case 27: /* PT_LPAREN */
1110
0
    case 28: /* PT_RPAREN */
1111
0
    case 29: /* PT_DOT */
1112
0
    case 30: /* PT_LCURLY */
1113
0
    case 31: /* PT_RCURLY */
1114
0
    case 32: /* PT_STRLIT */
1115
0
    case 33: /* PT_LBRACKET */
1116
0
    case 34: /* PT_RBRACKET */
1117
0
    case 35: /* PT_EQUAL */
1118
0
    case 36: /* PT_NOTEQUAL */
1119
0
    case 37: /* PT_NOTEQUAL2 */
1120
0
    case 38: /* PT_GEQUAL */
1121
0
    case 39: /* PT_LEQUAL */
1122
0
    case 40: /* PT_ASSIGN_PLUS */
1123
0
    case 41: /* PT_PLUS */
1124
0
    case 42: /* PT_MINUS */
1125
0
    case 43: /* PT_MULTIPLY */
1126
0
    case 44: /* PT_DIV */
1127
0
    case 45: /* PT_LOGIC_OR */
1128
0
    case 46: /* PT_OR */
1129
0
    case 47: /* PT_LOGIC_AND */
1130
0
    case 48: /* PT_AND */
1131
0
    case 49: /* PT_NOT */
1132
0
    case 50: /* PT_NEG */
1133
0
    case 51: /* PT_XOR */
1134
0
    case 52: /* PT_SHL */
1135
0
    case 53: /* PT_SHR */
1136
0
    case 54: /* PT_PERCENT */
1137
0
    case 55: /* PT_DOLLAR */
1138
0
    case 56: /* PT_COND */
1139
0
    case 57: /* PT_COMMA */
1140
0
    case 58: /* PT_COLON */
1141
0
    case 59: /* PT_LESS */
1142
0
    case 60: /* PT_GREATER */
1143
0
    case 61: /* PT_DECIMALLIT */
1144
0
    case 62: /* PT_OCTALLIT */
1145
0
    case 63: /* PT_HEXLIT */
1146
0
{
1147
0
#line 66 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1148
1149
    /* We manage memory allocated for token values by ourself */
1150
0
    (void) state; /* Mark unused, similar to Q_UNUSED */
1151
0
    (void) (yypminor->yy0); /* Mark unused, similar to Q_UNUSED */
1152
1153
0
#line 1178 "./protobuf_lang_parser.c"
1154
0
}
1155
0
      break;
1156
/********* End destructor definitions *****************************************/
1157
0
    default:  break;   /* If no destructor action specified: do nothing */
1158
0
  }
1159
0
}
1160
1161
/*
1162
** Pop the parser's stack once.
1163
**
1164
** If there is a destructor routine associated with the token which
1165
** is popped from the stack, then call it.
1166
*/
1167
0
static void yy_pop_parser_stack(yyParser *pParser){
1168
0
  yyStackEntry *yytos;
1169
0
  assert( pParser->yytos!=0 );
1170
0
  assert( pParser->yytos > pParser->yystack );
1171
0
  yytos = pParser->yytos--;
1172
#ifndef NDEBUG
1173
  if( yyTraceFILE ){
1174
    fprintf(yyTraceFILE,"%sPopping %s\n",
1175
      yyTracePrompt,
1176
      yyTokenName[yytos->major]);
1177
  }
1178
#endif
1179
0
  yy_destructor(pParser, yytos->major, &yytos->minor);
1180
0
}
1181
1182
/*
1183
** Clear all secondary memory allocations from the parser
1184
*/
1185
0
void ProtobufLangParserFinalize(void *p){
1186
0
  yyParser *pParser = (yyParser*)p;
1187
0
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
1188
#if YYSTACKDEPTH<=0
1189
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
1190
#endif
1191
0
}
1192
1193
#ifndef ProtobufLangParser_ENGINEALWAYSONSTACK
1194
/*
1195
** Deallocate and destroy a parser.  Destructors are called for
1196
** all stack elements before shutting the parser down.
1197
**
1198
** If the YYPARSEFREENEVERNULL macro exists (for example because it
1199
** is defined in a %include section of the input grammar) then it is
1200
** assumed that the input pointer is never NULL.
1201
*/
1202
void ProtobufLangParserFree(
1203
  void *p,                    /* The parser to be deleted */
1204
  void (*freeProc)(void*)     /* Function used to reclaim memory */
1205
0
){
1206
0
#ifndef YYPARSEFREENEVERNULL
1207
0
  if( p==0 ) return;
1208
0
#endif
1209
0
  ProtobufLangParserFinalize(p);
1210
0
  (*freeProc)(p);
1211
0
}
1212
#endif /* ProtobufLangParser_ENGINEALWAYSONSTACK */
1213
1214
/*
1215
** Return the peak depth of the stack for a parser.
1216
*/
1217
#ifdef YYTRACKMAXSTACKDEPTH
1218
int ProtobufLangParserStackPeak(void *p){
1219
  yyParser *pParser = (yyParser*)p;
1220
  return pParser->yyhwm;
1221
}
1222
#endif
1223
1224
/* This array of booleans keeps track of the parser statement
1225
** coverage.  The element yycoverage[X][Y] is set when the parser
1226
** is in state X and has a lookahead token Y.  In a well-tested
1227
** systems, every element of this matrix should end up being set.
1228
*/
1229
#if defined(YYCOVERAGE)
1230
static unsigned char yycoverage[YYNSTATE][YYNTOKEN];
1231
#endif
1232
1233
/*
1234
** Write into out a description of every state/lookahead combination that
1235
**
1236
**   (1)  has not been used by the parser, and
1237
**   (2)  is not a syntax error.
1238
**
1239
** Return the number of missed state/lookahead combinations.
1240
*/
1241
#if defined(YYCOVERAGE)
1242
int ProtobufLangParserCoverage(FILE *out){
1243
  int stateno, iLookAhead, i;
1244
  int nMissed = 0;
1245
  for(stateno=0; stateno<YYNSTATE; stateno++){
1246
    i = yy_shift_ofst[stateno];
1247
    for(iLookAhead=0; iLookAhead<YYNTOKEN; iLookAhead++){
1248
      if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;
1249
      if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;
1250
      if( out ){
1251
        fprintf(out,"State %d lookahead %s %s\n", stateno,
1252
                yyTokenName[iLookAhead],
1253
                yycoverage[stateno][iLookAhead] ? "ok" : "missed");
1254
      }
1255
    }
1256
  }
1257
  return nMissed;
1258
}
1259
#endif
1260
1261
/*
1262
** Find the appropriate action for a parser given the terminal
1263
** look-ahead token iLookAhead.
1264
*/
1265
static YYACTIONTYPE yy_find_shift_action(
1266
  YYCODETYPE iLookAhead,    /* The look-ahead token */
1267
  YYACTIONTYPE stateno      /* Current state number */
1268
0
){
1269
0
  int i;
1270
1271
0
  if( stateno>YY_MAX_SHIFT ) return stateno;
1272
0
  assert( stateno <= YY_SHIFT_COUNT );
1273
#if defined(YYCOVERAGE)
1274
  yycoverage[stateno][iLookAhead] = 1;
1275
#endif
1276
0
  do{
1277
0
    i = yy_shift_ofst[stateno];
1278
0
    assert( i>=0 );
1279
0
    assert( i<=YY_ACTTAB_COUNT );
1280
0
    assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
1281
0
    assert( iLookAhead!=YYNOCODE );
1282
0
    assert( iLookAhead < YYNTOKEN );
1283
0
    i += iLookAhead;
1284
0
    assert( i<(int)YY_NLOOKAHEAD );
1285
0
    if( yy_lookahead[i]!=iLookAhead ){
1286
0
#ifdef YYFALLBACK
1287
0
      YYCODETYPE iFallback;            /* Fallback token */
1288
0
      assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
1289
0
      iFallback = yyFallback[iLookAhead];
1290
0
      if( iFallback!=0 ){
1291
#ifndef NDEBUG
1292
        if( yyTraceFILE ){
1293
          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
1294
             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
1295
        }
1296
#endif
1297
0
        assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
1298
0
        iLookAhead = iFallback;
1299
0
        continue;
1300
0
      }
1301
0
#endif
1302
#ifdef YYWILDCARD
1303
      {
1304
        int j = i - iLookAhead + YYWILDCARD;
1305
        assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
1306
        if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
1307
#ifndef NDEBUG
1308
          if( yyTraceFILE ){
1309
            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
1310
               yyTracePrompt, yyTokenName[iLookAhead],
1311
               yyTokenName[YYWILDCARD]);
1312
          }
1313
#endif /* NDEBUG */
1314
          return yy_action[j];
1315
        }
1316
      }
1317
#endif /* YYWILDCARD */
1318
0
      return yy_default[stateno];
1319
0
    }else{
1320
0
      assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) );
1321
0
      return yy_action[i];
1322
0
    }
1323
0
  }while(1);
1324
0
}
1325
1326
/*
1327
** Find the appropriate action for a parser given the non-terminal
1328
** look-ahead token iLookAhead.
1329
*/
1330
static YYACTIONTYPE yy_find_reduce_action(
1331
  YYACTIONTYPE stateno,     /* Current state number */
1332
  YYCODETYPE iLookAhead     /* The look-ahead token */
1333
0
){
1334
0
  int i;
1335
#ifdef YYERRORSYMBOL
1336
  if( stateno>YY_REDUCE_COUNT ){
1337
    return yy_default[stateno];
1338
  }
1339
#else
1340
0
  assert( stateno<=YY_REDUCE_COUNT );
1341
0
#endif
1342
0
  i = yy_reduce_ofst[stateno];
1343
0
  assert( iLookAhead!=YYNOCODE );
1344
0
  i += iLookAhead;
1345
#ifdef YYERRORSYMBOL
1346
  if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
1347
    return yy_default[stateno];
1348
  }
1349
#else
1350
0
  assert( i>=0 && i<YY_ACTTAB_COUNT );
1351
0
  assert( yy_lookahead[i]==iLookAhead );
1352
0
#endif
1353
0
  return yy_action[i];
1354
0
}
1355
1356
/*
1357
** The following routine is called if the stack overflows.
1358
*/
1359
0
static void yyStackOverflow(yyParser *yypParser){
1360
0
   ProtobufLangParserARG_FETCH
1361
0
   ProtobufLangParserCTX_FETCH
1362
#ifndef NDEBUG
1363
   if( yyTraceFILE ){
1364
     fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
1365
   }
1366
#endif
1367
0
   while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
1368
   /* Here code is inserted which will execute if the parser
1369
   ** stack every overflows */
1370
/******** Begin %stack_overflow code ******************************************/
1371
/******** End %stack_overflow code ********************************************/
1372
0
   ProtobufLangParserARG_STORE /* Suppress warning about unused %extra_argument var */
1373
0
   ProtobufLangParserCTX_STORE
1374
0
}
1375
1376
/*
1377
** Print tracing information for a SHIFT action
1378
*/
1379
#ifndef NDEBUG
1380
static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
1381
  if( yyTraceFILE ){
1382
    if( yyNewState<YYNSTATE ){
1383
      fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",
1384
         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
1385
         yyNewState);
1386
    }else{
1387
      fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",
1388
         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
1389
         yyNewState - YY_MIN_REDUCE);
1390
    }
1391
  }
1392
}
1393
#else
1394
# define yyTraceShift(X,Y,Z)
1395
#endif
1396
1397
/*
1398
** Perform a shift action.
1399
*/
1400
static void yy_shift(
1401
  yyParser *yypParser,          /* The parser to be shifted */
1402
  YYACTIONTYPE yyNewState,      /* The new state to shift in */
1403
  YYCODETYPE yyMajor,           /* The major token to shift in */
1404
  ProtobufLangParserTOKENTYPE yyMinor        /* The minor token to shift in */
1405
0
){
1406
0
  yyStackEntry *yytos;
1407
0
  yypParser->yytos++;
1408
#ifdef YYTRACKMAXSTACKDEPTH
1409
  if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
1410
    yypParser->yyhwm++;
1411
    assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
1412
  }
1413
#endif
1414
0
#if YYSTACKDEPTH>0
1415
0
  if( yypParser->yytos>yypParser->yystackEnd ){
1416
0
    yypParser->yytos--;
1417
0
    yyStackOverflow(yypParser);
1418
0
    return;
1419
0
  }
1420
#else
1421
  if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
1422
    if( yyGrowStack(yypParser) ){
1423
      yypParser->yytos--;
1424
      yyStackOverflow(yypParser);
1425
      return;
1426
    }
1427
  }
1428
#endif
1429
0
  if( yyNewState > YY_MAX_SHIFT ){
1430
0
    yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
1431
0
  }
1432
0
  yytos = yypParser->yytos;
1433
0
  yytos->stateno = yyNewState;
1434
0
  yytos->major = yyMajor;
1435
0
  yytos->minor.yy0 = yyMinor;
1436
0
  yyTraceShift(yypParser, yyNewState, "Shift");
1437
0
}
1438
1439
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
1440
** of that rule */
1441
static const YYCODETYPE yyRuleInfoLhs[] = {
1442
   108,  /* (0) wholeProtoBody ::= protoBody */
1443
   109,  /* (1) syntax ::= PT_SYNTAX PT_ASSIGN strLit PT_SEMICOLON */
1444
   110,  /* (2) edition ::= PT_EDITION PT_ASSIGN strLit PT_SEMICOLON */
1445
    81,  /* (3) protoBody ::= */
1446
    81,  /* (4) protoBody ::= protoBody topLevelDef */
1447
   111,  /* (5) import ::= PT_IMPORT strLit PT_SEMICOLON */
1448
   111,  /* (6) import ::= PT_IMPORT PT_PUBLIC strLit PT_SEMICOLON */
1449
   111,  /* (7) import ::= PT_IMPORT PT_WEAK strLit PT_SEMICOLON */
1450
   112,  /* (8) package ::= PT_PACKAGE exIdent PT_SEMICOLON */
1451
   116,  /* (9) extIdentInParentheses ::= PT_LPAREN exIdent PT_RPAREN */
1452
    71,  /* (10) optionName ::= optionName exIdent */
1453
    71,  /* (11) optionName ::= optionName PT_DOT extIdentInParentheses */
1454
    71,  /* (12) optionName ::= optionName extIdentInParentheses */
1455
    83,  /* (13) message ::= PT_MESSAGE messageName PT_LCURLY messageBody PT_RCURLY */
1456
    84,  /* (14) messageBody ::= */
1457
    84,  /* (15) messageBody ::= messageBody field */
1458
    84,  /* (16) messageBody ::= messageBody enum */
1459
    84,  /* (17) messageBody ::= messageBody message */
1460
    84,  /* (18) messageBody ::= messageBody group */
1461
    84,  /* (19) messageBody ::= messageBody oneof */
1462
    84,  /* (20) messageBody ::= messageBody mapField */
1463
    89,  /* (21) enum ::= PT_ENUM enumName PT_LCURLY enumBody PT_RCURLY */
1464
    90,  /* (22) enumBody ::= */
1465
    90,  /* (23) enumBody ::= enumBody enumField */
1466
    91,  /* (24) enumField ::= exIdent PT_ASSIGN enumNumber PT_LBRACKET enumValueOptions PT_RBRACKET PT_SEMICOLON */
1467
    91,  /* (25) enumField ::= exIdent PT_ASSIGN enumNumber */
1468
   106,  /* (26) enumNumber ::= intLit */
1469
   106,  /* (27) enumNumber ::= PT_PLUS intLit */
1470
   106,  /* (28) enumNumber ::= PT_MINUS intLit */
1471
    92,  /* (29) service ::= PT_SERVICE serviceName PT_LCURLY serviceBody PT_RCURLY */
1472
    93,  /* (30) serviceBody ::= */
1473
    93,  /* (31) serviceBody ::= serviceBody rpc */
1474
    93,  /* (32) serviceBody ::= serviceBody stream */
1475
    86,  /* (33) rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */
1476
    86,  /* (34) rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */
1477
    86,  /* (35) rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */
1478
    86,  /* (36) rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */
1479
    95,  /* (37) streamDecl ::= PT_STREAM streamName PT_LPAREN messageType PT_COMMA messageType PT_RPAREN */
1480
    87,  /* (38) field ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */
1481
    87,  /* (39) field ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
1482
    87,  /* (40) field ::= label type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */
1483
    87,  /* (41) field ::= label type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
1484
    65,  /* (42) label ::= PT_REQUIRED */
1485
    65,  /* (43) label ::= PT_OPTIONAL */
1486
    65,  /* (44) label ::= PT_REPEATED */
1487
    66,  /* (45) type ::= exIdent */
1488
   105,  /* (46) fieldNumber ::= intLit */
1489
   105,  /* (47) fieldNumber ::= PT_PLUS intLit */
1490
    96,  /* (48) fieldOptions ::= fieldOption */
1491
    96,  /* (49) fieldOptions ::= fieldOptions PT_COMMA fieldOption */
1492
    97,  /* (50) fieldOption ::= optionName PT_ASSIGN constant */
1493
    97,  /* (51) fieldOption ::= optionName PT_ASSIGN customOptionValue */
1494
   101,  /* (52) group ::= PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */
1495
   101,  /* (53) group ::= label PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */
1496
    98,  /* (54) oneof ::= PT_ONEOF oneofName PT_LCURLY oneofBody PT_RCURLY */
1497
    99,  /* (55) oneofBody ::= */
1498
    99,  /* (56) oneofBody ::= oneofBody oneofField */
1499
    88,  /* (57) oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
1500
    88,  /* (58) oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */
1501
   100,  /* (59) mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
1502
   100,  /* (60) mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_SEMICOLON */
1503
    67,  /* (61) keyType ::= exIdent */
1504
   102,  /* (62) extend ::= PT_EXTEND messageType PT_LCURLY extendBody PT_RCURLY */
1505
   103,  /* (63) extendBody ::= */
1506
   103,  /* (64) extendBody ::= extendBody field */
1507
   103,  /* (65) extendBody ::= extendBody group */
1508
    68,  /* (66) messageType ::= exIdent */
1509
   104,  /* (67) intLit ::= PT_DECIMALLIT */
1510
   104,  /* (68) intLit ::= PT_OCTALLIT */
1511
   104,  /* (69) intLit ::= PT_HEXLIT */
1512
    69,  /* (70) constant ::= exIdent */
1513
    69,  /* (71) constant ::= intLit */
1514
    69,  /* (72) constant ::= PT_PLUS intLit */
1515
    69,  /* (73) constant ::= PT_MINUS intLit */
1516
    69,  /* (74) constant ::= PT_PLUS exIdent */
1517
    69,  /* (75) constant ::= PT_MINUS exIdent */
1518
    64,  /* (76) strLit ::= PT_STRLIT */
1519
    64,  /* (77) strLit ::= strLit PT_STRLIT */
1520
   107,  /* (78) proto ::= wholeProtoBody */
1521
   107,  /* (79) proto ::= syntax wholeProtoBody */
1522
   107,  /* (80) proto ::= edition wholeProtoBody */
1523
    81,  /* (81) protoBody ::= protoBody import */
1524
    81,  /* (82) protoBody ::= protoBody package */
1525
    81,  /* (83) protoBody ::= protoBody option */
1526
    81,  /* (84) protoBody ::= protoBody emptyStatement */
1527
   113,  /* (85) option ::= PT_OPTION optionName PT_ASSIGN constant PT_SEMICOLON */
1528
   113,  /* (86) option ::= PT_OPTION optionName PT_ASSIGN customOptionValue PT_SEMICOLON */
1529
    71,  /* (87) optionName ::= exIdent */
1530
    71,  /* (88) optionName ::= extIdentInParentheses */
1531
   115,  /* (89) customOptionValue ::= PT_LCURLY customOptionBody PT_RCURLY */
1532
   117,  /* (90) customOptionBody ::= */
1533
   117,  /* (91) customOptionBody ::= customOptionBody exIdent */
1534
   117,  /* (92) customOptionBody ::= customOptionBody PT_STRLIT */
1535
   117,  /* (93) customOptionBody ::= customOptionBody symbolsWithoutCurly */
1536
   117,  /* (94) customOptionBody ::= customOptionBody intLit */
1537
   117,  /* (95) customOptionBody ::= customOptionBody customOptionValue */
1538
   118,  /* (96) symbolsWithoutCurly ::= PT_LPAREN */
1539
   118,  /* (97) symbolsWithoutCurly ::= PT_RPAREN */
1540
   118,  /* (98) symbolsWithoutCurly ::= PT_LBRACKET */
1541
   118,  /* (99) symbolsWithoutCurly ::= PT_RBRACKET */
1542
   118,  /* (100) symbolsWithoutCurly ::= PT_EQUAL */
1543
   118,  /* (101) symbolsWithoutCurly ::= PT_NOTEQUAL */
1544
   118,  /* (102) symbolsWithoutCurly ::= PT_NOTEQUAL2 */
1545
   118,  /* (103) symbolsWithoutCurly ::= PT_GEQUAL */
1546
   118,  /* (104) symbolsWithoutCurly ::= PT_LEQUAL */
1547
   118,  /* (105) symbolsWithoutCurly ::= PT_ASSIGN_PLUS */
1548
   118,  /* (106) symbolsWithoutCurly ::= PT_ASSIGN */
1549
   118,  /* (107) symbolsWithoutCurly ::= PT_PLUS */
1550
   118,  /* (108) symbolsWithoutCurly ::= PT_MINUS */
1551
   118,  /* (109) symbolsWithoutCurly ::= PT_MULTIPLY */
1552
   118,  /* (110) symbolsWithoutCurly ::= PT_DIV */
1553
   118,  /* (111) symbolsWithoutCurly ::= PT_LOGIC_OR */
1554
   118,  /* (112) symbolsWithoutCurly ::= PT_OR */
1555
   118,  /* (113) symbolsWithoutCurly ::= PT_LOGIC_AND */
1556
   118,  /* (114) symbolsWithoutCurly ::= PT_AND */
1557
   118,  /* (115) symbolsWithoutCurly ::= PT_NOT */
1558
   118,  /* (116) symbolsWithoutCurly ::= PT_NEG */
1559
   118,  /* (117) symbolsWithoutCurly ::= PT_XOR */
1560
   118,  /* (118) symbolsWithoutCurly ::= PT_SHL */
1561
   118,  /* (119) symbolsWithoutCurly ::= PT_SHR */
1562
   118,  /* (120) symbolsWithoutCurly ::= PT_PERCENT */
1563
   118,  /* (121) symbolsWithoutCurly ::= PT_DOLLAR */
1564
   118,  /* (122) symbolsWithoutCurly ::= PT_COND */
1565
   118,  /* (123) symbolsWithoutCurly ::= PT_SEMICOLON */
1566
   118,  /* (124) symbolsWithoutCurly ::= PT_DOT */
1567
   118,  /* (125) symbolsWithoutCurly ::= PT_COMMA */
1568
   118,  /* (126) symbolsWithoutCurly ::= PT_COLON */
1569
   118,  /* (127) symbolsWithoutCurly ::= PT_LESS */
1570
   118,  /* (128) symbolsWithoutCurly ::= PT_GREATER */
1571
    82,  /* (129) topLevelDef ::= message */
1572
    82,  /* (130) topLevelDef ::= enum */
1573
    82,  /* (131) topLevelDef ::= extend */
1574
    82,  /* (132) topLevelDef ::= service */
1575
    84,  /* (133) messageBody ::= messageBody extend */
1576
    84,  /* (134) messageBody ::= messageBody extensions */
1577
    84,  /* (135) messageBody ::= messageBody option */
1578
    84,  /* (136) messageBody ::= messageBody reserved */
1579
    84,  /* (137) messageBody ::= messageBody emptyStatement */
1580
    90,  /* (138) enumBody ::= enumBody reserved */
1581
    90,  /* (139) enumBody ::= enumBody option */
1582
    90,  /* (140) enumBody ::= enumBody emptyStatement */
1583
   121,  /* (141) enumValueOptions ::= enumValueOption */
1584
   121,  /* (142) enumValueOptions ::= enumValueOptions PT_COMMA enumValueOption */
1585
   122,  /* (143) enumValueOption ::= optionName PT_ASSIGN constant */
1586
   122,  /* (144) enumValueOption ::= optionName PT_ASSIGN customOptionValue */
1587
    93,  /* (145) serviceBody ::= serviceBody option */
1588
    93,  /* (146) serviceBody ::= serviceBody emptyStatement */
1589
    85,  /* (147) rpc ::= rpcDecl PT_SEMICOLON */
1590
    85,  /* (148) rpc ::= rpcDecl PT_LCURLY rpcBody PT_RCURLY */
1591
   123,  /* (149) rpcBody ::= */
1592
   123,  /* (150) rpcBody ::= rpcBody option */
1593
   123,  /* (151) rpcBody ::= rpcBody emptyStatement */
1594
    94,  /* (152) stream ::= streamDecl PT_SEMICOLON */
1595
    94,  /* (153) stream ::= streamDecl PT_LCURLY streamBody PT_RCURLY */
1596
   124,  /* (154) streamBody ::= */
1597
   124,  /* (155) streamBody ::= streamBody option */
1598
   124,  /* (156) streamBody ::= streamBody emptyStatement */
1599
    80,  /* (157) groupName ::= exIdent */
1600
    99,  /* (158) oneofBody ::= oneofBody option */
1601
    99,  /* (159) oneofBody ::= oneofBody group */
1602
    99,  /* (160) oneofBody ::= oneofBody emptyStatement */
1603
   119,  /* (161) extensions ::= PT_EXTENSIONS ranges PT_SEMICOLON */
1604
   119,  /* (162) extensions ::= PT_EXTENSIONS ranges PT_LBRACKET declarations PT_RBRACKET PT_SEMICOLON */
1605
   126,  /* (163) declarations ::= declaration */
1606
   126,  /* (164) declarations ::= declarations PT_COMMA declaration */
1607
   127,  /* (165) declaration ::= optionName PT_ASSIGN constant */
1608
   127,  /* (166) declaration ::= optionName PT_ASSIGN customOptionValue */
1609
   120,  /* (167) reserved ::= PT_RESERVED ranges PT_SEMICOLON */
1610
   120,  /* (168) reserved ::= PT_RESERVED quoteFieldNames PT_SEMICOLON */
1611
   120,  /* (169) reserved ::= PT_RESERVED reservedIdent PT_SEMICOLON */
1612
   125,  /* (170) ranges ::= range */
1613
   125,  /* (171) ranges ::= ranges PT_COMMA range */
1614
   130,  /* (172) range ::= intLit */
1615
   130,  /* (173) range ::= intLit PT_TO intLit */
1616
   130,  /* (174) range ::= intLit PT_TO exIdent */
1617
   128,  /* (175) quoteFieldNames ::= strLit */
1618
   128,  /* (176) quoteFieldNames ::= quoteFieldNames PT_COMMA strLit */
1619
   129,  /* (177) reservedIdent ::= fieldName */
1620
   129,  /* (178) reservedIdent ::= fieldName PT_COMMA fieldName */
1621
   103,  /* (179) extendBody ::= extendBody emptyStatement */
1622
    72,  /* (180) messageName ::= exIdent */
1623
    73,  /* (181) enumName ::= exIdent */
1624
    74,  /* (182) streamName ::= exIdent */
1625
    75,  /* (183) fieldName ::= exIdent */
1626
    76,  /* (184) oneofName ::= exIdent */
1627
    77,  /* (185) mapName ::= exIdent */
1628
    78,  /* (186) serviceName ::= exIdent */
1629
    79,  /* (187) rpcName ::= exIdent */
1630
   114,  /* (188) emptyStatement ::= PT_SEMICOLON */
1631
    69,  /* (189) constant ::= strLit */
1632
    70,  /* (190) exIdent ::= PT_IDENT */
1633
};
1634
1635
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
1636
** of symbols on the right-hand side of that rule. */
1637
static const signed char yyRuleInfoNRhs[] = {
1638
   -1,  /* (0) wholeProtoBody ::= protoBody */
1639
   -4,  /* (1) syntax ::= PT_SYNTAX PT_ASSIGN strLit PT_SEMICOLON */
1640
   -4,  /* (2) edition ::= PT_EDITION PT_ASSIGN strLit PT_SEMICOLON */
1641
    0,  /* (3) protoBody ::= */
1642
   -2,  /* (4) protoBody ::= protoBody topLevelDef */
1643
   -3,  /* (5) import ::= PT_IMPORT strLit PT_SEMICOLON */
1644
   -4,  /* (6) import ::= PT_IMPORT PT_PUBLIC strLit PT_SEMICOLON */
1645
   -4,  /* (7) import ::= PT_IMPORT PT_WEAK strLit PT_SEMICOLON */
1646
   -3,  /* (8) package ::= PT_PACKAGE exIdent PT_SEMICOLON */
1647
   -3,  /* (9) extIdentInParentheses ::= PT_LPAREN exIdent PT_RPAREN */
1648
   -2,  /* (10) optionName ::= optionName exIdent */
1649
   -3,  /* (11) optionName ::= optionName PT_DOT extIdentInParentheses */
1650
   -2,  /* (12) optionName ::= optionName extIdentInParentheses */
1651
   -5,  /* (13) message ::= PT_MESSAGE messageName PT_LCURLY messageBody PT_RCURLY */
1652
    0,  /* (14) messageBody ::= */
1653
   -2,  /* (15) messageBody ::= messageBody field */
1654
   -2,  /* (16) messageBody ::= messageBody enum */
1655
   -2,  /* (17) messageBody ::= messageBody message */
1656
   -2,  /* (18) messageBody ::= messageBody group */
1657
   -2,  /* (19) messageBody ::= messageBody oneof */
1658
   -2,  /* (20) messageBody ::= messageBody mapField */
1659
   -5,  /* (21) enum ::= PT_ENUM enumName PT_LCURLY enumBody PT_RCURLY */
1660
    0,  /* (22) enumBody ::= */
1661
   -2,  /* (23) enumBody ::= enumBody enumField */
1662
   -7,  /* (24) enumField ::= exIdent PT_ASSIGN enumNumber PT_LBRACKET enumValueOptions PT_RBRACKET PT_SEMICOLON */
1663
   -3,  /* (25) enumField ::= exIdent PT_ASSIGN enumNumber */
1664
   -1,  /* (26) enumNumber ::= intLit */
1665
   -2,  /* (27) enumNumber ::= PT_PLUS intLit */
1666
   -2,  /* (28) enumNumber ::= PT_MINUS intLit */
1667
   -5,  /* (29) service ::= PT_SERVICE serviceName PT_LCURLY serviceBody PT_RCURLY */
1668
    0,  /* (30) serviceBody ::= */
1669
   -2,  /* (31) serviceBody ::= serviceBody rpc */
1670
   -2,  /* (32) serviceBody ::= serviceBody stream */
1671
   -9,  /* (33) rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */
1672
  -10,  /* (34) rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */
1673
  -10,  /* (35) rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */
1674
  -11,  /* (36) rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */
1675
   -7,  /* (37) streamDecl ::= PT_STREAM streamName PT_LPAREN messageType PT_COMMA messageType PT_RPAREN */
1676
   -5,  /* (38) field ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */
1677
   -8,  /* (39) field ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
1678
   -6,  /* (40) field ::= label type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */
1679
   -9,  /* (41) field ::= label type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
1680
   -1,  /* (42) label ::= PT_REQUIRED */
1681
   -1,  /* (43) label ::= PT_OPTIONAL */
1682
   -1,  /* (44) label ::= PT_REPEATED */
1683
   -1,  /* (45) type ::= exIdent */
1684
   -1,  /* (46) fieldNumber ::= intLit */
1685
   -2,  /* (47) fieldNumber ::= PT_PLUS intLit */
1686
   -1,  /* (48) fieldOptions ::= fieldOption */
1687
   -3,  /* (49) fieldOptions ::= fieldOptions PT_COMMA fieldOption */
1688
   -3,  /* (50) fieldOption ::= optionName PT_ASSIGN constant */
1689
   -3,  /* (51) fieldOption ::= optionName PT_ASSIGN customOptionValue */
1690
   -7,  /* (52) group ::= PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */
1691
   -8,  /* (53) group ::= label PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */
1692
   -5,  /* (54) oneof ::= PT_ONEOF oneofName PT_LCURLY oneofBody PT_RCURLY */
1693
    0,  /* (55) oneofBody ::= */
1694
   -2,  /* (56) oneofBody ::= oneofBody oneofField */
1695
   -8,  /* (57) oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
1696
   -5,  /* (58) oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */
1697
  -13,  /* (59) mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
1698
  -10,  /* (60) mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_SEMICOLON */
1699
   -1,  /* (61) keyType ::= exIdent */
1700
   -5,  /* (62) extend ::= PT_EXTEND messageType PT_LCURLY extendBody PT_RCURLY */
1701
    0,  /* (63) extendBody ::= */
1702
   -2,  /* (64) extendBody ::= extendBody field */
1703
   -2,  /* (65) extendBody ::= extendBody group */
1704
   -1,  /* (66) messageType ::= exIdent */
1705
   -1,  /* (67) intLit ::= PT_DECIMALLIT */
1706
   -1,  /* (68) intLit ::= PT_OCTALLIT */
1707
   -1,  /* (69) intLit ::= PT_HEXLIT */
1708
   -1,  /* (70) constant ::= exIdent */
1709
   -1,  /* (71) constant ::= intLit */
1710
   -2,  /* (72) constant ::= PT_PLUS intLit */
1711
   -2,  /* (73) constant ::= PT_MINUS intLit */
1712
   -2,  /* (74) constant ::= PT_PLUS exIdent */
1713
   -2,  /* (75) constant ::= PT_MINUS exIdent */
1714
   -1,  /* (76) strLit ::= PT_STRLIT */
1715
   -2,  /* (77) strLit ::= strLit PT_STRLIT */
1716
   -1,  /* (78) proto ::= wholeProtoBody */
1717
   -2,  /* (79) proto ::= syntax wholeProtoBody */
1718
   -2,  /* (80) proto ::= edition wholeProtoBody */
1719
   -2,  /* (81) protoBody ::= protoBody import */
1720
   -2,  /* (82) protoBody ::= protoBody package */
1721
   -2,  /* (83) protoBody ::= protoBody option */
1722
   -2,  /* (84) protoBody ::= protoBody emptyStatement */
1723
   -5,  /* (85) option ::= PT_OPTION optionName PT_ASSIGN constant PT_SEMICOLON */
1724
   -5,  /* (86) option ::= PT_OPTION optionName PT_ASSIGN customOptionValue PT_SEMICOLON */
1725
   -1,  /* (87) optionName ::= exIdent */
1726
   -1,  /* (88) optionName ::= extIdentInParentheses */
1727
   -3,  /* (89) customOptionValue ::= PT_LCURLY customOptionBody PT_RCURLY */
1728
    0,  /* (90) customOptionBody ::= */
1729
   -2,  /* (91) customOptionBody ::= customOptionBody exIdent */
1730
   -2,  /* (92) customOptionBody ::= customOptionBody PT_STRLIT */
1731
   -2,  /* (93) customOptionBody ::= customOptionBody symbolsWithoutCurly */
1732
   -2,  /* (94) customOptionBody ::= customOptionBody intLit */
1733
   -2,  /* (95) customOptionBody ::= customOptionBody customOptionValue */
1734
   -1,  /* (96) symbolsWithoutCurly ::= PT_LPAREN */
1735
   -1,  /* (97) symbolsWithoutCurly ::= PT_RPAREN */
1736
   -1,  /* (98) symbolsWithoutCurly ::= PT_LBRACKET */
1737
   -1,  /* (99) symbolsWithoutCurly ::= PT_RBRACKET */
1738
   -1,  /* (100) symbolsWithoutCurly ::= PT_EQUAL */
1739
   -1,  /* (101) symbolsWithoutCurly ::= PT_NOTEQUAL */
1740
   -1,  /* (102) symbolsWithoutCurly ::= PT_NOTEQUAL2 */
1741
   -1,  /* (103) symbolsWithoutCurly ::= PT_GEQUAL */
1742
   -1,  /* (104) symbolsWithoutCurly ::= PT_LEQUAL */
1743
   -1,  /* (105) symbolsWithoutCurly ::= PT_ASSIGN_PLUS */
1744
   -1,  /* (106) symbolsWithoutCurly ::= PT_ASSIGN */
1745
   -1,  /* (107) symbolsWithoutCurly ::= PT_PLUS */
1746
   -1,  /* (108) symbolsWithoutCurly ::= PT_MINUS */
1747
   -1,  /* (109) symbolsWithoutCurly ::= PT_MULTIPLY */
1748
   -1,  /* (110) symbolsWithoutCurly ::= PT_DIV */
1749
   -1,  /* (111) symbolsWithoutCurly ::= PT_LOGIC_OR */
1750
   -1,  /* (112) symbolsWithoutCurly ::= PT_OR */
1751
   -1,  /* (113) symbolsWithoutCurly ::= PT_LOGIC_AND */
1752
   -1,  /* (114) symbolsWithoutCurly ::= PT_AND */
1753
   -1,  /* (115) symbolsWithoutCurly ::= PT_NOT */
1754
   -1,  /* (116) symbolsWithoutCurly ::= PT_NEG */
1755
   -1,  /* (117) symbolsWithoutCurly ::= PT_XOR */
1756
   -1,  /* (118) symbolsWithoutCurly ::= PT_SHL */
1757
   -1,  /* (119) symbolsWithoutCurly ::= PT_SHR */
1758
   -1,  /* (120) symbolsWithoutCurly ::= PT_PERCENT */
1759
   -1,  /* (121) symbolsWithoutCurly ::= PT_DOLLAR */
1760
   -1,  /* (122) symbolsWithoutCurly ::= PT_COND */
1761
   -1,  /* (123) symbolsWithoutCurly ::= PT_SEMICOLON */
1762
   -1,  /* (124) symbolsWithoutCurly ::= PT_DOT */
1763
   -1,  /* (125) symbolsWithoutCurly ::= PT_COMMA */
1764
   -1,  /* (126) symbolsWithoutCurly ::= PT_COLON */
1765
   -1,  /* (127) symbolsWithoutCurly ::= PT_LESS */
1766
   -1,  /* (128) symbolsWithoutCurly ::= PT_GREATER */
1767
   -1,  /* (129) topLevelDef ::= message */
1768
   -1,  /* (130) topLevelDef ::= enum */
1769
   -1,  /* (131) topLevelDef ::= extend */
1770
   -1,  /* (132) topLevelDef ::= service */
1771
   -2,  /* (133) messageBody ::= messageBody extend */
1772
   -2,  /* (134) messageBody ::= messageBody extensions */
1773
   -2,  /* (135) messageBody ::= messageBody option */
1774
   -2,  /* (136) messageBody ::= messageBody reserved */
1775
   -2,  /* (137) messageBody ::= messageBody emptyStatement */
1776
   -2,  /* (138) enumBody ::= enumBody reserved */
1777
   -2,  /* (139) enumBody ::= enumBody option */
1778
   -2,  /* (140) enumBody ::= enumBody emptyStatement */
1779
   -1,  /* (141) enumValueOptions ::= enumValueOption */
1780
   -3,  /* (142) enumValueOptions ::= enumValueOptions PT_COMMA enumValueOption */
1781
   -3,  /* (143) enumValueOption ::= optionName PT_ASSIGN constant */
1782
   -3,  /* (144) enumValueOption ::= optionName PT_ASSIGN customOptionValue */
1783
   -2,  /* (145) serviceBody ::= serviceBody option */
1784
   -2,  /* (146) serviceBody ::= serviceBody emptyStatement */
1785
   -2,  /* (147) rpc ::= rpcDecl PT_SEMICOLON */
1786
   -4,  /* (148) rpc ::= rpcDecl PT_LCURLY rpcBody PT_RCURLY */
1787
    0,  /* (149) rpcBody ::= */
1788
   -2,  /* (150) rpcBody ::= rpcBody option */
1789
   -2,  /* (151) rpcBody ::= rpcBody emptyStatement */
1790
   -2,  /* (152) stream ::= streamDecl PT_SEMICOLON */
1791
   -4,  /* (153) stream ::= streamDecl PT_LCURLY streamBody PT_RCURLY */
1792
    0,  /* (154) streamBody ::= */
1793
   -2,  /* (155) streamBody ::= streamBody option */
1794
   -2,  /* (156) streamBody ::= streamBody emptyStatement */
1795
   -1,  /* (157) groupName ::= exIdent */
1796
   -2,  /* (158) oneofBody ::= oneofBody option */
1797
   -2,  /* (159) oneofBody ::= oneofBody group */
1798
   -2,  /* (160) oneofBody ::= oneofBody emptyStatement */
1799
   -3,  /* (161) extensions ::= PT_EXTENSIONS ranges PT_SEMICOLON */
1800
   -6,  /* (162) extensions ::= PT_EXTENSIONS ranges PT_LBRACKET declarations PT_RBRACKET PT_SEMICOLON */
1801
   -1,  /* (163) declarations ::= declaration */
1802
   -3,  /* (164) declarations ::= declarations PT_COMMA declaration */
1803
   -3,  /* (165) declaration ::= optionName PT_ASSIGN constant */
1804
   -3,  /* (166) declaration ::= optionName PT_ASSIGN customOptionValue */
1805
   -3,  /* (167) reserved ::= PT_RESERVED ranges PT_SEMICOLON */
1806
   -3,  /* (168) reserved ::= PT_RESERVED quoteFieldNames PT_SEMICOLON */
1807
   -3,  /* (169) reserved ::= PT_RESERVED reservedIdent PT_SEMICOLON */
1808
   -1,  /* (170) ranges ::= range */
1809
   -3,  /* (171) ranges ::= ranges PT_COMMA range */
1810
   -1,  /* (172) range ::= intLit */
1811
   -3,  /* (173) range ::= intLit PT_TO intLit */
1812
   -3,  /* (174) range ::= intLit PT_TO exIdent */
1813
   -1,  /* (175) quoteFieldNames ::= strLit */
1814
   -3,  /* (176) quoteFieldNames ::= quoteFieldNames PT_COMMA strLit */
1815
   -1,  /* (177) reservedIdent ::= fieldName */
1816
   -3,  /* (178) reservedIdent ::= fieldName PT_COMMA fieldName */
1817
   -2,  /* (179) extendBody ::= extendBody emptyStatement */
1818
   -1,  /* (180) messageName ::= exIdent */
1819
   -1,  /* (181) enumName ::= exIdent */
1820
   -1,  /* (182) streamName ::= exIdent */
1821
   -1,  /* (183) fieldName ::= exIdent */
1822
   -1,  /* (184) oneofName ::= exIdent */
1823
   -1,  /* (185) mapName ::= exIdent */
1824
   -1,  /* (186) serviceName ::= exIdent */
1825
   -1,  /* (187) rpcName ::= exIdent */
1826
   -1,  /* (188) emptyStatement ::= PT_SEMICOLON */
1827
   -1,  /* (189) constant ::= strLit */
1828
   -1,  /* (190) exIdent ::= PT_IDENT */
1829
};
1830
1831
static void yy_accept(yyParser*);  /* Forward Declaration */
1832
1833
/*
1834
** Perform a reduce action and the shift that must immediately
1835
** follow the reduce.
1836
**
1837
** The yyLookahead and yyLookaheadToken parameters provide reduce actions
1838
** access to the lookahead token (if any).  The yyLookahead will be YYNOCODE
1839
** if the lookahead token has already been consumed.  As this procedure is
1840
** only called from one place, optimizing compilers will in-line it, which
1841
** means that the extra parameters have no performance impact.
1842
*/
1843
static YYACTIONTYPE yy_reduce(
1844
  yyParser *yypParser,         /* The parser */
1845
  unsigned int yyruleno,       /* Number of the rule by which to reduce */
1846
  int yyLookahead,             /* Lookahead token, or YYNOCODE if none */
1847
  ProtobufLangParserTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
1848
  ProtobufLangParserCTX_PDECL                   /* %extra_context */
1849
0
){
1850
0
  int yygoto;                     /* The next state */
1851
0
  YYACTIONTYPE yyact;             /* The next action */
1852
0
  yyStackEntry *yymsp;            /* The top of the parser's stack */
1853
0
  int yysize;                     /* Amount to pop the stack */
1854
0
  ProtobufLangParserARG_FETCH
1855
0
  (void)yyLookahead;
1856
0
  (void)yyLookaheadToken;
1857
0
  yymsp = yypParser->yytos;
1858
1859
0
  switch( yyruleno ){
1860
  /* Beginning here are the reduction cases.  A typical example
1861
  ** follows:
1862
  **   case 0:
1863
  **  #line <lineno> <grammarfile>
1864
  **     { ... }           // User supplied code
1865
  **  #line <lineno> <thisfile>
1866
  **     break;
1867
  */
1868
/********** Begin reduce actions **********************************************/
1869
0
        YYMINORTYPE yylhsminor;
1870
0
      case 0: /* wholeProtoBody ::= protoBody */
1871
0
#line 155 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1872
0
{
1873
        /* set real package name */
1874
0
        pbl_set_node_name(yymsp[0].minor.yy93, state->file->package_name_lineno, state->file->package_name);
1875
        /* use the allocate mem of the name of the package node */
1876
0
        state->file->package_name = pbl_get_node_name(yymsp[0].minor.yy93);
1877
        /* put this file data into package tables */
1878
0
        pbl_node_t* packnode = (pbl_node_t*)g_hash_table_lookup(state->pool->packages, state->file->package_name);
1879
0
        if (packnode) {
1880
0
            pbl_merge_children(packnode, yymsp[0].minor.yy93);
1881
0
            pbl_free_node(yymsp[0].minor.yy93);
1882
0
        } else {
1883
0
            g_hash_table_insert(state->pool->packages, g_strdup(state->file->package_name), yymsp[0].minor.yy93);
1884
0
        }
1885
0
    }
1886
0
#line 1911 "./protobuf_lang_parser.c"
1887
0
        break;
1888
0
      case 1: /* syntax ::= PT_SYNTAX PT_ASSIGN strLit PT_SEMICOLON */
1889
0
{  yy_destructor(yypParser,2,&yymsp[-3].minor);
1890
0
#line 173 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1891
0
{
1892
0
        if (!strcmp(yymsp[-1].minor.yy254, "proto3")) {
1893
0
            state->file->syntax_version = 3;
1894
0
        } else if (!strcmp(yymsp[-1].minor.yy254, "proto2")) {
1895
0
            state->file->syntax_version = 2;
1896
0
        } else {
1897
0
            pbl_parser_error(state, "Unrecognized syntax identifier [%s]. This parser only recognizes \"proto3\" or \"proto2\"!", yymsp[-1].minor.yy254);
1898
0
            state->grammar_error = TRUE;
1899
0
        }
1900
0
    }
1901
0
#line 1926 "./protobuf_lang_parser.c"
1902
0
  yy_destructor(yypParser,25,&yymsp[-2].minor);
1903
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
1904
0
}
1905
0
        break;
1906
0
      case 2: /* edition ::= PT_EDITION PT_ASSIGN strLit PT_SEMICOLON */
1907
0
{  yy_destructor(yypParser,3,&yymsp[-3].minor);
1908
0
#line 189 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1909
0
{
1910
0
    if (strcmp(yymsp[-1].minor.yy254, "2024") == 0) {
1911
0
        state->file->syntax_version = 3;
1912
0
    } else if (strcmp(yymsp[-1].minor.yy254, "2023") == 0) {
1913
0
        state->file->syntax_version = 3;
1914
0
    } else {
1915
0
        pbl_parser_error(state, "unsupported edition %s", yymsp[-1].minor.yy254);
1916
0
    }
1917
0
}
1918
0
#line 1943 "./protobuf_lang_parser.c"
1919
0
  yy_destructor(yypParser,25,&yymsp[-2].minor);
1920
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
1921
0
}
1922
0
        break;
1923
0
      case 3: /* protoBody ::= */
1924
0
#line 199 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1925
0
{ yymsp[1].minor.yy93 = pbl_create_node(state->file, CUR_LINENO, PBL_PACKAGE, NAME_TO_BE_SET); }
1926
0
#line 1951 "./protobuf_lang_parser.c"
1927
0
        break;
1928
0
      case 4: /* protoBody ::= protoBody topLevelDef */
1929
0
      case 15: /* messageBody ::= messageBody field */ yytestcase(yyruleno==15);
1930
0
      case 16: /* messageBody ::= messageBody enum */ yytestcase(yyruleno==16);
1931
0
      case 17: /* messageBody ::= messageBody message */ yytestcase(yyruleno==17);
1932
0
      case 18: /* messageBody ::= messageBody group */ yytestcase(yyruleno==18);
1933
0
      case 20: /* messageBody ::= messageBody mapField */ yytestcase(yyruleno==20);
1934
0
      case 23: /* enumBody ::= enumBody enumField */ yytestcase(yyruleno==23);
1935
0
      case 31: /* serviceBody ::= serviceBody rpc */ yytestcase(yyruleno==31);
1936
0
      case 32: /* serviceBody ::= serviceBody stream */ yytestcase(yyruleno==32);
1937
0
      case 56: /* oneofBody ::= oneofBody oneofField */ yytestcase(yyruleno==56);
1938
0
      case 64: /* extendBody ::= extendBody field */ yytestcase(yyruleno==64);
1939
0
      case 65: /* extendBody ::= extendBody group */ yytestcase(yyruleno==65);
1940
0
#line 203 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1941
0
{ yylhsminor.yy93 = yymsp[-1].minor.yy93; pbl_add_child(yylhsminor.yy93, yymsp[0].minor.yy93); }
1942
0
#line 1967 "./protobuf_lang_parser.c"
1943
0
  yymsp[-1].minor.yy93 = yylhsminor.yy93;
1944
0
        break;
1945
0
      case 5: /* import ::= PT_IMPORT strLit PT_SEMICOLON */
1946
0
{  yy_destructor(yypParser,4,&yymsp[-2].minor);
1947
0
#line 207 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1948
0
{ pbl_add_proto_file_to_be_parsed(state->pool, yymsp[-1].minor.yy254); }
1949
0
#line 1974 "./protobuf_lang_parser.c"
1950
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
1951
0
}
1952
0
        break;
1953
0
      case 6: /* import ::= PT_IMPORT PT_PUBLIC strLit PT_SEMICOLON */
1954
0
{  yy_destructor(yypParser,4,&yymsp[-3].minor);
1955
0
#line 208 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1956
0
{ pbl_add_proto_file_to_be_parsed(state->pool, yymsp[-1].minor.yy254); }
1957
0
#line 1982 "./protobuf_lang_parser.c"
1958
0
  yy_destructor(yypParser,6,&yymsp[-2].minor);
1959
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
1960
0
}
1961
0
        break;
1962
0
      case 7: /* import ::= PT_IMPORT PT_WEAK strLit PT_SEMICOLON */
1963
0
{  yy_destructor(yypParser,4,&yymsp[-3].minor);
1964
0
#line 209 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1965
0
{ pbl_add_proto_file_to_be_parsed(state->pool, yymsp[-1].minor.yy254); }
1966
0
#line 1991 "./protobuf_lang_parser.c"
1967
0
  yy_destructor(yypParser,5,&yymsp[-2].minor);
1968
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
1969
0
}
1970
0
        break;
1971
0
      case 8: /* package ::= PT_PACKAGE exIdent PT_SEMICOLON */
1972
0
{  yy_destructor(yypParser,7,&yymsp[-2].minor);
1973
0
#line 213 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1974
0
{   /* The memory of (yymsp[-1].minor.yy118) will be freed after parsing, but the package_name will
1975
           be replaced by the new-allocated name of package node late */
1976
0
        state->file->package_name = yymsp[-1].minor.yy118->v;
1977
0
        state->file->package_name_lineno = yymsp[-1].minor.yy118->ln;
1978
0
    }
1979
0
#line 2004 "./protobuf_lang_parser.c"
1980
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
1981
0
}
1982
0
        break;
1983
0
      case 9: /* extIdentInParentheses ::= PT_LPAREN exIdent PT_RPAREN */
1984
0
{  yy_destructor(yypParser,27,&yymsp[-2].minor);
1985
0
#line 227 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1986
0
{ yymsp[-2].minor.yy0 = yymsp[-1].minor.yy118; yymsp[-2].minor.yy0->v = pbl_store_string_token(state, g_strconcat("(", yymsp[-1].minor.yy118->v, ")", NULL)); }
1987
0
#line 2012 "./protobuf_lang_parser.c"
1988
0
  yy_destructor(yypParser,28,&yymsp[0].minor);
1989
0
}
1990
0
        break;
1991
0
      case 10: /* optionName ::= optionName exIdent */
1992
0
#line 231 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1993
0
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118->v = pbl_store_string_token(state, g_strconcat(yymsp[-1].minor.yy118->v, yymsp[0].minor.yy118->v, NULL)); }
1994
0
#line 2019 "./protobuf_lang_parser.c"
1995
0
  yymsp[-1].minor.yy118 = yylhsminor.yy118;
1996
0
        break;
1997
0
      case 11: /* optionName ::= optionName PT_DOT extIdentInParentheses */
1998
0
#line 233 "/src/wireshark/epan/protobuf_lang_parser.lemon"
1999
0
{ yylhsminor.yy118 = yymsp[-2].minor.yy118; yylhsminor.yy118->v = pbl_store_string_token(state, g_strconcat(yymsp[-2].minor.yy118->v, ".", yymsp[0].minor.yy0->v, NULL)); }
2000
0
#line 2025 "./protobuf_lang_parser.c"
2001
0
  yy_destructor(yypParser,29,&yymsp[-1].minor);
2002
0
  yymsp[-2].minor.yy118 = yylhsminor.yy118;
2003
0
        break;
2004
0
      case 12: /* optionName ::= optionName extIdentInParentheses */
2005
0
#line 235 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2006
0
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118->v = pbl_store_string_token(state, g_strconcat(yymsp[-1].minor.yy118->v, ".", yymsp[0].minor.yy0->v, NULL)); }
2007
0
#line 2032 "./protobuf_lang_parser.c"
2008
0
  yymsp[-1].minor.yy118 = yylhsminor.yy118;
2009
0
        break;
2010
0
      case 13: /* message ::= PT_MESSAGE messageName PT_LCURLY messageBody PT_RCURLY */
2011
0
{  yy_destructor(yypParser,19,&yymsp[-4].minor);
2012
0
#line 315 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2013
0
{ yymsp[-4].minor.yy93 = yymsp[-1].minor.yy93; pbl_set_node_name(yymsp[-4].minor.yy93, yymsp[-3].minor.yy118->ln, yymsp[-3].minor.yy118->v); }
2014
0
#line 2039 "./protobuf_lang_parser.c"
2015
0
  yy_destructor(yypParser,30,&yymsp[-2].minor);
2016
0
  yy_destructor(yypParser,31,&yymsp[0].minor);
2017
0
}
2018
0
        break;
2019
0
      case 14: /* messageBody ::= */
2020
0
      case 63: /* extendBody ::= */ yytestcase(yyruleno==63);
2021
0
#line 319 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2022
0
{ yymsp[1].minor.yy93 = pbl_create_node(state->file, CUR_LINENO, PBL_MESSAGE, NAME_TO_BE_SET); }
2023
0
#line 2048 "./protobuf_lang_parser.c"
2024
0
        break;
2025
0
      case 19: /* messageBody ::= messageBody oneof */
2026
0
#line 327 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2027
0
{ yylhsminor.yy93 = yymsp[-1].minor.yy93; pbl_merge_children(yylhsminor.yy93, yymsp[0].minor.yy93); pbl_free_node(yymsp[0].minor.yy93); }
2028
0
#line 2053 "./protobuf_lang_parser.c"
2029
0
  yymsp[-1].minor.yy93 = yylhsminor.yy93;
2030
0
        break;
2031
0
      case 21: /* enum ::= PT_ENUM enumName PT_LCURLY enumBody PT_RCURLY */
2032
0
{  yy_destructor(yypParser,15,&yymsp[-4].minor);
2033
0
#line 334 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2034
0
{ yymsp[-4].minor.yy93 = yymsp[-1].minor.yy93; pbl_set_node_name(yymsp[-4].minor.yy93, yymsp[-3].minor.yy118->ln, yymsp[-3].minor.yy118->v); }
2035
0
#line 2060 "./protobuf_lang_parser.c"
2036
0
  yy_destructor(yypParser,30,&yymsp[-2].minor);
2037
0
  yy_destructor(yypParser,31,&yymsp[0].minor);
2038
0
}
2039
0
        break;
2040
0
      case 22: /* enumBody ::= */
2041
0
#line 338 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2042
0
{ yymsp[1].minor.yy93 = pbl_create_node(state->file, CUR_LINENO, PBL_ENUM, NAME_TO_BE_SET); }
2043
0
#line 2068 "./protobuf_lang_parser.c"
2044
0
        break;
2045
0
      case 24: /* enumField ::= exIdent PT_ASSIGN enumNumber PT_LBRACKET enumValueOptions PT_RBRACKET PT_SEMICOLON */
2046
0
#line 346 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2047
0
{ yylhsminor.yy93 = pbl_create_enum_value_node(state->file, yymsp[-6].minor.yy118->ln, yymsp[-6].minor.yy118->v, yymsp[-4].minor.yy116); }
2048
0
#line 2073 "./protobuf_lang_parser.c"
2049
0
  yy_destructor(yypParser,25,&yymsp[-5].minor);
2050
0
  yy_destructor(yypParser,33,&yymsp[-3].minor);
2051
0
  yy_destructor(yypParser,34,&yymsp[-1].minor);
2052
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2053
0
  yymsp[-6].minor.yy93 = yylhsminor.yy93;
2054
0
        break;
2055
0
      case 25: /* enumField ::= exIdent PT_ASSIGN enumNumber */
2056
0
#line 348 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2057
0
{ yylhsminor.yy93 = pbl_create_enum_value_node(state->file, yymsp[-2].minor.yy118->ln, yymsp[-2].minor.yy118->v, yymsp[0].minor.yy116); }
2058
0
#line 2083 "./protobuf_lang_parser.c"
2059
0
  yy_destructor(yypParser,25,&yymsp[-1].minor);
2060
0
  yymsp[-2].minor.yy93 = yylhsminor.yy93;
2061
0
        break;
2062
0
      case 26: /* enumNumber ::= intLit */
2063
0
      case 46: /* fieldNumber ::= intLit */ yytestcase(yyruleno==46);
2064
0
#line 351 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2065
0
{ yylhsminor.yy116 = (int)yymsp[0].minor.yy180; }
2066
0
#line 2091 "./protobuf_lang_parser.c"
2067
0
  yymsp[0].minor.yy116 = yylhsminor.yy116;
2068
0
        break;
2069
0
      case 27: /* enumNumber ::= PT_PLUS intLit */
2070
0
      case 47: /* fieldNumber ::= PT_PLUS intLit */ yytestcase(yyruleno==47);
2071
0
{  yy_destructor(yypParser,41,&yymsp[-1].minor);
2072
0
#line 352 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2073
0
{ yymsp[-1].minor.yy116 = (int)yymsp[0].minor.yy180; }
2074
0
#line 2099 "./protobuf_lang_parser.c"
2075
0
}
2076
0
        break;
2077
0
      case 28: /* enumNumber ::= PT_MINUS intLit */
2078
0
{  yy_destructor(yypParser,42,&yymsp[-1].minor);
2079
0
#line 353 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2080
0
{ yymsp[-1].minor.yy116 = -(int)yymsp[0].minor.yy180; }
2081
0
#line 2106 "./protobuf_lang_parser.c"
2082
0
}
2083
0
        break;
2084
0
      case 29: /* service ::= PT_SERVICE serviceName PT_LCURLY serviceBody PT_RCURLY */
2085
0
{  yy_destructor(yypParser,20,&yymsp[-4].minor);
2086
0
#line 367 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2087
0
{ yymsp[-4].minor.yy93 = yymsp[-1].minor.yy93; pbl_set_node_name(yymsp[-4].minor.yy93, yymsp[-3].minor.yy118->ln, yymsp[-3].minor.yy118->v); }
2088
0
#line 2113 "./protobuf_lang_parser.c"
2089
0
  yy_destructor(yypParser,30,&yymsp[-2].minor);
2090
0
  yy_destructor(yypParser,31,&yymsp[0].minor);
2091
0
}
2092
0
        break;
2093
0
      case 30: /* serviceBody ::= */
2094
0
#line 369 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2095
0
{ yymsp[1].minor.yy93 = pbl_create_node(state->file, CUR_LINENO, PBL_SERVICE, NAME_TO_BE_SET); }
2096
0
#line 2121 "./protobuf_lang_parser.c"
2097
0
        break;
2098
0
      case 33: /* rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */
2099
0
{  yy_destructor(yypParser,21,&yymsp[-8].minor);
2100
0
#line 381 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2101
0
{ yymsp[-8].minor.yy93 = pbl_create_method_node(state->file, yymsp[-7].minor.yy118->ln, yymsp[-7].minor.yy118->v, yymsp[-5].minor.yy254, FALSE, yymsp[-1].minor.yy254, FALSE); }
2102
0
#line 2127 "./protobuf_lang_parser.c"
2103
0
  yy_destructor(yypParser,27,&yymsp[-6].minor);
2104
0
  yy_destructor(yypParser,28,&yymsp[-4].minor);
2105
0
  yy_destructor(yypParser,23,&yymsp[-3].minor);
2106
0
  yy_destructor(yypParser,27,&yymsp[-2].minor);
2107
0
  yy_destructor(yypParser,28,&yymsp[0].minor);
2108
0
}
2109
0
        break;
2110
0
      case 34: /* rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN messageType PT_RPAREN */
2111
0
{  yy_destructor(yypParser,21,&yymsp[-9].minor);
2112
0
#line 383 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2113
0
{ yymsp[-9].minor.yy93 = pbl_create_method_node(state->file, yymsp[-8].minor.yy118->ln, yymsp[-8].minor.yy118->v, yymsp[-5].minor.yy254, TRUE, yymsp[-1].minor.yy254, FALSE); }
2114
0
#line 2139 "./protobuf_lang_parser.c"
2115
0
  yy_destructor(yypParser,27,&yymsp[-7].minor);
2116
0
  yy_destructor(yypParser,22,&yymsp[-6].minor);
2117
0
  yy_destructor(yypParser,28,&yymsp[-4].minor);
2118
0
  yy_destructor(yypParser,23,&yymsp[-3].minor);
2119
0
  yy_destructor(yypParser,27,&yymsp[-2].minor);
2120
0
  yy_destructor(yypParser,28,&yymsp[0].minor);
2121
0
}
2122
0
        break;
2123
0
      case 35: /* rpcDecl ::= PT_RPC rpcName PT_LPAREN messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */
2124
0
{  yy_destructor(yypParser,21,&yymsp[-9].minor);
2125
0
#line 385 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2126
0
{ yymsp[-9].minor.yy93 = pbl_create_method_node(state->file, yymsp[-8].minor.yy118->ln, yymsp[-8].minor.yy118->v, yymsp[-6].minor.yy254, FALSE, yymsp[-1].minor.yy254, TRUE); }
2127
0
#line 2152 "./protobuf_lang_parser.c"
2128
0
  yy_destructor(yypParser,27,&yymsp[-7].minor);
2129
0
  yy_destructor(yypParser,28,&yymsp[-5].minor);
2130
0
  yy_destructor(yypParser,23,&yymsp[-4].minor);
2131
0
  yy_destructor(yypParser,27,&yymsp[-3].minor);
2132
0
  yy_destructor(yypParser,22,&yymsp[-2].minor);
2133
0
  yy_destructor(yypParser,28,&yymsp[0].minor);
2134
0
}
2135
0
        break;
2136
0
      case 36: /* rpcDecl ::= PT_RPC rpcName PT_LPAREN PT_STREAM messageType PT_RPAREN PT_RETURNS PT_LPAREN PT_STREAM messageType PT_RPAREN */
2137
0
{  yy_destructor(yypParser,21,&yymsp[-10].minor);
2138
0
#line 387 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2139
0
{ yymsp[-10].minor.yy93 = pbl_create_method_node(state->file, yymsp[-9].minor.yy118->ln, yymsp[-9].minor.yy118->v, yymsp[-6].minor.yy254, TRUE, yymsp[-1].minor.yy254, TRUE); }
2140
0
#line 2165 "./protobuf_lang_parser.c"
2141
0
  yy_destructor(yypParser,27,&yymsp[-8].minor);
2142
0
  yy_destructor(yypParser,22,&yymsp[-7].minor);
2143
0
  yy_destructor(yypParser,28,&yymsp[-5].minor);
2144
0
  yy_destructor(yypParser,23,&yymsp[-4].minor);
2145
0
  yy_destructor(yypParser,27,&yymsp[-3].minor);
2146
0
  yy_destructor(yypParser,22,&yymsp[-2].minor);
2147
0
  yy_destructor(yypParser,28,&yymsp[0].minor);
2148
0
}
2149
0
        break;
2150
0
      case 37: /* streamDecl ::= PT_STREAM streamName PT_LPAREN messageType PT_COMMA messageType PT_RPAREN */
2151
0
{  yy_destructor(yypParser,22,&yymsp[-6].minor);
2152
0
#line 399 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2153
0
{ yymsp[-6].minor.yy93 = pbl_create_method_node(state->file, yymsp[-5].minor.yy118->ln, yymsp[-5].minor.yy118->v, yymsp[-3].minor.yy254, TRUE, yymsp[-1].minor.yy254, TRUE); }
2154
0
#line 2179 "./protobuf_lang_parser.c"
2155
0
  yy_destructor(yypParser,27,&yymsp[-4].minor);
2156
0
  yy_destructor(yypParser,57,&yymsp[-2].minor);
2157
0
  yy_destructor(yypParser,28,&yymsp[0].minor);
2158
0
}
2159
0
        break;
2160
0
      case 38: /* field ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */
2161
0
      case 58: /* oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */ yytestcase(yyruleno==58);
2162
0
#line 409 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2163
0
{ yylhsminor.yy93 = pbl_create_field_node(state->file, yymsp[-3].minor.yy118->ln, NULL, yymsp[-4].minor.yy254, yymsp[-3].minor.yy118->v, yymsp[-1].minor.yy116, NULL); }
2164
0
#line 2189 "./protobuf_lang_parser.c"
2165
0
  yy_destructor(yypParser,25,&yymsp[-2].minor);
2166
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2167
0
  yymsp[-4].minor.yy93 = yylhsminor.yy93;
2168
0
        break;
2169
0
      case 39: /* field ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
2170
0
      case 57: /* oneofField ::= type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */ yytestcase(yyruleno==57);
2171
0
#line 411 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2172
0
{ yylhsminor.yy93 = pbl_create_field_node(state->file, yymsp[-6].minor.yy118->ln, NULL, yymsp[-7].minor.yy254, yymsp[-6].minor.yy118->v, yymsp[-4].minor.yy116, yymsp[-2].minor.yy93); }
2173
0
#line 2198 "./protobuf_lang_parser.c"
2174
0
  yy_destructor(yypParser,25,&yymsp[-5].minor);
2175
0
  yy_destructor(yypParser,33,&yymsp[-3].minor);
2176
0
  yy_destructor(yypParser,34,&yymsp[-1].minor);
2177
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2178
0
  yymsp[-7].minor.yy93 = yylhsminor.yy93;
2179
0
        break;
2180
0
      case 40: /* field ::= label type fieldName PT_ASSIGN fieldNumber PT_SEMICOLON */
2181
0
#line 413 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2182
0
{ yylhsminor.yy93 = pbl_create_field_node(state->file, yymsp[-3].minor.yy118->ln, yymsp[-5].minor.yy254, yymsp[-4].minor.yy254, yymsp[-3].minor.yy118->v, yymsp[-1].minor.yy116, NULL); }
2183
0
#line 2208 "./protobuf_lang_parser.c"
2184
0
  yy_destructor(yypParser,25,&yymsp[-2].minor);
2185
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2186
0
  yymsp[-5].minor.yy93 = yylhsminor.yy93;
2187
0
        break;
2188
0
      case 41: /* field ::= label type fieldName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
2189
0
#line 415 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2190
0
{ yylhsminor.yy93 = pbl_create_field_node(state->file, yymsp[-6].minor.yy118->ln, yymsp[-8].minor.yy254, yymsp[-7].minor.yy254, yymsp[-6].minor.yy118->v, yymsp[-4].minor.yy116, yymsp[-2].minor.yy93); }
2191
0
#line 2216 "./protobuf_lang_parser.c"
2192
0
  yy_destructor(yypParser,25,&yymsp[-5].minor);
2193
0
  yy_destructor(yypParser,33,&yymsp[-3].minor);
2194
0
  yy_destructor(yypParser,34,&yymsp[-1].minor);
2195
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2196
0
  yymsp[-8].minor.yy93 = yylhsminor.yy93;
2197
0
        break;
2198
0
      case 42: /* label ::= PT_REQUIRED */
2199
0
      case 43: /* label ::= PT_OPTIONAL */ yytestcase(yyruleno==43);
2200
0
      case 44: /* label ::= PT_REPEATED */ yytestcase(yyruleno==44);
2201
0
#line 418 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2202
0
{ yylhsminor.yy254 = yymsp[0].minor.yy0->v; }
2203
0
#line 2228 "./protobuf_lang_parser.c"
2204
0
  yymsp[0].minor.yy254 = yylhsminor.yy254;
2205
0
        break;
2206
0
      case 45: /* type ::= exIdent */
2207
0
      case 61: /* keyType ::= exIdent */ yytestcase(yyruleno==61);
2208
0
      case 66: /* messageType ::= exIdent */ yytestcase(yyruleno==66);
2209
0
      case 70: /* constant ::= exIdent */ yytestcase(yyruleno==70);
2210
0
#line 426 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2211
0
{ yylhsminor.yy254 = yymsp[0].minor.yy118->v; }
2212
0
#line 2237 "./protobuf_lang_parser.c"
2213
0
  yymsp[0].minor.yy254 = yylhsminor.yy254;
2214
0
        break;
2215
0
      case 48: /* fieldOptions ::= fieldOption */
2216
0
#line 434 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2217
0
{ yylhsminor.yy93 = pbl_create_node(state->file, CUR_LINENO, PBL_OPTIONS, NEED_NOT_NAME); pbl_add_child(yylhsminor.yy93, yymsp[0].minor.yy93); }
2218
0
#line 2243 "./protobuf_lang_parser.c"
2219
0
  yymsp[0].minor.yy93 = yylhsminor.yy93;
2220
0
        break;
2221
0
      case 49: /* fieldOptions ::= fieldOptions PT_COMMA fieldOption */
2222
0
#line 436 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2223
0
{ yylhsminor.yy93 = yymsp[-2].minor.yy93; pbl_add_child(yylhsminor.yy93, yymsp[0].minor.yy93); }
2224
0
#line 2249 "./protobuf_lang_parser.c"
2225
0
  yy_destructor(yypParser,57,&yymsp[-1].minor);
2226
0
  yymsp[-2].minor.yy93 = yylhsminor.yy93;
2227
0
        break;
2228
0
      case 50: /* fieldOption ::= optionName PT_ASSIGN constant */
2229
0
#line 441 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2230
0
{ yylhsminor.yy93 = pbl_create_option_node(state->file, yymsp[-2].minor.yy118->ln, yymsp[-2].minor.yy118->v, yymsp[0].minor.yy254); }
2231
0
#line 2256 "./protobuf_lang_parser.c"
2232
0
  yy_destructor(yypParser,25,&yymsp[-1].minor);
2233
0
  yymsp[-2].minor.yy93 = yylhsminor.yy93;
2234
0
        break;
2235
0
      case 51: /* fieldOption ::= optionName PT_ASSIGN customOptionValue */
2236
0
#line 443 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2237
0
{ yylhsminor.yy93 = pbl_create_option_node(state->file, yymsp[-2].minor.yy118->ln, yymsp[-2].minor.yy118->v, pbl_store_string_token(state, g_strdup("{ ... }"))); }
2238
0
#line 2263 "./protobuf_lang_parser.c"
2239
0
  yy_destructor(yypParser,25,&yymsp[-1].minor);
2240
0
  yymsp[-2].minor.yy93 = yylhsminor.yy93;
2241
0
        break;
2242
0
      case 52: /* group ::= PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */
2243
0
{  yy_destructor(yypParser,16,&yymsp[-6].minor);
2244
0
#line 448 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2245
0
{ yymsp[-6].minor.yy93 = yymsp[-1].minor.yy93; pbl_set_node_name(yymsp[-6].minor.yy93, yymsp[-5].minor.yy118->ln, yymsp[-5].minor.yy118->v); }
2246
0
#line 2271 "./protobuf_lang_parser.c"
2247
0
  yy_destructor(yypParser,25,&yymsp[-4].minor);
2248
0
  yy_destructor(yypParser,30,&yymsp[-2].minor);
2249
0
  yy_destructor(yypParser,31,&yymsp[0].minor);
2250
0
}
2251
0
        break;
2252
0
      case 53: /* group ::= label PT_GROUP groupName PT_ASSIGN fieldNumber PT_LCURLY messageBody PT_RCURLY */
2253
0
#line 450 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2254
0
{ yymsp[-7].minor.yy93 = yymsp[-1].minor.yy93; pbl_set_node_name(yymsp[-7].minor.yy93, yymsp[-5].minor.yy118->ln, yymsp[-5].minor.yy118->v); }
2255
0
#line 2280 "./protobuf_lang_parser.c"
2256
0
  yy_destructor(yypParser,16,&yymsp[-6].minor);
2257
0
  yy_destructor(yypParser,25,&yymsp[-4].minor);
2258
0
  yy_destructor(yypParser,30,&yymsp[-2].minor);
2259
0
  yy_destructor(yypParser,31,&yymsp[0].minor);
2260
0
        break;
2261
0
      case 54: /* oneof ::= PT_ONEOF oneofName PT_LCURLY oneofBody PT_RCURLY */
2262
0
{  yy_destructor(yypParser,12,&yymsp[-4].minor);
2263
0
#line 457 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2264
0
{ yymsp[-4].minor.yy93 = yymsp[-1].minor.yy93; pbl_set_node_name(yymsp[-4].minor.yy93, yymsp[-3].minor.yy118->ln, yymsp[-3].minor.yy118->v); }
2265
0
#line 2290 "./protobuf_lang_parser.c"
2266
0
  yy_destructor(yypParser,30,&yymsp[-2].minor);
2267
0
  yy_destructor(yypParser,31,&yymsp[0].minor);
2268
0
}
2269
0
        break;
2270
0
      case 55: /* oneofBody ::= */
2271
0
#line 459 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2272
0
{ yymsp[1].minor.yy93 = pbl_create_node(state->file, CUR_LINENO, PBL_ONEOF, NAME_TO_BE_SET); }
2273
0
#line 2298 "./protobuf_lang_parser.c"
2274
0
        break;
2275
0
      case 59: /* mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_LBRACKET fieldOptions PT_RBRACKET PT_SEMICOLON */
2276
0
{  yy_destructor(yypParser,13,&yymsp[-12].minor);
2277
0
#line 473 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2278
0
{
2279
0
        yymsp[-12].minor.yy93 = pbl_create_map_field_node(state->file, yymsp[-6].minor.yy118->ln, yymsp[-6].minor.yy118->v, yymsp[-4].minor.yy116, yymsp[-2].minor.yy93);
2280
0
        pbl_add_child(yymsp[-12].minor.yy93, pbl_create_field_node(state->file, yymsp[-6].minor.yy118->ln, NULL, yymsp[-10].minor.yy254, "key", 1, NULL)); /* add key field */
2281
0
        pbl_add_child(yymsp[-12].minor.yy93, pbl_create_field_node(state->file, yymsp[-6].minor.yy118->ln, NULL, yymsp[-8].minor.yy254, "value", 2, NULL)); /* add value field */
2282
0
    }
2283
0
#line 2308 "./protobuf_lang_parser.c"
2284
0
  yy_destructor(yypParser,59,&yymsp[-11].minor);
2285
0
  yy_destructor(yypParser,57,&yymsp[-9].minor);
2286
0
  yy_destructor(yypParser,60,&yymsp[-7].minor);
2287
0
  yy_destructor(yypParser,25,&yymsp[-5].minor);
2288
0
  yy_destructor(yypParser,33,&yymsp[-3].minor);
2289
0
  yy_destructor(yypParser,34,&yymsp[-1].minor);
2290
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2291
0
}
2292
0
        break;
2293
0
      case 60: /* mapField ::= PT_MAP PT_LESS keyType PT_COMMA type PT_GREATER mapName PT_ASSIGN fieldNumber PT_SEMICOLON */
2294
0
{  yy_destructor(yypParser,13,&yymsp[-9].minor);
2295
0
#line 479 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2296
0
{
2297
0
        yymsp[-9].minor.yy93 = pbl_create_map_field_node(state->file, yymsp[-3].minor.yy118->ln, yymsp[-3].minor.yy118->v, yymsp[-1].minor.yy116, NULL);
2298
0
        pbl_add_child(yymsp[-9].minor.yy93, pbl_create_field_node(state->file, yymsp[-3].minor.yy118->ln, NULL, yymsp[-7].minor.yy254, "key", 1, NULL)); /* add key field */
2299
0
        pbl_add_child(yymsp[-9].minor.yy93, pbl_create_field_node(state->file, yymsp[-3].minor.yy118->ln, NULL, yymsp[-5].minor.yy254, "value", 2, NULL)); /* add value field */
2300
0
    }
2301
0
#line 2326 "./protobuf_lang_parser.c"
2302
0
  yy_destructor(yypParser,59,&yymsp[-8].minor);
2303
0
  yy_destructor(yypParser,57,&yymsp[-6].minor);
2304
0
  yy_destructor(yypParser,60,&yymsp[-4].minor);
2305
0
  yy_destructor(yypParser,25,&yymsp[-2].minor);
2306
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2307
0
}
2308
0
        break;
2309
0
      case 62: /* extend ::= PT_EXTEND messageType PT_LCURLY extendBody PT_RCURLY */
2310
0
{  yy_destructor(yypParser,17,&yymsp[-4].minor);
2311
0
#line 555 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2312
0
{ yymsp[-4].minor.yy93 = NULL; pbl_free_node(yymsp[-1].minor.yy93); }
2313
0
#line 2338 "./protobuf_lang_parser.c"
2314
0
  yy_destructor(yypParser,30,&yymsp[-2].minor);
2315
0
  yy_destructor(yypParser,31,&yymsp[0].minor);
2316
0
}
2317
0
        break;
2318
0
      case 67: /* intLit ::= PT_DECIMALLIT */
2319
0
#line 578 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2320
0
{ yylhsminor.yy180 = g_ascii_strtoull(yymsp[0].minor.yy0->v, NULL, 10); }
2321
0
#line 2346 "./protobuf_lang_parser.c"
2322
0
  yymsp[0].minor.yy180 = yylhsminor.yy180;
2323
0
        break;
2324
0
      case 68: /* intLit ::= PT_OCTALLIT */
2325
0
#line 579 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2326
0
{ yylhsminor.yy180 = g_ascii_strtoull(yymsp[0].minor.yy0->v+1, NULL, 8); }
2327
0
#line 2352 "./protobuf_lang_parser.c"
2328
0
  yymsp[0].minor.yy180 = yylhsminor.yy180;
2329
0
        break;
2330
0
      case 69: /* intLit ::= PT_HEXLIT */
2331
0
#line 580 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2332
0
{ yylhsminor.yy180 = g_ascii_strtoull(yymsp[0].minor.yy0->v+2, NULL, 16); }
2333
0
#line 2358 "./protobuf_lang_parser.c"
2334
0
  yymsp[0].minor.yy180 = yylhsminor.yy180;
2335
0
        break;
2336
0
      case 71: /* constant ::= intLit */
2337
0
#line 588 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2338
0
{ yylhsminor.yy254 = pbl_store_string_token(state, ws_strdup_printf("%" PRIu64, yymsp[0].minor.yy180)); }
2339
0
#line 2364 "./protobuf_lang_parser.c"
2340
0
  yymsp[0].minor.yy254 = yylhsminor.yy254;
2341
0
        break;
2342
0
      case 72: /* constant ::= PT_PLUS intLit */
2343
0
{  yy_destructor(yypParser,41,&yymsp[-1].minor);
2344
0
#line 589 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2345
0
{ yymsp[-1].minor.yy254 = pbl_store_string_token(state, ws_strdup_printf("%" PRIu64, yymsp[0].minor.yy180)); }
2346
0
#line 2371 "./protobuf_lang_parser.c"
2347
0
}
2348
0
        break;
2349
0
      case 73: /* constant ::= PT_MINUS intLit */
2350
0
{  yy_destructor(yypParser,42,&yymsp[-1].minor);
2351
0
#line 590 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2352
0
{ yymsp[-1].minor.yy254 = pbl_store_string_token(state, ws_strdup_printf("-%" PRIu64, yymsp[0].minor.yy180)); }
2353
0
#line 2378 "./protobuf_lang_parser.c"
2354
0
}
2355
0
        break;
2356
0
      case 74: /* constant ::= PT_PLUS exIdent */
2357
0
{  yy_destructor(yypParser,41,&yymsp[-1].minor);
2358
0
#line 591 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2359
0
{ yymsp[-1].minor.yy254 = pbl_store_string_token(state, g_strconcat("+", yymsp[0].minor.yy118->v, NULL)); }
2360
0
#line 2385 "./protobuf_lang_parser.c"
2361
0
}
2362
0
        break;
2363
0
      case 75: /* constant ::= PT_MINUS exIdent */
2364
0
{  yy_destructor(yypParser,42,&yymsp[-1].minor);
2365
0
#line 592 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2366
0
{ yymsp[-1].minor.yy254 = pbl_store_string_token(state, g_strconcat("-", yymsp[0].minor.yy118->v, NULL)); }
2367
0
#line 2392 "./protobuf_lang_parser.c"
2368
0
}
2369
0
        break;
2370
0
      case 76: /* strLit ::= PT_STRLIT */
2371
0
#line 596 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2372
0
{ yylhsminor.yy254 = pbl_store_string_token(state, g_strndup(yymsp[0].minor.yy0->v + 1, strlen(yymsp[0].minor.yy0->v) - 2)); }
2373
0
#line 2398 "./protobuf_lang_parser.c"
2374
0
  yymsp[0].minor.yy254 = yylhsminor.yy254;
2375
0
        break;
2376
0
      case 77: /* strLit ::= strLit PT_STRLIT */
2377
0
#line 598 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2378
0
{ gchar *v = g_strndup(yymsp[0].minor.yy0->v + 1, strlen(yymsp[0].minor.yy0->v) - 2); yylhsminor.yy254 = pbl_store_string_token(state, g_strconcat(yymsp[-1].minor.yy254, v, NULL)); g_free(v); }
2379
0
#line 2404 "./protobuf_lang_parser.c"
2380
0
  yymsp[-1].minor.yy254 = yylhsminor.yy254;
2381
0
        break;
2382
0
      case 85: /* option ::= PT_OPTION optionName PT_ASSIGN constant PT_SEMICOLON */
2383
0
      case 86: /* option ::= PT_OPTION optionName PT_ASSIGN customOptionValue PT_SEMICOLON */ yytestcase(yyruleno==86);
2384
0
{  yy_destructor(yypParser,8,&yymsp[-4].minor);
2385
0
#line 221 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2386
0
{
2387
0
}
2388
0
#line 2413 "./protobuf_lang_parser.c"
2389
0
  yy_destructor(yypParser,25,&yymsp[-2].minor);
2390
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2391
0
}
2392
0
        break;
2393
0
      case 89: /* customOptionValue ::= PT_LCURLY customOptionBody PT_RCURLY */
2394
0
{  yy_destructor(yypParser,30,&yymsp[-2].minor);
2395
0
#line 242 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2396
0
{
2397
0
}
2398
0
#line 2423 "./protobuf_lang_parser.c"
2399
0
  yy_destructor(yypParser,31,&yymsp[0].minor);
2400
0
}
2401
0
        break;
2402
0
      case 92: /* customOptionBody ::= customOptionBody PT_STRLIT */
2403
0
#line 267 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2404
0
{
2405
0
}
2406
0
#line 2431 "./protobuf_lang_parser.c"
2407
0
  yy_destructor(yypParser,32,&yymsp[0].minor);
2408
0
        break;
2409
0
      case 96: /* symbolsWithoutCurly ::= PT_LPAREN */
2410
0
{  yy_destructor(yypParser,27,&yymsp[0].minor);
2411
0
#line 272 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2412
0
{
2413
0
}
2414
0
#line 2439 "./protobuf_lang_parser.c"
2415
0
}
2416
0
        break;
2417
0
      case 97: /* symbolsWithoutCurly ::= PT_RPAREN */
2418
0
{  yy_destructor(yypParser,28,&yymsp[0].minor);
2419
0
#line 273 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2420
0
{
2421
0
}
2422
0
#line 2447 "./protobuf_lang_parser.c"
2423
0
}
2424
0
        break;
2425
0
      case 98: /* symbolsWithoutCurly ::= PT_LBRACKET */
2426
0
{  yy_destructor(yypParser,33,&yymsp[0].minor);
2427
0
#line 274 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2428
0
{
2429
0
}
2430
0
#line 2455 "./protobuf_lang_parser.c"
2431
0
}
2432
0
        break;
2433
0
      case 99: /* symbolsWithoutCurly ::= PT_RBRACKET */
2434
0
{  yy_destructor(yypParser,34,&yymsp[0].minor);
2435
0
#line 275 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2436
0
{
2437
0
}
2438
0
#line 2463 "./protobuf_lang_parser.c"
2439
0
}
2440
0
        break;
2441
0
      case 100: /* symbolsWithoutCurly ::= PT_EQUAL */
2442
0
{  yy_destructor(yypParser,35,&yymsp[0].minor);
2443
0
#line 276 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2444
0
{
2445
0
}
2446
0
#line 2471 "./protobuf_lang_parser.c"
2447
0
}
2448
0
        break;
2449
0
      case 101: /* symbolsWithoutCurly ::= PT_NOTEQUAL */
2450
0
{  yy_destructor(yypParser,36,&yymsp[0].minor);
2451
0
#line 277 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2452
0
{
2453
0
}
2454
0
#line 2479 "./protobuf_lang_parser.c"
2455
0
}
2456
0
        break;
2457
0
      case 102: /* symbolsWithoutCurly ::= PT_NOTEQUAL2 */
2458
0
{  yy_destructor(yypParser,37,&yymsp[0].minor);
2459
0
#line 278 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2460
0
{
2461
0
}
2462
0
#line 2487 "./protobuf_lang_parser.c"
2463
0
}
2464
0
        break;
2465
0
      case 103: /* symbolsWithoutCurly ::= PT_GEQUAL */
2466
0
{  yy_destructor(yypParser,38,&yymsp[0].minor);
2467
0
#line 279 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2468
0
{
2469
0
}
2470
0
#line 2495 "./protobuf_lang_parser.c"
2471
0
}
2472
0
        break;
2473
0
      case 104: /* symbolsWithoutCurly ::= PT_LEQUAL */
2474
0
{  yy_destructor(yypParser,39,&yymsp[0].minor);
2475
0
#line 280 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2476
0
{
2477
0
}
2478
0
#line 2503 "./protobuf_lang_parser.c"
2479
0
}
2480
0
        break;
2481
0
      case 105: /* symbolsWithoutCurly ::= PT_ASSIGN_PLUS */
2482
0
{  yy_destructor(yypParser,40,&yymsp[0].minor);
2483
0
#line 281 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2484
0
{
2485
0
}
2486
0
#line 2511 "./protobuf_lang_parser.c"
2487
0
}
2488
0
        break;
2489
0
      case 106: /* symbolsWithoutCurly ::= PT_ASSIGN */
2490
0
{  yy_destructor(yypParser,25,&yymsp[0].minor);
2491
0
#line 282 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2492
0
{
2493
0
}
2494
0
#line 2519 "./protobuf_lang_parser.c"
2495
0
}
2496
0
        break;
2497
0
      case 107: /* symbolsWithoutCurly ::= PT_PLUS */
2498
0
{  yy_destructor(yypParser,41,&yymsp[0].minor);
2499
0
#line 283 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2500
0
{
2501
0
}
2502
0
#line 2527 "./protobuf_lang_parser.c"
2503
0
}
2504
0
        break;
2505
0
      case 108: /* symbolsWithoutCurly ::= PT_MINUS */
2506
0
{  yy_destructor(yypParser,42,&yymsp[0].minor);
2507
0
#line 284 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2508
0
{
2509
0
}
2510
0
#line 2535 "./protobuf_lang_parser.c"
2511
0
}
2512
0
        break;
2513
0
      case 109: /* symbolsWithoutCurly ::= PT_MULTIPLY */
2514
0
{  yy_destructor(yypParser,43,&yymsp[0].minor);
2515
0
#line 285 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2516
0
{
2517
0
}
2518
0
#line 2543 "./protobuf_lang_parser.c"
2519
0
}
2520
0
        break;
2521
0
      case 110: /* symbolsWithoutCurly ::= PT_DIV */
2522
0
{  yy_destructor(yypParser,44,&yymsp[0].minor);
2523
0
#line 286 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2524
0
{
2525
0
}
2526
0
#line 2551 "./protobuf_lang_parser.c"
2527
0
}
2528
0
        break;
2529
0
      case 111: /* symbolsWithoutCurly ::= PT_LOGIC_OR */
2530
0
{  yy_destructor(yypParser,45,&yymsp[0].minor);
2531
0
#line 287 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2532
0
{
2533
0
}
2534
0
#line 2559 "./protobuf_lang_parser.c"
2535
0
}
2536
0
        break;
2537
0
      case 112: /* symbolsWithoutCurly ::= PT_OR */
2538
0
{  yy_destructor(yypParser,46,&yymsp[0].minor);
2539
0
#line 288 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2540
0
{
2541
0
}
2542
0
#line 2567 "./protobuf_lang_parser.c"
2543
0
}
2544
0
        break;
2545
0
      case 113: /* symbolsWithoutCurly ::= PT_LOGIC_AND */
2546
0
{  yy_destructor(yypParser,47,&yymsp[0].minor);
2547
0
#line 289 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2548
0
{
2549
0
}
2550
0
#line 2575 "./protobuf_lang_parser.c"
2551
0
}
2552
0
        break;
2553
0
      case 114: /* symbolsWithoutCurly ::= PT_AND */
2554
0
{  yy_destructor(yypParser,48,&yymsp[0].minor);
2555
0
#line 290 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2556
0
{
2557
0
}
2558
0
#line 2583 "./protobuf_lang_parser.c"
2559
0
}
2560
0
        break;
2561
0
      case 115: /* symbolsWithoutCurly ::= PT_NOT */
2562
0
{  yy_destructor(yypParser,49,&yymsp[0].minor);
2563
0
#line 291 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2564
0
{
2565
0
}
2566
0
#line 2591 "./protobuf_lang_parser.c"
2567
0
}
2568
0
        break;
2569
0
      case 116: /* symbolsWithoutCurly ::= PT_NEG */
2570
0
{  yy_destructor(yypParser,50,&yymsp[0].minor);
2571
0
#line 292 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2572
0
{
2573
0
}
2574
0
#line 2599 "./protobuf_lang_parser.c"
2575
0
}
2576
0
        break;
2577
0
      case 117: /* symbolsWithoutCurly ::= PT_XOR */
2578
0
{  yy_destructor(yypParser,51,&yymsp[0].minor);
2579
0
#line 293 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2580
0
{
2581
0
}
2582
0
#line 2607 "./protobuf_lang_parser.c"
2583
0
}
2584
0
        break;
2585
0
      case 118: /* symbolsWithoutCurly ::= PT_SHL */
2586
0
{  yy_destructor(yypParser,52,&yymsp[0].minor);
2587
0
#line 294 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2588
0
{
2589
0
}
2590
0
#line 2615 "./protobuf_lang_parser.c"
2591
0
}
2592
0
        break;
2593
0
      case 119: /* symbolsWithoutCurly ::= PT_SHR */
2594
0
{  yy_destructor(yypParser,53,&yymsp[0].minor);
2595
0
#line 295 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2596
0
{
2597
0
}
2598
0
#line 2623 "./protobuf_lang_parser.c"
2599
0
}
2600
0
        break;
2601
0
      case 120: /* symbolsWithoutCurly ::= PT_PERCENT */
2602
0
{  yy_destructor(yypParser,54,&yymsp[0].minor);
2603
0
#line 296 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2604
0
{
2605
0
}
2606
0
#line 2631 "./protobuf_lang_parser.c"
2607
0
}
2608
0
        break;
2609
0
      case 121: /* symbolsWithoutCurly ::= PT_DOLLAR */
2610
0
{  yy_destructor(yypParser,55,&yymsp[0].minor);
2611
0
#line 297 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2612
0
{
2613
0
}
2614
0
#line 2639 "./protobuf_lang_parser.c"
2615
0
}
2616
0
        break;
2617
0
      case 122: /* symbolsWithoutCurly ::= PT_COND */
2618
0
{  yy_destructor(yypParser,56,&yymsp[0].minor);
2619
0
#line 298 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2620
0
{
2621
0
}
2622
0
#line 2647 "./protobuf_lang_parser.c"
2623
0
}
2624
0
        break;
2625
0
      case 123: /* symbolsWithoutCurly ::= PT_SEMICOLON */
2626
0
      case 188: /* emptyStatement ::= PT_SEMICOLON */ yytestcase(yyruleno==188);
2627
0
{  yy_destructor(yypParser,26,&yymsp[0].minor);
2628
0
#line 299 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2629
0
{
2630
0
}
2631
0
#line 2656 "./protobuf_lang_parser.c"
2632
0
}
2633
0
        break;
2634
0
      case 124: /* symbolsWithoutCurly ::= PT_DOT */
2635
0
{  yy_destructor(yypParser,29,&yymsp[0].minor);
2636
0
#line 300 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2637
0
{
2638
0
}
2639
0
#line 2664 "./protobuf_lang_parser.c"
2640
0
}
2641
0
        break;
2642
0
      case 125: /* symbolsWithoutCurly ::= PT_COMMA */
2643
0
{  yy_destructor(yypParser,57,&yymsp[0].minor);
2644
0
#line 301 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2645
0
{
2646
0
}
2647
0
#line 2672 "./protobuf_lang_parser.c"
2648
0
}
2649
0
        break;
2650
0
      case 126: /* symbolsWithoutCurly ::= PT_COLON */
2651
0
{  yy_destructor(yypParser,58,&yymsp[0].minor);
2652
0
#line 302 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2653
0
{
2654
0
}
2655
0
#line 2680 "./protobuf_lang_parser.c"
2656
0
}
2657
0
        break;
2658
0
      case 127: /* symbolsWithoutCurly ::= PT_LESS */
2659
0
{  yy_destructor(yypParser,59,&yymsp[0].minor);
2660
0
#line 303 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2661
0
{
2662
0
}
2663
0
#line 2688 "./protobuf_lang_parser.c"
2664
0
}
2665
0
        break;
2666
0
      case 128: /* symbolsWithoutCurly ::= PT_GREATER */
2667
0
{  yy_destructor(yypParser,60,&yymsp[0].minor);
2668
0
#line 304 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2669
0
{
2670
0
}
2671
0
#line 2696 "./protobuf_lang_parser.c"
2672
0
}
2673
0
        break;
2674
0
      case 142: /* enumValueOptions ::= enumValueOptions PT_COMMA enumValueOption */
2675
0
      case 164: /* declarations ::= declarations PT_COMMA declaration */ yytestcase(yyruleno==164);
2676
0
      case 171: /* ranges ::= ranges PT_COMMA range */ yytestcase(yyruleno==171);
2677
0
      case 176: /* quoteFieldNames ::= quoteFieldNames PT_COMMA strLit */ yytestcase(yyruleno==176);
2678
0
      case 178: /* reservedIdent ::= fieldName PT_COMMA fieldName */ yytestcase(yyruleno==178);
2679
0
#line 357 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2680
0
{
2681
0
}
2682
0
#line 2707 "./protobuf_lang_parser.c"
2683
0
  yy_destructor(yypParser,57,&yymsp[-1].minor);
2684
0
        break;
2685
0
      case 143: /* enumValueOption ::= optionName PT_ASSIGN constant */
2686
0
      case 144: /* enumValueOption ::= optionName PT_ASSIGN customOptionValue */ yytestcase(yyruleno==144);
2687
0
      case 165: /* declaration ::= optionName PT_ASSIGN constant */ yytestcase(yyruleno==165);
2688
0
      case 166: /* declaration ::= optionName PT_ASSIGN customOptionValue */ yytestcase(yyruleno==166);
2689
0
#line 361 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2690
0
{
2691
0
}
2692
0
#line 2717 "./protobuf_lang_parser.c"
2693
0
  yy_destructor(yypParser,25,&yymsp[-1].minor);
2694
0
        break;
2695
0
      case 147: /* rpc ::= rpcDecl PT_SEMICOLON */
2696
0
      case 152: /* stream ::= streamDecl PT_SEMICOLON */ yytestcase(yyruleno==152);
2697
0
#line 376 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2698
0
{
2699
0
}
2700
0
#line 2725 "./protobuf_lang_parser.c"
2701
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2702
0
        break;
2703
0
      case 148: /* rpc ::= rpcDecl PT_LCURLY rpcBody PT_RCURLY */
2704
0
      case 153: /* stream ::= streamDecl PT_LCURLY streamBody PT_RCURLY */ yytestcase(yyruleno==153);
2705
0
#line 377 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2706
0
{
2707
0
}
2708
0
#line 2733 "./protobuf_lang_parser.c"
2709
0
  yy_destructor(yypParser,30,&yymsp[-2].minor);
2710
0
  yy_destructor(yypParser,31,&yymsp[0].minor);
2711
0
        break;
2712
0
      case 161: /* extensions ::= PT_EXTENSIONS ranges PT_SEMICOLON */
2713
0
{  yy_destructor(yypParser,18,&yymsp[-2].minor);
2714
0
#line 511 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2715
0
{
2716
0
}
2717
0
#line 2742 "./protobuf_lang_parser.c"
2718
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2719
0
}
2720
0
        break;
2721
0
      case 162: /* extensions ::= PT_EXTENSIONS ranges PT_LBRACKET declarations PT_RBRACKET PT_SEMICOLON */
2722
0
{  yy_destructor(yypParser,18,&yymsp[-5].minor);
2723
0
#line 512 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2724
0
{
2725
0
}
2726
0
#line 2751 "./protobuf_lang_parser.c"
2727
0
  yy_destructor(yypParser,33,&yymsp[-3].minor);
2728
0
  yy_destructor(yypParser,34,&yymsp[-1].minor);
2729
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2730
0
}
2731
0
        break;
2732
0
      case 167: /* reserved ::= PT_RESERVED ranges PT_SEMICOLON */
2733
0
      case 168: /* reserved ::= PT_RESERVED quoteFieldNames PT_SEMICOLON */ yytestcase(yyruleno==168);
2734
0
      case 169: /* reserved ::= PT_RESERVED reservedIdent PT_SEMICOLON */ yytestcase(yyruleno==169);
2735
0
{  yy_destructor(yypParser,14,&yymsp[-2].minor);
2736
0
#line 524 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2737
0
{
2738
0
}
2739
0
#line 2764 "./protobuf_lang_parser.c"
2740
0
  yy_destructor(yypParser,26,&yymsp[0].minor);
2741
0
}
2742
0
        break;
2743
0
      case 173: /* range ::= intLit PT_TO intLit */
2744
0
      case 174: /* range ::= intLit PT_TO exIdent */ yytestcase(yyruleno==174);
2745
0
#line 535 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2746
0
{
2747
0
}
2748
0
#line 2773 "./protobuf_lang_parser.c"
2749
0
  yy_destructor(yypParser,24,&yymsp[-1].minor);
2750
0
        break;
2751
0
      case 190: /* exIdent ::= PT_IDENT */
2752
0
{  yy_destructor(yypParser,1,&yymsp[0].minor);
2753
0
#line 594 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2754
0
{
2755
0
}
2756
0
#line 2781 "./protobuf_lang_parser.c"
2757
0
}
2758
0
        break;
2759
0
      default:
2760
0
      /* (78) proto ::= wholeProtoBody */ yytestcase(yyruleno==78);
2761
0
      /* (79) proto ::= syntax wholeProtoBody */ yytestcase(yyruleno==79);
2762
0
      /* (80) proto ::= edition wholeProtoBody */ yytestcase(yyruleno==80);
2763
0
      /* (81) protoBody ::= protoBody import */ yytestcase(yyruleno==81);
2764
0
      /* (82) protoBody ::= protoBody package */ yytestcase(yyruleno==82);
2765
0
      /* (83) protoBody ::= protoBody option */ yytestcase(yyruleno==83);
2766
0
      /* (84) protoBody ::= protoBody emptyStatement */ yytestcase(yyruleno==84);
2767
0
      /* (87) optionName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=87);
2768
0
      /* (88) optionName ::= extIdentInParentheses (OPTIMIZED OUT) */ assert(yyruleno!=88);
2769
0
      /* (90) customOptionBody ::= */ yytestcase(yyruleno==90);
2770
0
      /* (91) customOptionBody ::= customOptionBody exIdent */ yytestcase(yyruleno==91);
2771
0
      /* (93) customOptionBody ::= customOptionBody symbolsWithoutCurly */ yytestcase(yyruleno==93);
2772
0
      /* (94) customOptionBody ::= customOptionBody intLit */ yytestcase(yyruleno==94);
2773
0
      /* (95) customOptionBody ::= customOptionBody customOptionValue */ yytestcase(yyruleno==95);
2774
0
      /* (129) topLevelDef ::= message (OPTIMIZED OUT) */ assert(yyruleno!=129);
2775
0
      /* (130) topLevelDef ::= enum (OPTIMIZED OUT) */ assert(yyruleno!=130);
2776
0
      /* (131) topLevelDef ::= extend (OPTIMIZED OUT) */ assert(yyruleno!=131);
2777
0
      /* (132) topLevelDef ::= service (OPTIMIZED OUT) */ assert(yyruleno!=132);
2778
0
      /* (133) messageBody ::= messageBody extend */ yytestcase(yyruleno==133);
2779
0
      /* (134) messageBody ::= messageBody extensions */ yytestcase(yyruleno==134);
2780
0
      /* (135) messageBody ::= messageBody option */ yytestcase(yyruleno==135);
2781
0
      /* (136) messageBody ::= messageBody reserved */ yytestcase(yyruleno==136);
2782
0
      /* (137) messageBody ::= messageBody emptyStatement */ yytestcase(yyruleno==137);
2783
0
      /* (138) enumBody ::= enumBody reserved */ yytestcase(yyruleno==138);
2784
0
      /* (139) enumBody ::= enumBody option */ yytestcase(yyruleno==139);
2785
0
      /* (140) enumBody ::= enumBody emptyStatement */ yytestcase(yyruleno==140);
2786
0
      /* (141) enumValueOptions ::= enumValueOption (OPTIMIZED OUT) */ assert(yyruleno!=141);
2787
0
      /* (145) serviceBody ::= serviceBody option */ yytestcase(yyruleno==145);
2788
0
      /* (146) serviceBody ::= serviceBody emptyStatement */ yytestcase(yyruleno==146);
2789
0
      /* (149) rpcBody ::= */ yytestcase(yyruleno==149);
2790
0
      /* (150) rpcBody ::= rpcBody option */ yytestcase(yyruleno==150);
2791
0
      /* (151) rpcBody ::= rpcBody emptyStatement */ yytestcase(yyruleno==151);
2792
0
      /* (154) streamBody ::= */ yytestcase(yyruleno==154);
2793
0
      /* (155) streamBody ::= streamBody option */ yytestcase(yyruleno==155);
2794
0
      /* (156) streamBody ::= streamBody emptyStatement */ yytestcase(yyruleno==156);
2795
0
      /* (157) groupName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=157);
2796
0
      /* (158) oneofBody ::= oneofBody option */ yytestcase(yyruleno==158);
2797
0
      /* (159) oneofBody ::= oneofBody group */ yytestcase(yyruleno==159);
2798
0
      /* (160) oneofBody ::= oneofBody emptyStatement */ yytestcase(yyruleno==160);
2799
0
      /* (163) declarations ::= declaration (OPTIMIZED OUT) */ assert(yyruleno!=163);
2800
0
      /* (170) ranges ::= range (OPTIMIZED OUT) */ assert(yyruleno!=170);
2801
0
      /* (172) range ::= intLit */ yytestcase(yyruleno==172);
2802
0
      /* (175) quoteFieldNames ::= strLit */ yytestcase(yyruleno==175);
2803
0
      /* (177) reservedIdent ::= fieldName */ yytestcase(yyruleno==177);
2804
0
      /* (179) extendBody ::= extendBody emptyStatement */ yytestcase(yyruleno==179);
2805
0
      /* (180) messageName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=180);
2806
0
      /* (181) enumName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=181);
2807
0
      /* (182) streamName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=182);
2808
0
      /* (183) fieldName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=183);
2809
0
      /* (184) oneofName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=184);
2810
0
      /* (185) mapName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=185);
2811
0
      /* (186) serviceName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=186);
2812
0
      /* (187) rpcName ::= exIdent (OPTIMIZED OUT) */ assert(yyruleno!=187);
2813
0
      /* (189) constant ::= strLit */ yytestcase(yyruleno==189);
2814
0
        break;
2815
/********** End reduce actions ************************************************/
2816
0
  };
2817
0
  assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
2818
0
  yygoto = yyRuleInfoLhs[yyruleno];
2819
0
  yysize = yyRuleInfoNRhs[yyruleno];
2820
0
  yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
2821
2822
  /* There are no SHIFTREDUCE actions on nonterminals because the table
2823
  ** generator has simplified them to pure REDUCE actions. */
2824
0
  assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) );
2825
2826
  /* It is not possible for a REDUCE to be followed by an error */
2827
0
  assert( yyact!=YY_ERROR_ACTION );
2828
2829
0
  yymsp += yysize+1;
2830
0
  yypParser->yytos = yymsp;
2831
0
  yymsp->stateno = (YYACTIONTYPE)yyact;
2832
0
  yymsp->major = (YYCODETYPE)yygoto;
2833
0
  yyTraceShift(yypParser, yyact, "... then shift");
2834
0
  return yyact;
2835
0
}
2836
2837
/*
2838
** The following code executes when the parse fails
2839
*/
2840
#ifndef YYNOERRORRECOVERY
2841
static void yy_parse_failed(
2842
  yyParser *yypParser           /* The parser */
2843
0
){
2844
0
  ProtobufLangParserARG_FETCH
2845
0
  ProtobufLangParserCTX_FETCH
2846
#ifndef NDEBUG
2847
  if( yyTraceFILE ){
2848
    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
2849
  }
2850
#endif
2851
0
  while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
2852
  /* Here code is inserted which will be executed whenever the
2853
  ** parser fails */
2854
/************ Begin %parse_failure code ***************************************/
2855
0
#line 81 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2856
2857
0
    pbl_parser_error(state, "Parse Error");
2858
0
    state->grammar_error = TRUE;
2859
0
#line 2884 "./protobuf_lang_parser.c"
2860
/************ End %parse_failure code *****************************************/
2861
0
  ProtobufLangParserARG_STORE /* Suppress warning about unused %extra_argument variable */
2862
0
  ProtobufLangParserCTX_STORE
2863
0
}
2864
#endif /* YYNOERRORRECOVERY */
2865
2866
/*
2867
** The following code executes when a syntax error first occurs.
2868
*/
2869
static void yy_syntax_error(
2870
  yyParser *yypParser,           /* The parser */
2871
  int yymajor,                   /* The major type of the error token */
2872
  ProtobufLangParserTOKENTYPE yyminor         /* The minor type of the error token */
2873
0
){
2874
0
  ProtobufLangParserARG_FETCH
2875
0
  ProtobufLangParserCTX_FETCH
2876
0
#define TOKEN yyminor
2877
/************ Begin %syntax_error code ****************************************/
2878
0
#line 72 "/src/wireshark/epan/protobuf_lang_parser.lemon"
2879
2880
0
    if (yyminor) {
2881
0
        pbl_parser_error(state, "Syntax Error: unexpected token \"%s\"", yyminor->v);
2882
0
    } else {
2883
0
        pbl_parser_error(state, "Syntax Error: missing token");
2884
0
    }
2885
0
    state->grammar_error = TRUE;
2886
0
#line 2911 "./protobuf_lang_parser.c"
2887
/************ End %syntax_error code ******************************************/
2888
0
  ProtobufLangParserARG_STORE /* Suppress warning about unused %extra_argument variable */
2889
0
  ProtobufLangParserCTX_STORE
2890
0
}
2891
2892
/*
2893
** The following is executed when the parser accepts
2894
*/
2895
static void yy_accept(
2896
  yyParser *yypParser           /* The parser */
2897
0
){
2898
0
  ProtobufLangParserARG_FETCH
2899
0
  ProtobufLangParserCTX_FETCH
2900
#ifndef NDEBUG
2901
  if( yyTraceFILE ){
2902
    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
2903
  }
2904
#endif
2905
0
#ifndef YYNOERRORRECOVERY
2906
0
  yypParser->yyerrcnt = -1;
2907
0
#endif
2908
0
  assert( yypParser->yytos==yypParser->yystack );
2909
  /* Here code is inserted which will be executed whenever the
2910
  ** parser accepts */
2911
/*********** Begin %parse_accept code *****************************************/
2912
/*********** End %parse_accept code *******************************************/
2913
0
  ProtobufLangParserARG_STORE /* Suppress warning about unused %extra_argument variable */
2914
0
  ProtobufLangParserCTX_STORE
2915
0
}
2916
2917
/* The main parser program.
2918
** The first argument is a pointer to a structure obtained from
2919
** "ProtobufLangParserAlloc" which describes the current state of the parser.
2920
** The second argument is the major token number.  The third is
2921
** the minor token.  The fourth optional argument is whatever the
2922
** user wants (and specified in the grammar) and is available for
2923
** use by the action routines.
2924
**
2925
** Inputs:
2926
** <ul>
2927
** <li> A pointer to the parser (an opaque structure.)
2928
** <li> The major token number.
2929
** <li> The minor token number.
2930
** <li> An option argument of a grammar-specified type.
2931
** </ul>
2932
**
2933
** Outputs:
2934
** None.
2935
*/
2936
void ProtobufLangParser(
2937
  void *yyp,                   /* The parser */
2938
  int yymajor,                 /* The major token code number */
2939
  ProtobufLangParserTOKENTYPE yyminor       /* The value for the token */
2940
  ProtobufLangParserARG_PDECL               /* Optional %extra_argument parameter */
2941
0
){
2942
0
  YYMINORTYPE yyminorunion;
2943
0
  YYACTIONTYPE yyact;   /* The parser action. */
2944
0
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
2945
0
  int yyendofinput;     /* True if we are at the end of input */
2946
0
#endif
2947
#ifdef YYERRORSYMBOL
2948
  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
2949
#endif
2950
0
  yyParser *yypParser = (yyParser*)yyp;  /* The parser */
2951
0
  ProtobufLangParserCTX_FETCH
2952
0
  ProtobufLangParserARG_STORE
2953
2954
0
  assert( yypParser->yytos!=0 );
2955
0
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
2956
0
  yyendofinput = (yymajor==0);
2957
0
#endif
2958
2959
0
  yyact = yypParser->yytos->stateno;
2960
#ifndef NDEBUG
2961
  if( yyTraceFILE ){
2962
    if( yyact < YY_MIN_REDUCE ){
2963
      fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
2964
              yyTracePrompt,yyTokenName[yymajor],yyact);
2965
    }else{
2966
      fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
2967
              yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE);
2968
    }
2969
  }
2970
#endif
2971
2972
0
  while(1){ /* Exit by "break" */
2973
0
    assert( yypParser->yytos>=yypParser->yystack );
2974
0
    assert( yyact==yypParser->yytos->stateno );
2975
0
    yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
2976
0
    if( yyact >= YY_MIN_REDUCE ){
2977
0
      unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */
2978
#ifndef NDEBUG
2979
      assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) );
2980
      if( yyTraceFILE ){
2981
        int yysize = yyRuleInfoNRhs[yyruleno];
2982
        if( yysize ){
2983
          fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
2984
            yyTracePrompt,
2985
            yyruleno, yyRuleName[yyruleno],
2986
            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
2987
            yypParser->yytos[yysize].stateno);
2988
        }else{
2989
          fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
2990
            yyTracePrompt, yyruleno, yyRuleName[yyruleno],
2991
            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
2992
        }
2993
      }
2994
#endif /* NDEBUG */
2995
2996
      /* Check that the stack is large enough to grow by a single entry
2997
      ** if the RHS of the rule is empty.  This ensures that there is room
2998
      ** enough on the stack to push the LHS value */
2999
0
      if( yyRuleInfoNRhs[yyruleno]==0 ){
3000
#ifdef YYTRACKMAXSTACKDEPTH
3001
        if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
3002
          yypParser->yyhwm++;
3003
          assert( yypParser->yyhwm ==
3004
                  (int)(yypParser->yytos - yypParser->yystack));
3005
        }
3006
#endif
3007
0
#if YYSTACKDEPTH>0
3008
0
        if( yypParser->yytos>=yypParser->yystackEnd ){
3009
0
          yyStackOverflow(yypParser);
3010
0
          break;
3011
0
        }
3012
#else
3013
        if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
3014
          if( yyGrowStack(yypParser) ){
3015
            yyStackOverflow(yypParser);
3016
            break;
3017
          }
3018
        }
3019
#endif
3020
0
      }
3021
0
      yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ProtobufLangParserCTX_PARAM);
3022
0
    }else if( yyact <= YY_MAX_SHIFTREDUCE ){
3023
0
      yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
3024
0
#ifndef YYNOERRORRECOVERY
3025
0
      yypParser->yyerrcnt--;
3026
0
#endif
3027
0
      break;
3028
0
    }else if( yyact==YY_ACCEPT_ACTION ){
3029
0
      yypParser->yytos--;
3030
0
      yy_accept(yypParser);
3031
0
      return;
3032
0
    }else{
3033
0
      assert( yyact == YY_ERROR_ACTION );
3034
0
      yyminorunion.yy0 = yyminor;
3035
#ifdef YYERRORSYMBOL
3036
      int yymx;
3037
#endif
3038
#ifndef NDEBUG
3039
      if( yyTraceFILE ){
3040
        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
3041
      }
3042
#endif
3043
#ifdef YYERRORSYMBOL
3044
      /* A syntax error has occurred.
3045
      ** The response to an error depends upon whether or not the
3046
      ** grammar defines an error token "ERROR".
3047
      **
3048
      ** This is what we do if the grammar does define ERROR:
3049
      **
3050
      **  * Call the %syntax_error function.
3051
      **
3052
      **  * Begin popping the stack until we enter a state where
3053
      **    it is legal to shift the error symbol, then shift
3054
      **    the error symbol.
3055
      **
3056
      **  * Set the error count to three.
3057
      **
3058
      **  * Begin accepting and shifting new tokens.  No new error
3059
      **    processing will occur until three tokens have been
3060
      **    shifted successfully.
3061
      **
3062
      */
3063
      if( yypParser->yyerrcnt<0 ){
3064
        yy_syntax_error(yypParser,yymajor,yyminor);
3065
      }
3066
      yymx = yypParser->yytos->major;
3067
      if( yymx==YYERRORSYMBOL || yyerrorhit ){
3068
#ifndef NDEBUG
3069
        if( yyTraceFILE ){
3070
          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
3071
             yyTracePrompt,yyTokenName[yymajor]);
3072
        }
3073
#endif
3074
        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
3075
        yymajor = YYNOCODE;
3076
      }else{
3077
        while( yypParser->yytos > yypParser->yystack ){
3078
          yyact = yy_find_reduce_action(yypParser->yytos->stateno,
3079
                                        YYERRORSYMBOL);
3080
          if( yyact<=YY_MAX_SHIFTREDUCE ) break;
3081
          yy_pop_parser_stack(yypParser);
3082
        }
3083
        if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){
3084
          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
3085
          yy_parse_failed(yypParser);
3086
#ifndef YYNOERRORRECOVERY
3087
          yypParser->yyerrcnt = -1;
3088
#endif
3089
          yymajor = YYNOCODE;
3090
        }else if( yymx!=YYERRORSYMBOL ){
3091
          yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
3092
        }
3093
      }
3094
      yypParser->yyerrcnt = 3;
3095
      yyerrorhit = 1;
3096
      if( yymajor==YYNOCODE ) break;
3097
      yyact = yypParser->yytos->stateno;
3098
#elif defined(YYNOERRORRECOVERY)
3099
      /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
3100
      ** do any kind of error recovery.  Instead, simply invoke the syntax
3101
      ** error routine and continue going as if nothing had happened.
3102
      **
3103
      ** Applications can set this macro (for example inside %include) if
3104
      ** they intend to abandon the parse upon the first syntax error seen.
3105
      */
3106
      yy_syntax_error(yypParser,yymajor, yyminor);
3107
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
3108
      break;
3109
#else  /* YYERRORSYMBOL is not defined */
3110
      /* This is what we do if the grammar does not define ERROR:
3111
      **
3112
      **  * Report an error message, and throw away the input token.
3113
      **
3114
      **  * If the input token is $, then fail the parse.
3115
      **
3116
      ** As before, subsequent error messages are suppressed until
3117
      ** three input tokens have been successfully shifted.
3118
      */
3119
0
      if( yypParser->yyerrcnt<=0 ){
3120
0
        yy_syntax_error(yypParser,yymajor, yyminor);
3121
0
      }
3122
0
      yypParser->yyerrcnt = 3;
3123
0
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
3124
0
      if( yyendofinput ){
3125
0
        yy_parse_failed(yypParser);
3126
0
#ifndef YYNOERRORRECOVERY
3127
0
        yypParser->yyerrcnt = -1;
3128
0
#endif
3129
0
      }
3130
0
      break;
3131
0
#endif
3132
0
    }
3133
0
  }
3134
#ifndef NDEBUG
3135
  if( yyTraceFILE ){
3136
    yyStackEntry *i;
3137
    char cDiv = '[';
3138
    fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);
3139
    for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){
3140
      fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);
3141
      cDiv = ' ';
3142
    }
3143
    fprintf(yyTraceFILE,"]\n");
3144
  }
3145
#endif
3146
0
  return;
3147
0
}
3148
3149
/*
3150
** Return the fallback token corresponding to canonical token iToken, or
3151
** 0 if iToken has no fallback.
3152
*/
3153
0
int ProtobufLangParserFallback(int iToken){
3154
0
#ifdef YYFALLBACK
3155
0
  assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
3156
0
  return yyFallback[iToken];
3157
#else
3158
  (void)iToken;
3159
  return 0;
3160
#endif
3161
0
}
3162
#line 56 "/src/wireshark/epan/protobuf_lang_parser.lemon"
3163
3164
DIAG_ON_LEMON()
3165
#line 600 "/src/wireshark/epan/protobuf_lang_parser.lemon"
3166
3167
3168
void
3169
protobuf_lang_error(void* yyscanner, protobuf_lang_state_t *state, const char *msg)
3170
0
{
3171
0
    int lineno;
3172
0
    void(*error_cb)(const char *format, ...);
3173
0
    const char* filepath = (state && state->file) ?
3174
0
                            state->file->filename : "UNKNOWN";
3175
3176
0
    error_cb = (state && state->pool->error_cb) ?
3177
0
                state->pool->error_cb : pbl_printf;
3178
3179
0
    lineno = yyscanner ? protobuf_lang_get_lineno(yyscanner) : -1;
3180
3181
0
    if (lineno > -1) {
3182
0
        error_cb("Protobuf: Parsing file [%s:%d] failed: %s\n", filepath, lineno, msg);
3183
0
    } else {
3184
0
        error_cb("Protobuf: Parsing file [%s] failed: %s\n", filepath, msg);
3185
0
    }
3186
0
}
3187
3188
void
3189
pbl_parser_error(protobuf_lang_state_t *state, const char *fmt, ...)
3190
0
{
3191
0
    char* msg;
3192
0
    void* scanner;
3193
0
    va_list ap;
3194
0
    va_start(ap, fmt);
3195
0
    msg = ws_strdup_vprintf(fmt, ap);
3196
0
    scanner = state ? state->scanner : NULL;
3197
0
    protobuf_lang_error(scanner, state, msg);
3198
0
    va_end(ap);
3199
0
    g_free(msg);
3200
0
}
3201
3202
static void
3203
pbl_clear_state(protobuf_lang_state_t *state, pbl_descriptor_pool_t* pool)
3204
0
{
3205
0
    if (state == NULL) {
3206
0
        return;
3207
0
    }
3208
3209
0
    state->pool = NULL;
3210
0
    state->file = NULL;
3211
0
    state->grammar_error = FALSE;
3212
0
    state->tmp_token = NULL;
3213
3214
0
    if (state->scanner) {
3215
0
        protobuf_lang_lex_destroy(state->scanner);
3216
0
        state->scanner = NULL;
3217
0
    }
3218
3219
0
    if (state->pParser) {
3220
0
        ProtobufLangParserFree(state->pParser, g_free);
3221
0
        state->pParser = NULL;
3222
0
    }
3223
3224
0
    if (state->lex_string_tokens) {
3225
0
        g_slist_free_full(state->lex_string_tokens, g_free);
3226
0
        state->lex_string_tokens = NULL;
3227
0
    }
3228
3229
0
    if (state->lex_struct_tokens) {
3230
0
        g_slist_free_full(state->lex_struct_tokens, g_free);
3231
0
        state->lex_struct_tokens = NULL;
3232
0
    }
3233
3234
0
    if (pool) {
3235
0
        pool->parser_state = NULL;
3236
0
    }
3237
0
}
3238
3239
static void
3240
pbl_reinit_state(protobuf_lang_state_t *state, pbl_descriptor_pool_t* pool, const char* filepath)
3241
0
{
3242
0
    if (state == NULL) {
3243
0
        return;
3244
0
    }
3245
0
    pbl_clear_state(state, pool);
3246
3247
0
    state->pool = pool;
3248
0
    state->file = (pbl_file_descriptor_t*) g_hash_table_lookup(pool->proto_files, filepath);
3249
0
    state->pParser = ProtobufLangParserAlloc(g_malloc0);
3250
3251
0
    if (pool) {
3252
0
        pool->parser_state = state;
3253
0
    }
3254
0
}
3255
3256
int run_pbl_parser(pbl_descriptor_pool_t* pool)
3257
0
{
3258
0
    protobuf_lang_state_t state = {0};
3259
0
    yyscan_t scanner;
3260
0
    FILE * fp;
3261
0
    int status = 0;
3262
0
    int token_id;
3263
0
    const char* filepath;
3264
3265
0
    while (!g_queue_is_empty(pool->proto_files_to_be_parsed)) {
3266
0
        filepath = (const char*) g_queue_peek_head(pool->proto_files_to_be_parsed);
3267
        /* reinit state and scanner */
3268
0
        pbl_reinit_state(&state, pool, filepath);
3269
0
        scanner = NULL;
3270
3271
        /* Note that filepath is absolute path in proto_files */
3272
0
        fp = ws_fopen(filepath, "r");
3273
0
        if (fp == NULL) {
3274
0
            pbl_parser_error(&state, "File does not exists!");
3275
0
            status = -1;
3276
0
            goto finish;
3277
0
        }
3278
3279
0
        status = protobuf_lang_lex_init(&scanner);
3280
0
        if (status != 0) {
3281
0
            pbl_parser_error(&state, "Initialize Protocol Buffers Language scanner failed!\n");
3282
0
            fclose(fp);
3283
0
            goto finish;
3284
0
        }
3285
3286
        /* associate the parser state with the lexical analyzer state */
3287
0
        protobuf_lang_set_extra(&state, scanner);
3288
0
        state.scanner = scanner;
3289
3290
0
        protobuf_lang_restart(fp, scanner);
3291
        /* uncomment the next line for debugging */
3292
        /* ProtobufLangParserTrace(stdout, ">>>"); */
3293
0
        while (!state.grammar_error && (token_id = protobuf_lang_lex(scanner))) {
3294
            /* state.tmp_token contains token string value and lineno information */
3295
0
            ProtobufLangParser(state.pParser, token_id, state.tmp_token, &state);
3296
0
        }
3297
0
        fclose(fp);
3298
3299
0
        if (state.grammar_error) {
3300
0
            status = -2;
3301
0
            goto finish;
3302
0
        } else {
3303
0
            ProtobufLangParser(state.pParser, 0, NULL, &state);
3304
0
        }
3305
3306
        /* remove the parsed file from list */
3307
0
        g_queue_pop_head(pool->proto_files_to_be_parsed);
3308
0
    }
3309
3310
0
finish:
3311
0
    pbl_clear_state(&state, pool);
3312
0
    return status;
3313
0
}
3314
3315
#line 3340 "./protobuf_lang_parser.c"