diff options
Diffstat (limited to 'bitbake/lib/bb/parse/parse_c/bitbakescanner.l')
-rw-r--r-- | bitbake/lib/bb/parse/parse_c/bitbakescanner.l | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakescanner.l b/bitbake/lib/bb/parse/parse_c/bitbakescanner.l index f69a7325c3..b6592f28e9 100644 --- a/bitbake/lib/bb/parse/parse_c/bitbakescanner.l +++ b/bitbake/lib/bb/parse/parse_c/bitbakescanner.l | |||
@@ -91,7 +91,7 @@ int errorParse; | |||
91 | enum { | 91 | enum { |
92 | errorNone = 0, | 92 | errorNone = 0, |
93 | errorUnexpectedInput, | 93 | errorUnexpectedInput, |
94 | errorUnsupportedFeature, | 94 | errorUnsupportedFeature, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | } | 97 | } |
@@ -142,7 +142,7 @@ SSTRING \'([^\n\r]|"\\\n")*\' | |||
142 | VALUE ([^'" \t\n])|([^'" \t\n]([^\n]|(\\\n))*[^'" \t\n]) | 142 | VALUE ([^'" \t\n])|([^'" \t\n]([^\n]|(\\\n))*[^'" \t\n]) |
143 | 143 | ||
144 | C_SS [a-zA-Z_] | 144 | C_SS [a-zA-Z_] |
145 | C_SB [a-zA-Z0-9_+-.] | 145 | C_SB [a-zA-Z0-9_+-./] |
146 | REF $\{{C_SS}{C_SB}*\} | 146 | REF $\{{C_SS}{C_SB}*\} |
147 | SYMBOL {C_SS}{C_SB}* | 147 | SYMBOL {C_SS}{C_SB}* |
148 | VARIABLE $?{C_SS}({C_SB}*|{REF})*(\[[a-zA-Z0-9_]*\])? | 148 | VARIABLE $?{C_SS}({C_SB}*|{REF})*(\[[a-zA-Z0-9_]*\])? |
@@ -265,47 +265,49 @@ void lex_t::accept (int token, const char* sz) | |||
265 | 265 | ||
266 | void lex_t::input (char *buf, int *result, int max_size) | 266 | void lex_t::input (char *buf, int *result, int max_size) |
267 | { | 267 | { |
268 | printf("lex_t::input %p %d\n", buf, max_size); | 268 | /* printf("lex_t::input %p %d\n", buf, max_size); */ |
269 | *result = fread(buf, 1, max_size, file); | 269 | *result = fread(buf, 1, max_size, file); |
270 | printf("lex_t::input result %d\n", *result); | 270 | /* printf("lex_t::input result %d\n", *result); */ |
271 | } | 271 | } |
272 | 272 | ||
273 | int lex_t::line ()const | 273 | int lex_t::line ()const |
274 | { | 274 | { |
275 | printf("lex_t::line\n"); | 275 | /* printf("lex_t::line\n"); */ |
276 | return yyget_lineno (scanner); | 276 | return yyget_lineno (scanner); |
277 | } | 277 | } |
278 | 278 | ||
279 | 279 | ||
280 | extern "C" { | 280 | extern "C" { |
281 | 281 | ||
282 | void parse (FILE* file, PyObject* data) | 282 | void parse (FILE* file, char* name, PyObject* data, int config) |
283 | { | 283 | { |
284 | printf("parse bbparseAlloc\n"); | 284 | /* printf("parse bbparseAlloc\n"); */ |
285 | void* parser = bbparseAlloc (malloc); | 285 | void* parser = bbparseAlloc (malloc); |
286 | yyscan_t scanner; | 286 | yyscan_t scanner; |
287 | lex_t lex; | 287 | lex_t lex; |
288 | 288 | ||
289 | printf("parse yylex_init\n"); | 289 | /* printf("parse yylex_init\n"); */ |
290 | yylex_init (&scanner); | 290 | yylex_init (&scanner); |
291 | 291 | ||
292 | lex.parser = parser; | 292 | lex.parser = parser; |
293 | lex.scanner = scanner; | 293 | lex.scanner = scanner; |
294 | lex.file = file; | 294 | lex.file = file; |
295 | lex.name = name; | ||
295 | lex.data = data; | 296 | lex.data = data; |
297 | lex.config = config; | ||
296 | lex.parse = bbparse; | 298 | lex.parse = bbparse; |
297 | printf("parse yyset_extra\n"); | 299 | /*printf("parse yyset_extra\n"); */ |
298 | yyset_extra (&lex, scanner); | 300 | yyset_extra (&lex, scanner); |
299 | 301 | ||
300 | printf("parse yylex\n"); | 302 | /* printf("parse yylex\n"); */ |
301 | int result = yylex (scanner); | 303 | int result = yylex (scanner); |
302 | 304 | ||
303 | printf("parse result %d\n", result); | 305 | /* printf("parse result %d\n", result); */ |
304 | 306 | ||
305 | lex.accept (0); | 307 | lex.accept (0); |
306 | printf("parse lex.accept\n"); | 308 | /* printf("parse lex.accept\n"); */ |
307 | bbparseTrace (NULL, NULL); | 309 | bbparseTrace (NULL, NULL); |
308 | printf("parse bbparseTrace\n"); | 310 | /* printf("parse bbparseTrace\n"); */ |
309 | 311 | ||
310 | if (result != T_EOF) | 312 | if (result != T_EOF) |
311 | printf ("premature end of file\n"); | 313 | printf ("premature end of file\n"); |