summaryrefslogtreecommitdiff
path: root/adk/config/lex.zconf.c_shipped
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-12-21 00:26:41 -0600
committerWaldemar Brodkorb <wbx@openadk.org>2014-12-21 00:26:41 -0600
commitf82981b97110ac217ff7f0d7e5fd7d26036adfde (patch)
tree96963c6238cceed76c78e3c93cbcce78a6bd6bd4 /adk/config/lex.zconf.c_shipped
parent716ce66d95ede0e13cc182417a4d020ff5984407 (diff)
add patch to Kconfig
Add following patch https://lkml.org/lkml/2010/7/19/178 This allows to select for symbol as module and for special predefined values on int/string/hex symbols.
Diffstat (limited to 'adk/config/lex.zconf.c_shipped')
-rw-r--r--adk/config/lex.zconf.c_shipped137
1 files changed, 104 insertions, 33 deletions
diff --git a/adk/config/lex.zconf.c_shipped b/adk/config/lex.zconf.c_shipped
index dc3e81807..069e44b77 100644
--- a/adk/config/lex.zconf.c_shipped
+++ b/adk/config/lex.zconf.c_shipped
@@ -1,5 +1,6 @@
+#line 2 "lex.zconf.c"
-#line 3 "scripts/kconfig/lex.zconf.c"
+#line 4 "lex.zconf.c"
#define YY_INT_ALIGNED short int
@@ -160,7 +161,15 @@ 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.
@@ -764,8 +773,10 @@ int zconf_flex_debug = 0;
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *zconftext;
+#line 1 "zconf.l"
#define YY_NO_INPUT 1
+#line 6 "zconf.l"
/*
* Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
* Released under the terms of the GNU GPL v2.0.
@@ -777,7 +788,6 @@ char *zconftext;
#include <string.h>
#include <unistd.h>
-#define LKC_DIRECT_LINK
#include "lkc.h"
#define START_STRSIZE 16
@@ -791,8 +801,8 @@ static char *text;
static int text_size, text_asize;
struct buffer {
- struct buffer *parent;
- YY_BUFFER_STATE state;
+ struct buffer *parent;
+ YY_BUFFER_STATE state;
};
struct buffer *current_buf;
@@ -802,15 +812,15 @@ static int last_ts, first_ts;
static void zconf_endhelp(void);
static void zconf_endfile(void);
-void new_string(void)
+static void new_string(void)
{
- text = malloc(START_STRSIZE);
+ text = xmalloc(START_STRSIZE);
text_asize = START_STRSIZE;
text_size = 0;
*text = 0;
}
-void append_string(const char *str, int size)
+static void append_string(const char *str, int size)
{
int new_size = text_size + size + 1;
if (new_size > text_asize) {
@@ -824,12 +834,13 @@ void append_string(const char *str, int size)
text[text_size] = 0;
}
-void alloc_string(const char *str, int size)
+static void alloc_string(const char *str, int size)
{
- text = malloc(size + 1);
+ text = xmalloc(size + 1);
memcpy(text, str, size);
text[size] = 0;
}
+#line 844 "lex.zconf.c"
#define INITIAL 0
#define COMMAND 1
@@ -914,7 +925,12 @@ 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. */
@@ -922,7 +938,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO fwrite( zconftext, zconfleng, 1, zconfout )
+#define ECHO do { if (fwrite( zconftext, zconfleng, 1, zconfout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -999,9 +1015,13 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
+#line 73 "zconf.l"
+
int str = 0;
int ts, i;
+#line 1024 "lex.zconf.c"
+
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -1058,9 +1078,11 @@ do_action: /* This label is used only to access EOF actions. */
{ /* beginning of action switch */
case 1:
/* rule 1 can match eol */
+#line 78 "zconf.l"
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
+#line 78 "zconf.l"
{
current_file->lineno++;
return T_EOL;
@@ -1068,16 +1090,19 @@ YY_RULE_SETUP
YY_BREAK
case 3:
YY_RULE_SETUP
+#line 82 "zconf.l"
YY_BREAK
case 4:
YY_RULE_SETUP
+#line 85 "zconf.l"
{
BEGIN(COMMAND);
}
YY_BREAK
case 5:
YY_RULE_SETUP
+#line 89 "zconf.l"
{
unput(zconftext[0]);
BEGIN(COMMAND);
@@ -1086,8 +1111,9 @@ YY_RULE_SETUP
case 6:
YY_RULE_SETUP
+#line 96 "zconf.l"
{
- struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
+ const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
BEGIN(PARAM);
current_pos.file = current_file;
current_pos.lineno = current_file->lineno;
@@ -1102,11 +1128,13 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
+#line 109 "zconf.l"
YY_BREAK
case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
+#line 110 "zconf.l"
{
BEGIN(INITIAL);
current_file->lineno++;
@@ -1114,36 +1142,45 @@ YY_RULE_SETUP
}
YY_BREAK
+
case 9:
YY_RULE_SETUP
+#line 118 "zconf.l"
return T_AND;
YY_BREAK
case 10:
YY_RULE_SETUP
+#line 119 "zconf.l"
return T_OR;
YY_BREAK
case 11:
YY_RULE_SETUP
+#line 120 "zconf.l"
return T_OPEN_PAREN;
YY_BREAK
case 12:
YY_RULE_SETUP
+#line 121 "zconf.l"
return T_CLOSE_PAREN;
YY_BREAK
case 13:
YY_RULE_SETUP
+#line 122 "zconf.l"
return T_NOT;
YY_BREAK
case 14:
YY_RULE_SETUP
+#line 123 "zconf.l"
return T_EQUAL;
YY_BREAK
case 15:
YY_RULE_SETUP
+#line 124 "zconf.l"
return T_UNEQUAL;
YY_BREAK
case 16:
YY_RULE_SETUP
+#line 125 "zconf.l"
{
str = zconftext[0];
new_string();
@@ -1153,16 +1190,19 @@ YY_RULE_SETUP
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
+#line 130 "zconf.l"
BEGIN(INITIAL); current_file->lineno++; return T_EOL;
YY_BREAK
case 18:
YY_RULE_SETUP
+#line 131 "zconf.l"
/* ignore */
YY_BREAK
case 19:
YY_RULE_SETUP
+#line 132 "zconf.l"
{
- struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
+ const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
if (id && id->flags & TF_PARAM) {
zconflval.id = id;
return id->token;
@@ -1174,29 +1214,35 @@ YY_RULE_SETUP
YY_BREAK
case 20:
YY_RULE_SETUP
+#line 142 "zconf.l"
/* comment */
YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
+#line 143 "zconf.l"
current_file->lineno++;
YY_BREAK
case 22:
YY_RULE_SETUP
+#line 144 "zconf.l"
YY_BREAK
case YY_STATE_EOF(PARAM):
+#line 145 "zconf.l"
{
BEGIN(INITIAL);
}
YY_BREAK
+
case 23:
/* rule 23 can match eol */
*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up zconftext again */
YY_RULE_SETUP
+#line 151 "zconf.l"
{
append_string(zconftext, zconfleng);
zconflval.string = text;
@@ -1205,6 +1251,7 @@ YY_RULE_SETUP
YY_BREAK
case 24:
YY_RULE_SETUP
+#line 156 "zconf.l"
{
append_string(zconftext, zconfleng);
}
@@ -1215,6 +1262,7 @@ case 25:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up zconftext again */
YY_RULE_SETUP
+#line 159 "zconf.l"
{
append_string(zconftext + 1, zconfleng - 1);
zconflval.string = text;
@@ -1223,12 +1271,14 @@ YY_RULE_SETUP
YY_BREAK
case 26:
YY_RULE_SETUP
+#line 164 "zconf.l"
{
append_string(zconftext + 1, zconfleng - 1);
}
YY_BREAK
case 27:
YY_RULE_SETUP
+#line 167 "zconf.l"
{
if (str == zconftext[0]) {
BEGIN(PARAM);
@@ -1241,6 +1291,7 @@ YY_RULE_SETUP
case 28:
/* rule 28 can match eol */
YY_RULE_SETUP
+#line 175 "zconf.l"
{
printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
current_file->lineno++;
@@ -1249,13 +1300,16 @@ YY_RULE_SETUP
}
YY_BREAK
case YY_STATE_EOF(STRING):
+#line 181 "zconf.l"
{
BEGIN(INITIAL);
}
YY_BREAK
+
case 29:
YY_RULE_SETUP
+#line 187 "zconf.l"
{
ts = 0;
for (i = 0; i < zconfleng; i++) {
@@ -1285,6 +1339,7 @@ case 30:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up zconftext again */
YY_RULE_SETUP
+#line 209 "zconf.l"
{
current_file->lineno++;
zconf_endhelp();
@@ -1294,6 +1349,7 @@ YY_RULE_SETUP
case 31:
/* rule 31 can match eol */
YY_RULE_SETUP
+#line 214 "zconf.l"
{
current_file->lineno++;
append_string("\n", 1);
@@ -1301,6 +1357,7 @@ YY_RULE_SETUP
YY_BREAK
case 32:
YY_RULE_SETUP
+#line 218 "zconf.l"
{
while (zconfleng) {
if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t'))
@@ -1313,6 +1370,7 @@ YY_RULE_SETUP
}
YY_BREAK
case YY_STATE_EOF(HELP):
+#line 228 "zconf.l"
{
zconf_endhelp();
return T_HELPTEXT;
@@ -1321,6 +1379,7 @@ case YY_STATE_EOF(HELP):
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(COMMAND):
+#line 234 "zconf.l"
{
if (current_file) {
zconf_endfile();
@@ -1332,8 +1391,10 @@ case YY_STATE_EOF(COMMAND):
YY_BREAK
case 33:
YY_RULE_SETUP
+#line 243 "zconf.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
+#line 1398 "lex.zconf.c"
case YY_END_OF_BUFFER:
{
@@ -2060,8 +2121,8 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
* scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
@@ -2300,6 +2361,9 @@ void zconffree (void * ptr )
#define YYTABLES_NAME "yytables"
+#line 243 "zconf.l"
+
+
void zconf_starthelp(void)
{
new_string();
@@ -2313,6 +2377,7 @@ static void zconf_endhelp(void)
BEGIN(INITIAL);
}
+
/*
* Try to open specified file with following names:
* ./name
@@ -2345,42 +2410,50 @@ void zconf_initscan(const char *name)
exit(1);
}
- current_buf = malloc(sizeof(*current_buf));
+ current_buf = xmalloc(sizeof(*current_buf));
memset(current_buf, 0, sizeof(*current_buf));
current_file = file_lookup(name);
current_file->lineno = 1;
- current_file->flags = FILE_BUSY;
}
void zconf_nextfile(const char *name)
{
+ struct file *iter;
struct file *file = file_lookup(name);
- struct buffer *buf = malloc(sizeof(*buf));
+ struct buffer *buf = xmalloc(sizeof(*buf));
memset(buf, 0, sizeof(*buf));
current_buf->state = YY_CURRENT_BUFFER;
- zconfin = zconf_fopen(name);
+ zconfin = zconf_fopen(file->name);
if (!zconfin) {
- printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name);
+ printf("%s:%d: can't open file \"%s\"\n",
+ zconf_curname(), zconf_lineno(), file->name);
exit(1);
}
zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
buf->parent = current_buf;
current_buf = buf;
- if (file->flags & FILE_BUSY) {
- printf("%s:%d: do not source '%s' from itself\n",
- zconf_curname(), zconf_lineno(), name);
- exit(1);
- }
- if (file->flags & FILE_SCANNED) {
- printf("%s:%d: file '%s' is already sourced from '%s'\n",
- zconf_curname(), zconf_lineno(), name,
- file->parent->name);
- exit(1);
+ for (iter = current_file->parent; iter; iter = iter->parent ) {
+ if (!strcmp(current_file->name,iter->name) ) {
+ printf("%s:%d: recursive inclusion detected. "
+ "Inclusion path:\n current file : '%s'\n",
+ zconf_curname(), zconf_lineno(),
+ zconf_curname());
+ iter = current_file->parent;
+ while (iter && \
+ strcmp(iter->name,current_file->name)) {
+ printf(" included from: '%s:%d'\n",
+ iter->name, iter->lineno-1);
+ iter = iter->parent;
+ }
+ if (iter)
+ printf(" included from: '%s:%d'\n",
+ iter->name, iter->lineno+1);
+ exit(1);
+ }
}
- file->flags |= FILE_BUSY;
file->lineno = 1;
file->parent = current_file;
current_file = file;
@@ -2390,8 +2463,6 @@ static void zconf_endfile(void)
{
struct buffer *parent;
- current_file->flags |= FILE_SCANNED;
- current_file->flags &= ~FILE_BUSY;
current_file = current_file->parent;
parent = current_buf->parent;
@@ -2409,7 +2480,7 @@ int zconf_lineno(void)
return current_pos.lineno;
}
-char *zconf_curname(void)
+const char *zconf_curname(void)
{
return current_pos.file ? current_pos.file->name : "<none>";
}