Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 1 | /* A Bison parser, made by GNU Bison 3.8.2. */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 2 | |
| 3 | /* Bison interface for Yacc-like parsers in C |
| 4 | |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 5 | Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, |
| 6 | Inc. |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 7 | |
| 8 | This program is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 3 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 19 | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 20 | |
| 21 | /* As a special exception, you may create a larger work that contains |
| 22 | part or all of the Bison parser skeleton and distribute that work |
| 23 | under terms of your choice, so long as that work isn't itself a |
| 24 | parser generator using the skeleton or a modified version thereof |
| 25 | as a parser skeleton. Alternatively, if you modify or redistribute |
| 26 | the parser skeleton itself, you may (at your option) remove this |
| 27 | special exception, which will cause the skeleton and the resulting |
| 28 | Bison output files to be licensed under the GNU General Public |
| 29 | License without this special exception. |
| 30 | |
| 31 | This special exception was added by the Free Software Foundation in |
| 32 | version 2.2 of Bison. */ |
| 33 | |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 34 | /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, |
| 35 | especially those whose name start with YY_ or yy_. They are |
| 36 | private implementation details that can be changed or removed. */ |
| 37 | |
| 38 | #ifndef YY_YY_V_CROS_COREBOOT_UTIL_CBFSTOOL_FMD_PARSER_H_SHIPPED_INCLUDED |
| 39 | # define YY_YY_V_CROS_COREBOOT_UTIL_CBFSTOOL_FMD_PARSER_H_SHIPPED_INCLUDED |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 40 | /* Debug traces. */ |
| 41 | #ifndef YYDEBUG |
| 42 | # define YYDEBUG 0 |
| 43 | #endif |
| 44 | #if YYDEBUG |
| 45 | extern int yydebug; |
| 46 | #endif |
| 47 | /* "%code requires" blocks. */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 48 | |
| 49 | #include "fmd.h" |
| 50 | #include "option.h" |
| 51 | |
| 52 | #include <stdbool.h> |
| 53 | |
| 54 | struct descriptor_node { |
| 55 | struct flashmap_descriptor *val; |
| 56 | struct descriptor_node *next; |
| 57 | }; |
| 58 | |
| 59 | struct descriptor_list { |
| 60 | size_t len; |
| 61 | struct descriptor_node *head; |
| 62 | struct descriptor_node *tail; |
| 63 | }; |
| 64 | |
| 65 | extern struct flashmap_descriptor *res; |
| 66 | |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 67 | struct flashmap_descriptor *parse_descriptor( |
| 68 | char *name, union flashmap_flags flags, struct unsigned_option offset, |
| 69 | struct unsigned_option size, struct descriptor_list children); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 70 | void yyerror(const char *s); |
| 71 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 72 | |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 73 | /* Token kinds. */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 74 | #ifndef YYTOKENTYPE |
| 75 | # define YYTOKENTYPE |
| 76 | enum yytokentype |
| 77 | { |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 78 | YYEMPTY = -2, |
| 79 | YYEOF = 0, /* "end of file" */ |
| 80 | YYerror = 256, /* error */ |
| 81 | YYUNDEF = 257, /* "invalid token" */ |
| 82 | INTEGER = 258, /* INTEGER */ |
| 83 | OCTAL = 259, /* OCTAL */ |
| 84 | STRING = 260, /* STRING */ |
| 85 | FLAG_CBFS = 261, /* FLAG_CBFS */ |
| 86 | FLAG_PRESERVE = 262 /* FLAG_PRESERVE */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 87 | }; |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 88 | typedef enum yytokentype yytoken_kind_t; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 89 | #endif |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 90 | |
| 91 | /* Value type. */ |
| 92 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 93 | union YYSTYPE |
| 94 | { |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 95 | |
| 96 | unsigned intval; |
| 97 | char *strval; |
| 98 | struct unsigned_option maybe_intval; |
| 99 | struct flashmap_descriptor *region_ptr; |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 100 | union flashmap_flags flags; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 101 | struct descriptor_list region_listhdr; |
| 102 | |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 103 | |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 104 | }; |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 105 | typedef union YYSTYPE YYSTYPE; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 106 | # define YYSTYPE_IS_TRIVIAL 1 |
| 107 | # define YYSTYPE_IS_DECLARED 1 |
| 108 | #endif |
| 109 | |
| 110 | |
| 111 | extern YYSTYPE yylval; |
| 112 | |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 113 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 114 | int yyparse (void); |
| 115 | |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 116 | |
| 117 | #endif /* !YY_YY_V_CROS_COREBOOT_UTIL_CBFSTOOL_FMD_PARSER_H_SHIPPED_INCLUDED */ |