Hung-Te Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37262 )
Change subject: util: cbfstool: Add new flag 'ALIGNED' for checking alignment at build time ......................................................................
util: cbfstool: Add new flag 'ALIGNED' for checking alignment at build time
Some FMAP sections (for example MRC_VAR_CACHE, RW_DDR_TRAINING, ...) are accessed directly by raw block I/O and must be aligned at SPI flash erase block size (see spi_flash.c#spi_flash_erase_cmd, error "SF: Erase offset/length not multiple of erase size").
If we don't add explicit offset to these sections in FMD files, changing size of other sections may unexpectedly causing them to be unaligned.
This patch adds a new flag "ALIGNED" so we can declare a FMAP section as
RW_DDR_TRAINING(ALIGNED) 8k
to ensure an 8k section that its offset and size will be both aligned at 4k.
Note: in current implementation the alignment is fixed at 4k, which is supported on almost all SPI chipsets today.
TEST=Change bootblock from default.fmd to BOOTBLOCK(ALIGNED) 127k and build, seeing error message: "E: Section 'BOOTBLOCK'@0[0x1fc00] must be aligned to 0x1000"
Change-Id: I26b394590c28667a4afcd521c7caa2009b5b98a9 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M util/cbfstool/fmap_from_fmd.c M util/cbfstool/fmd.h M util/cbfstool/fmd_parser.c_shipped M util/cbfstool/fmd_parser.h_shipped M util/cbfstool/fmd_parser.y M util/cbfstool/fmd_scanner.c_shipped M util/cbfstool/fmd_scanner.h_shipped M util/cbfstool/fmd_scanner.l 8 files changed, 629 insertions(+), 440 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/37262/1
diff --git a/util/cbfstool/fmap_from_fmd.c b/util/cbfstool/fmap_from_fmd.c index 374667a..f822f7b 100644 --- a/util/cbfstool/fmap_from_fmd.c +++ b/util/cbfstool/fmap_from_fmd.c @@ -35,6 +35,18 @@ if (section->flags.f.preserve) flags |= FMAP_AREA_PRESERVE;
+ if (section->flags.f.aligned) { + /* Currently the alignment is fixed at 4K. */ + const int alignment = 0x1000; + if (absolute_watermark % alignment || + section->size % alignment) { + ERROR("Section '%s'@%#x[%#x] must be aligned to %#x\n", + section->name,absolute_watermark, section->size, + alignment); + return false; + } + } + if (fmap_append_area(flashmap, absolute_watermark, section->size, (uint8_t *)section->name, flags) < 0) { ERROR("Failed to insert section '%s' into FMAP\n", diff --git a/util/cbfstool/fmd.h b/util/cbfstool/fmd.h index 90e6d6e..1eb3a22 100644 --- a/util/cbfstool/fmd.h +++ b/util/cbfstool/fmd.h @@ -33,6 +33,7 @@ struct { int cbfs: 1; /* The section contains a CBFS area. */ int preserve: 1; /* Preserve the section before update. */ + int aligned:1; /* The section must be aligned for block I/O. */ } f; int v; }; diff --git a/util/cbfstool/fmd_parser.c_shipped b/util/cbfstool/fmd_parser.c_shipped index 2597fc6..7a5f34c 100644 --- a/util/cbfstool/fmd_parser.c_shipped +++ b/util/cbfstool/fmd_parser.c_shipped @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.4.1. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,11 +41,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */
+/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + /* Identify Bison output. */ #define YYBISON 1
/* Bison version. */ -#define YYBISON_VERSION "3.0.4" +#define YYBISON_VERSION "3.4.1"
/* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -61,8 +65,8 @@
-/* Copy the first part of user declarations. */ -#line 16 "fmd_parser.y" /* yacc.c:339 */ +/* First part of user prologue. */ +#line 16 "fmd_parser.y"
#include "fmd_scanner.h" #include "common.h" @@ -71,13 +75,17 @@
struct flashmap_descriptor *res = NULL;
-#line 75 "y.tab.c" /* yacc.c:339 */ +#line 79 "fmd_parser.tab.c"
# ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif # else -# define YY_NULLPTR 0 +# define YY_NULLPTR ((void*)0) # endif # endif
@@ -89,10 +97,10 @@ # define YYERROR_VERBOSE 0 #endif
-/* In a future release of Bison, this section will be replaced - by #include "y.tab.h". */ -#ifndef YY_YY_Y_TAB_H_INCLUDED -# define YY_YY_Y_TAB_H_INCLUDED +/* Use api.header.include to #include this header + instead of duplicating it here. */ +#ifndef YY_YY_FMD_PARSER_TAB_H_INCLUDED +# define YY_YY_FMD_PARSER_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -101,7 +109,7 @@ extern int yydebug; #endif /* "%code requires" blocks. */ -#line 34 "fmd_parser.y" /* yacc.c:355 */ +#line 34 "fmd_parser.y"
#include "fmd.h" #include "option.h" @@ -126,7 +134,7 @@ struct unsigned_option size, struct descriptor_list children); void yyerror(const char *s);
-#line 130 "y.tab.c" /* yacc.c:355 */ +#line 138 "fmd_parser.tab.c"
/* Token type. */ #ifndef YYTOKENTYPE @@ -137,22 +145,16 @@ OCTAL = 259, STRING = 260, FLAG_CBFS = 261, - FLAG_PRESERVE = 262 + FLAG_PRESERVE = 262, + FLAG_ALIGNED = 263 }; #endif -/* Tokens. */ -#define INTEGER 258 -#define OCTAL 259 -#define STRING 260 -#define FLAG_CBFS 261 -#define FLAG_PRESERVE 262
/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - union YYSTYPE { -#line 25 "fmd_parser.y" /* yacc.c:355 */ +#line 25 "fmd_parser.y"
unsigned intval; char *strval; @@ -161,9 +163,9 @@ union flashmap_flags flags; struct descriptor_list region_listhdr;
-#line 165 "y.tab.c" /* yacc.c:355 */ -}; +#line 167 "fmd_parser.tab.c"
+}; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -174,11 +176,9 @@
int yyparse (void);
-#endif /* !YY_YY_Y_TAB_H_INCLUDED */ +#endif /* !YY_YY_FMD_PARSER_TAB_H_INCLUDED */
-/* Copy the second part of user declarations. */
-#line 182 "y.tab.c" /* yacc.c:358 */
#ifdef short # undef short @@ -199,13 +199,13 @@ #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else -typedef unsigned short int yytype_uint16; +typedef unsigned short yytype_uint16; #endif
#ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else -typedef short int yytype_int16; +typedef short yytype_int16; #endif
#ifndef YYSIZE_T @@ -217,7 +217,7 @@ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif
@@ -253,15 +253,6 @@ # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif
-#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -269,7 +260,7 @@ # define YYUSE(E) /* empty */ #endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ @@ -289,6 +280,8 @@ #endif
+#define YY_ASSERT(E) ((void) (0 && (E))) + #if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -420,42 +413,42 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 23 +#define YYLAST 24
/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 13 +#define YYNTOKENS 14 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 14 /* YYNRULES -- Number of rules. */ -#define YYNRULES 21 +#define YYNRULES 22 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 31 +#define YYNSTATES 32
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 262 +#define YYMAXUTOK 263
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ + as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 8, 9, 2, 2, 2, 2, 2, 2, 2, 2, + 9, 10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 10, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 11, 2, 12, 2, 2, 2, 2, + 2, 2, 2, 12, 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -469,16 +462,16 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7 + 5, 6, 7, 8 };
#if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 80, 80, 86, 100, 107, 108, 109, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 119, 123, 124, - 125, 136 + 0, 81, 81, 87, 101, 108, 109, 110, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 121, 125, + 126, 127, 138 }; #endif
@@ -488,8 +481,8 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "INTEGER", "OCTAL", "STRING", - "FLAG_CBFS", "FLAG_PRESERVE", "'('", "')'", "'@'", "'{'", "'}'", - "$accept", "flash_chip", "flash_region", "region_name", + "FLAG_CBFS", "FLAG_PRESERVE", "FLAG_ALIGNED", "'('", "')'", "'@'", "'{'", + "'}'", "$accept", "flash_chip", "flash_region", "region_name", "region_flags_opt", "region_flags", "region_flag", "region_offset_opt", "region_offset", "region_size_opt", "region_size", "region_list_opt", "region_list", "region_list_entries", YY_NULLPTR @@ -501,15 +494,15 @@ (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { - 0, 256, 257, 258, 259, 260, 261, 262, 40, 41, - 64, 123, 125 + 0, 256, 257, 258, 259, 260, 261, 262, 263, 40, + 41, 64, 123, 125 }; # endif
-#define YYPACT_NINF -12 +#define YYPACT_NINF -13
#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-12))) + (!!((Yystate) == (-13)))
#define YYTABLE_NINF -1
@@ -520,10 +513,10 @@ STATE-NUM. */ static const yytype_int8 yypact[] = { - -1, -12, 1, -2, -12, 2, 3, -12, -12, -12, - 0, -1, -12, -12, 4, -5, -4, -2, -12, -12, - -12, -12, 5, -4, 3, -12, -12, 0, -12, -12, - -12 + 0, -13, 1, -2, -13, 3, 4, -13, -13, -13, + -1, 0, -13, -13, 5, -5, -4, -2, -13, -13, + -13, -13, -13, 2, -4, 4, -13, -13, -1, -13, + -13, -13 };
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -531,24 +524,24 @@ means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 4, 0, 11, 1, 0, 0, 12, 13, 16, - 0, 0, 2, 20, 5, 0, 0, 11, 19, 21, - 9, 10, 0, 7, 14, 6, 8, 17, 15, 3, - 18 + 0, 4, 0, 12, 1, 0, 0, 13, 14, 17, + 0, 0, 2, 21, 5, 0, 0, 12, 20, 22, + 9, 10, 11, 0, 7, 15, 6, 8, 18, 16, + 3, 19 };
/* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -12, -12, -6, 10, -12, -10, -12, 6, -12, -12, - -9, -12, -11, -12 + -13, -13, 6, 10, -13, -11, -13, 7, -13, -13, + -10, -13, -12, -13 };
/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 2, 13, 14, 17, 22, 23, 6, 7, 27, - 10, 29, 12, 15 + -1, 2, 13, 14, 17, 23, 24, 6, 7, 28, + 10, 30, 12, 15 };
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -556,42 +549,42 @@ number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { - 1, 4, 20, 21, 1, 8, 9, 18, 5, 19, - 3, 11, 16, 26, 25, 28, 30, 0, 0, 0, - 0, 0, 0, 24 + 1, 4, 20, 21, 22, 1, 8, 9, 18, 5, + 3, 11, 26, 27, 16, 29, 31, 0, 0, 0, + 0, 19, 0, 0, 25 };
static const yytype_int8 yycheck[] = { - 5, 0, 6, 7, 5, 3, 3, 12, 10, 15, - 0, 11, 8, 23, 9, 24, 27, -1, -1, -1, - -1, -1, -1, 17 + 5, 0, 6, 7, 8, 5, 3, 3, 13, 11, + 0, 12, 10, 24, 9, 25, 28, -1, -1, -1, + -1, 15, -1, -1, 17 };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 5, 14, 16, 0, 10, 20, 21, 3, 3, - 23, 11, 25, 15, 16, 26, 8, 17, 12, 15, - 6, 7, 18, 19, 20, 9, 18, 22, 23, 24, - 25 + 0, 5, 15, 17, 0, 11, 21, 22, 3, 3, + 24, 12, 26, 16, 17, 27, 9, 18, 13, 16, + 6, 7, 8, 19, 20, 21, 10, 19, 23, 24, + 25, 26 };
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 13, 14, 15, 16, 17, 17, 18, 18, 19, - 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, - 26, 26 + 0, 14, 15, 16, 17, 18, 18, 19, 19, 20, + 20, 20, 21, 21, 22, 23, 23, 24, 25, 25, + 26, 27, 27 };
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 4, 5, 1, 0, 3, 1, 2, 1, - 1, 0, 1, 2, 0, 1, 1, 0, 1, 3, - 1, 2 + 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, + 3, 1, 2 };
@@ -607,22 +600,22 @@
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0)
/* Error token number */ #define YYTERROR 1 @@ -662,37 +655,37 @@ } while (0)
-/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/
static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - FILE *yyo = yyoutput; - YYUSE (yyo); + FILE *yyoutput = yyo; + YYUSE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); }
-/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/
static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - YYFPRINTF (yyoutput, "%s %s (", + YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); + yy_symbol_value_print (yyo, yytype, yyvaluep); + YYFPRINTF (yyo, ")"); }
/*------------------------------------------------------------------. @@ -726,7 +719,7 @@ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { - unsigned long int yylno = yyrline[yyrule]; + unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", @@ -737,7 +730,7 @@ YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) + &yyvsp[(yyi + 1) - (yynrhs)] ); YYFPRINTF (stderr, "\n"); } @@ -841,7 +834,10 @@ case '\': if (*++yyp != '\') goto do_not_strip_quotes; - /* Fall through. */ + else + goto append; + + append: default: if (yyres) yyres[yyn] = *yyp; @@ -859,7 +855,7 @@ if (! yyres) return yystrlen (yystr);
- return yystpcpy (yyres, yystr) - yyres; + return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif
@@ -937,10 +933,10 @@ yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } } } @@ -952,6 +948,7 @@ case N: \ yyformat = S; \ break + default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); @@ -963,9 +960,10 @@
{ YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; }
if (*yymsg_alloc < yysize) @@ -1091,23 +1089,33 @@ yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate;
+ /*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | +| yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ - yynewstate: +yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++;
- yysetstate: - *yyssp = yystate; + +/*--------------------------------------------------------------------. +| yynewstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + *yyssp = (yytype_int16) yystate;
if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + goto yyexhaustedlab; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
-#ifdef yyoverflow +# if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into @@ -1123,14 +1131,10 @@ &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); - yyss = yyss1; yyvs = yyvs1; } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; @@ -1146,35 +1150,33 @@ goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif -#endif /* no yyoverflow */
yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long) yystacksize));
if (yyss + yystacksize - 1 <= yyssp) YYABORT; } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
if (yystate == YYFINAL) YYACCEPT;
goto yybackup;
+ /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */
@@ -1232,7 +1234,6 @@ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate;
@@ -1247,7 +1248,7 @@
/*-----------------------------. -| yyreduce -- Do a reduction. | +| yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ @@ -1267,18 +1268,18 @@ YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 81 "fmd_parser.y" /* yacc.c:1646 */ + case 2: +#line 82 "fmd_parser.y" { union flashmap_flags flags = { .v=0 }; if (!(res = parse_descriptor((yyvsp[-3].strval), flags, (yyvsp[-2].maybe_intval), (yyvsp[-1].maybe_intval), (yyvsp[0].region_listhdr)))) YYABORT; } -#line 1278 "y.tab.c" /* yacc.c:1646 */ +#line 1279 "fmd_parser.tab.c" break;
case 3: -#line 88 "fmd_parser.y" /* yacc.c:1646 */ +#line 89 "fmd_parser.y" { struct flashmap_descriptor *node = parse_descriptor((yyvsp[-4].strval), (yyvsp[-3].flags), (yyvsp[-2].maybe_intval), (yyvsp[-1].maybe_intval), (yyvsp[0].region_listhdr)); if (!node) @@ -1291,91 +1292,97 @@
(yyval.region_ptr) = node; } -#line 1295 "y.tab.c" /* yacc.c:1646 */ +#line 1296 "fmd_parser.tab.c" break;
case 4: -#line 101 "fmd_parser.y" /* yacc.c:1646 */ +#line 102 "fmd_parser.y" { if (!(yyvsp[0].strval)) { perror("E: While allocating section name"); YYABORT; } } -#line 1306 "y.tab.c" /* yacc.c:1646 */ +#line 1307 "fmd_parser.tab.c" break;
case 5: -#line 107 "fmd_parser.y" /* yacc.c:1646 */ +#line 108 "fmd_parser.y" { (yyval.flags) = (union flashmap_flags){ .v=0 }; } -#line 1312 "y.tab.c" /* yacc.c:1646 */ +#line 1313 "fmd_parser.tab.c" break;
case 6: -#line 108 "fmd_parser.y" /* yacc.c:1646 */ +#line 109 "fmd_parser.y" { (yyval.flags) = (yyvsp[-1].flags); } -#line 1318 "y.tab.c" /* yacc.c:1646 */ +#line 1319 "fmd_parser.tab.c" break;
case 8: -#line 109 "fmd_parser.y" /* yacc.c:1646 */ +#line 110 "fmd_parser.y" { (yyval.flags).v = (yyvsp[-1].flags).v | (yyvsp[0].flags).v; } -#line 1324 "y.tab.c" /* yacc.c:1646 */ +#line 1325 "fmd_parser.tab.c" break;
case 9: -#line 110 "fmd_parser.y" /* yacc.c:1646 */ +#line 111 "fmd_parser.y" { (yyval.flags).v = 0; (yyval.flags).f.cbfs = 1; } -#line 1330 "y.tab.c" /* yacc.c:1646 */ +#line 1331 "fmd_parser.tab.c" break;
case 10: -#line 111 "fmd_parser.y" /* yacc.c:1646 */ +#line 112 "fmd_parser.y" { (yyval.flags).v = 0; (yyval.flags).f.preserve = 1; } -#line 1336 "y.tab.c" /* yacc.c:1646 */ +#line 1337 "fmd_parser.tab.c" break;
case 11: -#line 112 "fmd_parser.y" /* yacc.c:1646 */ - { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; } -#line 1342 "y.tab.c" /* yacc.c:1646 */ +#line 113 "fmd_parser.y" + { (yyval.flags).v = 0; (yyval.flags).f.aligned = 1; } +#line 1343 "fmd_parser.tab.c" break;
- case 13: -#line 114 "fmd_parser.y" /* yacc.c:1646 */ - { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; } -#line 1348 "y.tab.c" /* yacc.c:1646 */ + case 12: +#line 114 "fmd_parser.y" + { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; } +#line 1349 "fmd_parser.tab.c" break;
case 14: -#line 115 "fmd_parser.y" /* yacc.c:1646 */ - { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; } -#line 1354 "y.tab.c" /* yacc.c:1646 */ +#line 116 "fmd_parser.y" + { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; } +#line 1355 "fmd_parser.tab.c" break;
- case 16: -#line 117 "fmd_parser.y" /* yacc.c:1646 */ - { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; } -#line 1360 "y.tab.c" /* yacc.c:1646 */ + case 15: +#line 117 "fmd_parser.y" + { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; } +#line 1361 "fmd_parser.tab.c" break;
case 17: -#line 119 "fmd_parser.y" /* yacc.c:1646 */ +#line 119 "fmd_parser.y" + { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; } +#line 1367 "fmd_parser.tab.c" + break; + + case 18: +#line 121 "fmd_parser.y" { (yyval.region_listhdr) = (struct descriptor_list) {.len = 0, .head = NULL, .tail = NULL}; } -#line 1369 "y.tab.c" /* yacc.c:1646 */ - break; - - case 19: -#line 124 "fmd_parser.y" /* yacc.c:1646 */ - { (yyval.region_listhdr) = (yyvsp[-1].region_listhdr); } -#line 1375 "y.tab.c" /* yacc.c:1646 */ +#line 1376 "fmd_parser.tab.c" break;
case 20: -#line 126 "fmd_parser.y" /* yacc.c:1646 */ +#line 126 "fmd_parser.y" + { (yyval.region_listhdr) = (yyvsp[-1].region_listhdr); } +#line 1382 "fmd_parser.tab.c" + break; + + case 21: +#line 128 "fmd_parser.y" { struct descriptor_node *node = malloc(sizeof(*node)); if (!node) { @@ -1386,11 +1393,11 @@ node->next = NULL; (yyval.region_listhdr) = (struct descriptor_list){.len = 1, .head = node, .tail = node}; } -#line 1390 "y.tab.c" /* yacc.c:1646 */ +#line 1397 "fmd_parser.tab.c" break;
- case 21: -#line 137 "fmd_parser.y" /* yacc.c:1646 */ + case 22: +#line 139 "fmd_parser.y" { struct descriptor_node *node = malloc(sizeof(*node)); if (!node) { @@ -1404,11 +1411,12 @@ (yyval.region_listhdr) = (struct descriptor_list) {.len = (yyvsp[-1].region_listhdr).len + 1, .head = (yyvsp[-1].region_listhdr).head, .tail = node}; } -#line 1408 "y.tab.c" /* yacc.c:1646 */ +#line 1415 "fmd_parser.tab.c" break;
-#line 1412 "y.tab.c" /* yacc.c:1646 */ +#line 1419 "fmd_parser.tab.c" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1433,14 +1441,13 @@ /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + }
goto yynewstate;
@@ -1523,12 +1530,10 @@ | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR;
/* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -1590,6 +1595,7 @@ yyresult = 0; goto yyreturn;
+ /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ @@ -1597,6 +1603,7 @@ yyresult = 1; goto yyreturn;
+ #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | @@ -1607,6 +1614,10 @@ /* Fall through. */ #endif
+ +/*-----------------------------------------------------. +| yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { @@ -1636,7 +1647,7 @@ #endif return yyresult; } -#line 151 "fmd_parser.y" /* yacc.c:1906 */ +#line 153 "fmd_parser.y"
struct flashmap_descriptor *parse_descriptor( diff --git a/util/cbfstool/fmd_parser.h_shipped b/util/cbfstool/fmd_parser.h_shipped index 07c0259..afe77af 100644 --- a/util/cbfstool/fmd_parser.h_shipped +++ b/util/cbfstool/fmd_parser.h_shipped @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.4.1. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,8 +31,11 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */
-#ifndef YY_YY_Y_TAB_H_INCLUDED -# define YY_YY_Y_TAB_H_INCLUDED +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + +#ifndef YY_YY_FMD_PARSER_TAB_H_INCLUDED +# define YY_YY_FMD_PARSER_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -40,7 +44,7 @@ extern int yydebug; #endif /* "%code requires" blocks. */ -#line 34 "fmd_parser.y" /* yacc.c:1909 */ +#line 34 "fmd_parser.y"
#include "fmd.h" #include "option.h" @@ -65,7 +69,7 @@ struct unsigned_option size, struct descriptor_list children); void yyerror(const char *s);
-#line 69 "y.tab.h" /* yacc.c:1909 */ +#line 73 "fmd_parser.tab.h"
/* Token type. */ #ifndef YYTOKENTYPE @@ -76,22 +80,16 @@ OCTAL = 259, STRING = 260, FLAG_CBFS = 261, - FLAG_PRESERVE = 262 + FLAG_PRESERVE = 262, + FLAG_ALIGNED = 263 }; #endif -/* Tokens. */ -#define INTEGER 258 -#define OCTAL 259 -#define STRING 260 -#define FLAG_CBFS 261 -#define FLAG_PRESERVE 262
/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - union YYSTYPE { -#line 25 "fmd_parser.y" /* yacc.c:1909 */ +#line 25 "fmd_parser.y"
unsigned intval; char *strval; @@ -100,9 +98,9 @@ union flashmap_flags flags; struct descriptor_list region_listhdr;
-#line 104 "y.tab.h" /* yacc.c:1909 */ -}; +#line 102 "fmd_parser.tab.h"
+}; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -113,4 +111,4 @@
int yyparse (void);
-#endif /* !YY_YY_Y_TAB_H_INCLUDED */ +#endif /* !YY_YY_FMD_PARSER_TAB_H_INCLUDED */ diff --git a/util/cbfstool/fmd_parser.y b/util/cbfstool/fmd_parser.y index 3ba710c..2f59399 100644 --- a/util/cbfstool/fmd_parser.y +++ b/util/cbfstool/fmd_parser.y @@ -61,6 +61,7 @@ %token <strval> STRING %token FLAG_CBFS %token FLAG_PRESERVE +%token FLAG_ALIGNED
%type <region_ptr> flash_region %type <strval> region_name @@ -109,6 +110,7 @@ region_flags: region_flag | region_flag region_flags { $$.v = $1.v | $2.v; }; region_flag: FLAG_CBFS { $$.v = 0; $$.f.cbfs = 1; }; region_flag: FLAG_PRESERVE { $$.v = 0; $$.f.preserve = 1; }; +region_flag: FLAG_ALIGNED { $$.v = 0; $$.f.aligned = 1; }; region_offset_opt: { $$ = (struct unsigned_option){false, 0}; } | region_offset; region_offset: '@' INTEGER { $$ = (struct unsigned_option){true, $2}; }; diff --git a/util/cbfstool/fmd_scanner.c_shipped b/util/cbfstool/fmd_scanner.c_shipped index 71d541d..e0d6418 100644 --- a/util/cbfstool/fmd_scanner.c_shipped +++ b/util/cbfstool/fmd_scanner.c_shipped @@ -8,7 +8,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 1 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -83,10 +83,16 @@ #define UINT32_MAX (4294967295U) #endif
+#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */ + /* TODO: this is always defined, so inline it */ #define yyconst const
@@ -99,32 +105,26 @@ /* Returned upon end-of-file. */ #define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */ @@ -161,7 +161,7 @@ #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr)
@@ -178,7 +178,6 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE @@ -260,7 +259,6 @@ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -281,65 +279,59 @@ */ static int yy_did_buffer_switch_on_eof;
-void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void );
-static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * );
#define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR;
FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
extern int yylineno; - int yylineno = 1;
extern char *yytext; @@ -348,10 +340,10 @@ #endif #define yytext_ptr yytext
-static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yynoreturn yy_fatal_error (yyconst char* msg ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg );
/* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -362,9 +354,8 @@ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 13 -#define YY_END_OF_BUFFER 14 +#define YY_NUM_RULES 14 +#define YY_END_OF_BUFFER 15 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -372,15 +363,16 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[40] = +static const flex_int16_t yy_accept[47] = { 0, - 11, 11, 11, 11, 14, 11, 1, 1, 12, 3, - 12, 7, 8, 4, 11, 11, 11, 1, 0, 2, - 9, 7, 11, 8, 8, 11, 11, 9, 10, 11, - 11, 10, 5, 11, 11, 11, 11, 6, 0 + 12, 12, 12, 12, 15, 12, 1, 1, 13, 3, + 13, 8, 9, 4, 12, 12, 12, 12, 1, 0, + 2, 10, 8, 12, 9, 9, 12, 12, 12, 10, + 11, 12, 12, 12, 11, 12, 5, 12, 12, 12, + 12, 12, 7, 12, 6, 0 } ;
-static yyconst YY_CHAR yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, @@ -388,13 +380,13 @@ 1, 2, 1, 1, 4, 1, 1, 1, 1, 5, 6, 1, 1, 1, 1, 1, 1, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, - 1, 1, 1, 9, 10, 11, 12, 10, 13, 14, - 15, 1, 1, 1, 15, 1, 15, 1, 1, 16, - 1, 17, 18, 1, 1, 19, 1, 20, 1, 1, - 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, + 1, 1, 1, 9, 10, 11, 12, 13, 14, 15, + 16, 1, 17, 1, 18, 19, 18, 20, 1, 21, + 1, 22, 23, 1, 1, 24, 1, 25, 1, 1, + 1, 1, 1, 1, 1, 1, 26, 26, 26, 26,
- 10, 10, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 20, + 26, 26, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 1, 1, 9, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -412,54 +404,67 @@ 1, 1, 1, 1, 1 } ;
-static yyconst YY_CHAR yy_meta[21] = +static const YY_CHAR yy_meta[27] = { 0, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1 } ;
-static yyconst flex_uint16_t yy_base[43] = +static const flex_int16_t yy_base[50] = { 0, - 0, 8, 12, 13, 63, 0, 18, 20, 59, 64, - 64, 23, 19, 64, 50, 43, 0, 30, 56, 64, - 20, 0, 37, 0, 0, 44, 44, 0, 41, 28, - 24, 0, 0, 28, 22, 18, 23, 0, 64, 51, - 0, 53 + 0, 8, 12, 28, 57, 0, 17, 23, 53, 105, + 105, 43, 62, 105, 36, 43, 31, 0, 25, 49, + 105, 5, 0, 74, 0, 0, 31, 32, 32, 0, + 13, 29, 21, 20, 0, 22, 0, 27, 25, 15, + 23, 11, 0, 18, 0, 105, 100, 0, 102 } ;
-static yyconst flex_int16_t yy_def[43] = +static const flex_int16_t yy_def[50] = { 0, - 40, 40, 2, 2, 39, 41, 39, 39, 42, 39, - 39, 41, 41, 39, 41, 41, 41, 39, 42, 39, - 12, 41, 41, 13, 41, 41, 41, 41, 23, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 0, 39, - 39, 39 + 47, 47, 2, 2, 46, 48, 46, 46, 49, 46, + 46, 48, 48, 46, 48, 48, 48, 48, 46, 49, + 46, 12, 48, 48, 13, 48, 48, 48, 48, 48, + 24, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 0, 46, 46, 46 } ;
-static yyconst flex_uint16_t yy_nxt[85] = +static const flex_int16_t yy_nxt[132] = { 0, - 17, 7, 8, 9, 10, 11, 12, 13, 11, 7, - 8, 9, 10, 11, 12, 13, 11, 14, 14, 18, - 18, 18, 18, 15, 15, 24, 24, 16, 16, 21, - 21, 18, 18, 25, 28, 38, 37, 22, 36, 17, - 35, 34, 23, 29, 29, 33, 29, 29, 29, 29, - 29, 6, 6, 19, 19, 32, 31, 30, 20, 27, - 26, 20, 39, 5, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39 + 18, 7, 8, 9, 10, 11, 12, 13, 11, 7, + 8, 9, 10, 11, 12, 13, 11, 14, 19, 19, + 30, 15, 30, 16, 19, 19, 19, 19, 35, 18, + 35, 45, 17, 14, 44, 43, 42, 15, 41, 16, + 40, 39, 38, 37, 36, 34, 33, 32, 17, 22, + 22, 21, 29, 28, 27, 21, 46, 46, 23, 46, + 23, 46, 46, 46, 46, 46, 46, 24, 25, 25, + 46, 46, 46, 46, 46, 46, 46, 26, 46, 26, + 31, 31, 46, 31, 31, 31, 31, 31, 31, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 31, + + 6, 6, 20, 20, 5, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46 } ;
-static yyconst flex_int16_t yy_chk[85] = +static const flex_int16_t yy_chk[132] = { 0, - 41, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 3, 4, 7, - 7, 8, 8, 3, 4, 13, 13, 3, 4, 12, - 12, 18, 18, 13, 21, 37, 36, 12, 35, 21, - 34, 31, 12, 23, 23, 30, 23, 23, 23, 23, - 23, 40, 40, 42, 42, 29, 27, 26, 19, 16, - 15, 9, 5, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39 + 48, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 3, 7, 7, + 22, 3, 22, 3, 8, 8, 19, 19, 31, 22, + 31, 44, 3, 4, 42, 41, 40, 4, 39, 4, + 38, 36, 34, 33, 32, 29, 28, 27, 4, 12, + 12, 20, 17, 16, 15, 9, 5, 0, 12, 0, + 12, 0, 0, 0, 0, 0, 0, 12, 13, 13, + 0, 0, 0, 0, 0, 0, 0, 13, 0, 13, + 24, 24, 0, 24, 24, 24, 24, 24, 24, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, + + 47, 47, 49, 49, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46 } ;
static yy_state_type yy_last_accepting_state; @@ -499,8 +504,9 @@
int parse_integer(char *src, int base); int copy_string(const char *src); +#line 508 "<stdout>"
-#line 504 "<stdout>" +#line 510 "<stdout>"
#define INITIAL 0 #define FLAGS 1 @@ -517,36 +523,36 @@ #define YY_EXTRA_TYPE void * #endif
-static int yy_init_globals (void ); +static int yy_init_globals ( void );
/* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */
-int yylex_destroy (void ); +int yylex_destroy ( void );
-int yyget_debug (void ); +int yyget_debug ( void );
-void yyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag );
-YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void );
-void yyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined );
-FILE *yyget_in (void ); +FILE *yyget_in ( void );
-void yyset_in (FILE * _in_str ); +void yyset_in ( FILE * _in_str );
-FILE *yyget_out (void ); +FILE *yyget_out ( void );
-void yyset_out (FILE * _out_str ); +void yyset_out ( FILE * _out_str );
- int yyget_leng (void ); + int yyget_leng ( void );
-char *yyget_text (void ); +char *yyget_text ( void );
-int yyget_lineno (void ); +int yyget_lineno ( void );
-void yyset_lineno (int _line_number ); +void yyset_lineno ( int _line_number );
/* Macros after this point can all be overridden by user definitions in * section 1. @@ -554,32 +560,31 @@
#ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); #endif #endif
#ifndef YY_NO_UNPUT
- static void yyunput (int c,char *buf_ptr ); + static void yyunput ( int c, char *buf_ptr );
#endif
#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif
#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif
#ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif
#endif @@ -610,7 +615,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -623,7 +628,7 @@ else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -712,16 +717,16 @@ if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); }
- yy_load_buffer_state( ); + yy_load_buffer_state( ); }
{ #line 31 "fmd_scanner.l"
-#line 725 "<stdout>" +#line 730 "<stdout>"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -748,13 +753,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 40 ) - yy_c = yy_meta[(unsigned int) yy_c]; + if ( yy_current_state >= 47 ) + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 64 ); + while ( yy_base[yy_current_state] != 105 );
yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -813,38 +818,43 @@ return FLAG_PRESERVE; YY_BREAK case 7: -#line 39 "fmd_scanner.l" -case 8: YY_RULE_SETUP -#line 39 "fmd_scanner.l" -return parse_integer(yytext, 10); +#line 38 "fmd_scanner.l" +return FLAG_ALIGNED; YY_BREAK +case 8: +#line 40 "fmd_scanner.l" case 9: YY_RULE_SETUP #line 40 "fmd_scanner.l" -return OCTAL; +return parse_integer(yytext, 10); YY_BREAK case 10: YY_RULE_SETUP #line 41 "fmd_scanner.l" -return parse_integer(yytext + 2, 16); +return OCTAL; YY_BREAK case 11: YY_RULE_SETUP #line 42 "fmd_scanner.l" -return copy_string(yytext); +return parse_integer(yytext + 2, 16); YY_BREAK case 12: YY_RULE_SETUP #line 43 "fmd_scanner.l" -return *yytext; +return copy_string(yytext); YY_BREAK case 13: YY_RULE_SETUP -#line 45 "fmd_scanner.l" +#line 44 "fmd_scanner.l" +return *yytext; + YY_BREAK +case 14: +YY_RULE_SETUP +#line 46 "fmd_scanner.l" ECHO; YY_BREAK -#line 848 "<stdout>" +#line 858 "<stdout>" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(FLAGS): yyterminate(); @@ -923,7 +933,7 @@ { (yy_did_buffer_switch_on_eof) = 0;
- if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -1055,7 +1065,8 @@
b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ @@ -1087,7 +1098,7 @@ if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); }
else @@ -1104,9 +1115,12 @@ if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); }
(yy_n_chars) += number_to_move; @@ -1138,10 +1152,10 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 40 ) - yy_c = yy_meta[(unsigned int) yy_c]; + if ( yy_current_state >= 47 ) + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; }
return yy_current_state; @@ -1166,11 +1180,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 40 ) - yy_c = yy_meta[(unsigned int) yy_c]; + if ( yy_current_state >= 47 ) + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; - yy_is_jam = (yy_current_state == 39); + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 46);
return yy_is_jam ? 0 : yy_current_state; } @@ -1240,7 +1254,7 @@
else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) ) @@ -1257,13 +1271,13 @@ */
/* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) + if ( yywrap( ) ) return 0;
if ( ! (yy_did_buffer_switch_on_eof) ) @@ -1301,11 +1315,11 @@ if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); }
- yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); }
/** Switch to a different input buffer. @@ -1333,7 +1347,7 @@ }
YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( );
/* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -1361,22 +1375,22 @@ { YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = (yy_size_t)size; + b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- yy_init_buffer(b,file ); + yy_init_buffer( b, file );
return b; } @@ -1395,9 +1409,9 @@ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf );
- yyfree((void *) b ); + yyfree( (void *) b ); }
/* Initializes or reinitializes a buffer. @@ -1409,7 +1423,7 @@ { int oerrno = errno;
- yy_flush_buffer(b ); + yy_flush_buffer( b );
b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -1452,7 +1466,7 @@ b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); }
/** Pushes the new state onto the stack. The new state becomes @@ -1483,7 +1497,7 @@ YY_CURRENT_BUFFER_LVALUE = new_buffer;
/* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; }
@@ -1502,7 +1516,7 @@ --(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -1512,7 +1526,7 @@ */ static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
@@ -1569,11 +1583,11 @@ /* They forgot to leave room for the EOB's. */ return NULL;
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; @@ -1583,7 +1597,7 @@ b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW;
- yy_switch_to_buffer(b ); + yy_switch_to_buffer( b );
return b; } @@ -1596,10 +1610,10 @@ * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) {
- return yy_scan_bytes(yystr,(int) strlen(yystr) ); + return yy_scan_bytes( yystr, (int) strlen(yystr) ); }
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will @@ -1609,7 +1623,7 @@ * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; @@ -1618,7 +1632,7 @@
/* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc(n ); + buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
@@ -1627,7 +1641,7 @@
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
@@ -1643,9 +1657,9 @@ #define YY_EXIT_FAILURE 2 #endif
-static void yynoreturn yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); }
@@ -1673,7 +1687,7 @@ */ int yyget_lineno (void) { - + return yylineno; }
@@ -1780,7 +1794,7 @@
/* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } @@ -1801,7 +1815,7 @@ */
#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; @@ -1811,7 +1825,7 @@ #endif
#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) @@ -1846,8 +1860,7 @@
#define YYTABLES_NAME "yytables"
-#line 45 "fmd_scanner.l" - +#line 46 "fmd_scanner.l"
int parse_integer(char *src, int base) diff --git a/util/cbfstool/fmd_scanner.h_shipped b/util/cbfstool/fmd_scanner.h_shipped index 2a8b291..92d2c72 100644 --- a/util/cbfstool/fmd_scanner.h_shipped +++ b/util/cbfstool/fmd_scanner.h_shipped @@ -11,7 +11,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 1 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -86,10 +86,16 @@ #define UINT32_MAX (4294967295U) #endif
+#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */ + /* TODO: this is always defined, so inline it */ #define yyconst const
@@ -177,21 +183,21 @@ }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */
-void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void );
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
-void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * );
/* Begin user sect3 */
@@ -227,31 +233,31 @@ /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */
-int yylex_destroy (void ); +int yylex_destroy ( void );
-int yyget_debug (void ); +int yyget_debug ( void );
-void yyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag );
-YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void );
-void yyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined );
-FILE *yyget_in (void ); +FILE *yyget_in ( void );
-void yyset_in (FILE * _in_str ); +void yyset_in ( FILE * _in_str );
-FILE *yyget_out (void ); +FILE *yyget_out ( void );
-void yyset_out (FILE * _out_str ); +void yyset_out ( FILE * _out_str );
- int yyget_leng (void ); + int yyget_leng ( void );
-char *yyget_text (void ); +char *yyget_text ( void );
-int yyget_lineno (void ); +int yyget_lineno ( void );
-void yyset_lineno (int _line_number ); +void yyset_lineno ( int _line_number );
/* Macros after this point can all be overridden by user definitions in * section 1. @@ -259,18 +265,18 @@
#ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); #endif #endif
#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif
#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif
#ifndef YY_NO_INPUT @@ -317,9 +323,154 @@ #undef YY_DECL #endif
-#line 45 "fmd_scanner.l" +#ifndef yy_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef yy_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef yy_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef yy_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef yy_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef yy_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef yy_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef yy_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef yy_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef yypush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef yypop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef yyensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef yylex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef yyrestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef yylex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef yylex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef yylex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef yyget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef yyset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef yyget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef yyset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef yyget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef yyset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef yyget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef yyset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef yyget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef yyget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef yyget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef yyset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef yyget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef yyset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef yywrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef yyget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef yyset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef yyget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef yyset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef yyalloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef yyrealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef yyfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef yytext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef yyleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef yyin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef yyout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef yy_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef yylineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef yytables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef yytables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef yyTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 46 "fmd_scanner.l"
-#line 324 "fmd_scanner.h_shipped" +#line 475 "fmd_scanner.h_shipped" #undef yyIN_HEADER #endif /* yyHEADER_H */ diff --git a/util/cbfstool/fmd_scanner.l b/util/cbfstool/fmd_scanner.l index be9a5de..50adbf4 100644 --- a/util/cbfstool/fmd_scanner.l +++ b/util/cbfstool/fmd_scanner.l @@ -35,6 +35,7 @@ <FLAGS>) BEGIN(INITIAL); return *yytext; <FLAGS>CBFS return FLAG_CBFS; <FLAGS>PRESERVE return FLAG_PRESERVE; +<FLAGS>ALIGNED return FLAG_ALIGNED; 0{MULTIPLIER}? | [1-9][0-9]*{MULTIPLIER}? return parse_integer(yytext, 10); 0[0-9]+{MULTIPLIER}? return OCTAL;