blob: 6a1e852bae1d72ec49970eb41e595a5ac08728fe [file] [log] [blame]
Karl Zhang3de5ab12021-05-31 11:45:48 +08001/* A Bison parser, made by GNU Bison 3.0.4. */
2
3/* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20/* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33/* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36/* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43/* Identify Bison output. */
44#define YYBISON 1
45
46/* Bison version. */
47#define YYBISON_VERSION "3.0.4"
48
49/* Skeleton name. */
50#define YYSKELETON_NAME "yacc.c"
51
52/* Pure parsers. */
53#define YYPURE 0
54
55/* Push parsers. */
56#define YYPUSH 0
57
58/* Pull parsers. */
59#define YYPULL 1
60
61
62
63
64/* Copy the first part of user declarations. */
65#line 8 "parser/tf_fuzz_grammar.y" /* yacc.c:339 */
66
67#include <iostream>
68#include <vector>
69#include <set>
70
71#include "class_forwards.hpp"
72#include "data_blocks.hpp"
73#include "boilerplate.hpp"
74#include "gibberish.hpp"
75#include "compute.hpp"
76#include "string_ops.hpp"
77#include "psa_asset.hpp"
78#include "find_or_create_asset.hpp"
79#include "template_line.hpp"
80#include "tf_fuzz.hpp"
81#include "sst_asset.hpp"
82#include "crypto_asset.hpp"
83#include "psa_call.hpp"
84#include "crypto_call.hpp"
85#include "sst_call.hpp"
86#include "security_call.hpp"
87#include "secure_template_line.hpp"
88#include "sst_template_line.hpp"
89#include "crypto_template_line.hpp"
90
91/* These items are defined in tf_fuzz_grammar.l. Note, however that, because
92 of "name mangling," defining them as extern "C" may or may not be ideal,
93 depending upon which compiler -- gcc vs. g++, compiles the output from lex.
94 So far, it seems best without the extern "C", including also compiling
95 under Visual Studio. */
96/* extern "C"
97{ */
98 extern int yylineno;
99 int yywrap() {return 1;}
100 extern char yytext[];
101 extern int yyleng;
102/* } */
103
104int yylex (void);
105void yyerror (tf_fuzz_info *, const char *);
106 /* Sends the yyparse() argument to yyerror(), probably, to print incorrect
107 text it parsed. */
108
109/* A few consts just to make code more comprehensible: */
110const bool yes_fill_in_template = true;
111const bool dont_fill_in_template = false;
112const bool yes_create_call = true;
113const bool dont_create_call = false;
114
115tf_fuzz_info *rsrc;
116
117/* These are object pointers used to parse the template and create the test. Ac-
118 tually, probably only templateLin is used for now, but this is a good outline of
119 of the template_line class hierarchy. */
120template_line *templateLin = nullptr;
121 sst_template_line *sstTemplateLin = nullptr;
122 set_sst_template_line *setSstTemplateLin = nullptr;
123 read_sst_template_line *reaSstTemplateLin = nullptr;
124 remove_sst_template_line *remSstTemplateLin = nullptr;
125 policy_template_line *polTemplateLin = nullptr;
126 set_policy_template_line *setPolTemplateLin = nullptr;
127 read_policy_template_line *reaPolTemplateLin = nullptr;
128 key_template_line *keyTemplateLin = nullptr;
129 set_key_template_line *setKeyTemplateLin = nullptr;
130 read_key_template_line *reaKeyTemplateLin = nullptr;
131 remove_key_template_line *remKeyTemplateLin = nullptr;
132 security_template_line *secTemplateLin = nullptr;
133 security_hash_template_line *secHasTemplateLin = nullptr;
134/* Call and asset objects are presumably not immediately needed, because the objects
135 of these types are within the resource object, *rsrc, but even if only just to
136 show that class hierarchy: */
137psa_call *psaCal = nullptr;
138 sst_call *sstCal = nullptr;
139 sst_set_call *sstSetCal = nullptr;
140 sst_get_call *sstGetCal = nullptr;
141 sst_remove_call *sstRemCal = nullptr;
142 crypto_call *cryCal = nullptr;
143 policy_call *polCal = nullptr;
144 init_policy_call *iniPolCal = nullptr;
145 reset_policy_call *resPolCal = nullptr;
146 add_policy_usage_call *addPolUsaCal = nullptr;
147 set_policy_lifetime_call *setPolLifCal = nullptr;
148 set_policy_type_call *setPolTypCal = nullptr;
149 set_policy_algorithm_call *setPolAlgCal = nullptr;
150 set_policy_usage_call *setPolUsaCal = nullptr;
151 get_policy_lifetime_call *getPolLifCal = nullptr;
152 get_policy_type_call *getPolTypCal = nullptr;
153 get_policy_algorithm_call *getPolAlgCal = nullptr;
154 get_policy_usage_call *getPolUsaCal = nullptr;
155 get_policy_size_call *getPolSizCal = nullptr;
156 get_key_policy_call *getKeyPolCal = nullptr;
157 key_call *keyCal = nullptr;
158 generate_key_call *genKeyCal = nullptr;
159 create_key_call *creKeyCal = nullptr;
160 copy_key_call *copKeyCal = nullptr;
161 read_key_data_call *reaKeyDatCal = nullptr;
162 remove_key_call *remKeyCal = nullptr;
163psa_asset *psaAst = nullptr;
164 sst_asset *sstAst = nullptr;
165 crypto_asset *cryAst = nullptr;
166 policy_asset *polAst = nullptr;
167 key_asset *keyAst = nullptr;
168
169/* For generating random, but readable/memorable, data: */
170gibberish gib;
171char gib_buff[4096]; // spew gibberish into here
172int rand_data_length = 0;
173
174/* General-utility variables: */
175bool purpose_defined = false;
176psa_asset_usage random_asset = psa_asset_usage::all;
177 /* to pick what type of asset at random */
178bool random_name; /* template didn't specify name, so it's generated randomly */
179string literal_data; /* literal data for an asset value */
180
181/* Holders for state in read commands: */
182expect_info expect; /* everything about expected results and data */
183set_data_info set_data; /* everything about setting the value of PSA-asset data */
184asset_name_id_info parsed_asset; /* everything about identifying assets */
185string target_barrier = ""; /* asset to set and search barrier when re-ordering PSA calls */
186key_policy_info policy_info; /* everything about key policies */
187bool assign_data_var_specified = false;
188string assign_data_var;
189bool print_data = false; /* true to just print asset data to the test log */
190bool hash_data = false; /* true to just print asset data to the test log */
191bool literal_is_string = true;
192 /* if true, literal value is character-string; if false, is list of hex values */
193
194/* The following are more tied to the template syntax than to the resulting PSA calls */
195string literal; /* temporary holder for all string literals */
196string identifier; /* temporary holder for strings representing identifiers */
197string var_name; /* a variable name */
198string asset_name; /* as parsed, not yet put into parsed_asset */
199string aid; /* string-typed holder for an asset ID in a list thereof */
200int nid; /* same idea as aid, but for asset ID# lists */
201size_t strFind1, strFind2; /* for searching through strings */
202
203/* Because of the parsing order, psa_calls of the specific type have to be
204 push_back()ed onto rsrc->calls before their expected results are known. Therefore,
205 must inject those results after parsing the expected results. add_expect is a
206 loop index to track where to add results. */
207unsigned int add_expect = 0;
208
209/* Temporaries: */
210vector<psa_asset*>::iterator t_sst_asset;
211vector<psa_asset*>::iterator t_key_asset;
212vector<psa_asset*>::iterator t_policy_asset;
213sst_call *t_sst_call = nullptr;
214key_call *t_key_call = nullptr;
215policy_call *t_policy_call = nullptr;
216long number; /* temporary holder for a number, e.g., sting form of UID */
217int i, j, k;
218
219/* Relating to template-statement blocks: */
220vector<template_line*> template_block_vector; /* (must be *pointers to* templates) */
221vector<int> block_order; /* "statisticalized" order of template lines in a block */
222int nesting_level = 0;
223 /* how many levels deep in { } nesting currently. Initially only 0 or 1. */
224bool shuffle_not_pick;
225 /* true to shuffle statements in a block, rather than pick so-and-so
226 number of them at random. */
227int low_nmbr_lines = 1; /* if picking so-and-so number of template lines from a ... */
228int high_nmbr_lines = 1; /* ... block at random, these are fewest and most lines. */
229int exact_nmbr_lines = 1;
230
231using namespace std;
232
233
234void set_purp_str (
235 char *raw_purpose, /* the purpose C string from parser */
236 tf_fuzz_info *rsrc /* test resources containing the actual test-purpose string */
237) {
238 size_t l; /* temporary of size_t type */
239 string purp_str = raw_purpose;
240 strFind1 = purp_str.find (" ");
241 purp_str = purp_str.substr (strFind1, purp_str.length());
242 purp_str.erase (0, 1); // (extra space)
243 strFind1 = purp_str.rfind (";");
244 purp_str = purp_str.substr (0, strFind1);
245 l = 0;
246 do { /* escape all " chars (if not already escaped) */
247 l = purp_str.find ("\"", l);
248 if ( l < purp_str.length()) { /* did find a quote character */
249 if ( l == 0 /* it's the first character in the string*/
250 || purp_str[l-1] != '\\' /* or it's not already escaped */
251 ) {
252 purp_str.insert (l, "\\"); /* then escape the " char */
253 l++; /* point l to the " again */
254 }
255 l++; /* point l past the " */
256 }
257 } while (l < purp_str.length());
258 rsrc->test_purpose = purp_str;
259}
260
261/* randomize_template_lines() chooses a template-line order in cases where they are to
262 be randomized -- shuffled or random picked. */
263void randomize_template_lines (
264 bool shuffle_not_pick, /* true to perform a shuffle operation rather than pick */
265 int &low_nmbr_lines, /* if picking so-and-so number of template lines from a ... */
266 int &high_nmbr_lines, /* ... block at random, these are fewest and most lines. */
267 int &exact_nmbr_lines,
268 vector<template_line*> &template_block_vector,
269 vector<int> &block_order,
270 tf_fuzz_info *rsrc /* test resources containing the actual test-purpose string */
271) {
272 set<int> template_used; /* used for shuffle */
273 low_nmbr_lines = (low_nmbr_lines < 0)? 0 : low_nmbr_lines;
274 high_nmbr_lines = (high_nmbr_lines < 0)? 0 : high_nmbr_lines;
275 if (low_nmbr_lines > high_nmbr_lines) {
276 int swap = low_nmbr_lines;
277 low_nmbr_lines = high_nmbr_lines;
278 high_nmbr_lines = swap;
279 }
280 template_used.clear();
281 if (shuffle_not_pick) {
282 /* Choose a random order in which to generate all of the
283 template lines in the block: */
284 while (template_used.size() < template_block_vector.size()) {
285 i = rand() % template_block_vector.size();
286 if (template_used.find (i) == template_used.end()) {
287 /* This template not already shuffled in. */
288 block_order.push_back (i);
289 template_used.insert (i);
290 }
291 }
292 /* Done shuffling; empty out the set: */
293 } else {
294 if (high_nmbr_lines == low_nmbr_lines) {
295 exact_nmbr_lines = low_nmbr_lines;
296 /* just in case the template says "3 to 3 of"... */
297 } else {
298 exact_nmbr_lines = low_nmbr_lines
299 + (rand() % ( high_nmbr_lines
300 - low_nmbr_lines + 1 ) );
301 }
302 for (int j = 0; j < exact_nmbr_lines; ++j) {
303 /* Repeatedly choose a random template line from the block: */
304 i = rand() % template_block_vector.size();
305 block_order.push_back (i);
306 }
307 }
308 IVM(cout << "Order of lines in block: " << flush;
309 for (auto i : block_order) {
310 cout << i << " ";
311 }
312 cout << endl;
313 )
314}
315
316/* interpret_template_line() fills in random data, locates PSA assets, (etc.) and
317 conditionally creates PSA calls for a given template line. Note that there needs
318 to be a single place where all of this is done, so that statement blocks can be
319 randomized and then dispatched from a single point. */
320void interpret_template_line (
321 template_line *templateLin, /* the template line to process */
322 tf_fuzz_info *rsrc, /* program resources in general */
323 set_data_info &set_data, psa_asset_usage random_asset,
324 bool assign_data_var_specified, expect_info &expect, key_policy_info &policy_info,
325 bool print_data, bool hash_data, string asset_name, string assign_data_var,
326 asset_name_id_info &asset_info, /* everything about the asset(s) involved */
327 bool create_call_bool, /* true to create the PSA call at this time */
328 bool create_asset_bool, /* true to create the PSA asset at this time */
329 bool fill_in_template, /* true to back-fill info into template */
330 int instance
331 /* if further differentiation to the names or IDs is needed, make instance >0 */
332) {
333 const bool yes_fill_in_template = true; /* just to improve readability */
334 vector<psa_asset*>::iterator t_psa_asset;
335
336 if (fill_in_template) {
337 /* Set basic parameters from the template line: */
338 templateLin->set_data = set_data;
339 templateLin->expect = expect;
340 templateLin->policy_info = policy_info;
341 templateLin->asset_info.id_n_not_name = asset_info.id_n_not_name;
342 templateLin->asset_info.set_name (asset_name);
343 /* Fill in state parsed from the template below: */
344 templateLin->assign_data_var_specified = assign_data_var_specified;
345 templateLin->assign_data_var.assign (assign_data_var);
346 templateLin->print_data = print_data;
347 templateLin->hash_data = hash_data;
348 templateLin->random_asset = random_asset;
349 if ( set_data.literal_data_not_file && !set_data.random_data
350 && set_data.string_specified) {
351 templateLin->set_data.set (literal_data);
352 }
353 /* Save names or IDs to the template-line tracker: */
354 for (auto id_no : asset_info.asset_id_n_vector) {
355 templateLin->asset_info.asset_id_n_vector.push_back (id_no);
356 }
357 asset_info.asset_id_n_vector.clear();
358 for (auto as_name : asset_info.asset_name_vector) {
359 templateLin->asset_info.asset_name_vector.push_back (as_name);
360 }
361 asset_info.asset_name_vector.clear();
362 }
363
364 /* Random asset choice (e.g., *active) case: */
365 if (templateLin->random_asset != psa_asset_usage::all) {
366 /* Just create the call tracker; random name chosen in simulation stage: */
367 templateLin->setup_call (set_data, templateLin->set_data.random_data,
368 yes_fill_in_template, create_call_bool,
369 templateLin, rsrc );
370 } else if (asset_info.id_n_not_name) {
371 /* Not random asset; asset(s) by ID rather than name. Go through all
372 specified asset IDs: */
373 uint64_t id_no;
374 for (auto id_n : templateLin->asset_info.asset_id_n_vector) {
375 id_no = id_n + (uint64_t) instance * 10000UL;
376 templateLin->asset_info.set_id_n(id_no); /* just a holder */
377 asset_name = templateLin->asset_info.make_id_n_based_name (id_no);
378 templateLin->asset_info.set_calc_name (asset_name);
379 templateLin->expect.data_var = var_name;
380 if (!set_data.literal_data_not_file) {
381 templateLin->set_data.set_file (set_data.file_path);
382 }
383 templateLin->setup_call (set_data, templateLin->set_data.random_data,
384 fill_in_template, create_call_bool,
385 templateLin, rsrc );
386 }
387 } else {
388 /* Not random asset, asset(s) specified by name. Go through all specified
389 asset names: */
390 for (auto as_name : templateLin->asset_info.asset_name_vector) {
391 /* Also copy into template line object's local vector: */
392 if (instance > 0) {
393 templateLin->asset_info.set_name (as_name + "_" + to_string (instance));
394 } else {
395 templateLin->asset_info.set_name (as_name);
396 }
397 /* Give each occurrence a different random ID: */
398 templateLin->asset_info.set_id_n (100 + (rand() % 10000));
399 /* TODO: unlikely, but this *could* alias! */
400 templateLin->setup_call (set_data, templateLin->set_data.random_data,
401 yes_fill_in_template, create_call_bool,
402 templateLin, rsrc );
403 }
404 }
405}
406
407
408#line 409 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:339 */
409
410# ifndef YY_NULLPTR
411# if defined __cplusplus && 201103L <= __cplusplus
412# define YY_NULLPTR nullptr
413# else
414# define YY_NULLPTR 0
415# endif
416# endif
417
418/* Enabling verbose error messages. */
419#ifdef YYERROR_VERBOSE
420# undef YYERROR_VERBOSE
421# define YYERROR_VERBOSE 1
422#else
423# define YYERROR_VERBOSE 1
424#endif
425
426/* In a future release of Bison, this section will be replaced
427 by #include "tf_fuzz_grammar.tab.hpp". */
428#ifndef YY_YY_PARSER_TF_FUZZ_GRAMMAR_TAB_HPP_INCLUDED
429# define YY_YY_PARSER_TF_FUZZ_GRAMMAR_TAB_HPP_INCLUDED
430/* Debug traces. */
431#ifndef YYDEBUG
432# define YYDEBUG 0
433#endif
434#if YYDEBUG
435extern int yydebug;
436#endif
437
438/* Token type. */
439#ifndef YYTOKENTYPE
440# define YYTOKENTYPE
441 enum yytokentype
442 {
443 PURPOSE = 258,
444 RAW_TEXT = 259,
445 SET = 260,
446 READ = 261,
447 REMOVE = 262,
448 SECURE = 263,
449 DONE = 264,
450 SST = 265,
451 KEY = 266,
452 POLICY = 267,
453 NAME = 268,
454 UID = 269,
455 STAR = 270,
456 ACTIVE = 271,
457 DELETED = 272,
458 EQUAL = 273,
459 DATA = 274,
460 DFNAME = 275,
461 FLAG = 276,
462 NONE = 277,
463 WRITE_ONCE = 278,
464 NO_RP = 279,
465 NO_CONF = 280,
466 OFFSET = 281,
467 CHECK = 282,
468 VAR = 283,
469 HASH = 284,
470 NEQ = 285,
471 PRINT = 286,
472 EXPECT = 287,
473 PASS = 288,
474 FAIL = 289,
475 NOTHING = 290,
476 ERROR = 291,
477 IDENTIFIER_TOK = 292,
478 LITERAL_TOK = 293,
479 HEX_LIST = 294,
480 FILE_PATH_TOK = 295,
481 NUMBER_TOK = 296,
482 SEMICOLON = 297,
483 SHUFFLE = 298,
484 TO = 299,
485 OF = 300,
486 OPEN_BRACE = 301,
487 CLOSE_BRACE = 302,
488 ATTR = 303,
489 TYPE = 304,
490 ALG = 305,
491 EXPORT = 306,
492 COPY = 307,
493 ENCRYPT = 308,
494 DECRYPT = 309,
495 SIGN = 310,
496 VERIFY = 311,
497 DERIVE = 312,
498 NOEXPORT = 313,
499 NOCOPY = 314,
500 NOENCRYPT = 315,
501 NODECRYPT = 316,
502 NOSIGN = 317,
503 NOVERIFY = 318,
504 NODERIVE = 319,
505 PERSISTENT = 320,
506 VOLATILE = 321,
507 FROM = 322,
508 WITH = 323
509 };
510#endif
511
512/* Value type. */
513#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
514
515union YYSTYPE
516{
517#line 353 "parser/tf_fuzz_grammar.y" /* yacc.c:355 */
518int valueN; int tokenN; char *str;
519
520#line 521 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:355 */
521};
522
523typedef union YYSTYPE YYSTYPE;
524# define YYSTYPE_IS_TRIVIAL 1
525# define YYSTYPE_IS_DECLARED 1
526#endif
527
528/* Location type. */
529#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
530typedef struct YYLTYPE YYLTYPE;
531struct YYLTYPE
532{
533 int first_line;
534 int first_column;
535 int last_line;
536 int last_column;
537};
538# define YYLTYPE_IS_DECLARED 1
539# define YYLTYPE_IS_TRIVIAL 1
540#endif
541
542
543extern YYSTYPE yylval;
544extern YYLTYPE yylloc;
545int yyparse (tf_fuzz_info *rsrc);
546
547#endif /* !YY_YY_PARSER_TF_FUZZ_GRAMMAR_TAB_HPP_INCLUDED */
548
549/* Copy the second part of user declarations. */
550
551#line 552 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:358 */
552
553#ifdef short
554# undef short
555#endif
556
557#ifdef YYTYPE_UINT8
558typedef YYTYPE_UINT8 yytype_uint8;
559#else
560typedef unsigned char yytype_uint8;
561#endif
562
563#ifdef YYTYPE_INT8
564typedef YYTYPE_INT8 yytype_int8;
565#else
566typedef signed char yytype_int8;
567#endif
568
569#ifdef YYTYPE_UINT16
570typedef YYTYPE_UINT16 yytype_uint16;
571#else
572typedef unsigned short int yytype_uint16;
573#endif
574
575#ifdef YYTYPE_INT16
576typedef YYTYPE_INT16 yytype_int16;
577#else
578typedef short int yytype_int16;
579#endif
580
581#ifndef YYSIZE_T
582# ifdef __SIZE_TYPE__
583# define YYSIZE_T __SIZE_TYPE__
584# elif defined size_t
585# define YYSIZE_T size_t
586# elif ! defined YYSIZE_T
587# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
588# define YYSIZE_T size_t
589# else
590# define YYSIZE_T unsigned int
591# endif
592#endif
593
594#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
595
596#ifndef YY_
597# if defined YYENABLE_NLS && YYENABLE_NLS
598# if ENABLE_NLS
599# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
600# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
601# endif
602# endif
603# ifndef YY_
604# define YY_(Msgid) Msgid
605# endif
606#endif
607
608#ifndef YY_ATTRIBUTE
609# if (defined __GNUC__ \
610 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
611 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
612# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
613# else
614# define YY_ATTRIBUTE(Spec) /* empty */
615# endif
616#endif
617
618#ifndef YY_ATTRIBUTE_PURE
619# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
620#endif
621
622#ifndef YY_ATTRIBUTE_UNUSED
623# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
624#endif
625
626#if !defined _Noreturn \
627 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
628# if defined _MSC_VER && 1200 <= _MSC_VER
629# define _Noreturn __declspec (noreturn)
630# else
631# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
632# endif
633#endif
634
635/* Suppress unused-variable warnings by "using" E. */
636#if ! defined lint || defined __GNUC__
637# define YYUSE(E) ((void) (E))
638#else
639# define YYUSE(E) /* empty */
640#endif
641
642#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
643/* Suppress an incorrect diagnostic about yylval being uninitialized. */
644# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
645 _Pragma ("GCC diagnostic push") \
646 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
647 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
648# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
649 _Pragma ("GCC diagnostic pop")
650#else
651# define YY_INITIAL_VALUE(Value) Value
652#endif
653#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
654# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
655# define YY_IGNORE_MAYBE_UNINITIALIZED_END
656#endif
657#ifndef YY_INITIAL_VALUE
658# define YY_INITIAL_VALUE(Value) /* Nothing. */
659#endif
660
661
662#if ! defined yyoverflow || YYERROR_VERBOSE
663
664/* The parser invokes alloca or malloc; define the necessary symbols. */
665
666# ifdef YYSTACK_USE_ALLOCA
667# if YYSTACK_USE_ALLOCA
668# ifdef __GNUC__
669# define YYSTACK_ALLOC __builtin_alloca
670# elif defined __BUILTIN_VA_ARG_INCR
671# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
672# elif defined _AIX
673# define YYSTACK_ALLOC __alloca
674# elif defined _MSC_VER
675# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
676# define alloca _alloca
677# else
678# define YYSTACK_ALLOC alloca
679# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
680# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
681 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
682# ifndef EXIT_SUCCESS
683# define EXIT_SUCCESS 0
684# endif
685# endif
686# endif
687# endif
688# endif
689
690# ifdef YYSTACK_ALLOC
691 /* Pacify GCC's 'empty if-body' warning. */
692# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
693# ifndef YYSTACK_ALLOC_MAXIMUM
694 /* The OS might guarantee only one guard page at the bottom of the stack,
695 and a page size can be as small as 4096 bytes. So we cannot safely
696 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
697 to allow for a few compiler-allocated temporary stack slots. */
698# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
699# endif
700# else
701# define YYSTACK_ALLOC YYMALLOC
702# define YYSTACK_FREE YYFREE
703# ifndef YYSTACK_ALLOC_MAXIMUM
704# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
705# endif
706# if (defined __cplusplus && ! defined EXIT_SUCCESS \
707 && ! ((defined YYMALLOC || defined malloc) \
708 && (defined YYFREE || defined free)))
709# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
710# ifndef EXIT_SUCCESS
711# define EXIT_SUCCESS 0
712# endif
713# endif
714# ifndef YYMALLOC
715# define YYMALLOC malloc
716# if ! defined malloc && ! defined EXIT_SUCCESS
717void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
718# endif
719# endif
720# ifndef YYFREE
721# define YYFREE free
722# if ! defined free && ! defined EXIT_SUCCESS
723void free (void *); /* INFRINGES ON USER NAME SPACE */
724# endif
725# endif
726# endif
727#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
728
729
730#if (! defined yyoverflow \
731 && (! defined __cplusplus \
732 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
733 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
734
735/* A type that is properly aligned for any stack member. */
736union yyalloc
737{
738 yytype_int16 yyss_alloc;
739 YYSTYPE yyvs_alloc;
740 YYLTYPE yyls_alloc;
741};
742
743/* The size of the maximum gap between one aligned stack and the next. */
744# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
745
746/* The size of an array large to enough to hold all stacks, each with
747 N elements. */
748# define YYSTACK_BYTES(N) \
749 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
750 + 2 * YYSTACK_GAP_MAXIMUM)
751
752# define YYCOPY_NEEDED 1
753
754/* Relocate STACK from its old location to the new one. The
755 local variables YYSIZE and YYSTACKSIZE give the old and new number of
756 elements in the stack, and YYPTR gives the new location of the
757 stack. Advance YYPTR to a properly aligned location for the next
758 stack. */
759# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
760 do \
761 { \
762 YYSIZE_T yynewbytes; \
763 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
764 Stack = &yyptr->Stack_alloc; \
765 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
766 yyptr += yynewbytes / sizeof (*yyptr); \
767 } \
768 while (0)
769
770#endif
771
772#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
773/* Copy COUNT objects from SRC to DST. The source and destination do
774 not overlap. */
775# ifndef YYCOPY
776# if defined __GNUC__ && 1 < __GNUC__
777# define YYCOPY(Dst, Src, Count) \
778 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
779# else
780# define YYCOPY(Dst, Src, Count) \
781 do \
782 { \
783 YYSIZE_T yyi; \
784 for (yyi = 0; yyi < (Count); yyi++) \
785 (Dst)[yyi] = (Src)[yyi]; \
786 } \
787 while (0)
788# endif
789# endif
790#endif /* !YYCOPY_NEEDED */
791
792/* YYFINAL -- State number of the termination state. */
793#define YYFINAL 34
794/* YYLAST -- Last index in YYTABLE. */
795#define YYLAST 159
796
797/* YYNTOKENS -- Number of terminals. */
798#define YYNTOKENS 69
799/* YYNNTS -- Number of nonterminals. */
800#define YYNNTS 82
801/* YYNRULES -- Number of rules. */
802#define YYNRULES 155
803/* YYNSTATES -- Number of states. */
804#define YYNSTATES 212
805
806/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
807 by yylex, with out-of-bounds checking. */
808#define YYUNDEFTOK 2
809#define YYMAXUTOK 323
810
811#define YYTRANSLATE(YYX) \
812 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
813
814/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
815 as returned by yylex, without out-of-bounds checking. */
816static const yytype_uint8 yytranslate[] =
817{
818 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
819 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
820 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
821 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
822 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
823 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
824 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
825 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
826 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
827 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
828 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
829 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
830 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
831 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
832 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
833 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
834 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
835 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
836 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
837 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
838 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
839 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
840 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
841 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
842 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
843 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
844 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
845 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
846 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
847 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
848 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
849 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
850 65, 66, 67, 68
851};
852
853#if YYDEBUG
854 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
855static const yytype_uint16 yyrline[] =
856{
857 0, 378, 378, 379, 390, 409, 451, 475, 501, 504,
858 507, 510, 513, 519, 524, 529, 534, 543, 555, 568,
859 583, 595, 607, 622, 634, 649, 679, 691, 701, 712,
860 713, 718, 726, 736, 737, 744, 745, 751, 751, 751,
861 751, 753, 760, 767, 775, 784, 793, 799, 807, 816,
862 826, 838, 851, 859, 860, 868, 868, 875, 883, 896,
863 904, 908, 914, 923, 924, 932, 944, 951, 959, 967,
864 974, 977, 978, 984, 990, 996, 1002, 1008, 1014, 1020,
865 1026, 1032, 1038, 1044, 1050, 1056, 1062, 1068, 1074, 1081,
866 1081, 1081, 1081, 1081, 1081, 1081, 1082, 1082, 1082, 1082,
867 1082, 1082, 1083, 1083, 1083, 1083, 1089, 1098, 1107, 1108,
868 1114, 1114, 1114, 1117, 1118, 1126, 1140, 1150, 1157, 1164,
869 1176, 1182, 1188, 1189, 1196, 1200, 1210, 1211, 1218, 1224,
870 1231, 1243, 1250, 1257, 1268, 1274, 1288, 1291, 1298, 1307,
871 1317, 1320, 1321, 1324, 1337, 1340, 1341, 1344, 1353, 1361,
872 1371, 1380, 1388, 1399, 1407, 1413
873};
874#endif
875
876#if YYDEBUG || YYERROR_VERBOSE || 1
877/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
878 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
879static const char *const yytname[] =
880{
881 "$end", "error", "$undefined", "PURPOSE", "RAW_TEXT", "SET", "READ",
882 "REMOVE", "SECURE", "DONE", "SST", "KEY", "POLICY", "NAME", "UID",
883 "STAR", "ACTIVE", "DELETED", "EQUAL", "DATA", "DFNAME", "FLAG", "NONE",
884 "WRITE_ONCE", "NO_RP", "NO_CONF", "OFFSET", "CHECK", "VAR", "HASH",
885 "NEQ", "PRINT", "EXPECT", "PASS", "FAIL", "NOTHING", "ERROR",
886 "IDENTIFIER_TOK", "LITERAL_TOK", "HEX_LIST", "FILE_PATH_TOK",
887 "NUMBER_TOK", "SEMICOLON", "SHUFFLE", "TO", "OF", "OPEN_BRACE",
888 "CLOSE_BRACE", "ATTR", "TYPE", "ALG", "EXPORT", "COPY", "ENCRYPT",
889 "DECRYPT", "SIGN", "VERIFY", "DERIVE", "NOEXPORT", "NOCOPY", "NOENCRYPT",
890 "NODECRYPT", "NOSIGN", "NOVERIFY", "NODERIVE", "PERSISTENT", "VOLATILE",
891 "FROM", "WITH", "$accept", "lines", "line", "command", "expect",
892 "set_command", "read_command", "remove_command", "secure_command",
893 "done_command", "literal_or_random_data", "sst_set_base_args",
894 "sst_set_extended_args", "sst_flags", "sst_flag", "none", "write_once",
895 "no_rp", "no_conf", "sst_offset_spec", "sst_read_args", "read_args",
896 "sst_read_extended_args", "sst_remove_args", "asset_designator",
897 "single_existing_asset", "random_picked_asset", "sst_asset_name",
898 "sst_asset_set_file_path", "read_args_var_name",
899 "sst_asset_dump_file_path", "key_size", "policy_usage_list",
900 "policy_usages", "export", "noexport", "copy", "nocopy", "encrypt",
901 "noencrypt", "decrypt", "nodecrypt", "sign", "nosign", "verify",
902 "noverify", "derive", "noderive", "persistent", "volatle",
903 "policy_usage", "policy_type", "policy_algorithm", "policy_specs",
904 "policy_spec", "policy_asset_spec", "policy_asset_name",
905 "policy_set_args", "policy_read_args", "key_set_sources",
906 "key_set_source", "key_data_or_not", "key_set_args", "key_remove_args",
907 "key_read_args", "block", "block_content", "open_brace", "close_brace",
908 "ASSET_NUMBER_LIST", "ASSET_NUMBERS", "ASSET_NUMBER",
909 "ASSET_IDENTIFIER_LIST", "ASSET_IDENTIFIERS", "ASSET_IDENTIFIER",
910 "IDENTIFIER", "FILE_PATH", "exact_sel_count", "low_sel_count",
911 "high_sel_count", "NUMBER", "LITERAL", YY_NULLPTR
912};
913#endif
914
915# ifdef YYPRINT
916/* YYTOKNUM[NUM] -- (External) token number corresponding to the
917 (internal) symbol number NUM (which must be that of a token). */
918static const yytype_uint16 yytoknum[] =
919{
920 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
921 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
922 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
923 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
924 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
925 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
926 315, 316, 317, 318, 319, 320, 321, 322, 323
927};
928# endif
929
930#define YYPACT_NINF -102
931
932#define yypact_value_is_default(Yystate) \
933 (!!((Yystate) == (-102)))
934
935#define YYTABLE_NINF -152
936
937#define yytable_value_is_error(Yytable_value) \
938 0
939
940 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
941 STATE-NUM. */
942static const yytype_int16 yypact[] =
943{
944 35, -102, 75, 104, 47, -17, -102, -102, 20, 64,
945 35, -23, -102, -102, -102, -102, -102, -102, 30, 39,
946 73, 37, 95, 112, 37, 95, 7, 106, 95, 103,
947 -102, -102, -102, 35, -102, -102, 72, -102, 92, 20,
948 94, 32, -2, 116, -102, -4, -8, -102, 33, 74,
949 -102, -102, 53, 53, -102, 99, 99, 113, 53, -102,
950 115, -102, -102, -102, -102, -102, 101, 93, -102, -102,
951 -102, -102, -102, -102, -102, 96, -102, -102, -102, -102,
952 101, -102, -102, -102, 98, 88, -102, -7, 102, 99,
953 -102, 99, 34, 76, -102, 2, 77, -102, -102, 38,
954 99, 99, -102, -102, -102, -102, 74, 102, 89, 99,
955 -102, -102, 117, -102, -102, -102, -102, -102, -102, -102,
956 -102, -102, -102, -102, 20, -102, 101, -102, 98, -102,
957 -102, -102, -102, -102, 88, -102, -102, -102, -102, -102,
958 -102, -102, -102, -102, -102, -102, -102, -102, 134, -102,
959 -102, -102, -102, 74, -102, -102, -102, -102, -102, -102,
960 -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
961 -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
962 -102, -102, -102, -102, -102, -102, -102, -102, 38, -102,
963 -102, -102, -102, -102, -102, -102, -102, -102, 107, -102,
964 -102, -102, -102, -102, 99, -102, -102, 38, -102, -102,
965 -102, -102
966};
967
968 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
969 Performed when YYTABLE does not specify something else to do. Zero
970 means the default is an error. */
971static const yytype_uint8 yydefact[] =
972{
973 2, 4, 0, 0, 0, 0, 26, 153, 0, 0,
974 2, 0, 8, 10, 9, 11, 12, 5, 0, 0,
975 150, 0, 0, 113, 0, 0, 0, 0, 0, 0,
976 138, 137, 133, 2, 1, 3, 0, 6, 0, 0,
977 0, 0, 0, 33, 63, 30, 122, 18, 0, 108,
978 19, 20, 0, 0, 21, 0, 0, 0, 0, 22,
979 0, 23, 56, 55, 131, 24, 0, 0, 13, 14,
980 15, 148, 16, 7, 134, 0, 152, 58, 147, 57,
981 145, 65, 143, 64, 141, 35, 17, 0, 0, 0,
982 29, 0, 0, 124, 128, 122, 0, 115, 114, 0,
983 0, 0, 110, 111, 112, 120, 108, 0, 0, 0,
984 51, 50, 53, 132, 119, 116, 117, 118, 121, 61,
985 62, 25, 139, 136, 0, 144, 145, 140, 141, 41,
986 42, 43, 44, 34, 35, 37, 38, 39, 40, 28,
987 154, 155, 27, 149, 32, 66, 31, 125, 0, 60,
988 59, 124, 123, 108, 69, 73, 75, 77, 79, 81,
989 83, 85, 74, 76, 78, 80, 82, 84, 86, 87,
990 88, 105, 89, 96, 90, 97, 91, 98, 92, 99,
991 93, 100, 94, 101, 95, 102, 103, 104, 71, 106,
992 107, 109, 52, 68, 48, 67, 49, 47, 0, 46,
993 135, 146, 142, 36, 0, 130, 70, 71, 45, 54,
994 129, 72
995};
996
997 /* YYPGOTO[NTERM-NUM]. */
998static const yytype_int8 yypgoto[] =
999{
1000 -102, -3, -6, -102, -102, -102, -102, -102, -102, -102,
1001 -40, -102, -102, 13, -102, -102, -102, -102, -102, -102,
1002 -102, 14, -102, -102, 40, -102, 58, 50, -102, -102,
1003 -102, -102, -102, -56, -102, -102, -102, -102, -102, -102,
1004 -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
1005 54, -102, -102, -101, -102, -102, -102, -102, -102, 57,
1006 -102, -102, -102, -102, -102, -102, -36, -102, -102, -102,
1007 26, 114, -31, 29, -70, -55, 51, -102, -102, -102,
1008 119, 49
1009};
1010
1011 /* YYDEFGOTO[NTERM-NUM]. */
1012static const yytype_int16 yydefgoto[] =
1013{
1014 -1, 9, 10, 11, 38, 12, 13, 14, 15, 16,
1015 90, 43, 86, 133, 134, 135, 136, 137, 138, 209,
1016 51, 112, 199, 61, 44, 148, 62, 45, 144, 194,
1017 192, 171, 102, 206, 172, 173, 174, 175, 176, 177,
1018 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
1019 207, 103, 104, 105, 106, 49, 58, 50, 59, 94,
1020 95, 96, 47, 65, 54, 17, 32, 33, 123, 83,
1021 127, 128, 79, 125, 80, 72, 145, 18, 19, 75,
1022 20, 142
1023};
1024
1025 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1026 positive, shift that token. If negative, reduce the rule whose
1027 number is the opposite. If YYTABLE_NINF, syntax error. */
1028static const yytype_int16 yytable[] =
1029{
1030 114, 115, 31, 74, 91, 191, 93, 35, 139, 36,
1031 126, 87, 29, 81, 91, 87, 88, 98, 55, 37,
1032 56, 87, 57, 1, 89, 2, 3, 4, 5, 6,
1033 67, 140, 141, 31, 146, 121, 147, 150, 1, 82,
1034 2, 3, 4, 5, 6, 189, 190, 77, 97, 60,
1035 41, 42, 205, 195, 197, 151, 126, 27, 28, 92,
1036 -126, 7, 46, 8, 34, 53, 30, 113, 64, 78,
1037 78, 71, 118, 107, 52, 39, 7, 63, 8, 154,
1038 108, 109, 110, 40, 111, 21, 22, 23, 200, 155,
1039 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
1040 166, 167, 168, 169, 170, 68, 69, 70, 41, 71,
1041 129, 130, 131, 132, 24, 25, 26, -151, 31, 41,
1042 42, 60, 99, 100, 101, 48, 71, 140, 141, 116,
1043 117, 119, 120, 66, 73, 7, 71, 85, 78, 82,
1044 122, 124, 143, 198, -127, 153, 204, 203, 208, 210,
1045 149, 211, 152, 188, 202, 201, 84, 196, 193, 76
1046};
1047
1048static const yytype_uint8 yycheck[] =
1049{
1050 55, 56, 8, 39, 12, 106, 46, 10, 15, 32,
1051 80, 19, 29, 15, 12, 19, 20, 48, 11, 42,
1052 13, 19, 15, 3, 28, 5, 6, 7, 8, 9,
1053 33, 38, 39, 39, 89, 66, 91, 92, 3, 41,
1054 5, 6, 7, 8, 9, 100, 101, 15, 15, 15,
1055 13, 14, 153, 108, 109, 95, 126, 10, 11, 67,
1056 68, 41, 22, 43, 0, 25, 46, 53, 28, 37,
1057 37, 37, 58, 20, 24, 45, 41, 27, 43, 41,
1058 27, 28, 29, 44, 31, 10, 11, 12, 124, 51,
1059 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
1060 62, 63, 64, 65, 66, 33, 34, 35, 13, 37,
1061 22, 23, 24, 25, 10, 11, 12, 44, 124, 13,
1062 14, 15, 48, 49, 50, 13, 37, 38, 39, 16,
1063 17, 16, 17, 30, 42, 41, 37, 21, 37, 41,
1064 47, 45, 40, 26, 68, 68, 12, 134, 41, 204,
1065 92, 207, 95, 99, 128, 126, 42, 108, 107, 40
1066};
1067
1068 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1069 symbol of state STATE-NUM. */
1070static const yytype_uint8 yystos[] =
1071{
1072 0, 3, 5, 6, 7, 8, 9, 41, 43, 70,
1073 71, 72, 74, 75, 76, 77, 78, 134, 146, 147,
1074 149, 10, 11, 12, 10, 11, 12, 10, 11, 29,
1075 46, 71, 135, 136, 0, 70, 32, 42, 73, 45,
1076 44, 13, 14, 80, 93, 96, 93, 131, 13, 124,
1077 126, 89, 96, 93, 133, 11, 13, 15, 125, 127,
1078 15, 92, 95, 96, 93, 132, 30, 70, 33, 34,
1079 35, 37, 144, 42, 135, 148, 149, 15, 37, 141,
1080 143, 15, 41, 138, 140, 21, 81, 19, 20, 28,
1081 79, 12, 67, 79, 128, 129, 130, 15, 141, 48,
1082 49, 50, 101, 120, 121, 122, 123, 20, 27, 28,
1083 29, 31, 90, 90, 144, 144, 16, 17, 90, 16,
1084 17, 141, 47, 137, 45, 142, 143, 139, 140, 22,
1085 23, 24, 25, 82, 83, 84, 85, 86, 87, 15,
1086 38, 39, 150, 40, 97, 145, 144, 144, 94, 95,
1087 144, 79, 128, 68, 41, 51, 52, 53, 54, 55,
1088 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1089 66, 100, 103, 104, 105, 106, 107, 108, 109, 110,
1090 111, 112, 113, 114, 115, 116, 117, 118, 119, 144,
1091 144, 122, 99, 145, 98, 144, 150, 144, 26, 91,
1092 135, 142, 139, 82, 12, 122, 102, 119, 41, 88,
1093 144, 102
1094};
1095
1096 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1097static const yytype_uint8 yyr1[] =
1098{
1099 0, 69, 70, 70, 71, 71, 71, 71, 72, 72,
1100 72, 72, 72, 73, 73, 73, 73, 74, 74, 74,
1101 75, 75, 75, 76, 76, 77, 78, 79, 79, 80,
1102 80, 80, 80, 81, 81, 82, 82, 83, 83, 83,
1103 83, 84, 85, 86, 87, 88, 89, 90, 90, 90,
1104 90, 90, 90, 91, 91, 92, 92, 93, 93, 94,
1105 94, 95, 95, 96, 96, 96, 97, 98, 99, 100,
1106 101, 102, 102, 103, 104, 105, 106, 107, 108, 109,
1107 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
1108 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
1109 119, 119, 119, 119, 119, 119, 120, 121, 122, 122,
1110 123, 123, 123, 124, 124, 124, 125, 125, 125, 125,
1111 126, 127, 128, 128, 129, 129, 130, 130, 131, 131,
1112 131, 132, 133, 134, 134, 134, 135, 135, 136, 137,
1113 138, 139, 139, 140, 141, 142, 142, 143, 144, 145,
1114 146, 147, 148, 149, 150, 150
1115};
1116
1117 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1118static const yytype_uint8 yyr2[] =
1119{
1120 0, 2, 0, 2, 1, 1, 2, 3, 1, 1,
1121 1, 1, 1, 2, 2, 2, 2, 4, 3, 3,
1122 3, 3, 3, 3, 3, 4, 1, 2, 2, 2,
1123 1, 3, 3, 0, 2, 0, 2, 1, 1, 1,
1124 1, 1, 1, 1, 1, 1, 3, 2, 2, 2,
1125 1, 1, 2, 0, 2, 1, 1, 2, 2, 1,
1126 1, 2, 2, 1, 2, 2, 1, 1, 1, 1,
1127 3, 0, 2, 1, 1, 1, 1, 1, 1, 1,
1128 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1129 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1130 1, 1, 1, 1, 1, 1, 2, 2, 0, 2,
1131 1, 1, 1, 0, 2, 2, 2, 2, 2, 2,
1132 2, 2, 0, 2, 1, 2, 0, 1, 2, 5,
1133 4, 1, 2, 2, 3, 5, 3, 1, 1, 1,
1134 2, 0, 2, 1, 2, 0, 2, 1, 1, 1,
1135 1, 1, 1, 1, 1, 1
1136};
1137
1138
1139#define yyerrok (yyerrstatus = 0)
1140#define yyclearin (yychar = YYEMPTY)
1141#define YYEMPTY (-2)
1142#define YYEOF 0
1143
1144#define YYACCEPT goto yyacceptlab
1145#define YYABORT goto yyabortlab
1146#define YYERROR goto yyerrorlab
1147
1148
1149#define YYRECOVERING() (!!yyerrstatus)
1150
1151#define YYBACKUP(Token, Value) \
1152do \
1153 if (yychar == YYEMPTY) \
1154 { \
1155 yychar = (Token); \
1156 yylval = (Value); \
1157 YYPOPSTACK (yylen); \
1158 yystate = *yyssp; \
1159 goto yybackup; \
1160 } \
1161 else \
1162 { \
1163 yyerror (rsrc, YY_("syntax error: cannot back up")); \
1164 YYERROR; \
1165 } \
1166while (0)
1167
1168/* Error token number */
1169#define YYTERROR 1
1170#define YYERRCODE 256
1171
1172
1173/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1174 If N is 0, then set CURRENT to the empty location which ends
1175 the previous symbol: RHS[0] (always defined). */
1176
1177#ifndef YYLLOC_DEFAULT
1178# define YYLLOC_DEFAULT(Current, Rhs, N) \
1179 do \
1180 if (N) \
1181 { \
1182 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1183 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1184 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1185 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1186 } \
1187 else \
1188 { \
1189 (Current).first_line = (Current).last_line = \
1190 YYRHSLOC (Rhs, 0).last_line; \
1191 (Current).first_column = (Current).last_column = \
1192 YYRHSLOC (Rhs, 0).last_column; \
1193 } \
1194 while (0)
1195#endif
1196
1197#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1198
1199
1200/* Enable debugging if requested. */
1201#if YYDEBUG
1202
1203# ifndef YYFPRINTF
1204# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1205# define YYFPRINTF fprintf
1206# endif
1207
1208# define YYDPRINTF(Args) \
1209do { \
1210 if (yydebug) \
1211 YYFPRINTF Args; \
1212} while (0)
1213
1214
1215/* YY_LOCATION_PRINT -- Print the location on the stream.
1216 This macro was not mandated originally: define only if we know
1217 we won't break user code: when these are the locations we know. */
1218
1219#ifndef YY_LOCATION_PRINT
1220# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1221
1222/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
1223
1224YY_ATTRIBUTE_UNUSED
1225static unsigned
1226yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
1227{
1228 unsigned res = 0;
1229 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
1230 if (0 <= yylocp->first_line)
1231 {
1232 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
1233 if (0 <= yylocp->first_column)
1234 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
1235 }
1236 if (0 <= yylocp->last_line)
1237 {
1238 if (yylocp->first_line < yylocp->last_line)
1239 {
1240 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
1241 if (0 <= end_col)
1242 res += YYFPRINTF (yyo, ".%d", end_col);
1243 }
1244 else if (0 <= end_col && yylocp->first_column < end_col)
1245 res += YYFPRINTF (yyo, "-%d", end_col);
1246 }
1247 return res;
1248 }
1249
1250# define YY_LOCATION_PRINT(File, Loc) \
1251 yy_location_print_ (File, &(Loc))
1252
1253# else
1254# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1255# endif
1256#endif
1257
1258
1259# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1260do { \
1261 if (yydebug) \
1262 { \
1263 YYFPRINTF (stderr, "%s ", Title); \
1264 yy_symbol_print (stderr, \
1265 Type, Value, Location, rsrc); \
1266 YYFPRINTF (stderr, "\n"); \
1267 } \
1268} while (0)
1269
1270
1271/*----------------------------------------.
1272| Print this symbol's value on YYOUTPUT. |
1273`----------------------------------------*/
1274
1275static void
1276yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, tf_fuzz_info *rsrc)
1277{
1278 FILE *yyo = yyoutput;
1279 YYUSE (yyo);
1280 YYUSE (yylocationp);
1281 YYUSE (rsrc);
1282 if (!yyvaluep)
1283 return;
1284# ifdef YYPRINT
1285 if (yytype < YYNTOKENS)
1286 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1287# endif
1288 YYUSE (yytype);
1289}
1290
1291
1292/*--------------------------------.
1293| Print this symbol on YYOUTPUT. |
1294`--------------------------------*/
1295
1296static void
1297yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, tf_fuzz_info *rsrc)
1298{
1299 YYFPRINTF (yyoutput, "%s %s (",
1300 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1301
1302 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1303 YYFPRINTF (yyoutput, ": ");
1304 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, rsrc);
1305 YYFPRINTF (yyoutput, ")");
1306}
1307
1308/*------------------------------------------------------------------.
1309| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1310| TOP (included). |
1311`------------------------------------------------------------------*/
1312
1313static void
1314yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1315{
1316 YYFPRINTF (stderr, "Stack now");
1317 for (; yybottom <= yytop; yybottom++)
1318 {
1319 int yybot = *yybottom;
1320 YYFPRINTF (stderr, " %d", yybot);
1321 }
1322 YYFPRINTF (stderr, "\n");
1323}
1324
1325# define YY_STACK_PRINT(Bottom, Top) \
1326do { \
1327 if (yydebug) \
1328 yy_stack_print ((Bottom), (Top)); \
1329} while (0)
1330
1331
1332/*------------------------------------------------.
1333| Report that the YYRULE is going to be reduced. |
1334`------------------------------------------------*/
1335
1336static void
1337yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, tf_fuzz_info *rsrc)
1338{
1339 unsigned long int yylno = yyrline[yyrule];
1340 int yynrhs = yyr2[yyrule];
1341 int yyi;
1342 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1343 yyrule - 1, yylno);
1344 /* The symbols being reduced. */
1345 for (yyi = 0; yyi < yynrhs; yyi++)
1346 {
1347 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1348 yy_symbol_print (stderr,
1349 yystos[yyssp[yyi + 1 - yynrhs]],
1350 &(yyvsp[(yyi + 1) - (yynrhs)])
1351 , &(yylsp[(yyi + 1) - (yynrhs)]) , rsrc);
1352 YYFPRINTF (stderr, "\n");
1353 }
1354}
1355
1356# define YY_REDUCE_PRINT(Rule) \
1357do { \
1358 if (yydebug) \
1359 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, rsrc); \
1360} while (0)
1361
1362/* Nonzero means print parse trace. It is left uninitialized so that
1363 multiple parsers can coexist. */
1364int yydebug;
1365#else /* !YYDEBUG */
1366# define YYDPRINTF(Args)
1367# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1368# define YY_STACK_PRINT(Bottom, Top)
1369# define YY_REDUCE_PRINT(Rule)
1370#endif /* !YYDEBUG */
1371
1372
1373/* YYINITDEPTH -- initial size of the parser's stacks. */
1374#ifndef YYINITDEPTH
1375# define YYINITDEPTH 200
1376#endif
1377
1378/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1379 if the built-in stack extension method is used).
1380
1381 Do not make this value too large; the results are undefined if
1382 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1383 evaluated with infinite-precision integer arithmetic. */
1384
1385#ifndef YYMAXDEPTH
1386# define YYMAXDEPTH 10000
1387#endif
1388
1389
1390#if YYERROR_VERBOSE
1391
1392# ifndef yystrlen
1393# if defined __GLIBC__ && defined _STRING_H
1394# define yystrlen strlen
1395# else
1396/* Return the length of YYSTR. */
1397static YYSIZE_T
1398yystrlen (const char *yystr)
1399{
1400 YYSIZE_T yylen;
1401 for (yylen = 0; yystr[yylen]; yylen++)
1402 continue;
1403 return yylen;
1404}
1405# endif
1406# endif
1407
1408# ifndef yystpcpy
1409# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1410# define yystpcpy stpcpy
1411# else
1412/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1413 YYDEST. */
1414static char *
1415yystpcpy (char *yydest, const char *yysrc)
1416{
1417 char *yyd = yydest;
1418 const char *yys = yysrc;
1419
1420 while ((*yyd++ = *yys++) != '\0')
1421 continue;
1422
1423 return yyd - 1;
1424}
1425# endif
1426# endif
1427
1428# ifndef yytnamerr
1429/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1430 quotes and backslashes, so that it's suitable for yyerror. The
1431 heuristic is that double-quoting is unnecessary unless the string
1432 contains an apostrophe, a comma, or backslash (other than
1433 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1434 null, do not copy; instead, return the length of what the result
1435 would have been. */
1436static YYSIZE_T
1437yytnamerr (char *yyres, const char *yystr)
1438{
1439 if (*yystr == '"')
1440 {
1441 YYSIZE_T yyn = 0;
1442 char const *yyp = yystr;
1443
1444 for (;;)
1445 switch (*++yyp)
1446 {
1447 case '\'':
1448 case ',':
1449 goto do_not_strip_quotes;
1450
1451 case '\\':
1452 if (*++yyp != '\\')
1453 goto do_not_strip_quotes;
1454 /* Fall through. */
1455 default:
1456 if (yyres)
1457 yyres[yyn] = *yyp;
1458 yyn++;
1459 break;
1460
1461 case '"':
1462 if (yyres)
1463 yyres[yyn] = '\0';
1464 return yyn;
1465 }
1466 do_not_strip_quotes: ;
1467 }
1468
1469 if (! yyres)
1470 return yystrlen (yystr);
1471
1472 return yystpcpy (yyres, yystr) - yyres;
1473}
1474# endif
1475
1476/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1477 about the unexpected token YYTOKEN for the state stack whose top is
1478 YYSSP.
1479
1480 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1481 not large enough to hold the message. In that case, also set
1482 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1483 required number of bytes is too large to store. */
1484static int
1485yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1486 yytype_int16 *yyssp, int yytoken)
1487{
1488 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1489 YYSIZE_T yysize = yysize0;
1490 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1491 /* Internationalized format string. */
1492 const char *yyformat = YY_NULLPTR;
1493 /* Arguments of yyformat. */
1494 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1495 /* Number of reported tokens (one for the "unexpected", one per
1496 "expected"). */
1497 int yycount = 0;
1498
1499 /* There are many possibilities here to consider:
1500 - If this state is a consistent state with a default action, then
1501 the only way this function was invoked is if the default action
1502 is an error action. In that case, don't check for expected
1503 tokens because there are none.
1504 - The only way there can be no lookahead present (in yychar) is if
1505 this state is a consistent state with a default action. Thus,
1506 detecting the absence of a lookahead is sufficient to determine
1507 that there is no unexpected or expected token to report. In that
1508 case, just report a simple "syntax error".
1509 - Don't assume there isn't a lookahead just because this state is a
1510 consistent state with a default action. There might have been a
1511 previous inconsistent state, consistent state with a non-default
1512 action, or user semantic action that manipulated yychar.
1513 - Of course, the expected token list depends on states to have
1514 correct lookahead information, and it depends on the parser not
1515 to perform extra reductions after fetching a lookahead from the
1516 scanner and before detecting a syntax error. Thus, state merging
1517 (from LALR or IELR) and default reductions corrupt the expected
1518 token list. However, the list is correct for canonical LR with
1519 one exception: it will still contain any token that will not be
1520 accepted due to an error action in a later state.
1521 */
1522 if (yytoken != YYEMPTY)
1523 {
1524 int yyn = yypact[*yyssp];
1525 yyarg[yycount++] = yytname[yytoken];
1526 if (!yypact_value_is_default (yyn))
1527 {
1528 /* Start YYX at -YYN if negative to avoid negative indexes in
1529 YYCHECK. In other words, skip the first -YYN actions for
1530 this state because they are default actions. */
1531 int yyxbegin = yyn < 0 ? -yyn : 0;
1532 /* Stay within bounds of both yycheck and yytname. */
1533 int yychecklim = YYLAST - yyn + 1;
1534 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1535 int yyx;
1536
1537 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1538 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1539 && !yytable_value_is_error (yytable[yyx + yyn]))
1540 {
1541 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1542 {
1543 yycount = 1;
1544 yysize = yysize0;
1545 break;
1546 }
1547 yyarg[yycount++] = yytname[yyx];
1548 {
1549 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1550 if (! (yysize <= yysize1
1551 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1552 return 2;
1553 yysize = yysize1;
1554 }
1555 }
1556 }
1557 }
1558
1559 switch (yycount)
1560 {
1561# define YYCASE_(N, S) \
1562 case N: \
1563 yyformat = S; \
1564 break
1565 YYCASE_(0, YY_("syntax error"));
1566 YYCASE_(1, YY_("syntax error, unexpected %s"));
1567 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1568 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1569 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1570 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1571# undef YYCASE_
1572 }
1573
1574 {
1575 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1576 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1577 return 2;
1578 yysize = yysize1;
1579 }
1580
1581 if (*yymsg_alloc < yysize)
1582 {
1583 *yymsg_alloc = 2 * yysize;
1584 if (! (yysize <= *yymsg_alloc
1585 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1586 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1587 return 1;
1588 }
1589
1590 /* Avoid sprintf, as that infringes on the user's name space.
1591 Don't have undefined behavior even if the translation
1592 produced a string with the wrong number of "%s"s. */
1593 {
1594 char *yyp = *yymsg;
1595 int yyi = 0;
1596 while ((*yyp = *yyformat) != '\0')
1597 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1598 {
1599 yyp += yytnamerr (yyp, yyarg[yyi++]);
1600 yyformat += 2;
1601 }
1602 else
1603 {
1604 yyp++;
1605 yyformat++;
1606 }
1607 }
1608 return 0;
1609}
1610#endif /* YYERROR_VERBOSE */
1611
1612/*-----------------------------------------------.
1613| Release the memory associated to this symbol. |
1614`-----------------------------------------------*/
1615
1616static void
1617yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, tf_fuzz_info *rsrc)
1618{
1619 YYUSE (yyvaluep);
1620 YYUSE (yylocationp);
1621 YYUSE (rsrc);
1622 if (!yymsg)
1623 yymsg = "Deleting";
1624 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1625
1626 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1627 YYUSE (yytype);
1628 YY_IGNORE_MAYBE_UNINITIALIZED_END
1629}
1630
1631
1632
1633
1634/* The lookahead symbol. */
1635int yychar;
1636
1637/* The semantic value of the lookahead symbol. */
1638YYSTYPE yylval;
1639/* Location data for the lookahead symbol. */
1640YYLTYPE yylloc
1641# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1642 = { 1, 1, 1, 1 }
1643# endif
1644;
1645/* Number of syntax errors so far. */
1646int yynerrs;
1647
1648
1649/*----------.
1650| yyparse. |
1651`----------*/
1652
1653int
1654yyparse (tf_fuzz_info *rsrc)
1655{
1656 int yystate;
1657 /* Number of tokens to shift before error messages enabled. */
1658 int yyerrstatus;
1659
1660 /* The stacks and their tools:
1661 'yyss': related to states.
1662 'yyvs': related to semantic values.
1663 'yyls': related to locations.
1664
1665 Refer to the stacks through separate pointers, to allow yyoverflow
1666 to reallocate them elsewhere. */
1667
1668 /* The state stack. */
1669 yytype_int16 yyssa[YYINITDEPTH];
1670 yytype_int16 *yyss;
1671 yytype_int16 *yyssp;
1672
1673 /* The semantic value stack. */
1674 YYSTYPE yyvsa[YYINITDEPTH];
1675 YYSTYPE *yyvs;
1676 YYSTYPE *yyvsp;
1677
1678 /* The location stack. */
1679 YYLTYPE yylsa[YYINITDEPTH];
1680 YYLTYPE *yyls;
1681 YYLTYPE *yylsp;
1682
1683 /* The locations where the error started and ended. */
1684 YYLTYPE yyerror_range[3];
1685
1686 YYSIZE_T yystacksize;
1687
1688 int yyn;
1689 int yyresult;
1690 /* Lookahead token as an internal (translated) token number. */
1691 int yytoken = 0;
1692 /* The variables used to return semantic value and location from the
1693 action routines. */
1694 YYSTYPE yyval;
1695 YYLTYPE yyloc;
1696
1697#if YYERROR_VERBOSE
1698 /* Buffer for error messages, and its allocated size. */
1699 char yymsgbuf[128];
1700 char *yymsg = yymsgbuf;
1701 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1702#endif
1703
1704#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1705
1706 /* The number of symbols on the RHS of the reduced rule.
1707 Keep to zero when no symbol should be popped. */
1708 int yylen = 0;
1709
1710 yyssp = yyss = yyssa;
1711 yyvsp = yyvs = yyvsa;
1712 yylsp = yyls = yylsa;
1713 yystacksize = YYINITDEPTH;
1714
1715 YYDPRINTF ((stderr, "Starting parse\n"));
1716
1717 yystate = 0;
1718 yyerrstatus = 0;
1719 yynerrs = 0;
1720 yychar = YYEMPTY; /* Cause a token to be read. */
1721 yylsp[0] = yylloc;
1722 goto yysetstate;
1723
1724/*------------------------------------------------------------.
1725| yynewstate -- Push a new state, which is found in yystate. |
1726`------------------------------------------------------------*/
1727 yynewstate:
1728 /* In all cases, when you get here, the value and location stacks
1729 have just been pushed. So pushing a state here evens the stacks. */
1730 yyssp++;
1731
1732 yysetstate:
1733 *yyssp = yystate;
1734
1735 if (yyss + yystacksize - 1 <= yyssp)
1736 {
1737 /* Get the current used size of the three stacks, in elements. */
1738 YYSIZE_T yysize = yyssp - yyss + 1;
1739
1740#ifdef yyoverflow
1741 {
1742 /* Give user a chance to reallocate the stack. Use copies of
1743 these so that the &'s don't force the real ones into
1744 memory. */
1745 YYSTYPE *yyvs1 = yyvs;
1746 yytype_int16 *yyss1 = yyss;
1747 YYLTYPE *yyls1 = yyls;
1748
1749 /* Each stack pointer address is followed by the size of the
1750 data in use in that stack, in bytes. This used to be a
1751 conditional around just the two extra args, but that might
1752 be undefined if yyoverflow is a macro. */
1753 yyoverflow (YY_("memory exhausted"),
1754 &yyss1, yysize * sizeof (*yyssp),
1755 &yyvs1, yysize * sizeof (*yyvsp),
1756 &yyls1, yysize * sizeof (*yylsp),
1757 &yystacksize);
1758
1759 yyls = yyls1;
1760 yyss = yyss1;
1761 yyvs = yyvs1;
1762 }
1763#else /* no yyoverflow */
1764# ifndef YYSTACK_RELOCATE
1765 goto yyexhaustedlab;
1766# else
1767 /* Extend the stack our own way. */
1768 if (YYMAXDEPTH <= yystacksize)
1769 goto yyexhaustedlab;
1770 yystacksize *= 2;
1771 if (YYMAXDEPTH < yystacksize)
1772 yystacksize = YYMAXDEPTH;
1773
1774 {
1775 yytype_int16 *yyss1 = yyss;
1776 union yyalloc *yyptr =
1777 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1778 if (! yyptr)
1779 goto yyexhaustedlab;
1780 YYSTACK_RELOCATE (yyss_alloc, yyss);
1781 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1782 YYSTACK_RELOCATE (yyls_alloc, yyls);
1783# undef YYSTACK_RELOCATE
1784 if (yyss1 != yyssa)
1785 YYSTACK_FREE (yyss1);
1786 }
1787# endif
1788#endif /* no yyoverflow */
1789
1790 yyssp = yyss + yysize - 1;
1791 yyvsp = yyvs + yysize - 1;
1792 yylsp = yyls + yysize - 1;
1793
1794 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1795 (unsigned long int) yystacksize));
1796
1797 if (yyss + yystacksize - 1 <= yyssp)
1798 YYABORT;
1799 }
1800
1801 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1802
1803 if (yystate == YYFINAL)
1804 YYACCEPT;
1805
1806 goto yybackup;
1807
1808/*-----------.
1809| yybackup. |
1810`-----------*/
1811yybackup:
1812
1813 /* Do appropriate processing given the current state. Read a
1814 lookahead token if we need one and don't already have one. */
1815
1816 /* First try to decide what to do without reference to lookahead token. */
1817 yyn = yypact[yystate];
1818 if (yypact_value_is_default (yyn))
1819 goto yydefault;
1820
1821 /* Not known => get a lookahead token if don't already have one. */
1822
1823 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1824 if (yychar == YYEMPTY)
1825 {
1826 YYDPRINTF ((stderr, "Reading a token: "));
1827 yychar = yylex ();
1828 }
1829
1830 if (yychar <= YYEOF)
1831 {
1832 yychar = yytoken = YYEOF;
1833 YYDPRINTF ((stderr, "Now at end of input.\n"));
1834 }
1835 else
1836 {
1837 yytoken = YYTRANSLATE (yychar);
1838 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1839 }
1840
1841 /* If the proper action on seeing token YYTOKEN is to reduce or to
1842 detect an error, take that action. */
1843 yyn += yytoken;
1844 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1845 goto yydefault;
1846 yyn = yytable[yyn];
1847 if (yyn <= 0)
1848 {
1849 if (yytable_value_is_error (yyn))
1850 goto yyerrlab;
1851 yyn = -yyn;
1852 goto yyreduce;
1853 }
1854
1855 /* Count tokens shifted since error; after three, turn off error
1856 status. */
1857 if (yyerrstatus)
1858 yyerrstatus--;
1859
1860 /* Shift the lookahead token. */
1861 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1862
1863 /* Discard the shifted token. */
1864 yychar = YYEMPTY;
1865
1866 yystate = yyn;
1867 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1868 *++yyvsp = yylval;
1869 YY_IGNORE_MAYBE_UNINITIALIZED_END
1870 *++yylsp = yylloc;
1871 goto yynewstate;
1872
1873
1874/*-----------------------------------------------------------.
1875| yydefault -- do the default action for the current state. |
1876`-----------------------------------------------------------*/
1877yydefault:
1878 yyn = yydefact[yystate];
1879 if (yyn == 0)
1880 goto yyerrlab;
1881 goto yyreduce;
1882
1883
1884/*-----------------------------.
1885| yyreduce -- Do a reduction. |
1886`-----------------------------*/
1887yyreduce:
1888 /* yyn is the number of a rule to reduce with. */
1889 yylen = yyr2[yyn];
1890
1891 /* If YYLEN is nonzero, implement the default value of the action:
1892 '$$ = $1'.
1893
1894 Otherwise, the following line sets YYVAL to garbage.
1895 This behavior is undocumented and Bison
1896 users should not rely upon it. Assigning to YYVAL
1897 unconditionally makes the parser a bit smaller, and it avoids a
1898 GCC warning that YYVAL may be used uninitialized. */
1899 yyval = yyvsp[1-yylen];
1900
1901 /* Default location. */
1902 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1903 YY_REDUCE_PRINT (yyn);
1904 switch (yyn)
1905 {
1906 case 3:
1907#line 379 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
1908 {
1909 IVM(cout << "Lines: Line number " << dec << yylineno << "." << endl;)
1910 /* Re-randomize objects we parse into: */
1911 expect = expect_info();
1912 set_data = set_data_info();
1913 parsed_asset = asset_name_id_info();
1914 policy_info = key_policy_info();
1915 }
1916#line 1917 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
1917 break;
1918
1919 case 4:
1920#line 390 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
1921 {
1922 IVM(cout << "Purpose line: " << flush;)
1923 set_purp_str (yytext, rsrc);
1924 IVM(cout << rsrc->test_purpose << endl;)
1925 /* TODO: Is there much/any value in turning this back on? The
1926 constructor clear()s them out, and run-time errors observed
1927 under Visual Studio...
1928 Just a precaution to make sure that these vectors start out empty.
1929 Should inherently be, but purpose is typically specified first:
1930 parsed_asset.asset_id_n_vector.clear();
1931 parsed_asset.asset_name_vector.clear(); */
1932 /* Re-randomize or re-initialize objects we parse into: */
1933 purpose_defined = true;
1934 expect = expect_info();
1935 set_data = set_data_info();
1936 parsed_asset = asset_name_id_info();
1937 policy_info = key_policy_info();
1938 target_barrier = "";
1939 }
1940#line 1941 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
1941 break;
1942
1943 case 5:
1944#line 409 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
1945 {
1946 /* TODO: This code may not won't work with "secure hash neq ..." */
1947 IVM(cout << "Block of lines." << endl;)
1948 /* "Statisticalize" :-) the vector of template lines, then crank
1949 the selected lines in order here. */
1950 randomize_template_lines (shuffle_not_pick,
1951 low_nmbr_lines, high_nmbr_lines, exact_nmbr_lines,
1952 template_block_vector, block_order, rsrc
1953 );
1954 /* Vector block_order contains the sequence of template lines to be
1955 realized, in order. Pop the indicated template line off the
1956 vector and generate code from it: */
1957 k = 0; /* ID adder to at least help ensure uniqueness */
1958 for (int i : block_order) {
1959 templateLin = template_block_vector[i];
1960 /* Note that temLin will have its fields filled in already. */
1961 interpret_template_line (
1962 templateLin, rsrc, set_data, random_asset,
1963 assign_data_var_specified, expect, policy_info,
1964 print_data, hash_data, asset_name, assign_data_var, parsed_asset,
1965 yes_create_call, /* did not create call nor asset earlier */
1966 yes_create_asset,
1967 dont_fill_in_template, /* but did fill it all in before */
1968 0
1969 );
1970 k++;
1971 for (add_expect = 0; add_expect < rsrc->calls.size(); ++add_expect) {
1972 if (!(rsrc->calls[add_expect]->exp_data.expected_results_saved)) {
1973 templateLin->expect.copy_expect_to_call (rsrc->calls[add_expect]);
1974 templateLin->expect.expected_results_saved = true;
1975 }
1976 }
1977 }
1978 templateLin->asset_info.asset_id_n_vector.clear();
1979 templateLin->asset_info.asset_name_vector.clear();
1980 /* Done. Empty out the "statisticalization" vector: */
1981 block_order.clear();
1982 /* Empty out the vector of template lines; no longer needed. */
1983 template_block_vector.clear();
1984 --nesting_level;
1985 IVM(cout << "Finished coding block of lines." << endl;)
1986 }
1987#line 1988 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
1988 break;
1989
1990 case 6:
1991#line 451 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
1992 {
1993 IVM(cout << "Command with no expect: \"" << flush;)
1994 if (!purpose_defined) {
1995 cerr << endl << endl
1996 << "Error: Please begin your test with the \"purpose\" "
1997 << "directive. \n For example, "
1998 << "\"purpose to exercise crypto and SST...\"" << endl;
1999 exit (1024);
2000 }
2001 if (nesting_level == 0) { /* if laying down the code now... */
2002 for (add_expect = 0; add_expect < rsrc->calls.size(); ++add_expect) {
2003 if (!(rsrc->calls[add_expect]->exp_data.expected_results_saved)) {
2004 templateLin->expect.copy_expect_to_call (rsrc->calls[add_expect]);
2005 templateLin->expect.expected_results_saved = true;
2006 }
2007 }
2008 delete templateLin; /* done with this template line */
2009 } else {
2010 /* The template line is now fully decoded, so stuff it onto
2011 vector of lines to be "statisticalized": */
2012 template_block_vector.push_back (templateLin);
2013 }
2014 IVM(cout << yytext << "\"" << endl;)
2015 }
2016#line 2017 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2017 break;
2018
2019 case 7:
2020#line 475 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2021 {
2022 /* (This is the same as for command SEMICOLON, other than the IVM.) */
2023 IVM(cout << "Command with expect: \"" << flush;)
2024 if (!purpose_defined) {
2025 cerr << endl << endl
2026 << "Error: Please begin your test with the \"purpose\" "
2027 << "directive. \n For example, "
2028 << "\"purpose to exercise crypto and SST...\"" << endl;
2029 exit (1024);
2030 }
2031 if (nesting_level == 0) {
2032 for (add_expect = 0; add_expect < rsrc->calls.size(); ++add_expect) {
2033 if (!(rsrc->calls[add_expect]->exp_data.expected_results_saved)) {
2034 templateLin->expect.copy_expect_to_call (rsrc->calls[add_expect]);
2035 templateLin->expect.expected_results_saved = true;
2036 }
2037 }
2038 delete templateLin;
2039 } else {
2040 template_block_vector.push_back (templateLin);
2041 }
2042 IVM(cout << yytext << "\"" << endl;)
2043 }
2044#line 2045 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2045 break;
2046
2047 case 8:
2048#line 501 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2049 {
2050 IVM(cout << "Set command: \"" << yytext << "\"" << endl;)
2051 }
2052#line 2053 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2053 break;
2054
2055 case 9:
2056#line 504 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2057 {
2058 IVM(cout << "Remove command: \"" << yytext << "\"" << endl;)
2059 }
2060#line 2061 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2061 break;
2062
2063 case 10:
2064#line 507 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2065 {
2066 IVM(cout << "Read command: \"" << yytext << "\"" << endl;)
2067 }
2068#line 2069 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2069 break;
2070
2071 case 11:
2072#line 510 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2073 {
2074 IVM(cout << "Security command: \"" << yytext << "\"" << endl;)
2075 }
2076#line 2077 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2077 break;
2078
2079 case 12:
2080#line 513 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2081 {
2082 IVM(cout << "Done command: \"" << yytext << "\"" << endl;)
2083 }
2084#line 2085 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2085 break;
2086
2087 case 13:
2088#line 519 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2089 {
2090 IVM(cout << "Expect pass clause: \"" << flush;)
2091 templateLin->expect.set_pf_pass();
2092 IVM(cout << yytext << "\"" << endl;)
2093 }
2094#line 2095 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2095 break;
2096
2097 case 14:
2098#line 524 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2099 {
2100 IVM(cout << "Expect fail clause: \"" << flush;)
2101 templateLin->expect.set_pf_fail();
2102 IVM(cout << yytext << "\"" << endl;)
2103 }
2104#line 2105 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2105 break;
2106
2107 case 15:
2108#line 529 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2109 {
2110 IVM(cout << "Expect nothing clause: \"" << flush;)
2111 templateLin->expect.set_pf_nothing();
2112 IVM(cout << yytext << "\"" << endl;)
2113 }
2114#line 2115 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2115 break;
2116
2117 case 16:
2118#line 534 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2119 {
2120 IVM(cout << "Expect error clause: \"" << flush;)
2121 templateLin->expect.set_pf_error (identifier);
2122 IVM(cout << yytext << "\"" << endl;)
2123 }
2124#line 2125 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2125 break;
2126
2127 case 17:
2128#line 543 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2129 {
2130 IVM(cout << "Set SST command: \"" << yytext << "\"" << endl;)
2131 templateLin = new set_sst_template_line (rsrc);
2132 interpret_template_line (
2133 templateLin, rsrc, set_data, random_asset,
2134 assign_data_var_specified, expect, policy_info,
2135 print_data, hash_data, asset_name, assign_data_var, parsed_asset,
2136 nesting_level == 0 /* create call unless inside {} */,
2137 nesting_level == 0 /* similarly, create asset unless inside {} */,
2138 yes_fill_in_template, 0
2139 );
2140 }
2141#line 2142 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2142 break;
2143
2144 case 18:
2145#line 555 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2146 {
2147 IVM(cout << "Set key command: \"" << yytext << "\"" << endl;)
2148 templateLin = new set_key_template_line (rsrc);
2149 target_barrier = policy_info.asset_2_name; /* policy */
2150 interpret_template_line (
2151 templateLin, rsrc, set_data, random_asset,
2152 assign_data_var_specified, expect, policy_info,
2153 print_data, hash_data, asset_name, assign_data_var, parsed_asset,
2154 nesting_level == 0 /* create call unless inside {} */,
2155 nesting_level == 0 /* similarly, create asset unless inside {} */,
2156 yes_fill_in_template, 0
2157 );
2158 }
2159#line 2160 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2160 break;
2161
2162 case 19:
2163#line 568 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2164 {
2165 IVM(cout << "Set policy command: \"" << yytext << "\"" << endl;;)
2166 templateLin = new set_policy_template_line (rsrc);
2167 interpret_template_line (
2168 templateLin, rsrc, set_data, random_asset,
2169 assign_data_var_specified, expect, policy_info,
2170 print_data, hash_data, asset_name, assign_data_var, parsed_asset,
2171 nesting_level == 0 /* create call unless inside {} */,
2172 nesting_level == 0 /* similarly, create asset unless inside {} */,
2173 yes_fill_in_template, 0
2174 );
2175 }
2176#line 2177 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2177 break;
2178
2179 case 20:
2180#line 583 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2181 {
2182 IVM(cout << "Read SST command: \"" << yytext << "\"" << endl;;)
2183 templateLin = new read_sst_template_line (rsrc);
2184 interpret_template_line (
2185 templateLin, rsrc, set_data, random_asset,
2186 assign_data_var_specified, expect, policy_info,
2187 print_data, hash_data, asset_name, assign_data_var, parsed_asset,
2188 nesting_level == 0 /* create call unless inside {} */,
2189 dont_create_asset /* if no such asset exists, fail the call */,
2190 yes_fill_in_template, 0
2191 );
2192 }
2193#line 2194 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2194 break;
2195
2196 case 21:
2197#line 595 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2198 {
2199 IVM(cout << "Read key command: \"" << yytext << "\"" << endl;;)
2200 templateLin = new read_key_template_line (rsrc);
2201 interpret_template_line (
2202 templateLin, rsrc, set_data, random_asset,
2203 assign_data_var_specified, expect, policy_info,
2204 print_data, hash_data, asset_name, assign_data_var, parsed_asset,
2205 nesting_level == 0 /* create call unless inside {} */,
2206 dont_create_asset /* if no such asset exists, fail the call */,
2207 yes_fill_in_template, 0
2208 );
2209 }
2210#line 2211 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2211 break;
2212
2213 case 22:
2214#line 607 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2215 {
2216 IVM(cout << "Read policy command: \"" << yytext << "\"" << endl;;)
2217 templateLin = new read_policy_template_line (rsrc);
2218 interpret_template_line (
2219 templateLin, rsrc, set_data, random_asset,
2220 assign_data_var_specified, expect, policy_info,
2221 print_data, hash_data, asset_name, assign_data_var, parsed_asset,
2222 nesting_level == 0 /* create call unless inside {} */,
2223 dont_create_asset /* if no such asset exists, fail the call */,
2224 yes_fill_in_template, 0
2225 );
2226 }
2227#line 2228 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2228 break;
2229
2230 case 23:
2231#line 622 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2232 {
2233 IVM(cout << "Remove SST command: \"" << yytext << "\"" << endl;;)
2234 templateLin = new remove_sst_template_line (rsrc);
2235 interpret_template_line (
2236 templateLin, rsrc, set_data, random_asset,
2237 assign_data_var_specified, expect, policy_info,
2238 print_data, hash_data, asset_name, assign_data_var, parsed_asset,
2239 nesting_level == 0 /* create call unless inside {} */,
2240 dont_create_asset /* don't create an asset being deleted */,
2241 yes_fill_in_template, 0
2242 );
2243 }
2244#line 2245 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2245 break;
2246
2247 case 24:
2248#line 634 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2249 {
2250 IVM(cout << "Remove key command: \"" << yytext << "\"" << endl;;)
2251 templateLin = new remove_key_template_line (rsrc);
2252 templateLin->asset_info.set_name (asset_name); // set in key_asset_name, below
2253 interpret_template_line (
2254 templateLin, rsrc, set_data, random_asset,
2255 assign_data_var_specified, expect, policy_info,
2256 print_data, hash_data, asset_name, assign_data_var, parsed_asset,
2257 nesting_level == 0 /* create call unless inside {} */,
2258 dont_create_asset /* don't create an asset being deleted */,
2259 yes_fill_in_template, 0
2260 );
2261 }
2262#line 2263 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2263 break;
2264
2265 case 25:
2266#line 649 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2267 {
2268 /* TODO: This needs to allow not only SST assets, but mix and match with others
2269 (keys especially) as well. */
2270 IVM(cout << "Secure hash command: \"" << yytext << "\"" << endl;)
2271 templateLin = new security_hash_template_line (rsrc);
2272 templateLin->asset_info.set_name (asset_name);
2273 templateLin->assign_data_var_specified = assign_data_var_specified;
2274 templateLin->assign_data_var.assign (assign_data_var);
2275 templateLin->expect = expect;
2276 templateLin->print_data = print_data;
2277 templateLin->hash_data = hash_data;
2278 templateLin->random_asset = random_asset;
2279 /* Hash checks are different from the rest in that there's a single
2280 "call" -- not a PSA call though -- for all of the assets cited in the
2281 template line. In *other* cases, create a single call for *each*
2282 asset cited by the template line, but not in this case. */
2283 for (auto as_name : parsed_asset.asset_name_vector) {
2284 /* Also copy into template line object's local vector: */
2285 templateLin->asset_info.asset_name_vector.push_back (as_name);
2286 }
2287 /* Don't need to locate the assets, so no searches required. */
2288 templateLin->expect.data_var = var_name;
2289 templateLin->setup_call (set_data, set_data.random_data, yes_fill_in_template,
2290 nesting_level == 0, templateLin, rsrc );
2291 parsed_asset.asset_name_vector.clear();
2292
2293
2294 }
2295#line 2296 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2296 break;
2297
2298 case 26:
2299#line 679 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2300 {
2301 if (nesting_level != 0) {
2302 cerr << "\n\"done\" only available at outer-most { } nesting level."
2303 << endl;
2304 exit (702);
2305 } else {
2306 YYACCEPT;
2307 }
2308 }
2309#line 2310 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2310 break;
2311
2312 case 27:
2313#line 691 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2314 {
2315 IVM(cout << "Create from literal data: \"" << flush;)
2316 set_data.random_data = false;
2317 set_data.string_specified = true;
2318 set_data.literal_data_not_file = true;
2319 literal.erase(0,1); // zap the ""s
2320 literal.erase(literal.length()-1,1);
2321 literal_data.assign (literal);
2322 IVM(cout << yytext << "\"" << endl;)
2323 }
2324#line 2325 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2325 break;
2326
2327 case 28:
2328#line 701 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2329 { /* TF-Fuzz supplies random data */
2330 IVM(cout << "Create from random data" << endl;)
2331 set_data.randomize();
2332 literal.assign (set_data.get()); /* just in case something uses literal */
2333 set_data.random_data = true;
2334 set_data.string_specified = false;
2335 }
2336#line 2337 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2337 break;
2338
2339 case 30:
2340#line 713 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2341 {
2342 IVM(cout << "SST-create from random data (no 'data *')" << endl;)
2343 set_data.randomize();
2344 literal.assign (set_data.get()); /* just in case something uses literal */
2345 }
2346#line 2347 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2347 break;
2348
2349 case 31:
2350#line 718 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2351 { /* set from variable */
2352 IVM(cout << "SST-set set from variable: \"" << flush;)
2353 assign_data_var.assign (identifier);
2354 assign_data_var_specified = true;
2355 expect.data_specified = false;
2356 expect.data_var_specified = false;
2357 IVM(cout << yytext << "\"" << endl;)
2358 }
2359#line 2360 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2360 break;
2361
2362 case 32:
2363#line 726 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2364 {
2365 set_data.literal_data_not_file = set_data.random_data = false;
2366 IVM(cout << "SST-create from file: " << yytext << "\"" << endl;)
2367 /* TODO: Need to decide whether the concept of using files to set SST
2368 asset values has meaning, and if so, write code to write code to
2369 set data appropriately from the file. */
2370 }
2371#line 2372 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2372 break;
2373
2374 case 34:
2375#line 737 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2376 {
2377 IVM(cout << "SST creation flags" << endl;)
2378 IVM(cout << yytext << "\"" << endl;)
2379 }
2380#line 2381 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2381 break;
2382
2383 case 36:
2384#line 745 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2385 {
2386 IVM(cout << "SST creation flag" << endl;)
2387 IVM(cout << yytext << "\"" << endl;)
2388 }
2389#line 2390 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2390 break;
2391
2392 case 41:
2393#line 753 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2394 {
2395 set_data.flags_string = "PSA_STORAGE_FLAG_NONE";
2396 /* TODO: grab from boilerplate */
2397 IVM(cout << "SST no storage flag: " << yytext << "\"" << endl;)
2398 }
2399#line 2400 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2400 break;
2401
2402 case 42:
2403#line 760 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2404 {
2405 set_data.flags_string = "PSA_STORAGE_FLAG_WRITE_ONCE";
2406 /* TODO: grab from boilerplate */
2407 IVM(cout << "SST write-once flag: " << yytext << "\"" << endl;)
2408 }
2409#line 2410 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2410 break;
2411
2412 case 43:
2413#line 767 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2414 {
2415 set_data.flags_string = "PSA_STORAGE_FLAG_NO_REPLAY_PROTECTION";
2416 /* TODO: grab from boilerplate */
2417 IVM(cout << "SST no-replay-protection flag: "
2418 << yytext << "\"" << endl;)
2419 }
2420#line 2421 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2421 break;
2422
2423 case 44:
2424#line 775 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2425 {
2426 set_data.flags_string = "PSA_STORAGE_FLAG_NO_CONFIDENTIALITY";
2427 /* TODO: grab from boilerplate */
2428 IVM(cout << "SST no-confidentiality flag: " << yytext
2429 << "\"" << endl;)
2430 }
2431#line 2432 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2432 break;
2433
2434 case 45:
2435#line 784 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2436 {
2437 IVM(cout << "SST-data offset: \"" << flush;)
2438 set_data.data_offset = atol(yytext);
2439 IVM(cout << yytext << "\"" << endl;)
2440 }
2441#line 2442 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2442 break;
2443
2444 case 46:
2445#line 793 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2446 {
2447 IVM(cout << "SST-read arguments: " << yytext << "\"" << endl;)
2448 }
2449#line 2450 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2450 break;
2451
2452 case 47:
2453#line 799 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2454 { /* dump to variable */
2455 IVM(cout << "Read dump to variable: \"" << flush;)
2456 assign_data_var.assign (identifier);
2457 assign_data_var_specified = true;
2458 expect.data_specified = false;
2459 expect.data_var_specified = false;
2460 IVM(cout << yytext << "\"" << endl;)
2461 }
2462#line 2463 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2463 break;
2464
2465 case 48:
2466#line 807 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2467 { /* check against variable */
2468 IVM(cout << "Read check against variable: \""
2469 << yytext << "\"" << endl;)
2470 set_data.set (literal);
2471 assign_data_var_specified = false;
2472 expect.data_specified = false;
2473 expect.data_var_specified = true;
2474 expect.data_var = identifier;
2475 }
2476#line 2477 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2477 break;
2478
2479 case 49:
2480#line 816 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2481 { /* check against literal */
2482 IVM(cout << "Read check against literal: " << flush;)
2483 expect.data.assign (literal);
2484 expect.data.erase(0,1); // zap the ""s
2485 expect.data.erase(expect.data.length()-1,1);
2486 assign_data_var_specified = false; /* don't read variable */
2487 expect.data_specified = true; /* check against literal data */
2488 expect.data_var_specified = false; /* don't check against variable */
2489 IVM(cout << yytext << endl;)
2490 }
2491#line 2492 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2492 break;
2493
2494 case 50:
2495#line 826 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2496 { /* print out content in test log */
2497 IVM(cout << "Read log to test log: \"" << flush;)
2498 /* TODO: set_data content probably doesn't need to be set here;
2499 constructor probably sets it fine. */
2500 set_data.random_data = false;
2501 set_data.literal_data_not_file = true;
2502 assign_data_var_specified = false;
2503 expect.data_specified = false;
2504 expect.data_var_specified = false;
2505 print_data = true;
2506 IVM(cout << yytext << "\"" << endl;)
2507 }
2508#line 2509 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2509 break;
2510
2511 case 51:
2512#line 838 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2513 { /* hash the data and save for later comparison */
2514 IVM(cout << "Read hash for future data-leak detection: \"" << flush;)
2515 /* TODO: set_data content probably doesn't need to be set here;
2516 constructor probably sets it fine. */
2517 set_data.random_data = false;
2518 set_data.literal_data_not_file = true;
2519 assign_data_var_specified = false;
2520 expect.data_specified = false;
2521 expect.data_var_specified = false;
2522 hash_data = true;
2523 rsrc->include_hashing_code = true;
2524 IVM(cout << yytext << "\"" << endl;)
2525 }
2526#line 2527 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2527 break;
2528
2529 case 52:
2530#line 851 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2531 { /* dump to file */
2532 IVM(cout << "Read dump to file: \""
2533 << yytext << "\"" << endl;)
2534 set_data.literal_data_not_file = set_data.random_data = false;
2535 }
2536#line 2537 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2537 break;
2538
2539 case 54:
2540#line 860 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2541 {
2542 IVM(cout << "SST data offset" << endl;)
2543 set_data.data_offset = atol(yytext);
2544 IVM(cout << yytext << "\"" << endl;)
2545 }
2546#line 2547 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2547 break;
2548
2549 case 56:
2550#line 868 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2551 {
2552 IVM(cout << "SST-remove arguments: \""
2553 << yytext << "\"" << endl;)
2554 }
2555#line 2556 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2556 break;
2557
2558 case 57:
2559#line 875 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2560 {
2561 IVM(cout << "Asset identifier list: \"" << flush;)
2562 random_name = false;
2563 asset_name.assign (identifier); /* TODO: Not sure this ultimately has any effect... */
2564 random_asset = psa_asset_usage::all; /* don't randomly choose existing asset */
2565 parsed_asset.id_n_not_name = false;
2566 IVM(cout << yytext << "\"" << endl;)
2567 }
2568#line 2569 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2569 break;
2570
2571 case 58:
2572#line 883 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2573 {
2574 IVM(cout << "Asset random identifier: \"" << flush;)
2575 random_name = true;
2576 rand_data_length = 4 + (rand() % 5);
2577 gib.word (false, gib_buff, gib_buff + rand_data_length - 1);
2578 aid.assign (gib_buff);
2579 parsed_asset.asset_name_vector.push_back (aid);
2580 random_asset = psa_asset_usage::all; /* don't randomly choose existing asset */
2581 parsed_asset.id_n_not_name = false;
2582 IVM(cout << yytext << "\"" << endl;)
2583 }
2584#line 2585 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2585 break;
2586
2587 case 59:
2588#line 896 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2589 {
2590 IVM(cout << "Single existing asset by name: \"" << flush;)
2591 random_name = false;
2592 policy_info.asset_3_name.assign (identifier);
2593 random_asset = psa_asset_usage::all; /* don't randomly choose existing asset */
2594 parsed_asset.id_n_not_name = false;
2595 IVM(cout << yytext << "\"" << endl;)
2596 }
2597#line 2598 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2598 break;
2599
2600 case 61:
2601#line 908 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2602 {
2603 IVM(cout << "Asset random active: \"" << flush;)
2604 random_asset = psa_asset_usage::active;
2605 parsed_asset.id_n_not_name = false;
2606 IVM(cout << yytext << "\"" << endl;)
2607 }
2608#line 2609 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2609 break;
2610
2611 case 62:
2612#line 914 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2613 {
2614 IVM(cout << "Asset random deleted: \"" << flush;)
2615 random_asset = psa_asset_usage::deleted;
2616 parsed_asset.id_n_not_name = false;
2617 IVM(cout << yytext << "\"" << endl;)
2618 }
2619#line 2620 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2620 break;
2621
2622 case 64:
2623#line 924 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2624 {
2625 IVM(cout << "SST-asset UID list: \"" << flush;)
2626 random_name = false;
2627 random_asset = psa_asset_usage::all; /* don't randomly choose existing asset */
2628 parsed_asset.id_n_not_name = true;
2629 parsed_asset.id_n_specified = true;
2630 IVM(cout << yytext << "\"" << endl;)
2631 }
2632#line 2633 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2633 break;
2634
2635 case 65:
2636#line 932 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2637 {
2638 IVM(cout << "SST-asset random UID: \"" << flush;)
2639 parsed_asset.id_n_not_name = true;
2640 random_name = false;
2641 nid = 100 + (rand() % 10000);
2642 parsed_asset.asset_id_n_vector.push_back (nid);
2643 random_asset = psa_asset_usage::all; /* don't randomly choose existing asset */
2644 IVM(cout << yytext << "\"" << endl;)
2645 }
2646#line 2647 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2647 break;
2648
2649 case 66:
2650#line 944 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2651 {
2652 IVM(cout << "SST-asset-create file path: \"" << flush;)
2653 IVM(cout << yytext << "\"" << endl;)
2654 }
2655#line 2656 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2656 break;
2657
2658 case 67:
2659#line 951 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2660 {
2661 IVM(cout << "Read-arguments variable name: \"" << flush;)
2662 var_name = yytext;
2663 IVM(cout << yytext << "\"" << endl;)
2664 }
2665#line 2666 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2666 break;
2667
2668 case 68:
2669#line 959 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2670 {
2671 IVM(cout << "SST-asset dump-file path: \"" << flush;)
2672 set_data.file_path = yytext;
2673 IVM(cout << yytext << "\"" << endl;)
2674 }
2675#line 2676 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2676 break;
2677
2678 case 69:
2679#line 967 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2680 {
2681 IVM(cout << "Key size: \"" << flush;)
2682 policy_info.n_bits = atol(yytext);
2683 IVM(cout << yytext << "\"" << endl;)
2684 }
2685#line 2686 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2686 break;
2687
2688 case 72:
2689#line 978 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2690 {
2691 IVM(cout << "Key-policy usages at line number " << dec << yylineno
2692 << "." << endl;)
2693 }
2694#line 2695 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2695 break;
2696
2697 case 73:
2698#line 984 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2699 {
2700 policy_info.exportable = true;
2701 IVM(cout << "Exportable key true: " << yytext << "\"" << endl;)
2702 }
2703#line 2704 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2704 break;
2705
2706 case 74:
2707#line 990 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2708 {
2709 policy_info.exportable = false;
2710 IVM(cout << "Non-exportable key: " << yytext << "\"" << endl;)
2711 }
2712#line 2713 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2713 break;
2714
2715 case 75:
2716#line 996 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2717 {
2718 policy_info.copyable = true;
2719 IVM(cout << "Copyable key true: " << yytext << "\"" << endl;)
2720 }
2721#line 2722 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2722 break;
2723
2724 case 76:
2725#line 1002 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2726 {
2727 policy_info.copyable = false;
2728 IVM(cout << "Non-copyable key: " << yytext << "\"" << endl;)
2729 }
2730#line 2731 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2731 break;
2732
2733 case 77:
2734#line 1008 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2735 {
2736 policy_info.can_encrypt = true;
2737 IVM(cout << "Encryption key true: " << yytext << "\"" << endl;)
2738 }
2739#line 2740 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2740 break;
2741
2742 case 78:
2743#line 1014 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2744 {
2745 policy_info.can_encrypt = false;
2746 IVM(cout << "Non-encryption key: " << yytext << "\"" << endl;)
2747 }
2748#line 2749 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2749 break;
2750
2751 case 79:
2752#line 1020 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2753 {
2754 policy_info.can_decrypt = true;
2755 IVM(cout << "Decryption key true: " << yytext << "\"" << endl;)
2756 }
2757#line 2758 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2758 break;
2759
2760 case 80:
2761#line 1026 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2762 {
2763 policy_info.can_decrypt = false;
2764 IVM(cout << "Non-decryption key: " << yytext << "\"" << endl;)
2765 }
2766#line 2767 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2767 break;
2768
2769 case 81:
2770#line 1032 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2771 {
2772 policy_info.can_sign = true;
2773 IVM(cout << "Signing key true: " << yytext << "\"" << endl;)
2774 }
2775#line 2776 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2776 break;
2777
2778 case 82:
2779#line 1038 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2780 {
2781 policy_info.can_sign = false;
2782 IVM(cout << "Non-signing key: " << yytext << "\"" << endl;)
2783 }
2784#line 2785 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2785 break;
2786
2787 case 83:
2788#line 1044 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2789 {
2790 policy_info.can_verify = true;
2791 IVM(cout << "Verify key true: " << yytext << "\"" << endl;)
2792 }
2793#line 2794 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2794 break;
2795
2796 case 84:
2797#line 1050 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2798 {
2799 policy_info.can_verify = false;
2800 IVM(cout << "Non-verify key: " << yytext << "\"" << endl;)
2801 }
2802#line 2803 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2803 break;
2804
2805 case 85:
2806#line 1056 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2807 {
2808 policy_info.derivable = true;
2809 IVM(cout << "Derivable key true: " << yytext << "\"" << endl;)
2810 }
2811#line 2812 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2812 break;
2813
2814 case 86:
2815#line 1062 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2816 {
2817 policy_info.derivable = false;
2818 IVM(cout << "Non-derivable key: " << yytext << "\"" << endl;)
2819 }
2820#line 2821 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2821 break;
2822
2823 case 87:
2824#line 1068 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2825 {
2826 policy_info.persistent = true;
2827 IVM(cout << "Persistent key: " << yytext << "\"" << endl;)
2828 }
2829#line 2830 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2830 break;
2831
2832 case 88:
2833#line 1074 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2834 {
2835 policy_info.persistent = false;
2836 IVM(cout << "Volatile key: " << yytext << "\"" << endl;)
2837 }
2838#line 2839 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2839 break;
2840
2841 case 105:
2842#line 1083 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2843 {
2844 IVM(cout << "Policy usage: " << yytext << "\"" << endl;)
2845 }
2846#line 2847 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2847 break;
2848
2849 case 106:
2850#line 1089 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2851 {
2852 // Change type identifier, e.g., from "raw_data" to PSA_KEY_TYPE_RAW_DATA:
2853 identifier = formalize (identifier, "PSA_KEY_TYPE_");
2854 policy_info.key_type = identifier;
2855 IVM(cout << "Policy type: \""
2856 << policy_info.key_type << "\"" << endl;)
2857 }
2858#line 2859 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2859 break;
2860
2861 case 107:
2862#line 1098 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2863 {
2864 // Change type identifier, e.g., from "sha_256" to PSA_ALG_SHA_256:
2865 identifier = formalize (identifier, "PSA_ALG_");
2866 policy_info.key_algorithm = identifier;
2867 IVM(cout << "Policy algorithm: \""
2868 << policy_info.key_algorithm << "\"" << endl;)
2869 }
2870#line 2871 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2871 break;
2872
2873 case 109:
2874#line 1108 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2875 {
2876 IVM(cout << "Key-policy specs at line number " << dec << yylineno
2877 << "." << endl;)
2878 }
2879#line 2880 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2880 break;
2881
2882 case 114:
2883#line 1118 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2884 {
2885 IVM(cout << "policy-asset identifier list: \"" << flush;)
2886 random_name = false;
2887 asset_name.assign (identifier); /* TODO: Not sure this ultimately has any effect... */
2888 random_asset = psa_asset_usage::all; /* don't randomly choose existing asset */
2889 parsed_asset.id_n_not_name = false;
2890 IVM(cout << yytext << "\"" << endl;)
2891 }
2892#line 2893 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2893 break;
2894
2895 case 115:
2896#line 1126 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2897 {
2898 IVM(cout << "policy-asset random identifier: \"" << flush;)
2899 random_name = true;
2900 rand_data_length = 2 + (rand() % 10);
2901 gib.word (false, gib_buff, gib_buff + rand_data_length - 1);
2902 aid.assign (gib_buff);
2903 parsed_asset.asset_name_vector.push_back (aid);
2904 random_asset = psa_asset_usage::all; /* don't randomly choose existing asset */
2905 parsed_asset.id_n_not_name = false;
2906 IVM(cout << yytext << "\"" << endl;)
2907 }
2908#line 2909 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2909 break;
2910
2911 case 116:
2912#line 1140 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2913 {
2914 IVM(cout << "policy-asset identifier list: \"" << flush;)
2915 random_name = false;
2916 policy_info.get_policy_from_key = false;
2917 asset_name.assign (identifier); /* TODO: Not sure this ultimately has any effect... */
2918 parsed_asset.asset_name_vector.push_back (identifier);
2919 random_asset = psa_asset_usage::all; /* don't randomly choose existing asset */
2920 parsed_asset.id_n_not_name = false;
2921 IVM(cout << yytext << "\"" << endl;)
2922 }
2923#line 2924 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2924 break;
2925
2926 case 117:
2927#line 1150 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2928 {
2929 IVM(cout << "policy-asset random active: \"" << flush;)
2930 policy_info.get_policy_from_key = false;
2931 random_asset = psa_asset_usage::active;
2932 parsed_asset.id_n_not_name = false;
2933 IVM(cout << yytext << "\"" << endl;)
2934 }
2935#line 2936 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2936 break;
2937
2938 case 118:
2939#line 1157 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2940 {
2941 IVM(cout << "policy-asset random deleted: \"" << flush;)
2942 policy_info.get_policy_from_key = false;
2943 random_asset = psa_asset_usage::deleted;
2944 parsed_asset.id_n_not_name = false;
2945 IVM(cout << yytext << "\"" << endl;)
2946 }
2947#line 2948 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2948 break;
2949
2950 case 119:
2951#line 1164 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2952 {
2953 IVM(cout << "policy-asset specified by key: \"" << flush;)
2954 policy_info.get_policy_from_key = true;
2955 random_name = false;
2956 asset_name.assign (identifier); /* ask this key what it's policy is */
2957 random_asset = psa_asset_usage::all; /* don't randomly choose existing asset */
2958 parsed_asset.id_n_not_name = false;
2959 IVM(cout << yytext << "\"" << endl;)
2960 }
2961#line 2962 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2962 break;
2963
2964 case 120:
2965#line 1176 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2966 {
2967 IVM(cout << "Policy-create arguments: \"" << yytext << "\"" << endl;)
2968 }
2969#line 2970 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2970 break;
2971
2972 case 121:
2973#line 1182 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2974 {
2975 IVM(cout << "Policy-read arguments: " << yytext << "\"" << endl;)
2976 }
2977#line 2978 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2978 break;
2979
2980 case 123:
2981#line 1189 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2982 {
2983 IVM(cout << "Key-set sources at Line number "
2984 << yytext << "\"" << endl;)
2985 }
2986#line 2987 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2987 break;
2988
2989 case 124:
2990#line 1196 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
2991 {
2992 IVM(cout << "Key-set sources, literal or random data: "
2993 << yytext << "\"" << endl;)
2994 }
2995#line 2996 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
2996 break;
2997
2998 case 125:
2999#line 1200 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3000 {
3001 IVM(cout << "Key-set sources, explicitly-specified policy name: "
3002 << flush;)
3003 policy_info.asset_2_name = identifier; /* policy */
3004 /* Make note that key data (key material) was not specified: */
3005 IVM(cout << yytext << "\"" << endl;)
3006 }
3007#line 3008 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3008 break;
3009
3010 case 127:
3011#line 1211 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3012 {
3013 IVM(cout << "Key data, literal or random data: "
3014 << yytext << "\"" << endl;)
3015 }
3016#line 3017 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3017 break;
3018
3019 case 128:
3020#line 1218 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3021 {
3022 IVM(cout << "Key-create from data, policy, or nothing (default): \""
3023 << yytext << "\"" << endl;)
3024 policy_info.copy_key = false;
3025 policy_info.implicit_policy = false;
3026 }
3027#line 3028 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3028 break;
3029
3030 case 129:
3031#line 1224 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3032 {
3033 IVM(cout << "Key-copy from other key: \"" << flush;)
3034 policy_info.asset_2_name = identifier; /* policy */
3035 policy_info.copy_key = true;
3036 policy_info.implicit_policy = false;
3037 IVM(cout << yytext << "\"" << endl;)
3038 }
3039#line 3040 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3040 break;
3041
3042 case 130:
3043#line 1231 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3044 {
3045 IVM(cout << "Key-create directly specifying policy attributes (implicit policy): \""
3046 << yytext << "\"" << endl;)
3047 policy_info.copy_key = false;
3048 policy_info.implicit_policy = true;
3049 cerr << "\nError: Defining keys with implicit policies is not yet implemented."
3050 << endl;
3051 exit (772);
3052 }
3053#line 3054 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3054 break;
3055
3056 case 131:
3057#line 1243 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3058 {
3059 IVM(cout << "Key-remove arguments: \""
3060 << yytext << "\"" << endl;)
3061 }
3062#line 3063 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3063 break;
3064
3065 case 132:
3066#line 1250 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3067 {
3068 IVM(cout << "Key dump: \"" << yytext << "\"" << endl;)
3069 }
3070#line 3071 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3071 break;
3072
3073 case 133:
3074#line 1257 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3075 {
3076 IVM(cout << "Shuffled block: \"" << flush;)
3077 if (nesting_level > 1) {
3078 cerr << "\nError: Sorry, currently only one level of { } "
3079 << "nesting is allowed." << endl;
3080 exit (500);
3081 }
3082 shuffle_not_pick = true;
3083 low_nmbr_lines = high_nmbr_lines = 0; /* not used, but... */
3084 IVM(cout << yytext << "\"" << endl;)
3085 }
3086#line 3087 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3087 break;
3088
3089 case 134:
3090#line 1268 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3091 {
3092 IVM(cout << "Fixed number of lines from block: \"" << flush;)
3093 shuffle_not_pick = false;
3094 /* low_nmbr_lines and high_nmbr_lines are set below. */
3095 IVM(cout << yytext << "\"" << endl;)
3096 }
3097#line 3098 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3098 break;
3099
3100 case 135:
3101#line 1274 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3102 {
3103 IVM(cout << "Range number of lines from block: \"" << flush;)
3104 if (nesting_level > 1) {
3105 cerr << "\nError: Sorry, currently only one level of { } "
3106 << "nesting is allowed." << endl;
3107 exit (502);
3108 }
3109 shuffle_not_pick = false;
3110 /* low_nmbr_lines and high_nmbr_lines are set below. */
3111 IVM(cout << yytext << "\"" << endl;)
3112 }
3113#line 3114 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3114 break;
3115
3116 case 136:
3117#line 1288 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3118 {
3119 IVM(cout << "Block content: \"" << yytext << "\"" << endl;)
3120 }
3121#line 3122 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3122 break;
3123
3124 case 137:
3125#line 1291 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3126 {
3127 IVM(cout << "Single-line would-be-block content: \"" << flush;)
3128 IVM(cout << yytext << "\"" << endl;)
3129 }
3130#line 3131 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3131 break;
3132
3133 case 138:
3134#line 1298 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3135 {
3136 IVM(cout << "Open brace: \"" << flush;)
3137 template_block_vector.clear(); // clean slate of template lines
3138 nesting_level = 1;
3139 IVM(cout << yytext << "\"" << endl;)
3140 }
3141#line 3142 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3142 break;
3143
3144 case 139:
3145#line 1307 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3146 {
3147 IVM(cout << "Close brace: " << flush;)
3148 IVM(cout << yytext << "\"" << endl;)
3149 }
3150#line 3151 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3151 break;
3152
3153 case 143:
3154#line 1324 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3155 {
3156 IVM(cout << "ASSET_NUMBER: \"" << flush;)
3157 nid = atol(yytext);
3158 parsed_asset.asset_id_n_vector.push_back (nid);
3159 IVM(cout << yytext << "\"" << endl;)
3160 }
3161#line 3162 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3162 break;
3163
3164 case 147:
3165#line 1344 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3166 {
3167 IVM(cout << "ASSET_IDENTIFIER: \"" << flush;)
3168 aid = identifier = yytext;
3169 parsed_asset.asset_name_vector.push_back (aid);
3170 IVM(cout << yytext << "\"" << endl;)
3171 }
3172#line 3173 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3173 break;
3174
3175 case 148:
3176#line 1353 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3177 {
3178 IVM(cout << "IDENTIFIER: \"" << flush;)
3179 identifier = yytext;
3180 IVM(cout << yytext << "\"" << endl;)
3181 }
3182#line 3183 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3183 break;
3184
3185 case 149:
3186#line 1361 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3187 {
3188 IVM(cout << "FILE_PATH: \"" << flush;)
3189 set_data.file_path = yytext;
3190 IVM(cout << yytext << "\"" << endl;)
3191 }
3192#line 3193 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3193 break;
3194
3195 case 150:
3196#line 1371 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3197 {
3198 IVM(cout << "Exact number of random template lines: \"" << flush;)
3199 low_nmbr_lines = high_nmbr_lines = exact_nmbr_lines = number;
3200 ++nesting_level;
3201 IVM(cout << number << "\"" << endl;)
3202 }
3203#line 3204 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3204 break;
3205
3206 case 151:
3207#line 1380 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3208 {
3209 IVM(cout << "Least number of random template lines: \"" << flush;)
3210 low_nmbr_lines = number;
3211 IVM(cout << number << "\"" << endl;)
3212 }
3213#line 3214 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3214 break;
3215
3216 case 152:
3217#line 1388 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3218 {
3219 IVM(cout << "Most number of random template lines: \"" << flush;)
3220 high_nmbr_lines = number;
3221 ++nesting_level;
3222 IVM(cout << number << "\"" << endl;)
3223 }
3224#line 3225 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3225 break;
3226
3227 case 153:
3228#line 1399 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3229 {
3230 IVM(cout << "NUMBER: \"" << flush;)
3231 number = atol(yytext);
3232 IVM(cout << yytext << "\"" << endl;)
3233 }
3234#line 3235 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3235 break;
3236
3237 case 154:
3238#line 1407 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3239 {
3240 IVM(cout << "LITERAL string: " << flush;)
3241 literal = yytext;
3242 literal_is_string = true;
3243 IVM(cout << yytext << endl;)
3244 }
3245#line 3246 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3246 break;
3247
3248 case 155:
3249#line 1413 "parser/tf_fuzz_grammar.y" /* yacc.c:1646 */
3250 {
3251 IVM(cout << "LITERAL hex-value list: " << flush;)
3252 literal = yytext;
3253 literal_is_string = false;
3254 IVM(cout << yytext << endl;)
3255 }
3256#line 3257 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3257 break;
3258
3259
3260#line 3261 "parser/tf_fuzz_grammar.tab.cpp" /* yacc.c:1646 */
3261 default: break;
3262 }
3263 /* User semantic actions sometimes alter yychar, and that requires
3264 that yytoken be updated with the new translation. We take the
3265 approach of translating immediately before every use of yytoken.
3266 One alternative is translating here after every semantic action,
3267 but that translation would be missed if the semantic action invokes
3268 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3269 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3270 incorrect destructor might then be invoked immediately. In the
3271 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3272 to an incorrect destructor call or verbose syntax error message
3273 before the lookahead is translated. */
3274 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3275
3276 YYPOPSTACK (yylen);
3277 yylen = 0;
3278 YY_STACK_PRINT (yyss, yyssp);
3279
3280 *++yyvsp = yyval;
3281 *++yylsp = yyloc;
3282
3283 /* Now 'shift' the result of the reduction. Determine what state
3284 that goes to, based on the state we popped back to and the rule
3285 number reduced by. */
3286
3287 yyn = yyr1[yyn];
3288
3289 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3290 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3291 yystate = yytable[yystate];
3292 else
3293 yystate = yydefgoto[yyn - YYNTOKENS];
3294
3295 goto yynewstate;
3296
3297
3298/*--------------------------------------.
3299| yyerrlab -- here on detecting error. |
3300`--------------------------------------*/
3301yyerrlab:
3302 /* Make sure we have latest lookahead translation. See comments at
3303 user semantic actions for why this is necessary. */
3304 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3305
3306 /* If not already recovering from an error, report this error. */
3307 if (!yyerrstatus)
3308 {
3309 ++yynerrs;
3310#if ! YYERROR_VERBOSE
3311 yyerror (rsrc, YY_("syntax error"));
3312#else
3313# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3314 yyssp, yytoken)
3315 {
3316 char const *yymsgp = YY_("syntax error");
3317 int yysyntax_error_status;
3318 yysyntax_error_status = YYSYNTAX_ERROR;
3319 if (yysyntax_error_status == 0)
3320 yymsgp = yymsg;
3321 else if (yysyntax_error_status == 1)
3322 {
3323 if (yymsg != yymsgbuf)
3324 YYSTACK_FREE (yymsg);
3325 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3326 if (!yymsg)
3327 {
3328 yymsg = yymsgbuf;
3329 yymsg_alloc = sizeof yymsgbuf;
3330 yysyntax_error_status = 2;
3331 }
3332 else
3333 {
3334 yysyntax_error_status = YYSYNTAX_ERROR;
3335 yymsgp = yymsg;
3336 }
3337 }
3338 yyerror (rsrc, yymsgp);
3339 if (yysyntax_error_status == 2)
3340 goto yyexhaustedlab;
3341 }
3342# undef YYSYNTAX_ERROR
3343#endif
3344 }
3345
3346 yyerror_range[1] = yylloc;
3347
3348 if (yyerrstatus == 3)
3349 {
3350 /* If just tried and failed to reuse lookahead token after an
3351 error, discard it. */
3352
3353 if (yychar <= YYEOF)
3354 {
3355 /* Return failure if at end of input. */
3356 if (yychar == YYEOF)
3357 YYABORT;
3358 }
3359 else
3360 {
3361 yydestruct ("Error: discarding",
3362 yytoken, &yylval, &yylloc, rsrc);
3363 yychar = YYEMPTY;
3364 }
3365 }
3366
3367 /* Else will try to reuse lookahead token after shifting the error
3368 token. */
3369 goto yyerrlab1;
3370
3371
3372/*---------------------------------------------------.
3373| yyerrorlab -- error raised explicitly by YYERROR. |
3374`---------------------------------------------------*/
3375yyerrorlab:
3376
3377 /* Pacify compilers like GCC when the user code never invokes
3378 YYERROR and the label yyerrorlab therefore never appears in user
3379 code. */
3380 if (/*CONSTCOND*/ 0)
3381 goto yyerrorlab;
3382
3383 yyerror_range[1] = yylsp[1-yylen];
3384 /* Do not reclaim the symbols of the rule whose action triggered
3385 this YYERROR. */
3386 YYPOPSTACK (yylen);
3387 yylen = 0;
3388 YY_STACK_PRINT (yyss, yyssp);
3389 yystate = *yyssp;
3390 goto yyerrlab1;
3391
3392
3393/*-------------------------------------------------------------.
3394| yyerrlab1 -- common code for both syntax error and YYERROR. |
3395`-------------------------------------------------------------*/
3396yyerrlab1:
3397 yyerrstatus = 3; /* Each real token shifted decrements this. */
3398
3399 for (;;)
3400 {
3401 yyn = yypact[yystate];
3402 if (!yypact_value_is_default (yyn))
3403 {
3404 yyn += YYTERROR;
3405 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3406 {
3407 yyn = yytable[yyn];
3408 if (0 < yyn)
3409 break;
3410 }
3411 }
3412
3413 /* Pop the current state because it cannot handle the error token. */
3414 if (yyssp == yyss)
3415 YYABORT;
3416
3417 yyerror_range[1] = *yylsp;
3418 yydestruct ("Error: popping",
3419 yystos[yystate], yyvsp, yylsp, rsrc);
3420 YYPOPSTACK (1);
3421 yystate = *yyssp;
3422 YY_STACK_PRINT (yyss, yyssp);
3423 }
3424
3425 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3426 *++yyvsp = yylval;
3427 YY_IGNORE_MAYBE_UNINITIALIZED_END
3428
3429 yyerror_range[2] = yylloc;
3430 /* Using YYLLOC is tempting, but would change the location of
3431 the lookahead. YYLOC is available though. */
3432 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
3433 *++yylsp = yyloc;
3434
3435 /* Shift the error token. */
3436 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3437
3438 yystate = yyn;
3439 goto yynewstate;
3440
3441
3442/*-------------------------------------.
3443| yyacceptlab -- YYACCEPT comes here. |
3444`-------------------------------------*/
3445yyacceptlab:
3446 yyresult = 0;
3447 goto yyreturn;
3448
3449/*-----------------------------------.
3450| yyabortlab -- YYABORT comes here. |
3451`-----------------------------------*/
3452yyabortlab:
3453 yyresult = 1;
3454 goto yyreturn;
3455
3456#if !defined yyoverflow || YYERROR_VERBOSE
3457/*-------------------------------------------------.
3458| yyexhaustedlab -- memory exhaustion comes here. |
3459`-------------------------------------------------*/
3460yyexhaustedlab:
3461 yyerror (rsrc, YY_("memory exhausted"));
3462 yyresult = 2;
3463 /* Fall through. */
3464#endif
3465
3466yyreturn:
3467 if (yychar != YYEMPTY)
3468 {
3469 /* Make sure we have latest lookahead translation. See comments at
3470 user semantic actions for why this is necessary. */
3471 yytoken = YYTRANSLATE (yychar);
3472 yydestruct ("Cleanup: discarding lookahead",
3473 yytoken, &yylval, &yylloc, rsrc);
3474 }
3475 /* Do not reclaim the symbols of the rule whose action triggered
3476 this YYABORT or YYACCEPT. */
3477 YYPOPSTACK (yylen);
3478 YY_STACK_PRINT (yyss, yyssp);
3479 while (yyssp != yyss)
3480 {
3481 yydestruct ("Cleanup: popping",
3482 yystos[*yyssp], yyvsp, yylsp, rsrc);
3483 YYPOPSTACK (1);
3484 }
3485#ifndef yyoverflow
3486 if (yyss != yyssa)
3487 YYSTACK_FREE (yyss);
3488#endif
3489#if YYERROR_VERBOSE
3490 if (yymsg != yymsgbuf)
3491 YYSTACK_FREE (yymsg);
3492#endif
3493 return yyresult;
3494}
3495#line 1422 "parser/tf_fuzz_grammar.y" /* yacc.c:1906 */
3496
3497