diff options
| author | Richard Purdie <richard@openedhand.com> | 2006-11-16 15:02:15 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2006-11-16 15:02:15 +0000 |
| commit | 306b7c7a9757ead077363074e7bbac2e5c03e7c5 (patch) | |
| tree | 6935017a9af749c46816881c86258f514384ba1c /bitbake/lib/bb/parse | |
| parent | 65930a38e415ae4a0182e1cea1be838e0ada50ee (diff) | |
| download | poky-306b7c7a9757ead077363074e7bbac2e5c03e7c5.tar.gz | |
bitbake: Upgrade from 1.4 -> 1.7.4ish
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@863 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/parse')
| -rw-r--r-- | bitbake/lib/bb/parse/__init__.py | 11 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_c/BBHandler.py | 151 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_c/Makefile | 16 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_c/bitbakec.pyx | 205 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_c/bitbakeparser.cc | 144 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_c/bitbakescanner.cc | 218 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_c/bitbakescanner.l | 30 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_c/lexer.h | 8 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_c/lexerc.h | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 28 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 33 |
11 files changed, 510 insertions, 336 deletions
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index 58e17d154a..70fdba03b4 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py | |||
| @@ -37,11 +37,16 @@ class SkipPackage(Exception): | |||
| 37 | __mtime_cache = {} | 37 | __mtime_cache = {} |
| 38 | def cached_mtime(f): | 38 | def cached_mtime(f): |
| 39 | if not __mtime_cache.has_key(f): | 39 | if not __mtime_cache.has_key(f): |
| 40 | update_mtime(f) | 40 | __mtime_cache[f] = os.stat(f)[8] |
| 41 | return __mtime_cache[f] | 41 | return __mtime_cache[f] |
| 42 | 42 | ||
| 43 | def update_mtime(f): | 43 | def cached_mtime_noerror(f): |
| 44 | __mtime_cache[f] = os.stat(f)[8] | 44 | if not __mtime_cache.has_key(f): |
| 45 | try: | ||
| 46 | __mtime_cache[f] = os.stat(f)[8] | ||
| 47 | except OSError: | ||
| 48 | return 0 | ||
| 49 | return __mtime_cache[f] | ||
| 45 | 50 | ||
| 46 | def mark_dependency(d, f): | 51 | def mark_dependency(d, f): |
| 47 | if f.startswith('./'): | 52 | if f.startswith('./'): |
diff --git a/bitbake/lib/bb/parse/parse_c/BBHandler.py b/bitbake/lib/bb/parse/parse_c/BBHandler.py index d9f48db17b..b430e1f4e5 100644 --- a/bitbake/lib/bb/parse/parse_c/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_c/BBHandler.py | |||
| @@ -5,33 +5,33 @@ | |||
| 5 | Reads a .bb file and obtains its metadata (using a C++ parser) | 5 | Reads a .bb file and obtains its metadata (using a C++ parser) |
| 6 | 6 | ||
| 7 | Copyright (C) 2006 Tim Robert Ansell | 7 | Copyright (C) 2006 Tim Robert Ansell |
| 8 | Copyright (C) 2006 Holger Hans Peter Freyther | 8 | Copyright (C) 2006 Holger Hans Peter Freyther |
| 9 | 9 | ||
| 10 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
| 11 | the terms of the GNU General Public License as published by the Free Software | 11 | the terms of the GNU General Public License as published by the Free Software |
| 12 | Foundation; either version 2 of the License, or (at your option) any later | 12 | Foundation; either version 2 of the License, or (at your option) any later |
| 13 | version. | 13 | version. |
| 14 | 14 | ||
| 15 | Permission is hereby granted, free of charge, to any person obtaining a copy | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy |
| 16 | of this software and associated documentation files (the "Software"), to deal | 16 | of this software and associated documentation files (the "Software"), to deal |
| 17 | in the Software without restriction, including without limitation the rights | 17 | in the Software without restriction, including without limitation the rights |
| 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 19 | copies of the Software, and to permit persons to whom the Software is | 19 | copies of the Software, and to permit persons to whom the Software is |
| 20 | furnished to do so, subject to the following conditions: | 20 | furnished to do so, subject to the following conditions: |
| 21 | 21 | ||
| 22 | The above copyright notice and this permission notice shall be included in all | 22 | The above copyright notice and this permission notice shall be included in all |
| 23 | copies or substantial portions of the Software. | 23 | copies or substantial portions of the Software. |
| 24 | 24 | ||
| 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT | 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT |
| 28 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | 28 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 29 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | 29 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 30 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR | 30 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR |
| 31 | THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 31 | THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 32 | """ | 32 | """ |
| 33 | 33 | ||
| 34 | import os | 34 | import os, sys |
| 35 | 35 | ||
| 36 | # The Module we will use here | 36 | # The Module we will use here |
| 37 | import bb | 37 | import bb |
| @@ -61,51 +61,126 @@ def supports(fn, data): | |||
| 61 | return fn[-3:] == ".bb" or fn[-8:] == ".bbclass" or fn[-4:] == ".inc" or fn[-5:] == ".conf" | 61 | return fn[-3:] == ".bb" or fn[-8:] == ".bbclass" or fn[-4:] == ".inc" or fn[-5:] == ".conf" |
| 62 | 62 | ||
| 63 | def init(fn, data): | 63 | def init(fn, data): |
| 64 | if not data.getVar('TOPDIR'): | 64 | if not bb.data.getVar('TOPDIR', data): |
| 65 | bb.error('TOPDIR is not set') | 65 | bb.data.setVar('TOPDIR', os.getcwd(), data) |
| 66 | if not data.getVar('BBPATH'): | 66 | if not bb.data.getVar('BBPATH', data): |
| 67 | bb.error('BBPATH is not set') | 67 | bb.data.setVar('BBPATH', os.path.join(sys.prefix, 'share', 'bitbake'), data) |
| 68 | |||
| 69 | def handle_inherit(d): | ||
| 70 | """ | ||
| 71 | Handle inheriting of classes. This will load all default classes. | ||
| 72 | It could be faster, it could detect infinite loops but this is todo | ||
| 73 | Also this delayed loading of bb.parse could impose a penalty | ||
| 74 | """ | ||
| 75 | from bb.parse import handle | ||
| 76 | |||
| 77 | files = (data.getVar('INHERIT', d, True) or "").split() | ||
| 78 | if not "base" in i: | ||
| 79 | files[0:0] = ["base"] | ||
| 80 | |||
| 81 | __inherit_cache = data.getVar('__inherit_cache', d) or [] | ||
| 82 | for f in files: | ||
| 83 | file = data.expand(f, d) | ||
| 84 | if file[0] != "/" and file[-8:] != ".bbclass": | ||
| 85 | file = os.path.join('classes', '%s.bbclass' % file) | ||
| 86 | |||
| 87 | if not file in __inherit_cache: | ||
| 88 | debug(2, "BB %s:%d: inheriting %s" % (fn, lineno, file)) | ||
| 89 | __inherit_cache.append( file ) | ||
| 90 | |||
| 91 | try: | ||
| 92 | handle(file, d, True) | ||
| 93 | except IOError: | ||
| 94 | print "Failed to inherit %s" % file | ||
| 95 | data.setVar('__inherit_cache', __inherit_cache, d) | ||
| 68 | 96 | ||
| 69 | 97 | ||
| 70 | def handle(fn, d, include): | 98 | def handle(fn, d, include): |
| 71 | print "" | 99 | from bb import data, parse |
| 72 | print "fn: %s" % fn | 100 | |
| 73 | print "data: %s" % d | 101 | (root, ext) = os.path.splitext(os.path.basename(fn)) |
| 74 | print dir(d) | 102 | base_name = "%s%s" % (root,ext) |
| 75 | print d.getVar.__doc__ | 103 | |
| 76 | print "include: %s" % include | 104 | # initialize with some data |
| 105 | init(fn,d) | ||
| 77 | 106 | ||
| 78 | # check if we include or are the beginning | 107 | # check if we include or are the beginning |
| 108 | oldfile = None | ||
| 79 | if include: | 109 | if include: |
| 80 | oldfile = d.getVar('FILE') | 110 | oldfile = d.getVar('FILE', False) |
| 81 | else: | 111 | is_conf = False |
| 82 | #d.inheritFromOS() | 112 | elif ext == ".conf": |
| 83 | oldfile = None | 113 | is_conf = True |
| 114 | data.inheritFromOS(d) | ||
| 84 | 115 | ||
| 85 | # find the file | 116 | # find the file |
| 86 | if not os.path.isabs(fn): | 117 | if not os.path.isabs(fn): |
| 87 | bb.error("No Absolute FILE name") | 118 | abs_fn = bb.which(d.getVar('BBPATH', True), fn) |
| 88 | abs_fn = bb.which(d.getVar('BBPATH'), fn) | ||
| 89 | else: | 119 | else: |
| 90 | abs_fn = fn | 120 | abs_fn = fn |
| 91 | 121 | ||
| 92 | # check if the file exists | 122 | # check if the file exists |
| 93 | if not os.path.exists(abs_fn): | 123 | if not os.path.exists(abs_fn): |
| 94 | raise IOError("file '%(fn)' not found" % locals() ) | 124 | raise IOError("file '%(fn)s' not found" % locals() ) |
| 95 | 125 | ||
| 96 | # now we know the file is around mark it as dep | 126 | # now we know the file is around mark it as dep |
| 97 | if include: | 127 | if include: |
| 98 | parse.mark_dependency(d, abs_fn) | 128 | parse.mark_dependency(d, abs_fn) |
| 99 | 129 | ||
| 130 | # manipulate the bbpath | ||
| 131 | if ext != ".bbclass" and ext != ".conf": | ||
| 132 | old_bb_path = data.getVar('BBPATH', d) | ||
| 133 | data.setVar('BBPATH', os.path.dirname(abs_fn) + (":%s" %old_bb_path) , d) | ||
| 134 | |||
| 135 | # handle INHERITS and base inherit | ||
| 136 | if ext != ".bbclass" and ext != ".conf": | ||
| 137 | data.setVar('FILE', fn, d) | ||
| 138 | handle_interit(d) | ||
| 139 | |||
| 100 | # now parse this file - by defering it to C++ | 140 | # now parse this file - by defering it to C++ |
| 101 | parsefile(fn, d) | 141 | parsefile(abs_fn, d, is_conf) |
| 142 | |||
| 143 | # Finish it up | ||
| 144 | if include == 0: | ||
| 145 | data.expandKeys(d) | ||
| 146 | data.update_data(d) | ||
| 147 | #### !!! XXX Finish it up by executing the anonfunc | ||
| 148 | |||
| 102 | 149 | ||
| 103 | # restore the original FILE | 150 | # restore the original FILE |
| 104 | if oldfile: | 151 | if oldfile: |
| 105 | d.setVar('FILE', oldfile) | 152 | d.setVar('FILE', oldfile) |
| 106 | 153 | ||
| 154 | # restore bbpath | ||
| 155 | if ext != ".bbclass" and ext != ".conf": | ||
| 156 | data.setVar('BBPATH', old_bb_path, d ) | ||
| 157 | |||
| 158 | |||
| 107 | return d | 159 | return d |
| 108 | 160 | ||
| 161 | |||
| 162 | # Needed for BitBake files... | ||
| 163 | __pkgsplit_cache__={} | ||
| 164 | def vars_from_file(mypkg, d): | ||
| 165 | if not mypkg: | ||
| 166 | return (None, None, None) | ||
| 167 | if mypkg in __pkgsplit_cache__: | ||
| 168 | return __pkgsplit_cache__[mypkg] | ||
| 169 | |||
| 170 | myfile = os.path.splitext(os.path.basename(mypkg)) | ||
| 171 | parts = myfile[0].split('_') | ||
| 172 | __pkgsplit_cache__[mypkg] = parts | ||
| 173 | exp = 3 - len(parts) | ||
| 174 | tmplist = [] | ||
| 175 | while exp != 0: | ||
| 176 | exp -= 1 | ||
| 177 | tmplist.append(None) | ||
| 178 | parts.extend(tmplist) | ||
| 179 | return parts | ||
| 180 | |||
| 181 | |||
| 182 | |||
| 183 | |||
| 109 | # Inform bitbake that we are a parser | 184 | # Inform bitbake that we are a parser |
| 110 | # We need to define all three | 185 | # We need to define all three |
| 111 | from bb.parse import handlers | 186 | from bb.parse import handlers |
diff --git a/bitbake/lib/bb/parse/parse_c/Makefile b/bitbake/lib/bb/parse/parse_c/Makefile index 9eb7ce9d08..77daccb72d 100644 --- a/bitbake/lib/bb/parse/parse_c/Makefile +++ b/bitbake/lib/bb/parse/parse_c/Makefile | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | ||
| 2 | test: bitbakec.so | 2 | buil: bitbakec.so |
| 3 | python test.py | 3 | echo "Done" |
| 4 | 4 | ||
| 5 | bitbakescanner.cc: bitbakescanner.l | 5 | bitbakescanner.cc: bitbakescanner.l |
| 6 | flex -t bitbakescanner.l > bitbakescanner.cc | 6 | flex -t bitbakescanner.l > bitbakescanner.cc |
| @@ -28,9 +28,9 @@ bitbakec.so: bitbakec.o bitbakeparser.o bitbakescanner.o | |||
| 28 | g++ -shared -fPIC bitbakeparser.o bitbakescanner.o bitbakec.o -o bitbakec.so | 28 | g++ -shared -fPIC bitbakeparser.o bitbakescanner.o bitbakec.o -o bitbakec.so |
| 29 | 29 | ||
| 30 | clean: | 30 | clean: |
| 31 | rm *.out | 31 | rm -f *.out |
| 32 | rm *.cc | 32 | rm -f *.cc |
| 33 | rm bitbakec.c | 33 | rm -f bitbakec.c |
| 34 | rm bitbakec-processed.c | 34 | rm -f bitbakec-processed.c |
| 35 | rm *.o | 35 | rm -f *.o |
| 36 | rm *.so | 36 | rm -f *.so |
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakec.pyx b/bitbake/lib/bb/parse/parse_c/bitbakec.pyx index 362cc2021e..c666e9b6b1 100644 --- a/bitbake/lib/bb/parse/parse_c/bitbakec.pyx +++ b/bitbake/lib/bb/parse/parse_c/bitbakec.pyx | |||
| @@ -6,96 +6,107 @@ cdef extern from "stdio.h": | |||
| 6 | FILE *fopen(char*, char*) | 6 | FILE *fopen(char*, char*) |
| 7 | int fclose(FILE *fp) | 7 | int fclose(FILE *fp) |
| 8 | 8 | ||
| 9 | cdef extern from "string.h": | ||
| 10 | int strlen(char*) | ||
| 9 | 11 | ||
| 10 | cdef extern from "lexerc.h": | 12 | cdef extern from "lexerc.h": |
| 11 | ctypedef struct lex_t: | 13 | ctypedef struct lex_t: |
| 12 | void* parser | 14 | void* parser |
| 13 | void* scanner | 15 | void* scanner |
| 16 | char* name | ||
| 14 | FILE* file | 17 | FILE* file |
| 18 | int config | ||
| 15 | void* data | 19 | void* data |
| 16 | 20 | ||
| 17 | int lineError | 21 | int lineError |
| 18 | int errorParse | 22 | int errorParse |
| 19 | 23 | ||
| 20 | cdef extern void parse(FILE*, object) | 24 | cdef extern int parse(FILE*, char*, object, int) |
| 21 | 25 | ||
| 22 | def parsefile(object file, object data): | 26 | def parsefile(object file, object data, object config): |
| 23 | print "parsefile: 1", file, data | 27 | #print "parsefile: 1", file, data |
| 24 | 28 | ||
| 25 | # Open the file | 29 | # Open the file |
| 26 | cdef FILE* f | 30 | cdef FILE* f |
| 27 | 31 | ||
| 28 | f = fopen(file, "r") | 32 | f = fopen(file, "r") |
| 29 | print "parsefile: 2 opening file" | 33 | #print "parsefile: 2 opening file" |
| 30 | if (f == NULL): | 34 | if (f == NULL): |
| 31 | raise IOError("No such file %s." % file) | 35 | raise IOError("No such file %s." % file) |
| 32 | 36 | ||
| 33 | print "parsefile: 3 parse" | 37 | #print "parsefile: 3 parse" |
| 34 | parse(f, data) | 38 | parse(f, file, data, config) |
| 35 | 39 | ||
| 36 | # Close the file | 40 | # Close the file |
| 37 | print "parsefile: 4 closing" | ||
| 38 | fclose(f) | 41 | fclose(f) |
| 39 | 42 | ||
| 40 | 43 | ||
| 41 | cdef public void e_assign(lex_t* container, char* key, char* what): | 44 | cdef public void e_assign(lex_t* container, char* key, char* what): |
| 42 | print "e_assign", key, what | 45 | #print "e_assign", key, what |
| 46 | if what == NULL: | ||
| 47 | print "FUTURE Warning empty string: use \"\"" | ||
| 48 | what = "" | ||
| 49 | |||
| 43 | d = <object>container.data | 50 | d = <object>container.data |
| 44 | d.setVar(key, what) | 51 | d.setVar(key, what) |
| 45 | 52 | ||
| 46 | cdef public void e_export(lex_t* c, char* what): | 53 | cdef public void e_export(lex_t* c, char* what): |
| 47 | print "e_export", what | 54 | #print "e_export", what |
| 48 | #exp: | 55 | #exp: |
| 49 | # bb.data.setVarFlag(key, "export", 1, data) | 56 | # bb.data.setVarFlag(key, "export", 1, data) |
| 50 | d = <object>container.data | 57 | d = <object>c.data |
| 51 | d.setVarFlag(key, "export", 1) | 58 | d.setVarFlag(what, "export", 1) |
| 52 | 59 | ||
| 53 | cdef public void e_immediate(lex_t* c, char* key, char* what): | 60 | cdef public void e_immediate(lex_t* c, char* key, char* what): |
| 54 | print "e_immediate", key, what | 61 | #print "e_immediate", key, what |
| 55 | #colon: | 62 | #colon: |
| 56 | # val = bb.data.expand(groupd["value"], data) | 63 | # val = bb.data.expand(groupd["value"], data) |
| 57 | d = <object>c.data | 64 | d = <object>c.data |
| 58 | d.setVar(key, d.expand(what)) | 65 | d.setVar(key, d.expand(what,d)) |
| 59 | 66 | ||
| 60 | cdef public void e_cond(lex_t* c, char* key, char* what): | 67 | cdef public void e_cond(lex_t* c, char* key, char* what): |
| 61 | print "e_cond", key, what | 68 | #print "e_cond", key, what |
| 62 | #ques: | 69 | #ques: |
| 63 | # val = bb.data.getVar(key, data) | 70 | # val = bb.data.getVar(key, data) |
| 64 | # if val == None: | 71 | # if val == None: |
| 65 | # val = groupd["value"] | 72 | # val = groupd["value"] |
| 73 | if what == NULL: | ||
| 74 | print "FUTURE warning: Use \"\" for", key | ||
| 75 | what = "" | ||
| 76 | |||
| 66 | d = <object>c.data | 77 | d = <object>c.data |
| 67 | d.setVar(key, (d.getVar(key) or what)) | 78 | d.setVar(key, (d.getVar(key,False) or what)) |
| 68 | 79 | ||
| 69 | cdef public void e_prepend(lex_t* c, char* key, char* what): | 80 | cdef public void e_prepend(lex_t* c, char* key, char* what): |
| 70 | print "e_prepend", key, what | 81 | #print "e_prepend", key, what |
| 71 | #prepend: | 82 | #prepend: |
| 72 | # val = "%s %s" % (groupd["value"], (bb.data.getVar(key, data) or "")) | 83 | # val = "%s %s" % (groupd["value"], (bb.data.getVar(key, data) or "")) |
| 73 | d = <object>c.data | 84 | d = <object>c.data |
| 74 | d.setVar(key, what + " " + (d.getVar(key) or "")) | 85 | d.setVar(key, what + " " + (d.getVar(key,0) or "")) |
| 75 | 86 | ||
| 76 | cdef public void e_append(lex_t* c, char* key, char* what): | 87 | cdef public void e_append(lex_t* c, char* key, char* what): |
| 77 | print "e_append", key, what | 88 | #print "e_append", key, what |
| 78 | #append: | 89 | #append: |
| 79 | # val = "%s %s" % ((bb.data.getVar(key, data) or ""), groupd["value"]) | 90 | # val = "%s %s" % ((bb.data.getVar(key, data) or ""), groupd["value"]) |
| 80 | d = <object>c.data | 91 | d = <object>c.data |
| 81 | d.setVar(key, (d.getVar(key) or "") + " " + what) | 92 | d.setVar(key, (d.getVar(key,0) or "") + " " + what) |
| 82 | 93 | ||
| 83 | cdef public void e_precat(lex_t* c, char* key, char* what): | 94 | cdef public void e_precat(lex_t* c, char* key, char* what): |
| 84 | print "e_precat", key, what | 95 | #print "e_precat", key, what |
| 85 | #predot: | 96 | #predot: |
| 86 | # val = "%s%s" % (groupd["value"], (bb.data.getVar(key, data) or "")) | 97 | # val = "%s%s" % (groupd["value"], (bb.data.getVar(key, data) or "")) |
| 87 | d = <object>c.data | 98 | d = <object>c.data |
| 88 | d.setVar(key, what + (d.getVar(key) or "")) | 99 | d.setVar(key, what + (d.getVar(key,0) or "")) |
| 89 | 100 | ||
| 90 | cdef public void e_postcat(lex_t* c, char* key, char* what): | 101 | cdef public void e_postcat(lex_t* c, char* key, char* what): |
| 91 | print "e_postcat", key, what | 102 | #print "e_postcat", key, what |
| 92 | #postdot: | 103 | #postdot: |
| 93 | # val = "%s%s" % ((bb.data.getVar(key, data) or ""), groupd["value"]) | 104 | # val = "%s%s" % ((bb.data.getVar(key, data) or ""), groupd["value"]) |
| 94 | d = <object>c.data | 105 | d = <object>c.data |
| 95 | d.setVar(key, (d.getVar(key) or "") + what) | 106 | d.setVar(key, (d.getVar(key,0) or "") + what) |
| 96 | 107 | ||
| 97 | cdef public void e_addtask(lex_t* c, char* name, char* before, char* after): | 108 | cdef public int e_addtask(lex_t* c, char* name, char* before, char* after) except -1: |
| 98 | print "e_addtask", name, before, after | 109 | #print "e_addtask", name |
| 99 | # func = m.group("func") | 110 | # func = m.group("func") |
| 100 | # before = m.group("before") | 111 | # before = m.group("before") |
| 101 | # after = m.group("after") | 112 | # after = m.group("after") |
| @@ -112,69 +123,131 @@ cdef public void e_addtask(lex_t* c, char* name, char* before, char* after): | |||
| 112 | # # set up things that depend on this func | 123 | # # set up things that depend on this func |
| 113 | # data.setVarFlag(var, "postdeps", before.split(), d) | 124 | # data.setVarFlag(var, "postdeps", before.split(), d) |
| 114 | # return | 125 | # return |
| 115 | 126 | ||
| 116 | do = "do_%s" % name | 127 | if c.config == 1: |
| 128 | from bb.parse import ParseError | ||
| 129 | raise ParseError("No tasks allowed in config files") | ||
| 130 | return -1 | ||
| 131 | |||
| 117 | d = <object>c.data | 132 | d = <object>c.data |
| 133 | do = "do_%s" % name | ||
| 118 | d.setVarFlag(do, "task", 1) | 134 | d.setVarFlag(do, "task", 1) |
| 119 | 135 | ||
| 120 | if strlen(before) > 0: | 136 | if before != NULL and strlen(before) > 0: |
| 137 | #print "Before", before | ||
| 138 | d.setVarFlag(do, "postdeps", ("%s" % before).split()) | ||
| 139 | if after != NULL and strlen(after) > 0: | ||
| 140 | #print "After", after | ||
| 121 | d.setVarFlag(do, "deps", ("%s" % after).split()) | 141 | d.setVarFlag(do, "deps", ("%s" % after).split()) |
| 122 | if strlen(after) > 0: | ||
| 123 | d.setVarFlag(do, "deps", ("%s" % before).split()) | ||
| 124 | 142 | ||
| 143 | return 0 | ||
| 125 | 144 | ||
| 126 | cdef public void e_addhandler(lex_t* c, char* h): | 145 | cdef public int e_addhandler(lex_t* c, char* h) except -1: |
| 127 | print "e_addhandler", h | 146 | #print "e_addhandler", h |
| 128 | # data.setVarFlag(h, "handler", 1, d) | 147 | # data.setVarFlag(h, "handler", 1, d) |
| 148 | if c.config == 1: | ||
| 149 | from bb.parse import ParseError | ||
| 150 | raise ParseError("No handlers allowed in config files") | ||
| 151 | return -1 | ||
| 152 | |||
| 129 | d = <object>c.data | 153 | d = <object>c.data |
| 130 | d.setVarFlag(h, "handler", 1) | 154 | d.setVarFlag(h, "handler", 1) |
| 155 | return 0 | ||
| 156 | |||
| 157 | cdef public int e_export_func(lex_t* c, char* function) except -1: | ||
| 158 | #print "e_export_func", function | ||
| 159 | if c.config == 1: | ||
| 160 | from bb.parse import ParseError | ||
| 161 | raise ParseError("No functions allowed in config files") | ||
| 162 | return -1 | ||
| 163 | |||
| 164 | return 0 | ||
| 165 | |||
| 166 | cdef public int e_inherit(lex_t* c, char* file) except -1: | ||
| 167 | #print "e_inherit", file | ||
| 131 | 168 | ||
| 132 | cdef public void e_export_func(lex_t* c, char* function): | 169 | if c.config == 1: |
| 133 | print "e_export_func", function | 170 | from bb.parse import ParseError |
| 134 | pass | 171 | raise ParseError("No inherits allowed in config files") |
| 172 | return -1 | ||
| 135 | 173 | ||
| 136 | cdef public void e_inherit(lex_t* c, char* file): | 174 | return 0 |
| 137 | print "e_inherit", file | ||
| 138 | pass | ||
| 139 | 175 | ||
| 140 | cdef public void e_include(lex_t* c, char* file): | 176 | cdef public void e_include(lex_t* c, char* file): |
| 141 | print "e_include", file | 177 | from bb.parse import handle |
| 142 | d = <object>c.data | 178 | d = <object>c.data |
| 143 | d.expand(file) | 179 | |
| 144 | |||
| 145 | try: | 180 | try: |
| 146 | parsefile(file, d) | 181 | handle(d.expand(file,d), d, True) |
| 147 | except IOError: | 182 | except IOError: |
| 148 | print "Could not include required file %s" % file | 183 | print "Could not include file", file |
| 149 | 184 | ||
| 150 | 185 | ||
| 151 | cdef public void e_require(lex_t* c, char* file): | 186 | cdef public int e_require(lex_t* c, char* file) except -1: |
| 152 | print "e_require", file | 187 | #print "e_require", file |
| 188 | from bb.parse import handle | ||
| 153 | d = <object>c.data | 189 | d = <object>c.data |
| 154 | d.expand(file) | 190 | |
| 155 | |||
| 156 | try: | 191 | try: |
| 157 | parsefile(file, d) | 192 | handle(d.expand(file,d), d, True) |
| 158 | except IOError: | 193 | except IOError: |
| 159 | raise CParseError("Could not include required file %s" % file) | 194 | print "ParseError", file |
| 195 | from bb.parse import ParseError | ||
| 196 | raise ParseError("Could not include required file %s" % file) | ||
| 197 | return -1 | ||
| 198 | |||
| 199 | return 0 | ||
| 200 | |||
| 201 | cdef public int e_proc(lex_t* c, char* key, char* what) except -1: | ||
| 202 | #print "e_proc", key, what | ||
| 203 | if c.config == 1: | ||
| 204 | from bb.parse import ParseError | ||
| 205 | raise ParseError("No inherits allowed in config files") | ||
| 206 | return -1 | ||
| 207 | |||
| 208 | return 0 | ||
| 209 | |||
| 210 | cdef public int e_proc_python(lex_t* c, char* key, char* what) except -1: | ||
| 211 | #print "e_proc_python" | ||
| 212 | if c.config == 1: | ||
| 213 | from bb.parse import ParseError | ||
| 214 | raise ParseError("No pythin allowed in config files") | ||
| 215 | return -1 | ||
| 216 | |||
| 217 | if key != NULL: | ||
| 218 | pass | ||
| 219 | #print "Key", key | ||
| 220 | if what != NULL: | ||
| 221 | pass | ||
| 222 | #print "What", what | ||
| 223 | |||
| 224 | return 0 | ||
| 225 | |||
| 226 | cdef public int e_proc_fakeroot(lex_t* c, char* key, char* what) except -1: | ||
| 227 | #print "e_fakeroot", key, what | ||
| 228 | |||
| 229 | if c.config == 1: | ||
| 230 | from bb.parse import ParseError | ||
| 231 | raise ParseError("No fakeroot allowed in config files") | ||
| 232 | return -1 | ||
| 233 | |||
| 234 | return 0 | ||
| 235 | |||
| 236 | cdef public int e_def(lex_t* c, char* a, char* b, char* d) except -1: | ||
| 237 | #print "e_def", a, b, d | ||
| 160 | 238 | ||
| 161 | cdef public void e_proc(lex_t* c, char* key, char* what): | 239 | if c.config == 1: |
| 162 | print "e_proc", key, what | 240 | from bb.parse import ParseError |
| 163 | pass | 241 | raise ParseError("No defs allowed in config files") |
| 242 | return -1 | ||
| 164 | 243 | ||
| 165 | cdef public void e_proc_python(lex_t* c, char* key, char* what): | 244 | return 0 |
| 166 | print "e_proc_python", key, what | ||
| 167 | pass | ||
| 168 | 245 | ||
| 169 | cdef public void e_proc_fakeroot(lex_t* c, char* key, char* what): | 246 | cdef public int e_parse_error(lex_t* c) except -1: |
| 170 | print "e_fakeroot", key, what | 247 | print "e_parse_error", c.name, "line:", lineError, "parse:", errorParse |
| 171 | pass | ||
| 172 | 248 | ||
| 173 | cdef public void e_def(lex_t* c, char* a, char* b, char* d): | ||
| 174 | print "e_def", key, what | ||
| 175 | pass | ||
| 176 | 249 | ||
| 177 | cdef public void e_parse_error(lex_t* c): | 250 | from bb.parse import ParseError |
| 178 | print "e_parse_error", "line:", lineError, "parse:", errorParse | 251 | raise ParseError("There was an parse error, sorry unable to give more information at the current time. File: %s Line: %d" % (c.name,lineError) ) |
| 179 | raise CParseError("There was an parse error, sorry unable to give more information at the current time.") | 252 | return -1 |
| 180 | 253 | ||
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakeparser.cc b/bitbake/lib/bb/parse/parse_c/bitbakeparser.cc index ee9a901b70..9d9793f8df 100644 --- a/bitbake/lib/bb/parse/parse_c/bitbakeparser.cc +++ b/bitbake/lib/bb/parse/parse_c/bitbakeparser.cc | |||
| @@ -128,51 +128,49 @@ typedef union { | |||
| 128 | */ | 128 | */ |
| 129 | static const YYACTIONTYPE yy_action[] = { | 129 | static const YYACTIONTYPE yy_action[] = { |
| 130 | /* 0 */ 82, 3, 7, 8, 38, 22, 39, 24, 26, 32, | 130 | /* 0 */ 82, 3, 7, 8, 38, 22, 39, 24, 26, 32, |
| 131 | /* 10 */ 34, 28, 30, 128, 1, 40, 53, 70, 55, 5, | 131 | /* 10 */ 34, 28, 30, 2, 21, 40, 53, 70, 55, 44, |
| 132 | /* 20 */ 60, 65, 67, 2, 21, 36, 69, 77, 9, 7, | 132 | /* 20 */ 60, 65, 67, 128, 1, 36, 69, 77, 42, 46, |
| 133 | /* 30 */ 11, 6, 13, 15, 17, 19, 12, 52, 50, 4, | 133 | /* 30 */ 11, 66, 13, 15, 17, 19, 64, 62, 9, 7, |
| 134 | /* 40 */ 74, 42, 46, 59, 57, 10, 64, 62, 38, 14, | 134 | /* 40 */ 74, 38, 45, 81, 59, 57, 38, 38, 73, 76, |
| 135 | /* 50 */ 73, 16, 38, 38, 76, 81, 18, 20, 23, 25, | 135 | /* 50 */ 5, 68, 52, 50, 14, 31, 47, 71, 48, 10, |
| 136 | /* 60 */ 27, 29, 31, 33, 35, 37, 56, 51, 90, 54, | 136 | /* 60 */ 72, 33, 23, 49, 6, 41, 51, 78, 75, 16, |
| 137 | /* 70 */ 58, 71, 41, 43, 63, 45, 44, 47, 72, 48, | 137 | /* 70 */ 4, 54, 35, 25, 18, 80, 79, 56, 27, 37, |
| 138 | /* 80 */ 75, 78, 80, 61, 90, 49, 66, 90, 90, 68, | 138 | /* 80 */ 58, 12, 61, 29, 43, 63, 20, |
| 139 | /* 90 */ 90, 90, 90, 90, 90, 79, | ||
| 140 | }; | 139 | }; |
| 141 | static const YYCODETYPE yy_lookahead[] = { | 140 | static const YYCODETYPE yy_lookahead[] = { |
| 142 | /* 0 */ 0, 1, 2, 3, 23, 4, 25, 6, 7, 8, | 141 | /* 0 */ 0, 1, 2, 3, 23, 4, 25, 6, 7, 8, |
| 143 | /* 10 */ 9, 10, 11, 31, 32, 15, 16, 1, 18, 42, | 142 | /* 10 */ 9, 10, 11, 33, 34, 15, 16, 1, 18, 14, |
| 144 | /* 20 */ 20, 21, 22, 33, 34, 24, 26, 27, 1, 2, | 143 | /* 20 */ 20, 21, 22, 31, 32, 24, 26, 27, 13, 14, |
| 145 | /* 30 */ 4, 28, 6, 7, 8, 9, 5, 35, 36, 29, | 144 | /* 30 */ 4, 19, 6, 7, 8, 9, 39, 40, 1, 2, |
| 146 | /* 40 */ 24, 13, 14, 37, 38, 34, 39, 40, 23, 5, | 145 | /* 40 */ 24, 23, 12, 25, 37, 38, 23, 23, 25, 25, |
| 147 | /* 50 */ 25, 5, 23, 23, 25, 25, 5, 5, 5, 5, | 146 | /* 50 */ 42, 19, 35, 36, 5, 5, 12, 24, 13, 34, |
| 148 | /* 60 */ 5, 5, 5, 5, 5, 41, 17, 35, 43, 1, | 147 | /* 60 */ 41, 5, 5, 12, 28, 12, 35, 1, 41, 5, |
| 149 | /* 70 */ 37, 24, 12, 12, 39, 12, 14, 12, 41, 13, | 148 | /* 70 */ 29, 1, 5, 5, 5, 41, 24, 17, 5, 41, |
| 150 | /* 80 */ 41, 1, 41, 19, 43, 12, 19, 43, 43, 19, | 149 | /* 80 */ 37, 5, 19, 5, 12, 39, 5, |
| 151 | /* 90 */ 43, 43, 43, 43, 43, 24, | ||
| 152 | }; | 150 | }; |
| 153 | #define YY_SHIFT_USE_DFLT (-20) | 151 | #define YY_SHIFT_USE_DFLT (-20) |
| 154 | static const signed char yy_shift_ofst[] = { | 152 | static const signed char yy_shift_ofst[] = { |
| 155 | /* 0 */ -20, 0, -20, 10, -20, 3, -20, -20, 27, -20, | 153 | /* 0 */ -20, 0, -20, 41, -20, 36, -20, -20, 37, -20, |
| 156 | /* 10 */ 26, 31, -20, 44, -20, 46, -20, 51, -20, 52, | 154 | /* 10 */ 26, 76, -20, 49, -20, 64, -20, 69, -20, 81, |
| 157 | /* 20 */ -20, 1, 53, -20, 54, -20, 55, -20, 56, -20, | 155 | /* 20 */ -20, 1, 57, -20, 68, -20, 73, -20, 78, -20, |
| 158 | /* 30 */ 57, -20, 58, -20, 59, -20, -20, -19, -20, -20, | 156 | /* 30 */ 50, -20, 56, -20, 67, -20, -20, -19, -20, -20, |
| 159 | /* 40 */ 60, 28, 61, 62, 63, -20, 65, 66, 73, -20, | 157 | /* 40 */ 53, 15, 72, 5, 30, -20, 44, 45, 51, -20, |
| 160 | /* 50 */ 60, -20, -20, 68, -20, 49, -20, 49, -20, -20, | 158 | /* 50 */ 53, -20, -20, 70, -20, 60, -20, 60, -20, -20, |
| 161 | /* 60 */ 64, -20, 64, -20, -20, 67, -20, 70, -20, 16, | 159 | /* 60 */ 63, -20, 63, -20, -20, 12, -20, 32, -20, 16, |
| 162 | /* 70 */ 47, -20, 25, -20, -20, 29, -20, 80, 71, -20, | 160 | /* 70 */ 33, -20, 23, -20, -20, 24, -20, 66, 52, -20, |
| 163 | /* 80 */ 30, -20, | 161 | /* 80 */ 18, -20, |
| 164 | }; | 162 | }; |
| 165 | #define YY_REDUCE_USE_DFLT (-24) | 163 | #define YY_REDUCE_USE_DFLT (-21) |
| 166 | static const signed char yy_reduce_ofst[] = { | 164 | static const signed char yy_reduce_ofst[] = { |
| 167 | /* 0 */ -18, -10, -24, -24, -23, -24, -24, -24, 11, -24, | 165 | /* 0 */ -8, -20, -21, -21, 8, -21, -21, -21, 25, -21, |
| 168 | /* 10 */ -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, | 166 | /* 10 */ -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, |
| 169 | /* 20 */ -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, | 167 | /* 20 */ -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, |
| 170 | /* 30 */ -24, -24, -24, -24, -24, -24, 24, -24, -24, -24, | 168 | /* 30 */ -21, -21, -21, -21, -21, -21, 38, -21, -21, -21, |
| 171 | /* 40 */ 2, -24, -24, -24, -24, -24, -24, -24, -24, -24, | 169 | /* 40 */ 17, -21, -21, -21, -21, -21, -21, -21, -21, -21, |
| 172 | /* 50 */ 32, -24, -24, -24, -24, 6, -24, 33, -24, -24, | 170 | /* 50 */ 31, -21, -21, -21, -21, 7, -21, 43, -21, -21, |
| 173 | /* 60 */ 7, -24, 35, -24, -24, -24, -24, -24, -24, -24, | 171 | /* 60 */ -3, -21, 46, -21, -21, -21, -21, -21, -21, -21, |
| 174 | /* 70 */ -24, 37, -24, -24, 39, -24, -24, -24, -24, 41, | 172 | /* 70 */ -21, 19, -21, -21, 27, -21, -21, -21, -21, 34, |
| 175 | /* 80 */ -24, -24, | 173 | /* 80 */ -21, -21, |
| 176 | }; | 174 | }; |
| 177 | static const YYACTIONTYPE yy_default[] = { | 175 | static const YYACTIONTYPE yy_default[] = { |
| 178 | /* 0 */ 84, 127, 83, 85, 125, 126, 124, 86, 127, 85, | 176 | /* 0 */ 84, 127, 83, 85, 125, 126, 124, 86, 127, 85, |
| @@ -420,7 +418,7 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){ | |||
| 420 | case 29: | 418 | case 29: |
| 421 | #line 50 "bitbakeparser.y" | 419 | #line 50 "bitbakeparser.y" |
| 422 | { (yypminor->yy0).release_this (); } | 420 | { (yypminor->yy0).release_this (); } |
| 423 | #line 425 "bitbakeparser.c" | 421 | #line 423 "bitbakeparser.c" |
| 424 | break; | 422 | break; |
| 425 | default: break; /* If no destructor action specified: do nothing */ | 423 | default: break; /* If no destructor action specified: do nothing */ |
| 426 | } | 424 | } |
| @@ -694,7 +692,7 @@ static void yy_reduce( | |||
| 694 | { yygotominor.yy0.assignString( (char*)yymsp[0].minor.yy0.string() ); | 692 | { yygotominor.yy0.assignString( (char*)yymsp[0].minor.yy0.string() ); |
| 695 | yymsp[0].minor.yy0.assignString( 0 ); | 693 | yymsp[0].minor.yy0.assignString( 0 ); |
| 696 | yymsp[0].minor.yy0.release_this(); } | 694 | yymsp[0].minor.yy0.release_this(); } |
| 697 | #line 699 "bitbakeparser.c" | 695 | #line 697 "bitbakeparser.c" |
| 698 | break; | 696 | break; |
| 699 | case 4: | 697 | case 4: |
| 700 | #line 64 "bitbakeparser.y" | 698 | #line 64 "bitbakeparser.y" |
| @@ -702,7 +700,7 @@ static void yy_reduce( | |||
| 702 | yygotominor.yy0.assignString( (char*)yymsp[0].minor.yy0.string() ); | 700 | yygotominor.yy0.assignString( (char*)yymsp[0].minor.yy0.string() ); |
| 703 | yymsp[0].minor.yy0.assignString( 0 ); | 701 | yymsp[0].minor.yy0.assignString( 0 ); |
| 704 | yymsp[0].minor.yy0.release_this(); } | 702 | yymsp[0].minor.yy0.release_this(); } |
| 705 | #line 707 "bitbakeparser.c" | 703 | #line 705 "bitbakeparser.c" |
| 706 | break; | 704 | break; |
| 707 | case 5: | 705 | case 5: |
| 708 | #line 70 "bitbakeparser.y" | 706 | #line 70 "bitbakeparser.y" |
| @@ -711,7 +709,7 @@ static void yy_reduce( | |||
| 711 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); | 709 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); |
| 712 | yy_destructor(4,&yymsp[-1].minor); | 710 | yy_destructor(4,&yymsp[-1].minor); |
| 713 | } | 711 | } |
| 714 | #line 716 "bitbakeparser.c" | 712 | #line 714 "bitbakeparser.c" |
| 715 | break; | 713 | break; |
| 716 | case 6: | 714 | case 6: |
| 717 | #line 74 "bitbakeparser.y" | 715 | #line 74 "bitbakeparser.y" |
| @@ -720,7 +718,7 @@ static void yy_reduce( | |||
| 720 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); | 718 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); |
| 721 | yy_destructor(6,&yymsp[-1].minor); | 719 | yy_destructor(6,&yymsp[-1].minor); |
| 722 | } | 720 | } |
| 723 | #line 725 "bitbakeparser.c" | 721 | #line 723 "bitbakeparser.c" |
| 724 | break; | 722 | break; |
| 725 | case 7: | 723 | case 7: |
| 726 | #line 78 "bitbakeparser.y" | 724 | #line 78 "bitbakeparser.y" |
| @@ -729,7 +727,7 @@ static void yy_reduce( | |||
| 729 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); | 727 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); |
| 730 | yy_destructor(7,&yymsp[-1].minor); | 728 | yy_destructor(7,&yymsp[-1].minor); |
| 731 | } | 729 | } |
| 732 | #line 734 "bitbakeparser.c" | 730 | #line 732 "bitbakeparser.c" |
| 733 | break; | 731 | break; |
| 734 | case 8: | 732 | case 8: |
| 735 | #line 82 "bitbakeparser.y" | 733 | #line 82 "bitbakeparser.y" |
| @@ -738,7 +736,7 @@ static void yy_reduce( | |||
| 738 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); | 736 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); |
| 739 | yy_destructor(8,&yymsp[-1].minor); | 737 | yy_destructor(8,&yymsp[-1].minor); |
| 740 | } | 738 | } |
| 741 | #line 743 "bitbakeparser.c" | 739 | #line 741 "bitbakeparser.c" |
| 742 | break; | 740 | break; |
| 743 | case 9: | 741 | case 9: |
| 744 | #line 86 "bitbakeparser.y" | 742 | #line 86 "bitbakeparser.y" |
| @@ -746,56 +744,56 @@ static void yy_reduce( | |||
| 746 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); | 744 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); |
| 747 | yy_destructor(9,&yymsp[-1].minor); | 745 | yy_destructor(9,&yymsp[-1].minor); |
| 748 | } | 746 | } |
| 749 | #line 751 "bitbakeparser.c" | 747 | #line 749 "bitbakeparser.c" |
| 750 | break; | 748 | break; |
| 751 | case 10: | 749 | case 10: |
| 752 | #line 90 "bitbakeparser.y" | 750 | #line 90 "bitbakeparser.y" |
| 753 | { e_assign( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | 751 | { e_assign( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); |
| 754 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(4,&yymsp[-1].minor); | 752 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(4,&yymsp[-1].minor); |
| 755 | } | 753 | } |
| 756 | #line 758 "bitbakeparser.c" | 754 | #line 756 "bitbakeparser.c" |
| 757 | break; | 755 | break; |
| 758 | case 11: | 756 | case 11: |
| 759 | #line 93 "bitbakeparser.y" | 757 | #line 93 "bitbakeparser.y" |
| 760 | { e_precat( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | 758 | { e_precat( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); |
| 761 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(6,&yymsp[-1].minor); | 759 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(6,&yymsp[-1].minor); |
| 762 | } | 760 | } |
| 763 | #line 765 "bitbakeparser.c" | 761 | #line 763 "bitbakeparser.c" |
| 764 | break; | 762 | break; |
| 765 | case 12: | 763 | case 12: |
| 766 | #line 96 "bitbakeparser.y" | 764 | #line 96 "bitbakeparser.y" |
| 767 | { e_postcat( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | 765 | { e_postcat( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); |
| 768 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(7,&yymsp[-1].minor); | 766 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(7,&yymsp[-1].minor); |
| 769 | } | 767 | } |
| 770 | #line 772 "bitbakeparser.c" | 768 | #line 770 "bitbakeparser.c" |
| 771 | break; | 769 | break; |
| 772 | case 13: | 770 | case 13: |
| 773 | #line 99 "bitbakeparser.y" | 771 | #line 99 "bitbakeparser.y" |
| 774 | { e_prepend( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | 772 | { e_prepend( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); |
| 775 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(10,&yymsp[-1].minor); | 773 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(10,&yymsp[-1].minor); |
| 776 | } | 774 | } |
| 777 | #line 779 "bitbakeparser.c" | 775 | #line 777 "bitbakeparser.c" |
| 778 | break; | 776 | break; |
| 779 | case 14: | 777 | case 14: |
| 780 | #line 102 "bitbakeparser.y" | 778 | #line 102 "bitbakeparser.y" |
| 781 | { e_append( lex, yymsp[-2].minor.yy0.string() , yymsp[0].minor.yy0.string() ); | 779 | { e_append( lex, yymsp[-2].minor.yy0.string() , yymsp[0].minor.yy0.string() ); |
| 782 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(11,&yymsp[-1].minor); | 780 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(11,&yymsp[-1].minor); |
| 783 | } | 781 | } |
| 784 | #line 786 "bitbakeparser.c" | 782 | #line 784 "bitbakeparser.c" |
| 785 | break; | 783 | break; |
| 786 | case 15: | 784 | case 15: |
| 787 | #line 105 "bitbakeparser.y" | 785 | #line 105 "bitbakeparser.y" |
| 788 | { e_immediate( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | 786 | { e_immediate( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); |
| 789 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(8,&yymsp[-1].minor); | 787 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(8,&yymsp[-1].minor); |
| 790 | } | 788 | } |
| 791 | #line 793 "bitbakeparser.c" | 789 | #line 791 "bitbakeparser.c" |
| 792 | break; | 790 | break; |
| 793 | case 16: | 791 | case 16: |
| 794 | #line 108 "bitbakeparser.y" | 792 | #line 108 "bitbakeparser.y" |
| 795 | { e_cond( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | 793 | { e_cond( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); |
| 796 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(9,&yymsp[-1].minor); | 794 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(9,&yymsp[-1].minor); |
| 797 | } | 795 | } |
| 798 | #line 800 "bitbakeparser.c" | 796 | #line 798 "bitbakeparser.c" |
| 799 | break; | 797 | break; |
| 800 | case 17: | 798 | case 17: |
| 801 | #line 112 "bitbakeparser.y" | 799 | #line 112 "bitbakeparser.y" |
| @@ -803,7 +801,7 @@ static void yy_reduce( | |||
| 803 | yymsp[-4].minor.yy0.release_this(); yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(13,&yymsp[-3].minor); | 801 | yymsp[-4].minor.yy0.release_this(); yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(13,&yymsp[-3].minor); |
| 804 | yy_destructor(14,&yymsp[-1].minor); | 802 | yy_destructor(14,&yymsp[-1].minor); |
| 805 | } | 803 | } |
| 806 | #line 808 "bitbakeparser.c" | 804 | #line 806 "bitbakeparser.c" |
| 807 | break; | 805 | break; |
| 808 | case 18: | 806 | case 18: |
| 809 | #line 115 "bitbakeparser.y" | 807 | #line 115 "bitbakeparser.y" |
| @@ -811,55 +809,55 @@ static void yy_reduce( | |||
| 811 | yymsp[-4].minor.yy0.release_this(); yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(14,&yymsp[-3].minor); | 809 | yymsp[-4].minor.yy0.release_this(); yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(14,&yymsp[-3].minor); |
| 812 | yy_destructor(13,&yymsp[-1].minor); | 810 | yy_destructor(13,&yymsp[-1].minor); |
| 813 | } | 811 | } |
| 814 | #line 816 "bitbakeparser.c" | 812 | #line 814 "bitbakeparser.c" |
| 815 | break; | 813 | break; |
| 816 | case 19: | 814 | case 19: |
| 817 | #line 118 "bitbakeparser.y" | 815 | #line 118 "bitbakeparser.y" |
| 818 | { e_addtask( lex, yymsp[0].minor.yy0.string(), NULL, NULL); | 816 | { e_addtask( lex, yymsp[0].minor.yy0.string(), NULL, NULL); |
| 819 | yymsp[0].minor.yy0.release_this();} | 817 | yymsp[0].minor.yy0.release_this();} |
| 820 | #line 822 "bitbakeparser.c" | 818 | #line 820 "bitbakeparser.c" |
| 821 | break; | 819 | break; |
| 822 | case 20: | 820 | case 20: |
| 823 | #line 121 "bitbakeparser.y" | 821 | #line 121 "bitbakeparser.y" |
| 824 | { e_addtask( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string(), NULL); | 822 | { e_addtask( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string(), NULL); |
| 825 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(13,&yymsp[-1].minor); | 823 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(13,&yymsp[-1].minor); |
| 826 | } | 824 | } |
| 827 | #line 829 "bitbakeparser.c" | 825 | #line 827 "bitbakeparser.c" |
| 828 | break; | 826 | break; |
| 829 | case 21: | 827 | case 21: |
| 830 | #line 124 "bitbakeparser.y" | 828 | #line 124 "bitbakeparser.y" |
| 831 | { e_addtask( lex, yymsp[-2].minor.yy0.string(), NULL, yymsp[0].minor.yy0.string()); | 829 | { e_addtask( lex, yymsp[-2].minor.yy0.string(), NULL, yymsp[0].minor.yy0.string()); |
| 832 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(14,&yymsp[-1].minor); | 830 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(14,&yymsp[-1].minor); |
| 833 | } | 831 | } |
| 834 | #line 836 "bitbakeparser.c" | 832 | #line 834 "bitbakeparser.c" |
| 835 | break; | 833 | break; |
| 836 | case 25: | 834 | case 25: |
| 837 | #line 131 "bitbakeparser.y" | 835 | #line 131 "bitbakeparser.y" |
| 838 | { e_addhandler( lex, yymsp[0].minor.yy0.string()); yymsp[0].minor.yy0.release_this (); yy_destructor(16,&yymsp[-1].minor); | 836 | { e_addhandler( lex, yymsp[0].minor.yy0.string()); yymsp[0].minor.yy0.release_this (); yy_destructor(16,&yymsp[-1].minor); |
| 839 | } | 837 | } |
| 840 | #line 842 "bitbakeparser.c" | 838 | #line 840 "bitbakeparser.c" |
| 841 | break; | 839 | break; |
| 842 | case 26: | 840 | case 26: |
| 843 | #line 133 "bitbakeparser.y" | 841 | #line 133 "bitbakeparser.y" |
| 844 | { e_export_func( lex, yymsp[0].minor.yy0.string()); yymsp[0].minor.yy0.release_this(); } | 842 | { e_export_func( lex, yymsp[0].minor.yy0.string()); yymsp[0].minor.yy0.release_this(); } |
| 845 | #line 847 "bitbakeparser.c" | 843 | #line 845 "bitbakeparser.c" |
| 846 | break; | 844 | break; |
| 847 | case 30: | 845 | case 30: |
| 848 | #line 138 "bitbakeparser.y" | 846 | #line 138 "bitbakeparser.y" |
| 849 | { e_inherit( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this (); } | 847 | { e_inherit( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this (); } |
| 850 | #line 852 "bitbakeparser.c" | 848 | #line 850 "bitbakeparser.c" |
| 851 | break; | 849 | break; |
| 852 | case 34: | 850 | case 34: |
| 853 | #line 144 "bitbakeparser.y" | 851 | #line 144 "bitbakeparser.y" |
| 854 | { e_include( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this(); yy_destructor(21,&yymsp[-1].minor); | 852 | { e_include( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this(); yy_destructor(21,&yymsp[-1].minor); |
| 855 | } | 853 | } |
| 856 | #line 858 "bitbakeparser.c" | 854 | #line 856 "bitbakeparser.c" |
| 857 | break; | 855 | break; |
| 858 | case 35: | 856 | case 35: |
| 859 | #line 147 "bitbakeparser.y" | 857 | #line 147 "bitbakeparser.y" |
| 860 | { e_require( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this(); yy_destructor(22,&yymsp[-1].minor); | 858 | { e_require( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this(); yy_destructor(22,&yymsp[-1].minor); |
| 861 | } | 859 | } |
| 862 | #line 864 "bitbakeparser.c" | 860 | #line 862 "bitbakeparser.c" |
| 863 | break; | 861 | break; |
| 864 | case 36: | 862 | case 36: |
| 865 | #line 150 "bitbakeparser.y" | 863 | #line 150 "bitbakeparser.y" |
| @@ -868,12 +866,12 @@ static void yy_reduce( | |||
| 868 | yymsp[-1].minor.yy0.release_this (); | 866 | yymsp[-1].minor.yy0.release_this (); |
| 869 | yymsp[0].minor.yy0.release_this (); | 867 | yymsp[0].minor.yy0.release_this (); |
| 870 | } | 868 | } |
| 871 | #line 873 "bitbakeparser.c" | 869 | #line 871 "bitbakeparser.c" |
| 872 | break; | 870 | break; |
| 873 | case 37: | 871 | case 37: |
| 874 | #line 155 "bitbakeparser.y" | 872 | #line 155 "bitbakeparser.y" |
| 875 | { yygotominor.yy0.assignString(0); } | 873 | { yygotominor.yy0.assignString(0); } |
| 876 | #line 878 "bitbakeparser.c" | 874 | #line 876 "bitbakeparser.c" |
| 877 | break; | 875 | break; |
| 878 | case 38: | 876 | case 38: |
| 879 | #line 157 "bitbakeparser.y" | 877 | #line 157 "bitbakeparser.y" |
| @@ -881,7 +879,7 @@ static void yy_reduce( | |||
| 881 | yymsp[-3].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this(); yy_destructor(24,&yymsp[-2].minor); | 879 | yymsp[-3].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this(); yy_destructor(24,&yymsp[-2].minor); |
| 882 | yy_destructor(25,&yymsp[0].minor); | 880 | yy_destructor(25,&yymsp[0].minor); |
| 883 | } | 881 | } |
| 884 | #line 886 "bitbakeparser.c" | 882 | #line 884 "bitbakeparser.c" |
| 885 | break; | 883 | break; |
| 886 | case 39: | 884 | case 39: |
| 887 | #line 160 "bitbakeparser.y" | 885 | #line 160 "bitbakeparser.y" |
| @@ -890,7 +888,7 @@ static void yy_reduce( | |||
| 890 | yy_destructor(24,&yymsp[-2].minor); | 888 | yy_destructor(24,&yymsp[-2].minor); |
| 891 | yy_destructor(25,&yymsp[0].minor); | 889 | yy_destructor(25,&yymsp[0].minor); |
| 892 | } | 890 | } |
| 893 | #line 895 "bitbakeparser.c" | 891 | #line 893 "bitbakeparser.c" |
| 894 | break; | 892 | break; |
| 895 | case 40: | 893 | case 40: |
| 896 | #line 163 "bitbakeparser.y" | 894 | #line 163 "bitbakeparser.y" |
| @@ -899,7 +897,7 @@ static void yy_reduce( | |||
| 899 | yy_destructor(24,&yymsp[-2].minor); | 897 | yy_destructor(24,&yymsp[-2].minor); |
| 900 | yy_destructor(25,&yymsp[0].minor); | 898 | yy_destructor(25,&yymsp[0].minor); |
| 901 | } | 899 | } |
| 902 | #line 904 "bitbakeparser.c" | 900 | #line 902 "bitbakeparser.c" |
| 903 | break; | 901 | break; |
| 904 | case 41: | 902 | case 41: |
| 905 | #line 167 "bitbakeparser.y" | 903 | #line 167 "bitbakeparser.y" |
| @@ -908,7 +906,7 @@ static void yy_reduce( | |||
| 908 | yy_destructor(24,&yymsp[-2].minor); | 906 | yy_destructor(24,&yymsp[-2].minor); |
| 909 | yy_destructor(25,&yymsp[0].minor); | 907 | yy_destructor(25,&yymsp[0].minor); |
| 910 | } | 908 | } |
| 911 | #line 913 "bitbakeparser.c" | 909 | #line 911 "bitbakeparser.c" |
| 912 | break; | 910 | break; |
| 913 | case 42: | 911 | case 42: |
| 914 | #line 171 "bitbakeparser.y" | 912 | #line 171 "bitbakeparser.y" |
| @@ -916,18 +914,18 @@ static void yy_reduce( | |||
| 916 | yygotominor.yy0.assignString( token_t::concatString(yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string()) ); | 914 | yygotominor.yy0.assignString( token_t::concatString(yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string()) ); |
| 917 | yymsp[-1].minor.yy0.release_this (); yymsp[0].minor.yy0.release_this (); | 915 | yymsp[-1].minor.yy0.release_this (); yymsp[0].minor.yy0.release_this (); |
| 918 | } | 916 | } |
| 919 | #line 921 "bitbakeparser.c" | 917 | #line 919 "bitbakeparser.c" |
| 920 | break; | 918 | break; |
| 921 | case 43: | 919 | case 43: |
| 922 | #line 175 "bitbakeparser.y" | 920 | #line 175 "bitbakeparser.y" |
| 923 | { yygotominor.yy0.assignString( 0 ); } | 921 | { yygotominor.yy0.assignString( 0 ); } |
| 924 | #line 926 "bitbakeparser.c" | 922 | #line 924 "bitbakeparser.c" |
| 925 | break; | 923 | break; |
| 926 | case 44: | 924 | case 44: |
| 927 | #line 177 "bitbakeparser.y" | 925 | #line 177 "bitbakeparser.y" |
| 928 | { e_def( lex, yymsp[-2].minor.yy0.string(), yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string()); | 926 | { e_def( lex, yymsp[-2].minor.yy0.string(), yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string()); |
| 929 | yymsp[-2].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); } | 927 | yymsp[-2].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); } |
| 930 | #line 932 "bitbakeparser.c" | 928 | #line 930 "bitbakeparser.c" |
| 931 | break; | 929 | break; |
| 932 | }; | 930 | }; |
| 933 | yygoto = yyRuleInfo[yyruleno].lhs; | 931 | yygoto = yyRuleInfo[yyruleno].lhs; |
| @@ -986,7 +984,7 @@ static void yy_syntax_error( | |||
| 986 | #define TOKEN (yyminor.yy0) | 984 | #define TOKEN (yyminor.yy0) |
| 987 | #line 52 "bitbakeparser.y" | 985 | #line 52 "bitbakeparser.y" |
| 988 | e_parse_error( lex ); | 986 | e_parse_error( lex ); |
| 989 | #line 992 "bitbakeparser.c" | 987 | #line 990 "bitbakeparser.c" |
| 990 | bbparseARG_STORE; /* Suppress warning about unused %extra_argument variable */ | 988 | bbparseARG_STORE; /* Suppress warning about unused %extra_argument variable */ |
| 991 | } | 989 | } |
| 992 | 990 | ||
| @@ -1042,7 +1040,7 @@ void bbparse( | |||
| 1042 | /* (re)initialize the parser, if necessary */ | 1040 | /* (re)initialize the parser, if necessary */ |
| 1043 | yypParser = (yyParser*)yyp; | 1041 | yypParser = (yyParser*)yyp; |
| 1044 | if( yypParser->yyidx<0 ){ | 1042 | if( yypParser->yyidx<0 ){ |
| 1045 | /* if( yymajor==0 ) return; // not sure why this was here... */ | 1043 | if( yymajor==0 ) return; |
| 1046 | yypParser->yyidx = 0; | 1044 | yypParser->yyidx = 0; |
| 1047 | yypParser->yyerrcnt = -1; | 1045 | yypParser->yyerrcnt = -1; |
| 1048 | yypParser->yystack[0].stateno = 0; | 1046 | yypParser->yystack[0].stateno = 0; |
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakescanner.cc b/bitbake/lib/bb/parse/parse_c/bitbakescanner.cc index 43dad12d39..acc13f7c34 100644 --- a/bitbake/lib/bb/parse/parse_c/bitbakescanner.cc +++ b/bitbake/lib/bb/parse/parse_c/bitbakescanner.cc | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #define FLEX_SCANNER | 8 | #define FLEX_SCANNER |
| 9 | #define YY_FLEX_MAJOR_VERSION 2 | 9 | #define YY_FLEX_MAJOR_VERSION 2 |
| 10 | #define YY_FLEX_MINOR_VERSION 5 | 10 | #define YY_FLEX_MINOR_VERSION 5 |
| 11 | #define YY_FLEX_SUBMINOR_VERSION 31 | 11 | #define YY_FLEX_SUBMINOR_VERSION 33 |
| 12 | #if YY_FLEX_SUBMINOR_VERSION > 0 | 12 | #if YY_FLEX_SUBMINOR_VERSION > 0 |
| 13 | #define FLEX_BETA | 13 | #define FLEX_BETA |
| 14 | #endif | 14 | #endif |
| @@ -30,7 +30,15 @@ | |||
| 30 | 30 | ||
| 31 | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ | 31 | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ |
| 32 | 32 | ||
| 33 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L | 33 | #if __STDC_VERSION__ >= 199901L |
| 34 | |||
| 35 | /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, | ||
| 36 | * if you want the limit (max/min) macros for int types. | ||
| 37 | */ | ||
| 38 | #ifndef __STDC_LIMIT_MACROS | ||
| 39 | #define __STDC_LIMIT_MACROS 1 | ||
| 40 | #endif | ||
| 41 | |||
| 34 | #include <inttypes.h> | 42 | #include <inttypes.h> |
| 35 | typedef int8_t flex_int8_t; | 43 | typedef int8_t flex_int8_t; |
| 36 | typedef uint8_t flex_uint8_t; | 44 | typedef uint8_t flex_uint8_t; |
| @@ -153,6 +161,10 @@ int yylex_init (yyscan_t* scanner); | |||
| 153 | #define YY_BUF_SIZE 16384 | 161 | #define YY_BUF_SIZE 16384 |
| 154 | #endif | 162 | #endif |
| 155 | 163 | ||
| 164 | /* The state buf must be large enough to hold one state per character in the main buffer. | ||
| 165 | */ | ||
| 166 | #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) | ||
| 167 | |||
| 156 | #ifndef YY_TYPEDEF_YY_BUFFER_STATE | 168 | #ifndef YY_TYPEDEF_YY_BUFFER_STATE |
| 157 | #define YY_TYPEDEF_YY_BUFFER_STATE | 169 | #define YY_TYPEDEF_YY_BUFFER_STATE |
| 158 | typedef struct yy_buffer_state *YY_BUFFER_STATE; | 170 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
| @@ -493,7 +505,7 @@ static yyconst flex_int32_t yy_ec[256] = | |||
| 493 | static yyconst flex_int32_t yy_meta[59] = | 505 | static yyconst flex_int32_t yy_meta[59] = |
| 494 | { 0, | 506 | { 0, |
| 495 | 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, | 507 | 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, |
| 496 | 5, 6, 5, 5, 7, 8, 1, 7, 1, 9, | 508 | 5, 6, 5, 5, 5, 7, 1, 8, 1, 9, |
| 497 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 509 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
| 498 | 9, 9, 10, 1, 11, 9, 9, 9, 9, 9, | 510 | 9, 9, 10, 1, 11, 9, 9, 9, 9, 9, |
| 499 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 511 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
| @@ -565,18 +577,18 @@ static yyconst flex_int16_t yy_base[847] = | |||
| 565 | 2077, 2072, 2066, 2069, 2056, 2067, 1398, 1343, 1408, 1404, | 577 | 2077, 2072, 2066, 2069, 2056, 2067, 1398, 1343, 1408, 1404, |
| 566 | 643, 1409, 2071, 2066, 2060, 2063, 2050, 2061, 2065, 2060, | 578 | 643, 1409, 2071, 2066, 2060, 2063, 2050, 2061, 2065, 2060, |
| 567 | 2054, 2057, 2044, 2055, 1420, 1445, 1413, 1447, 1453, 1454, | 579 | 2054, 2057, 2044, 2055, 1420, 1445, 1413, 1447, 1453, 1454, |
| 568 | 2059, 2054, 2047, 2050, 2035, 2043, 1455, 1459, 1460, 1461, | 580 | 2059, 2053, 2047, 2049, 2032, 2043, 1455, 1459, 1460, 1461, |
| 569 | 1462, 1463, 1471, 1436, 1430, 1192, 1433, 1479, 1482, 1492, | 581 | 1462, 1463, 1471, 1436, 1430, 1192, 1433, 1479, 1482, 1492, |
| 570 | 582 | ||
| 571 | 1506, 1519, 1520, 1528, 2047, 2040, 2031, 0, 2034, 2019, | 583 | 1506, 1519, 1520, 1528, 2046, 2037, 2031, 0, 2033, 2016, |
| 572 | 2027, 1486, 1496, 1505, 1506, 1510, 1516, 1524, 2044, 2018, | 584 | 2027, 1486, 1496, 1505, 1506, 1510, 1516, 1524, 2043, 2015, |
| 573 | 0, 0, 0, 0, 1281, 1517, 2043, 2042, 2039, 2035, | 585 | 0, 0, 0, 0, 1281, 1517, 2043, 2041, 2036, 2034, |
| 574 | 2023, 1994, 2309, 2309, 2309, 2309, 2005, 1981, 0, 0, | 586 | 2024, 1995, 2309, 2309, 2309, 2309, 2005, 1981, 0, 0, |
| 575 | 0, 0, 1538, 1528, 1530, 1534, 1537, 1540, 1981, 1957, | 587 | 0, 0, 1538, 1528, 1530, 1534, 1537, 1540, 1981, 1957, |
| 576 | 0, 0, 0, 0, 1557, 1558, 1559, 1560, 1561, 1563, | 588 | 0, 0, 0, 0, 1557, 1558, 1559, 1560, 1561, 1563, |
| 577 | 1568, 1547, 1988, 1959, 1954, 1948, 1580, 1581, 1582, 1590, | 589 | 1568, 1547, 1988, 1959, 1955, 1948, 1580, 1581, 1582, 1590, |
| 578 | 1592, 1594, 1923, 1863, 0, 0, 0, 0, 1598, 1599, | 590 | 1592, 1594, 1924, 1863, 0, 0, 0, 0, 1598, 1599, |
| 579 | 1600, 1874, 1858, 1350, 1584, 1803, 1792, 1801, 1790, 1603, | 591 | 1600, 1875, 1859, 1350, 1584, 1803, 1792, 1801, 1790, 1603, |
| 580 | 1601, 1799, 1788, 1604, 1602, 1610, 1609, 1643, 1644, 1797, | 592 | 1601, 1799, 1788, 1604, 1602, 1610, 1609, 1643, 1644, 1797, |
| 581 | 593 | ||
| 582 | 1786, 1611, 1630, 1800, 1773, 1010, 1606, 1798, 1771, 1795, | 594 | 1786, 1611, 1630, 1800, 1773, 1010, 1606, 1798, 1771, 1795, |
| @@ -593,8 +605,8 @@ static yyconst flex_int16_t yy_base[847] = | |||
| 593 | 1768, 0, 742, 2309, 0, 1764, 0, 1778, 678, 1801, | 605 | 1768, 0, 742, 2309, 0, 1764, 0, 1778, 678, 1801, |
| 594 | 0, 2309, 1835, 1847, 1859, 1871, 1883, 550, 1892, 1898, | 606 | 0, 2309, 1835, 1847, 1859, 1871, 1883, 550, 1892, 1898, |
| 595 | 1907, 1919, 1931, 1939, 1945, 1950, 1956, 1965, 1977, 1989, | 607 | 1907, 1919, 1931, 1939, 1945, 1950, 1956, 1965, 1977, 1989, |
| 596 | 2001, 2013, 2025, 2033, 2039, 2042, 306, 304, 301, 2049, | 608 | 2001, 2013, 2025, 2033, 2039, 2043, 306, 304, 301, 2050, |
| 597 | 213, 2057, 136, 2065, 2073, 2081 | 609 | 213, 2058, 136, 2066, 2074, 2082 |
| 598 | } ; | 610 | } ; |
| 599 | 611 | ||
| 600 | static yyconst flex_int16_t yy_def[847] = | 612 | static yyconst flex_int16_t yy_def[847] = |
| @@ -903,14 +915,14 @@ static yyconst flex_int16_t yy_nxt[2368] = | |||
| 903 | 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, | 915 | 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, |
| 904 | 112, 128, 128, 128, 128, 128, 128, 128, 128, 128, | 916 | 112, 128, 128, 128, 128, 128, 128, 128, 128, 128, |
| 905 | 128, 128, 128, 155, 155, 155, 155, 155, 155, 155, | 917 | 128, 128, 128, 155, 155, 155, 155, 155, 155, 155, |
| 906 | 155, 155, 155, 155, 155, 167, 167, 167, 705, 167, | 918 | 155, 155, 155, 155, 155, 167, 167, 167, 167, 705, |
| 907 | 919 | ||
| 908 | 167, 167, 177, 177, 704, 177, 177, 183, 701, 183, | 920 | 167, 167, 177, 177, 177, 704, 177, 183, 701, 183, |
| 909 | 183, 183, 183, 183, 183, 183, 183, 183, 183, 187, | 921 | 183, 183, 183, 183, 183, 183, 183, 183, 183, 187, |
| 910 | 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, | 922 | 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, |
| 911 | 187, 201, 201, 201, 201, 201, 201, 201, 201, 201, | 923 | 187, 201, 201, 201, 201, 201, 201, 201, 201, 201, |
| 912 | 201, 201, 201, 209, 209, 700, 209, 209, 217, 217, | 924 | 201, 201, 201, 209, 209, 209, 700, 209, 217, 217, |
| 913 | 238, 217, 217, 217, 223, 223, 238, 223, 223, 231, | 925 | 238, 217, 217, 217, 223, 223, 223, 238, 223, 231, |
| 914 | 231, 238, 231, 231, 231, 237, 237, 237, 237, 237, | 926 | 231, 238, 231, 231, 231, 237, 237, 237, 237, 237, |
| 915 | 237, 237, 237, 237, 237, 237, 237, 239, 239, 239, | 927 | 237, 237, 237, 237, 237, 237, 237, 239, 239, 239, |
| 916 | 239, 239, 239, 239, 239, 239, 239, 239, 239, 256, | 928 | 239, 239, 239, 239, 239, 239, 239, 239, 239, 256, |
| @@ -919,13 +931,13 @@ static yyconst flex_int16_t yy_nxt[2368] = | |||
| 919 | 256, 261, 693, 692, 261, 261, 261, 261, 261, 261, | 931 | 256, 261, 693, 692, 261, 261, 261, 261, 261, 261, |
| 920 | 261, 261, 261, 264, 264, 264, 264, 264, 264, 264, | 932 | 261, 261, 261, 264, 264, 264, 264, 264, 264, 264, |
| 921 | 264, 264, 264, 264, 264, 267, 689, 688, 267, 267, | 933 | 264, 264, 264, 264, 264, 267, 689, 688, 267, 267, |
| 922 | 267, 267, 267, 267, 267, 267, 267, 284, 284, 687, | 934 | 267, 267, 267, 267, 267, 267, 267, 284, 284, 284, |
| 923 | 284, 284, 292, 292, 292, 686, 292, 292, 292, 296, | 935 | 687, 284, 292, 292, 292, 292, 686, 292, 292, 296, |
| 924 | 296, 184, 296, 418, 418, 184, 418, 418, 184, 184, | 936 | 184, 296, 184, 296, 418, 418, 418, 184, 418, 184, |
| 925 | 418, 433, 433, 683, 433, 433, 682, 678, 433, 465, | 937 | 683, 418, 433, 433, 433, 682, 433, 678, 677, 433, |
| 926 | 465, 677, 465, 465, 676, 675, 465, 500, 500, 674, | 938 | 465, 465, 465, 676, 465, 675, 674, 465, 500, 500, |
| 927 | 500, 500, 673, 654, 500, 514, 514, 653, 514, 514, | 939 | 500, 673, 500, 654, 653, 500, 514, 514, 514, 652, |
| 928 | 652, 651, 514, 650, 649, 642, 641, 640, 639, 638, | 940 | 514, 651, 650, 514, 649, 642, 641, 640, 639, 638, |
| 929 | 941 | ||
| 930 | 637, 636, 635, 634, 633, 632, 631, 624, 623, 622, | 942 | 637, 636, 635, 634, 633, 632, 631, 624, 623, 622, |
| 931 | 621, 620, 619, 611, 610, 609, 608, 607, 606, 605, | 943 | 621, 620, 619, 611, 610, 609, 608, 607, 606, 605, |
| @@ -1167,14 +1179,14 @@ static yyconst flex_int16_t yy_chk[2368] = | |||
| 1167 | 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, | 1179 | 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, |
| 1168 | 815, 816, 816, 816, 816, 816, 816, 816, 816, 816, | 1180 | 815, 816, 816, 816, 816, 816, 816, 816, 816, 816, |
| 1169 | 816, 816, 816, 817, 817, 817, 817, 817, 817, 817, | 1181 | 816, 816, 816, 817, 817, 817, 817, 817, 817, 817, |
| 1170 | 817, 817, 817, 817, 817, 819, 819, 819, 683, 819, | 1182 | 817, 817, 817, 817, 817, 819, 819, 819, 819, 683, |
| 1171 | 1183 | ||
| 1172 | 819, 819, 820, 820, 682, 820, 820, 821, 674, 821, | 1184 | 819, 819, 820, 820, 820, 682, 820, 821, 674, 821, |
| 1173 | 821, 821, 821, 821, 821, 821, 821, 821, 821, 822, | 1185 | 821, 821, 821, 821, 821, 821, 821, 821, 821, 822, |
| 1174 | 822, 822, 822, 822, 822, 822, 822, 822, 822, 822, | 1186 | 822, 822, 822, 822, 822, 822, 822, 822, 822, 822, |
| 1175 | 822, 823, 823, 823, 823, 823, 823, 823, 823, 823, | 1187 | 822, 823, 823, 823, 823, 823, 823, 823, 823, 823, |
| 1176 | 823, 823, 823, 824, 824, 673, 824, 824, 825, 825, | 1188 | 823, 823, 823, 824, 824, 824, 673, 824, 825, 825, |
| 1177 | 666, 825, 825, 825, 826, 826, 665, 826, 826, 827, | 1189 | 666, 825, 825, 825, 826, 826, 826, 665, 826, 827, |
| 1178 | 827, 664, 827, 827, 827, 828, 828, 828, 828, 828, | 1190 | 827, 664, 827, 827, 827, 828, 828, 828, 828, 828, |
| 1179 | 828, 828, 828, 828, 828, 828, 828, 829, 829, 829, | 1191 | 828, 828, 828, 828, 828, 828, 828, 829, 829, 829, |
| 1180 | 829, 829, 829, 829, 829, 829, 829, 829, 829, 830, | 1192 | 829, 829, 829, 829, 829, 829, 829, 829, 829, 830, |
| @@ -1183,13 +1195,13 @@ static yyconst flex_int16_t yy_chk[2368] = | |||
| 1183 | 830, 831, 650, 649, 831, 831, 831, 831, 831, 831, | 1195 | 830, 831, 650, 649, 831, 831, 831, 831, 831, 831, |
| 1184 | 831, 831, 831, 832, 832, 832, 832, 832, 832, 832, | 1196 | 831, 831, 831, 832, 832, 832, 832, 832, 832, 832, |
| 1185 | 832, 832, 832, 832, 832, 833, 638, 637, 833, 833, | 1197 | 832, 832, 832, 832, 832, 833, 638, 637, 833, 833, |
| 1186 | 833, 833, 833, 833, 833, 833, 833, 834, 834, 632, | 1198 | 833, 833, 833, 833, 833, 833, 833, 834, 834, 834, |
| 1187 | 834, 834, 835, 835, 835, 631, 835, 835, 835, 836, | 1199 | 632, 834, 835, 835, 835, 835, 631, 835, 835, 836, |
| 1188 | 836, 630, 836, 840, 840, 629, 840, 840, 628, 627, | 1200 | 630, 836, 629, 836, 840, 840, 840, 628, 840, 627, |
| 1189 | 840, 842, 842, 620, 842, 842, 619, 611, 842, 844, | 1201 | 620, 840, 842, 842, 842, 619, 842, 611, 610, 842, |
| 1190 | 844, 610, 844, 844, 609, 607, 844, 845, 845, 606, | 1202 | 844, 844, 844, 609, 844, 607, 606, 844, 845, 845, |
| 1191 | 845, 845, 605, 586, 845, 846, 846, 585, 846, 846, | 1203 | 845, 605, 845, 586, 585, 845, 846, 846, 846, 584, |
| 1192 | 584, 583, 846, 582, 581, 574, 573, 572, 571, 570, | 1204 | 846, 583, 582, 846, 581, 574, 573, 572, 571, 570, |
| 1193 | 1205 | ||
| 1194 | 569, 568, 567, 566, 565, 564, 563, 556, 555, 554, | 1206 | 569, 568, 567, 566, 565, 564, 563, 556, 555, 554, |
| 1195 | 553, 552, 551, 541, 540, 539, 538, 536, 535, 534, | 1207 | 553, 552, 551, 541, 540, 539, 538, 536, 535, 534, |
| @@ -1323,7 +1335,7 @@ int errorParse; | |||
| 1323 | enum { | 1335 | enum { |
| 1324 | errorNone = 0, | 1336 | errorNone = 0, |
| 1325 | errorUnexpectedInput, | 1337 | errorUnexpectedInput, |
| 1326 | errorUnsupportedFeature, | 1338 | errorUnsupportedFeature, |
| 1327 | }; | 1339 | }; |
| 1328 | 1340 | ||
| 1329 | } | 1341 | } |
| @@ -1351,7 +1363,7 @@ static const char* fixup_escapes (const char* sz); | |||
| 1351 | 1363 | ||
| 1352 | 1364 | ||
| 1353 | 1365 | ||
| 1354 | #line 1355 "<stdout>" | 1366 | #line 1367 "<stdout>" |
| 1355 | 1367 | ||
| 1356 | #define INITIAL 0 | 1368 | #define INITIAL 0 |
| 1357 | #define S_DEF 1 | 1369 | #define S_DEF 1 |
| @@ -1587,11 +1599,11 @@ YY_DECL | |||
| 1587 | #line 164 "bitbakescanner.l" | 1599 | #line 164 "bitbakescanner.l" |
| 1588 | 1600 | ||
| 1589 | 1601 | ||
| 1590 | #line 1591 "<stdout>" | 1602 | #line 1603 "<stdout>" |
| 1591 | 1603 | ||
| 1592 | if ( yyg->yy_init ) | 1604 | if ( !yyg->yy_init ) |
| 1593 | { | 1605 | { |
| 1594 | yyg->yy_init = 0; | 1606 | yyg->yy_init = 1; |
| 1595 | 1607 | ||
| 1596 | #ifdef YY_USER_INIT | 1608 | #ifdef YY_USER_INIT |
| 1597 | YY_USER_INIT; | 1609 | YY_USER_INIT; |
| @@ -1972,7 +1984,7 @@ YY_RULE_SETUP | |||
| 1972 | #line 254 "bitbakescanner.l" | 1984 | #line 254 "bitbakescanner.l" |
| 1973 | ECHO; | 1985 | ECHO; |
| 1974 | YY_BREAK | 1986 | YY_BREAK |
| 1975 | #line 1976 "<stdout>" | 1987 | #line 1988 "<stdout>" |
| 1976 | 1988 | ||
| 1977 | case YY_END_OF_BUFFER: | 1989 | case YY_END_OF_BUFFER: |
| 1978 | { | 1990 | { |
| @@ -2274,7 +2286,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) | |||
| 2274 | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) | 2286 | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) |
| 2275 | { | 2287 | { |
| 2276 | register int yy_is_jam; | 2288 | register int yy_is_jam; |
| 2277 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | 2289 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ |
| 2278 | register char *yy_cp = yyg->yy_c_buf_p; | 2290 | register char *yy_cp = yyg->yy_c_buf_p; |
| 2279 | 2291 | ||
| 2280 | register YY_CHAR yy_c = 1; | 2292 | register YY_CHAR yy_c = 1; |
| @@ -2730,10 +2742,10 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann | |||
| 2730 | * @note If you want to scan bytes that may contain NUL values, then use | 2742 | * @note If you want to scan bytes that may contain NUL values, then use |
| 2731 | * yy_scan_bytes() instead. | 2743 | * yy_scan_bytes() instead. |
| 2732 | */ | 2744 | */ |
| 2733 | YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner) | 2745 | YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) |
| 2734 | { | 2746 | { |
| 2735 | 2747 | ||
| 2736 | return yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner); | 2748 | return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); |
| 2737 | } | 2749 | } |
| 2738 | 2750 | ||
| 2739 | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will | 2751 | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will |
| @@ -2743,7 +2755,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner) | |||
| 2743 | * @param yyscanner The scanner object. | 2755 | * @param yyscanner The scanner object. |
| 2744 | * @return the newly allocated buffer state object. | 2756 | * @return the newly allocated buffer state object. |
| 2745 | */ | 2757 | */ |
| 2746 | YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner) | 2758 | YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) |
| 2747 | { | 2759 | { |
| 2748 | YY_BUFFER_STATE b; | 2760 | YY_BUFFER_STATE b; |
| 2749 | char *buf; | 2761 | char *buf; |
| @@ -2751,15 +2763,15 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscan | |||
| 2751 | int i; | 2763 | int i; |
| 2752 | 2764 | ||
| 2753 | /* Get memory for full buffer, including space for trailing EOB's. */ | 2765 | /* Get memory for full buffer, including space for trailing EOB's. */ |
| 2754 | n = len + 2; | 2766 | n = _yybytes_len + 2; |
| 2755 | buf = (char *) yyalloc(n ,yyscanner ); | 2767 | buf = (char *) yyalloc(n ,yyscanner ); |
| 2756 | if ( ! buf ) | 2768 | if ( ! buf ) |
| 2757 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); | 2769 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
| 2758 | 2770 | ||
| 2759 | for ( i = 0; i < len; ++i ) | 2771 | for ( i = 0; i < _yybytes_len; ++i ) |
| 2760 | buf[i] = bytes[i]; | 2772 | buf[i] = yybytes[i]; |
| 2761 | 2773 | ||
| 2762 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; | 2774 | buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
| 2763 | 2775 | ||
| 2764 | b = yy_scan_buffer(buf,n ,yyscanner); | 2776 | b = yy_scan_buffer(buf,n ,yyscanner); |
| 2765 | if ( ! b ) | 2777 | if ( ! b ) |
| @@ -2987,21 +2999,51 @@ void yyset_debug (int bdebug , yyscan_t yyscanner) | |||
| 2987 | 2999 | ||
| 2988 | /* Accessor methods for yylval and yylloc */ | 3000 | /* Accessor methods for yylval and yylloc */ |
| 2989 | 3001 | ||
| 3002 | /* User-visible API */ | ||
| 3003 | |||
| 3004 | /* yylex_init is special because it creates the scanner itself, so it is | ||
| 3005 | * the ONLY reentrant function that doesn't take the scanner as the last argument. | ||
| 3006 | * That's why we explicitly handle the declaration, instead of using our macros. | ||
| 3007 | */ | ||
| 3008 | |||
| 3009 | int yylex_init(yyscan_t* ptr_yy_globals) | ||
| 3010 | |||
| 3011 | { | ||
| 3012 | if (ptr_yy_globals == NULL){ | ||
| 3013 | errno = EINVAL; | ||
| 3014 | return 1; | ||
| 3015 | } | ||
| 3016 | |||
| 3017 | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); | ||
| 3018 | |||
| 3019 | if (*ptr_yy_globals == NULL){ | ||
| 3020 | errno = ENOMEM; | ||
| 3021 | return 1; | ||
| 3022 | } | ||
| 3023 | |||
| 3024 | /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ | ||
| 3025 | memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); | ||
| 3026 | |||
| 3027 | return yy_init_globals ( *ptr_yy_globals ); | ||
| 3028 | } | ||
| 3029 | |||
| 2990 | static int yy_init_globals (yyscan_t yyscanner) | 3030 | static int yy_init_globals (yyscan_t yyscanner) |
| 2991 | { | 3031 | { |
| 2992 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | 3032 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2993 | /* Initialization is the same as for the non-reentrant scanner. | 3033 | /* Initialization is the same as for the non-reentrant scanner. |
| 2994 | This function is called once per scanner lifetime. */ | 3034 | * This function is called from yylex_destroy(), so don't allocate here. |
| 3035 | */ | ||
| 2995 | 3036 | ||
| 2996 | yyg->yy_buffer_stack = 0; | 3037 | yyg->yy_buffer_stack = 0; |
| 2997 | yyg->yy_buffer_stack_top = 0; | 3038 | yyg->yy_buffer_stack_top = 0; |
| 2998 | yyg->yy_buffer_stack_max = 0; | 3039 | yyg->yy_buffer_stack_max = 0; |
| 2999 | yyg->yy_c_buf_p = (char *) 0; | 3040 | yyg->yy_c_buf_p = (char *) 0; |
| 3000 | yyg->yy_init = 1; | 3041 | yyg->yy_init = 0; |
| 3001 | yyg->yy_start = 0; | 3042 | yyg->yy_start = 0; |
| 3043 | |||
| 3002 | yyg->yy_start_stack_ptr = 0; | 3044 | yyg->yy_start_stack_ptr = 0; |
| 3003 | yyg->yy_start_stack_depth = 0; | 3045 | yyg->yy_start_stack_depth = 0; |
| 3004 | yyg->yy_start_stack = (int *) 0; | 3046 | yyg->yy_start_stack = NULL; |
| 3005 | 3047 | ||
| 3006 | /* Defined in main.c */ | 3048 | /* Defined in main.c */ |
| 3007 | #ifdef YY_STDINIT | 3049 | #ifdef YY_STDINIT |
| @@ -3018,33 +3060,6 @@ static int yy_init_globals (yyscan_t yyscanner) | |||
| 3018 | return 0; | 3060 | return 0; |
| 3019 | } | 3061 | } |
| 3020 | 3062 | ||
| 3021 | /* User-visible API */ | ||
| 3022 | |||
| 3023 | /* yylex_init is special because it creates the scanner itself, so it is | ||
| 3024 | * the ONLY reentrant function that doesn't take the scanner as the last argument. | ||
| 3025 | * That's why we explicitly handle the declaration, instead of using our macros. | ||
| 3026 | */ | ||
| 3027 | |||
| 3028 | int yylex_init(yyscan_t* ptr_yy_globals) | ||
| 3029 | |||
| 3030 | { | ||
| 3031 | if (ptr_yy_globals == NULL){ | ||
| 3032 | errno = EINVAL; | ||
| 3033 | return 1; | ||
| 3034 | } | ||
| 3035 | |||
| 3036 | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); | ||
| 3037 | |||
| 3038 | if (*ptr_yy_globals == NULL){ | ||
| 3039 | errno = ENOMEM; | ||
| 3040 | return 1; | ||
| 3041 | } | ||
| 3042 | |||
| 3043 | memset(*ptr_yy_globals,0,sizeof(struct yyguts_t)); | ||
| 3044 | |||
| 3045 | return yy_init_globals ( *ptr_yy_globals ); | ||
| 3046 | } | ||
| 3047 | |||
| 3048 | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ | 3063 | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ |
| 3049 | int yylex_destroy (yyscan_t yyscanner) | 3064 | int yylex_destroy (yyscan_t yyscanner) |
| 3050 | { | 3065 | { |
| @@ -3065,8 +3080,13 @@ int yylex_destroy (yyscan_t yyscanner) | |||
| 3065 | yyfree(yyg->yy_start_stack ,yyscanner ); | 3080 | yyfree(yyg->yy_start_stack ,yyscanner ); |
| 3066 | yyg->yy_start_stack = NULL; | 3081 | yyg->yy_start_stack = NULL; |
| 3067 | 3082 | ||
| 3083 | /* Reset the globals. This is important in a non-reentrant scanner so the next time | ||
| 3084 | * yylex() is called, initialization will occur. */ | ||
| 3085 | yy_init_globals( yyscanner); | ||
| 3086 | |||
| 3068 | /* Destroy the main struct (reentrant only). */ | 3087 | /* Destroy the main struct (reentrant only). */ |
| 3069 | yyfree ( yyscanner , yyscanner ); | 3088 | yyfree ( yyscanner , yyscanner ); |
| 3089 | yyscanner = NULL; | ||
| 3070 | return 0; | 3090 | return 0; |
| 3071 | } | 3091 | } |
| 3072 | 3092 | ||
| @@ -3078,7 +3098,6 @@ int yylex_destroy (yyscan_t yyscanner) | |||
| 3078 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) | 3098 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) |
| 3079 | { | 3099 | { |
| 3080 | register int i; | 3100 | register int i; |
| 3081 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
| 3082 | for ( i = 0; i < n; ++i ) | 3101 | for ( i = 0; i < n; ++i ) |
| 3083 | s1[i] = s2[i]; | 3102 | s1[i] = s2[i]; |
| 3084 | } | 3103 | } |
| @@ -3088,7 +3107,6 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca | |||
| 3088 | static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) | 3107 | static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) |
| 3089 | { | 3108 | { |
| 3090 | register int n; | 3109 | register int n; |
| 3091 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
| 3092 | for ( n = 0; s[n]; ++n ) | 3110 | for ( n = 0; s[n]; ++n ) |
| 3093 | ; | 3111 | ; |
| 3094 | 3112 | ||
| @@ -3120,18 +3138,6 @@ void yyfree (void * ptr , yyscan_t yyscanner) | |||
| 3120 | 3138 | ||
| 3121 | #define YYTABLES_NAME "yytables" | 3139 | #define YYTABLES_NAME "yytables" |
| 3122 | 3140 | ||
| 3123 | #undef YY_NEW_FILE | ||
| 3124 | #undef YY_FLUSH_BUFFER | ||
| 3125 | #undef yy_set_bol | ||
| 3126 | #undef yy_new_buffer | ||
| 3127 | #undef yy_set_interactive | ||
| 3128 | #undef yytext_ptr | ||
| 3129 | #undef YY_DO_BEFORE_ACTION | ||
| 3130 | |||
| 3131 | #ifdef YY_DECL_IS_OURS | ||
| 3132 | #undef YY_DECL_IS_OURS | ||
| 3133 | #undef YY_DECL | ||
| 3134 | #endif | ||
| 3135 | #line 254 "bitbakescanner.l" | 3141 | #line 254 "bitbakescanner.l" |
| 3136 | 3142 | ||
| 3137 | 3143 | ||
| @@ -3148,47 +3154,49 @@ void lex_t::accept (int token, const char* sz) | |||
| 3148 | 3154 | ||
| 3149 | void lex_t::input (char *buf, int *result, int max_size) | 3155 | void lex_t::input (char *buf, int *result, int max_size) |
| 3150 | { | 3156 | { |
| 3151 | printf("lex_t::input %p %d\n", buf, max_size); | 3157 | /* printf("lex_t::input %p %d\n", buf, max_size); */ |
| 3152 | *result = fread(buf, 1, max_size, file); | 3158 | *result = fread(buf, 1, max_size, file); |
| 3153 | printf("lex_t::input result %d\n", *result); | 3159 | /* printf("lex_t::input result %d\n", *result); */ |
| 3154 | } | 3160 | } |
| 3155 | 3161 | ||
| 3156 | int lex_t::line ()const | 3162 | int lex_t::line ()const |
| 3157 | { | 3163 | { |
| 3158 | printf("lex_t::line\n"); | 3164 | /* printf("lex_t::line\n"); */ |
| 3159 | return yyget_lineno (scanner); | 3165 | return yyget_lineno (scanner); |
| 3160 | } | 3166 | } |
| 3161 | 3167 | ||
| 3162 | 3168 | ||
| 3163 | extern "C" { | 3169 | extern "C" { |
| 3164 | 3170 | ||
| 3165 | void parse (FILE* file, PyObject* data) | 3171 | void parse (FILE* file, char* name, PyObject* data, int config) |
| 3166 | { | 3172 | { |
| 3167 | printf("parse bbparseAlloc\n"); | 3173 | /* printf("parse bbparseAlloc\n"); */ |
| 3168 | void* parser = bbparseAlloc (malloc); | 3174 | void* parser = bbparseAlloc (malloc); |
| 3169 | yyscan_t scanner; | 3175 | yyscan_t scanner; |
| 3170 | lex_t lex; | 3176 | lex_t lex; |
| 3171 | 3177 | ||
| 3172 | printf("parse yylex_init\n"); | 3178 | /* printf("parse yylex_init\n"); */ |
| 3173 | yylex_init (&scanner); | 3179 | yylex_init (&scanner); |
| 3174 | 3180 | ||
| 3175 | lex.parser = parser; | 3181 | lex.parser = parser; |
| 3176 | lex.scanner = scanner; | 3182 | lex.scanner = scanner; |
| 3177 | lex.file = file; | 3183 | lex.file = file; |
| 3184 | lex.name = name; | ||
| 3178 | lex.data = data; | 3185 | lex.data = data; |
| 3186 | lex.config = config; | ||
| 3179 | lex.parse = bbparse; | 3187 | lex.parse = bbparse; |
| 3180 | printf("parse yyset_extra\n"); | 3188 | /*printf("parse yyset_extra\n"); */ |
| 3181 | yyset_extra (&lex, scanner); | 3189 | yyset_extra (&lex, scanner); |
| 3182 | 3190 | ||
| 3183 | printf("parse yylex\n"); | 3191 | /* printf("parse yylex\n"); */ |
| 3184 | int result = yylex (scanner); | 3192 | int result = yylex (scanner); |
| 3185 | 3193 | ||
| 3186 | printf("parse result %d\n", result); | 3194 | /* printf("parse result %d\n", result); */ |
| 3187 | 3195 | ||
| 3188 | lex.accept (0); | 3196 | lex.accept (0); |
| 3189 | printf("parse lex.accept\n"); | 3197 | /* printf("parse lex.accept\n"); */ |
| 3190 | bbparseTrace (NULL, NULL); | 3198 | bbparseTrace (NULL, NULL); |
| 3191 | printf("parse bbparseTrace\n"); | 3199 | /* printf("parse bbparseTrace\n"); */ |
| 3192 | 3200 | ||
| 3193 | if (result != T_EOF) | 3201 | if (result != T_EOF) |
| 3194 | printf ("premature end of file\n"); | 3202 | printf ("premature end of file\n"); |
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"); |
diff --git a/bitbake/lib/bb/parse/parse_c/lexer.h b/bitbake/lib/bb/parse/parse_c/lexer.h index 651f3a8618..cb32be7037 100644 --- a/bitbake/lib/bb/parse/parse_c/lexer.h +++ b/bitbake/lib/bb/parse/parse_c/lexer.h | |||
| @@ -27,13 +27,15 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
| 27 | #include "Python.h" | 27 | #include "Python.h" |
| 28 | 28 | ||
| 29 | extern "C" { | 29 | extern "C" { |
| 30 | 30 | ||
| 31 | struct lex_t { | 31 | struct lex_t { |
| 32 | void* parser; | 32 | void* parser; |
| 33 | void* scanner; | 33 | void* scanner; |
| 34 | FILE* file; | 34 | FILE* file; |
| 35 | char *name; | ||
| 35 | PyObject *data; | 36 | PyObject *data; |
| 36 | 37 | int config; | |
| 38 | |||
| 37 | void* (*parse)(void*, int, token_t, lex_t*); | 39 | void* (*parse)(void*, int, token_t, lex_t*); |
| 38 | 40 | ||
| 39 | void accept(int token, const char* sz = NULL); | 41 | void accept(int token, const char* sz = NULL); |
diff --git a/bitbake/lib/bb/parse/parse_c/lexerc.h b/bitbake/lib/bb/parse/parse_c/lexerc.h index 0163a7d632..c8a19fb222 100644 --- a/bitbake/lib/bb/parse/parse_c/lexerc.h +++ b/bitbake/lib/bb/parse/parse_c/lexerc.h | |||
| @@ -11,7 +11,9 @@ typedef struct { | |||
| 11 | void *parser; | 11 | void *parser; |
| 12 | void *scanner; | 12 | void *scanner; |
| 13 | FILE *file; | 13 | FILE *file; |
| 14 | char *name; | ||
| 14 | PyObject *data; | 15 | PyObject *data; |
| 16 | int config; | ||
| 15 | } lex_t; | 17 | } lex_t; |
| 16 | 18 | ||
| 17 | #endif | 19 | #endif |
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index c82090fec0..34f4d25996 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | import re, bb, os, sys, time | 24 | import re, bb, os, sys, time |
| 25 | import bb.fetch, bb.build, bb.utils | 25 | import bb.fetch, bb.build, bb.utils |
| 26 | from bb import debug, data, fetch, fatal, methodpool | 26 | from bb import data, fetch, methodpool |
| 27 | 27 | ||
| 28 | from ConfHandler import include, localpath, obtain, init | 28 | from ConfHandler import include, localpath, obtain, init |
| 29 | from bb.parse import ParseError | 29 | from bb.parse import ParseError |
| @@ -44,6 +44,13 @@ __bbpath_found__ = 0 | |||
| 44 | __classname__ = "" | 44 | __classname__ = "" |
| 45 | classes = [ None, ] | 45 | classes = [ None, ] |
| 46 | 46 | ||
| 47 | # We need to indicate EOF to the feeder. This code is so messy that | ||
| 48 | # factoring it out to a close_parse_file method is out of question. | ||
| 49 | # We will use the IN_PYTHON_EOF as an indicator to just close the method | ||
| 50 | # | ||
| 51 | # The two parts using it are tightly integrated anyway | ||
| 52 | IN_PYTHON_EOF = -9999999999999 | ||
| 53 | |||
| 47 | __parsed_methods__ = methodpool.get_parsed_dict() | 54 | __parsed_methods__ = methodpool.get_parsed_dict() |
| 48 | 55 | ||
| 49 | def supports(fn, d): | 56 | def supports(fn, d): |
| @@ -60,9 +67,9 @@ def inherit(files, d): | |||
| 60 | file = os.path.join('classes', '%s.bbclass' % file) | 67 | file = os.path.join('classes', '%s.bbclass' % file) |
| 61 | 68 | ||
| 62 | if not file in __inherit_cache.split(): | 69 | if not file in __inherit_cache.split(): |
| 63 | debug(2, "BB %s:%d: inheriting %s" % (fn, lineno, file)) | 70 | bb.msg.debug(2, bb.msg.domain.Parsing, "BB %s:%d: inheriting %s" % (fn, lineno, file)) |
| 64 | __inherit_cache += " %s" % file | 71 | __inherit_cache += " %s" % file |
| 65 | include(fn, file, d) | 72 | include(fn, file, d, "inherit") |
| 66 | data.setVar('__inherit_cache', __inherit_cache, d) | 73 | data.setVar('__inherit_cache', __inherit_cache, d) |
| 67 | 74 | ||
| 68 | 75 | ||
| @@ -75,9 +82,9 @@ def handle(fn, d, include = 0): | |||
| 75 | __residue__ = [] | 82 | __residue__ = [] |
| 76 | 83 | ||
| 77 | if include == 0: | 84 | if include == 0: |
| 78 | debug(2, "BB " + fn + ": handle(data)") | 85 | bb.msg.debug(2, bb.msg.domain.Parsing, "BB " + fn + ": handle(data)") |
| 79 | else: | 86 | else: |
| 80 | debug(2, "BB " + fn + ": handle(data, include)") | 87 | bb.msg.debug(2, bb.msg.domain.Parsing, "BB " + fn + ": handle(data, include)") |
| 81 | 88 | ||
| 82 | (root, ext) = os.path.splitext(os.path.basename(fn)) | 89 | (root, ext) = os.path.splitext(os.path.basename(fn)) |
| 83 | base_name = "%s%s" % (root,ext) | 90 | base_name = "%s%s" % (root,ext) |
| @@ -132,7 +139,7 @@ def handle(fn, d, include = 0): | |||
| 132 | feeder(lineno, s, fn, base_name, d) | 139 | feeder(lineno, s, fn, base_name, d) |
| 133 | if __inpython__: | 140 | if __inpython__: |
| 134 | # add a blank line to close out any python definition | 141 | # add a blank line to close out any python definition |
| 135 | feeder(lineno + 1, "", fn, base_name, d) | 142 | feeder(IN_PYTHON_EOF, "", fn, base_name, d) |
| 136 | if ext == ".bbclass": | 143 | if ext == ".bbclass": |
| 137 | classes.remove(__classname__) | 144 | classes.remove(__classname__) |
| 138 | else: | 145 | else: |
| @@ -152,7 +159,7 @@ def handle(fn, d, include = 0): | |||
| 152 | if t: | 159 | if t: |
| 153 | data.setVar('T', t, d) | 160 | data.setVar('T', t, d) |
| 154 | except Exception, e: | 161 | except Exception, e: |
| 155 | bb.debug(1, "executing anonymous function: %s" % e) | 162 | bb.msg.debug(1, bb.msg.domain.Parsing, "executing anonymous function: %s" % e) |
| 156 | raise | 163 | raise |
| 157 | data.delVar("__anonqueue", d) | 164 | data.delVar("__anonqueue", d) |
| 158 | data.delVar("__anonfunc", d) | 165 | data.delVar("__anonfunc", d) |
| @@ -220,7 +227,7 @@ def feeder(lineno, s, fn, root, d): | |||
| 220 | 227 | ||
| 221 | if __inpython__: | 228 | if __inpython__: |
| 222 | m = __python_func_regexp__.match(s) | 229 | m = __python_func_regexp__.match(s) |
| 223 | if m: | 230 | if m and lineno != IN_PYTHON_EOF: |
| 224 | __body__.append(s) | 231 | __body__.append(s) |
| 225 | return | 232 | return |
| 226 | else: | 233 | else: |
| @@ -240,6 +247,9 @@ def feeder(lineno, s, fn, root, d): | |||
| 240 | __body__ = [] | 247 | __body__ = [] |
| 241 | __inpython__ = False | 248 | __inpython__ = False |
| 242 | 249 | ||
| 250 | if lineno == IN_PYTHON_EOF: | ||
| 251 | return | ||
| 252 | |||
| 243 | # fall through | 253 | # fall through |
| 244 | 254 | ||
| 245 | if s == '' or s[0] == '#': return # skip comments and empty lines | 255 | if s == '' or s[0] == '#': return # skip comments and empty lines |
| @@ -374,7 +384,7 @@ def vars_from_file(mypkg, d): | |||
| 374 | def set_additional_vars(file, d, include): | 384 | def set_additional_vars(file, d, include): |
| 375 | """Deduce rest of variables, e.g. ${A} out of ${SRC_URI}""" | 385 | """Deduce rest of variables, e.g. ${A} out of ${SRC_URI}""" |
| 376 | 386 | ||
| 377 | debug(2,"BB %s: set_additional_vars" % file) | 387 | bb.msg.debug(2, bb.msg.domain.Parsing, "BB %s: set_additional_vars" % file) |
| 378 | 388 | ||
| 379 | src_uri = data.getVar('SRC_URI', d) | 389 | src_uri = data.getVar('SRC_URI', d) |
| 380 | if not src_uri: | 390 | if not src_uri: |
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index 90978300af..4bc2bbc2b7 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | Place, Suite 330, Boston, MA 02111-1307 USA.""" | 22 | Place, Suite 330, Boston, MA 02111-1307 USA.""" |
| 23 | 23 | ||
| 24 | import re, bb.data, os, sys | 24 | import re, bb.data, os, sys |
| 25 | from bb import debug, fatal | ||
| 26 | from bb.parse import ParseError | 25 | from bb.parse import ParseError |
| 27 | 26 | ||
| 28 | #__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}]+)\s*(?P<colon>:)?(?P<ques>\?)?=\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$") | 27 | #__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}]+)\s*(?P<colon>:)?(?P<ques>\?)?=\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$") |
| @@ -53,7 +52,7 @@ def localpath(fn, d): | |||
| 53 | localfn = fn | 52 | localfn = fn |
| 54 | return localfn | 53 | return localfn |
| 55 | 54 | ||
| 56 | def obtain(fn, data = bb.data.init()): | 55 | def obtain(fn, data): |
| 57 | import sys, bb | 56 | import sys, bb |
| 58 | fn = bb.data.expand(fn, data) | 57 | fn = bb.data.expand(fn, data) |
| 59 | localfn = bb.data.expand(localpath(fn, data), data) | 58 | localfn = bb.data.expand(localpath(fn, data), data) |
| @@ -61,30 +60,30 @@ def obtain(fn, data = bb.data.init()): | |||
| 61 | if localfn != fn: | 60 | if localfn != fn: |
| 62 | dldir = bb.data.getVar('DL_DIR', data, 1) | 61 | dldir = bb.data.getVar('DL_DIR', data, 1) |
| 63 | if not dldir: | 62 | if not dldir: |
| 64 | debug(1, "obtain: DL_DIR not defined") | 63 | bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: DL_DIR not defined") |
| 65 | return localfn | 64 | return localfn |
| 66 | bb.mkdirhier(dldir) | 65 | bb.mkdirhier(dldir) |
| 67 | try: | 66 | try: |
| 68 | bb.fetch.init([fn]) | 67 | bb.fetch.init([fn]) |
| 69 | except bb.fetch.NoMethodError: | 68 | except bb.fetch.NoMethodError: |
| 70 | (type, value, traceback) = sys.exc_info() | 69 | (type, value, traceback) = sys.exc_info() |
| 71 | debug(1, "obtain: no method: %s" % value) | 70 | bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: no method: %s" % value) |
| 72 | return localfn | 71 | return localfn |
| 73 | 72 | ||
| 74 | try: | 73 | try: |
| 75 | bb.fetch.go(data) | 74 | bb.fetch.go(data) |
| 76 | except bb.fetch.MissingParameterError: | 75 | except bb.fetch.MissingParameterError: |
| 77 | (type, value, traceback) = sys.exc_info() | 76 | (type, value, traceback) = sys.exc_info() |
| 78 | debug(1, "obtain: missing parameters: %s" % value) | 77 | bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: missing parameters: %s" % value) |
| 79 | return localfn | 78 | return localfn |
| 80 | except bb.fetch.FetchError: | 79 | except bb.fetch.FetchError: |
| 81 | (type, value, traceback) = sys.exc_info() | 80 | (type, value, traceback) = sys.exc_info() |
| 82 | debug(1, "obtain: failed: %s" % value) | 81 | bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: failed: %s" % value) |
| 83 | return localfn | 82 | return localfn |
| 84 | return localfn | 83 | return localfn |
| 85 | 84 | ||
| 86 | 85 | ||
| 87 | def include(oldfn, fn, data = bb.data.init(), error_out = False): | 86 | def include(oldfn, fn, data, error_out): |
| 88 | """ | 87 | """ |
| 89 | 88 | ||
| 90 | error_out If True a ParseError will be reaised if the to be included | 89 | error_out If True a ParseError will be reaised if the to be included |
| @@ -101,10 +100,10 @@ def include(oldfn, fn, data = bb.data.init(), error_out = False): | |||
| 101 | ret = handle(fn, data, True) | 100 | ret = handle(fn, data, True) |
| 102 | except IOError: | 101 | except IOError: |
| 103 | if error_out: | 102 | if error_out: |
| 104 | raise ParseError("Could not include required file %(fn)s" % vars() ) | 103 | raise ParseError("Could not %(error_out)s file %(fn)s" % vars() ) |
| 105 | debug(2, "CONF file '%s' not found" % fn) | 104 | bb.msg.debug(2, bb.msg.domain.Parsing, "CONF file '%s' not found" % fn) |
| 106 | 105 | ||
| 107 | def handle(fn, data = bb.data.init(), include = 0): | 106 | def handle(fn, data, include = 0): |
| 108 | if include: | 107 | if include: |
| 109 | inc_string = "including" | 108 | inc_string = "including" |
| 110 | else: | 109 | else: |
| @@ -129,13 +128,13 @@ def handle(fn, data = bb.data.init(), include = 0): | |||
| 129 | if os.access(currname, os.R_OK): | 128 | if os.access(currname, os.R_OK): |
| 130 | f = open(currname, 'r') | 129 | f = open(currname, 'r') |
| 131 | abs_fn = currname | 130 | abs_fn = currname |
| 132 | debug(1, "CONF %s %s" % (inc_string, currname)) | 131 | bb.msg.debug(2, bb.msg.domain.Parsing, "CONF %s %s" % (inc_string, currname)) |
| 133 | break | 132 | break |
| 134 | if f is None: | 133 | if f is None: |
| 135 | raise IOError("file '%s' not found" % fn) | 134 | raise IOError("file '%s' not found" % fn) |
| 136 | else: | 135 | else: |
| 137 | f = open(fn,'r') | 136 | f = open(fn,'r') |
| 138 | debug(1, "CONF %s %s" % (inc_string,fn)) | 137 | bb.msg.debug(1, bb.msg.domain.Parsing, "CONF %s %s" % (inc_string,fn)) |
| 139 | abs_fn = fn | 138 | abs_fn = fn |
| 140 | 139 | ||
| 141 | if include: | 140 | if include: |
| @@ -161,7 +160,7 @@ def handle(fn, data = bb.data.init(), include = 0): | |||
| 161 | bb.data.setVar('FILE', oldfile, data) | 160 | bb.data.setVar('FILE', oldfile, data) |
| 162 | return data | 161 | return data |
| 163 | 162 | ||
| 164 | def feeder(lineno, s, fn, data = bb.data.init()): | 163 | def feeder(lineno, s, fn, data): |
| 165 | m = __config_regexp__.match(s) | 164 | m = __config_regexp__.match(s) |
| 166 | if m: | 165 | if m: |
| 167 | groupd = m.groupdict() | 166 | groupd = m.groupdict() |
| @@ -185,7 +184,7 @@ def feeder(lineno, s, fn, data = bb.data.init()): | |||
| 185 | else: | 184 | else: |
| 186 | val = groupd["value"] | 185 | val = groupd["value"] |
| 187 | if 'flag' in groupd and groupd['flag'] != None: | 186 | if 'flag' in groupd and groupd['flag'] != None: |
| 188 | # bb.note("setVarFlag(%s, %s, %s, data)" % (key, groupd['flag'], val)) | 187 | bb.msg.debug(3, bb.msg.domain.Parsing, "setVarFlag(%s, %s, %s, data)" % (key, groupd['flag'], val)) |
| 189 | bb.data.setVarFlag(key, groupd['flag'], val, data) | 188 | bb.data.setVarFlag(key, groupd['flag'], val, data) |
| 190 | else: | 189 | else: |
| 191 | bb.data.setVar(key, val, data) | 190 | bb.data.setVar(key, val, data) |
| @@ -194,14 +193,14 @@ def feeder(lineno, s, fn, data = bb.data.init()): | |||
| 194 | m = __include_regexp__.match(s) | 193 | m = __include_regexp__.match(s) |
| 195 | if m: | 194 | if m: |
| 196 | s = bb.data.expand(m.group(1), data) | 195 | s = bb.data.expand(m.group(1), data) |
| 197 | # debug(2, "CONF %s:%d: including %s" % (fn, lineno, s)) | 196 | bb.msg.debug(3, bb.msg.domain.Parsing, "CONF %s:%d: including %s" % (fn, lineno, s)) |
| 198 | include(fn, s, data) | 197 | include(fn, s, data, False) |
| 199 | return | 198 | return |
| 200 | 199 | ||
| 201 | m = __require_regexp__.match(s) | 200 | m = __require_regexp__.match(s) |
| 202 | if m: | 201 | if m: |
| 203 | s = bb.data.expand(m.group(1), data) | 202 | s = bb.data.expand(m.group(1), data) |
| 204 | include(fn, s, data, True) | 203 | include(fn, s, data, "include required") |
| 205 | return | 204 | return |
| 206 | 205 | ||
| 207 | raise ParseError("%s:%d: unparsed line: '%s'" % (fn, lineno, s)); | 206 | raise ParseError("%s:%d: unparsed line: '%s'" % (fn, lineno, s)); |
