Skip to content

Commit

Permalink
dtc: regen parser
Browse files Browse the repository at this point in the history
Cc: David Gibson <[email protected]>
Signed-off-by: Arnaud Lacombe <[email protected]>
  • Loading branch information
lacombar committed Jun 9, 2011
1 parent 95abef8 commit edfc86a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 161 deletions.
59 changes: 5 additions & 54 deletions scripts/dtc/dtc-lexer.lex.c_shipped
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#line 2 "dtc-lexer.lex.c"

#line 4 "dtc-lexer.lex.c"
#line 3 "scripts/dtc/dtc-lexer.lex.c_shipped"

#define YY_INT_ALIGNED short int

Expand Down Expand Up @@ -54,6 +53,7 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */

/* Limits of integral types. */
#ifndef INT8_MIN
Expand Down Expand Up @@ -84,8 +84,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif

#endif /* ! C99 */

#endif /* ! FLEXINT_H */

#ifdef __cplusplus
Expand Down Expand Up @@ -142,15 +140,7 @@ typedef unsigned int flex_uint32_t;

/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif

/* The state buf must be large enough to hold one state per character in the main buffer.
Expand Down Expand Up @@ -550,7 +540,6 @@ int yy_flex_debug = 0;
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "dtc-lexer.l"
/*
* (C) Copyright David Gibson <[email protected]>, IBM Corporation. 2005.
*
Expand All @@ -572,10 +561,6 @@ char *yytext;
*/
#define YY_NO_INPUT 1




#line 37 "dtc-lexer.l"
#include "dtc.h"
#include "srcpos.h"
#include "dtc-parser.tab.h"
Expand Down Expand Up @@ -603,7 +588,6 @@ static int dts_version = 1;

static void push_input_file(const char *filename);
static int pop_input_file(void);
#line 607 "dtc-lexer.lex.c"

#define INITIAL 0
#define INCLUDE 1
Expand Down Expand Up @@ -686,12 +670,7 @@ static int input (void );

/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif

/* Copy whatever the last rule matched to the standard output. */
Expand All @@ -710,7 +689,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
unsigned n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
Expand Down Expand Up @@ -792,10 +771,6 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;

#line 66 "dtc-lexer.l"

#line 798 "dtc-lexer.lex.c"

if ( !(yy_init) )
{
(yy_init) = 1;
Expand Down Expand Up @@ -876,7 +851,6 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
#line 67 "dtc-lexer.l"
{
char *name = strchr(yytext, '\"') + 1;
yytext[yyleng-1] = '\0';
Expand All @@ -888,7 +862,6 @@ case YY_STATE_EOF(INCLUDE):
case YY_STATE_EOF(BYTESTRING):
case YY_STATE_EOF(PROPNODENAME):
case YY_STATE_EOF(V1):
#line 73 "dtc-lexer.l"
{
if (!pop_input_file()) {
yyterminate();
Expand All @@ -898,7 +871,6 @@ case YY_STATE_EOF(V1):
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
#line 79 "dtc-lexer.l"
{
DPRINT("String: %s\n", yytext);
yylval.data = data_copy_escape_string(yytext+1,
Expand All @@ -908,7 +880,6 @@ YY_RULE_SETUP
YY_BREAK
case 3:
YY_RULE_SETUP
#line 86 "dtc-lexer.l"
{
DPRINT("Keyword: /dts-v1/\n");
dts_version = 1;
Expand All @@ -918,7 +889,6 @@ YY_RULE_SETUP
YY_BREAK
case 4:
YY_RULE_SETUP
#line 93 "dtc-lexer.l"
{
DPRINT("Keyword: /memreserve/\n");
BEGIN_DEFAULT();
Expand All @@ -927,7 +897,6 @@ YY_RULE_SETUP
YY_BREAK
case 5:
YY_RULE_SETUP
#line 99 "dtc-lexer.l"
{
DPRINT("Label: %s\n", yytext);
yylval.labelref = xstrdup(yytext);
Expand All @@ -937,7 +906,6 @@ YY_RULE_SETUP
YY_BREAK
case 6:
YY_RULE_SETUP
#line 106 "dtc-lexer.l"
{
yylval.literal = xstrdup(yytext);
DPRINT("Literal: '%s'\n", yylval.literal);
Expand All @@ -946,7 +914,6 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
#line 112 "dtc-lexer.l"
{ /* label reference */
DPRINT("Ref: %s\n", yytext+1);
yylval.labelref = xstrdup(yytext+1);
Expand All @@ -955,7 +922,6 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
#line 118 "dtc-lexer.l"
{ /* new-style path reference */
yytext[yyleng-1] = '\0';
DPRINT("Ref: %s\n", yytext+2);
Expand All @@ -965,7 +931,6 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
#line 125 "dtc-lexer.l"
{
yylval.byte = strtol(yytext, NULL, 16);
DPRINT("Byte: %02x\n", (int)yylval.byte);
Expand All @@ -974,7 +939,6 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
#line 131 "dtc-lexer.l"
{
DPRINT("/BYTESTRING\n");
BEGIN_DEFAULT();
Expand All @@ -983,7 +947,6 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
#line 137 "dtc-lexer.l"
{
DPRINT("PropNodeName: %s\n", yytext);
yylval.propnodename = xstrdup(yytext);
Expand All @@ -993,7 +956,6 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
#line 144 "dtc-lexer.l"
{
DPRINT("Binary Include\n");
return DT_INCBIN;
Expand All @@ -1002,24 +964,20 @@ YY_RULE_SETUP
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
#line 149 "dtc-lexer.l"
/* eat whitespace */
YY_BREAK
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
#line 150 "dtc-lexer.l"
/* eat C-style comments */
YY_BREAK
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
#line 151 "dtc-lexer.l"
/* eat C++-style comments */
YY_BREAK
case 16:
YY_RULE_SETUP
#line 153 "dtc-lexer.l"
{
DPRINT("Char: %c (\\x%02x)\n", yytext[0],
(unsigned)yytext[0]);
Expand All @@ -1037,10 +995,8 @@ YY_RULE_SETUP
YY_BREAK
case 17:
YY_RULE_SETUP
#line 168 "dtc-lexer.l"
ECHO;
YY_BREAK
#line 1044 "dtc-lexer.lex.c"

case YY_END_OF_BUFFER:
{
Expand Down Expand Up @@ -1756,8 +1712,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )

/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
Expand Down Expand Up @@ -1996,10 +1952,6 @@ void yyfree (void * ptr )

#define YYTABLES_NAME "yytables"

#line 168 "dtc-lexer.l"



static void push_input_file(const char *filename)
{
assert(filename);
Expand All @@ -2011,7 +1963,6 @@ static void push_input_file(const char *filename)
yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
}


static int pop_input_file(void)
{
if (srcfile_pop() == 0)
Expand Down
Loading

0 comments on commit edfc86a

Please sign in to comment.