diff options
author | Richard Purdie <richard@openedhand.com> | 2006-03-20 17:45:11 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-03-20 17:45:11 +0000 |
commit | b26a945734ce271aa7d443ff9e96fe2851b21138 (patch) | |
tree | f540b8d58a7411cf0cabe5c8f4ad40f9f597352a /bitbake | |
parent | 3cd47ad235d54a9c539ae6fe4a5a2b4b5f7e5621 (diff) | |
download | poky-b26a945734ce271aa7d443ff9e96fe2851b21138.tar.gz |
Update to latest bitbake
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@309 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake')
29 files changed, 4868 insertions, 410 deletions
diff --git a/bitbake/ChangeLog b/bitbake/ChangeLog index c05ff96ab9..3dfba1ed81 100644 --- a/bitbake/ChangeLog +++ b/bitbake/ChangeLog | |||
@@ -1,3 +1,10 @@ | |||
1 | Changes in BitBake 1.3.x: | ||
2 | - Fix to check both RDEPENDS and RDEPENDS_${PN} | ||
3 | - Fix a RDEPENDS parsing bug in utils:explode_deps() | ||
4 | - Update git fetcher behaviour to match git changes | ||
5 | - ASSUME_PROVIDED allowed to include runtime packages | ||
6 | - git fetcher cleanup and efficency improvements | ||
7 | |||
1 | Changes in BitBake 1.3.3: | 8 | Changes in BitBake 1.3.3: |
2 | - Create a new Fetcher module to ease the | 9 | - Create a new Fetcher module to ease the |
3 | development of new Fetchers. | 10 | development of new Fetchers. |
diff --git a/bitbake/MANIFEST b/bitbake/MANIFEST index cf0aac99d9..14a21d7bf4 100644 --- a/bitbake/MANIFEST +++ b/bitbake/MANIFEST | |||
@@ -14,6 +14,7 @@ lib/bb/fetch/cvs.py | |||
14 | lib/bb/fetch/git.py | 14 | lib/bb/fetch/git.py |
15 | lib/bb/fetch/__init__.py | 15 | lib/bb/fetch/__init__.py |
16 | lib/bb/fetch/local.py | 16 | lib/bb/fetch/local.py |
17 | lib/bb/fetch/svk.py | ||
17 | lib/bb/fetch/svn.py | 18 | lib/bb/fetch/svn.py |
18 | lib/bb/fetch/wget.py | 19 | lib/bb/fetch/wget.py |
19 | lib/bb/manifest.py | 20 | lib/bb/manifest.py |
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 63bd07fe34..457fbb7527 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
@@ -22,7 +22,7 @@ | |||
22 | # Place, Suite 330, Boston, MA 02111-1307 USA. | 22 | # Place, Suite 330, Boston, MA 02111-1307 USA. |
23 | 23 | ||
24 | import sys, os, getopt, glob, copy, os.path, re, time | 24 | import sys, os, getopt, glob, copy, os.path, re, time |
25 | sys.path.append(os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) | 25 | sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) |
26 | import bb | 26 | import bb |
27 | from bb import utils, data, parse, debug, event, fatal | 27 | from bb import utils, data, parse, debug, event, fatal |
28 | from sets import Set | 28 | from sets import Set |
@@ -31,7 +31,7 @@ import itertools, optparse | |||
31 | parsespin = itertools.cycle( r'|/-\\' ) | 31 | parsespin = itertools.cycle( r'|/-\\' ) |
32 | bbdebug = 0 | 32 | bbdebug = 0 |
33 | 33 | ||
34 | __version__ = "1.3.3" | 34 | __version__ = "1.3.3.2" |
35 | 35 | ||
36 | #============================================================================# | 36 | #============================================================================# |
37 | # BBParsingStatus | 37 | # BBParsingStatus |
@@ -80,7 +80,7 @@ class BBParsingStatus: | |||
80 | depends = (bb.data.getVar("DEPENDS", bb_data, True) or "").split() | 80 | depends = (bb.data.getVar("DEPENDS", bb_data, True) or "").split() |
81 | packages = (bb.data.getVar('PACKAGES', bb_data, True) or "").split() | 81 | packages = (bb.data.getVar('PACKAGES', bb_data, True) or "").split() |
82 | packages_dynamic = (bb.data.getVar('PACKAGES_DYNAMIC', bb_data, True) or "").split() | 82 | packages_dynamic = (bb.data.getVar('PACKAGES_DYNAMIC', bb_data, True) or "").split() |
83 | rprovides = Set((bb.data.getVar("RPROVIDES_%s" % pn, bb_data, 1) or "").split() + (bb.data.getVar("RPROVIDES", bb_data, 1) or "").split()) | 83 | rprovides = (bb.data.getVar("RPROVIDES", bb_data, 1) or "").split() |
84 | 84 | ||
85 | 85 | ||
86 | # build PackageName to FileName lookup table | 86 | # build PackageName to FileName lookup table |
@@ -110,11 +110,11 @@ class BBParsingStatus: | |||
110 | 110 | ||
111 | # Build reverse hash for PACKAGES, so runtime dependencies | 111 | # Build reverse hash for PACKAGES, so runtime dependencies |
112 | # can be be resolved (RDEPENDS, RRECOMMENDS etc.) | 112 | # can be be resolved (RDEPENDS, RRECOMMENDS etc.) |
113 | |||
114 | for package in packages: | 113 | for package in packages: |
115 | if not package in self.packages: | 114 | if not package in self.packages: |
116 | self.packages[package] = [] | 115 | self.packages[package] = [] |
117 | self.packages[package].append(file_name) | 116 | self.packages[package].append(file_name) |
117 | rprovides += (bb.data.getVar("RPROVIDES_%s" % package, bb_data, 1) or "").split() | ||
118 | 118 | ||
119 | for package in packages_dynamic: | 119 | for package in packages_dynamic: |
120 | if not package in self.packages_dynamic: | 120 | if not package in self.packages_dynamic: |
@@ -493,6 +493,7 @@ class BBCooker: | |||
493 | 493 | ||
494 | if not item in self.status.providers: | 494 | if not item in self.status.providers: |
495 | bb.error("Nothing provides dependency %s" % item) | 495 | bb.error("Nothing provides dependency %s" % item) |
496 | bb.event.fire(bb.event.NoProvider(item,self.configuration.data)) | ||
496 | return 0 | 497 | return 0 |
497 | 498 | ||
498 | all_p = self.status.providers[item] | 499 | all_p = self.status.providers[item] |
@@ -529,6 +530,7 @@ class BBCooker: | |||
529 | providers_list.append(self.status.pkg_fn[fn]) | 530 | providers_list.append(self.status.pkg_fn[fn]) |
530 | bb.note("multiple providers are available (%s);" % ", ".join(providers_list)) | 531 | bb.note("multiple providers are available (%s);" % ", ".join(providers_list)) |
531 | bb.note("consider defining PREFERRED_PROVIDER_%s" % item) | 532 | bb.note("consider defining PREFERRED_PROVIDER_%s" % item) |
533 | bb.event.fire(bb.event.MultipleProviders(item,providers_list,self.configuration.data)) | ||
532 | self.consider_msgs_cache.append(item) | 534 | self.consider_msgs_cache.append(item) |
533 | 535 | ||
534 | 536 | ||
@@ -539,6 +541,7 @@ class BBCooker: | |||
539 | return 1 | 541 | return 1 |
540 | 542 | ||
541 | bb.note("no buildable providers for %s" % item) | 543 | bb.note("no buildable providers for %s" % item) |
544 | bb.event.fire(bb.event.NoProvider(item,self.configuration.data)) | ||
542 | return 0 | 545 | return 0 |
543 | 546 | ||
544 | def buildRProvider( self, item , buildAllDeps ): | 547 | def buildRProvider( self, item , buildAllDeps ): |
@@ -558,6 +561,7 @@ class BBCooker: | |||
558 | 561 | ||
559 | if not all_p: | 562 | if not all_p: |
560 | bb.error("Nothing provides runtime dependency %s" % (item)) | 563 | bb.error("Nothing provides runtime dependency %s" % (item)) |
564 | bb.event.fire(bb.event.NoProvider(item,self.configuration.data,runtime=True)) | ||
561 | return False | 565 | return False |
562 | 566 | ||
563 | for p in all_p: | 567 | for p in all_p: |
@@ -592,6 +596,7 @@ class BBCooker: | |||
592 | providers_list.append(self.status.pkg_fn[fn]) | 596 | providers_list.append(self.status.pkg_fn[fn]) |
593 | bb.note("multiple providers are available (%s);" % ", ".join(providers_list)) | 597 | bb.note("multiple providers are available (%s);" % ", ".join(providers_list)) |
594 | bb.note("consider defining a PREFERRED_PROVIDER to match runtime %s" % item) | 598 | bb.note("consider defining a PREFERRED_PROVIDER to match runtime %s" % item) |
599 | bb.event.fire(bb.event.MultipleProviders(item,providers_list,self.configuration.data,runtime=True)) | ||
595 | self.consider_msgs_cache.append(item) | 600 | self.consider_msgs_cache.append(item) |
596 | 601 | ||
597 | if len(preferred) > 1: | 602 | if len(preferred) > 1: |
@@ -601,6 +606,7 @@ class BBCooker: | |||
601 | providers_list.append(self.status.pkg_fn[fn]) | 606 | providers_list.append(self.status.pkg_fn[fn]) |
602 | bb.note("multiple preferred providers are available (%s);" % ", ".join(providers_list)) | 607 | bb.note("multiple preferred providers are available (%s);" % ", ".join(providers_list)) |
603 | bb.note("consider defining only one PREFERRED_PROVIDER to match runtime %s" % item) | 608 | bb.note("consider defining only one PREFERRED_PROVIDER to match runtime %s" % item) |
609 | bb.event.fire(bb.event.MultipleProviders(item,providers_list,self.configuration.data,runtime=True)) | ||
604 | self.consider_msgs_cache.append(item) | 610 | self.consider_msgs_cache.append(item) |
605 | 611 | ||
606 | # run through the list until we find one that we can build | 612 | # run through the list until we find one that we can build |
@@ -610,6 +616,7 @@ class BBCooker: | |||
610 | return True | 616 | return True |
611 | 617 | ||
612 | bb.error("No buildable providers for runtime %s" % item) | 618 | bb.error("No buildable providers for runtime %s" % item) |
619 | bb.event.fire(bb.event.NoProvider(item,self.configuration.data)) | ||
613 | return False | 620 | return False |
614 | 621 | ||
615 | def getProvidersRun(self, rdepend): | 622 | def getProvidersRun(self, rdepend): |
@@ -666,7 +673,9 @@ class BBCooker: | |||
666 | 673 | ||
667 | bb.debug(2, "Additional runtime dependencies for %s are: %s" % (item, " ".join(rdepends))) | 674 | bb.debug(2, "Additional runtime dependencies for %s are: %s" % (item, " ".join(rdepends))) |
668 | 675 | ||
669 | for rdepend in rdepends: | 676 | for rdepend in rdepends: |
677 | if rdepend in self.status.ignored_dependencies: | ||
678 | continue | ||
670 | if not self.buildRProvider(rdepend, buildAllDeps): | 679 | if not self.buildRProvider(rdepend, buildAllDeps): |
671 | return False | 680 | return False |
672 | return True | 681 | return True |
@@ -880,6 +889,7 @@ class BBCooker: | |||
880 | 889 | ||
881 | bb.event.fire(bb.event.BuildStarted(buildname, pkgs_to_build, self.configuration.data)) | 890 | bb.event.fire(bb.event.BuildStarted(buildname, pkgs_to_build, self.configuration.data)) |
882 | 891 | ||
892 | failures = 0 | ||
883 | for k in pkgs_to_build: | 893 | for k in pkgs_to_build: |
884 | failed = False | 894 | failed = False |
885 | try: | 895 | try: |
@@ -891,10 +901,11 @@ class BBCooker: | |||
891 | failed = True | 901 | failed = True |
892 | 902 | ||
893 | if failed: | 903 | if failed: |
904 | failures += failures | ||
894 | if self.configuration.abort: | 905 | if self.configuration.abort: |
895 | sys.exit(1) | 906 | sys.exit(1) |
896 | 907 | ||
897 | bb.event.fire(bb.event.BuildCompleted(buildname, pkgs_to_build, self.configuration.data)) | 908 | bb.event.fire(bb.event.BuildCompleted(buildname, pkgs_to_build, self.configuration.data, failures)) |
898 | 909 | ||
899 | sys.exit( self.stats.show() ) | 910 | sys.exit( self.stats.show() ) |
900 | 911 | ||
@@ -1067,8 +1078,7 @@ class BBCooker: | |||
1067 | # main | 1078 | # main |
1068 | #============================================================================# | 1079 | #============================================================================# |
1069 | 1080 | ||
1070 | if __name__ == "__main__": | 1081 | def main(): |
1071 | |||
1072 | parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % ( bb.__version__, __version__ ), | 1082 | parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % ( bb.__version__, __version__ ), |
1073 | usage = """%prog [options] [package ...] | 1083 | usage = """%prog [options] [package ...] |
1074 | 1084 | ||
@@ -1120,3 +1130,8 @@ Default BBFILES are the .bb files in the current directory.""" ) | |||
1120 | 1130 | ||
1121 | cooker = BBCooker() | 1131 | cooker = BBCooker() |
1122 | cooker.cook( BBConfiguration( options ), args[1:] ) | 1132 | cooker.cook( BBConfiguration( options ), args[1:] ) |
1133 | |||
1134 | |||
1135 | |||
1136 | if __name__ == "__main__": | ||
1137 | main() | ||
diff --git a/bitbake/bin/bitdoc b/bitbake/bin/bitdoc index 64d32945ba..84d2ee23ce 100755 --- a/bitbake/bin/bitdoc +++ b/bitbake/bin/bitdoc | |||
@@ -30,7 +30,7 @@ import optparse, os, sys | |||
30 | # bitbake | 30 | # bitbake |
31 | sys.path.append(os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) | 31 | sys.path.append(os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) |
32 | import bb | 32 | import bb |
33 | from bb import make | 33 | import bb.parse |
34 | from string import split, join | 34 | from string import split, join |
35 | 35 | ||
36 | __version__ = "0.0.2" | 36 | __version__ = "0.0.2" |
@@ -45,8 +45,8 @@ class HTMLFormatter: | |||
45 | one site for each key with links to the relations and groups. | 45 | one site for each key with links to the relations and groups. |
46 | 46 | ||
47 | index.html | 47 | index.html |
48 | keys.html | 48 | all_keys.html |
49 | groups.html | 49 | all_groups.html |
50 | groupNAME.html | 50 | groupNAME.html |
51 | keyNAME.html | 51 | keyNAME.html |
52 | """ | 52 | """ |
@@ -75,8 +75,8 @@ class HTMLFormatter: | |||
75 | return """<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> | 75 | return """<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> |
76 | <tr valign="middle"> | 76 | <tr valign="middle"> |
77 | <td><a accesskey="g" href="index.html">Home</a></td> | 77 | <td><a accesskey="g" href="index.html">Home</a></td> |
78 | <td><a accesskey="n" href="groups.html">Groups</a></td> | 78 | <td><a accesskey="n" href="all_groups.html">Groups</a></td> |
79 | <td><a accesskey="u" href="keys.html">Keys</a></td> | 79 | <td><a accesskey="u" href="all_keys.html">Keys</a></td> |
80 | </tr></table> | 80 | </tr></table> |
81 | """ | 81 | """ |
82 | 82 | ||
@@ -89,10 +89,11 @@ class HTMLFormatter: | |||
89 | return "" | 89 | return "" |
90 | 90 | ||
91 | txt = "<p><b>See also:</b><br>" | 91 | txt = "<p><b>See also:</b><br>" |
92 | txts = [] | ||
92 | for it in item.related(): | 93 | for it in item.related(): |
93 | txt += """<a href="key%s.html">%s</a>, """ % (it, it) | 94 | txts.append("""<a href="key%(it)s.html">%(it)s</a>""" % vars() ) |
94 | 95 | ||
95 | return txt | 96 | return txt + ",".join(txts) |
96 | 97 | ||
97 | def groups(self,item): | 98 | def groups(self,item): |
98 | """ | 99 | """ |
@@ -103,11 +104,12 @@ class HTMLFormatter: | |||
103 | return "" | 104 | return "" |
104 | 105 | ||
105 | 106 | ||
106 | txt = "<p><b>Seel also:</b><br>" | 107 | txt = "<p><b>See also:</b><br>" |
108 | txts = [] | ||
107 | for group in item.groups(): | 109 | for group in item.groups(): |
108 | txt += """<a href="group%s.html">%s</a>, """ % (group,group) | 110 | txts.append( """<a href="group%s.html">%s</a> """ % (group,group) ) |
109 | 111 | ||
110 | return txt | 112 | return txt + ",".join(txts) |
111 | 113 | ||
112 | 114 | ||
113 | def createKeySite(self,item): | 115 | def createKeySite(self,item): |
@@ -125,23 +127,23 @@ class HTMLFormatter: | |||
125 | 127 | ||
126 | <div class="refsynopsisdiv"> | 128 | <div class="refsynopsisdiv"> |
127 | <h2>Synopsis</h2> | 129 | <h2>Synopsis</h2> |
128 | <pre class="synopsis"> | 130 | <p> |
129 | %s | 131 | %s |
130 | </pre> | 132 | </p> |
131 | </div> | 133 | </div> |
132 | 134 | ||
133 | <div class="refsynopsisdiv"> | 135 | <div class="refsynopsisdiv"> |
134 | <h2>Related Keys</h2> | 136 | <h2>Related Keys</h2> |
135 | <pre class="synopsis"> | 137 | <p> |
136 | %s | 138 | %s |
137 | </pre> | 139 | </p> |
138 | </div> | 140 | </div> |
139 | 141 | ||
140 | <div class="refsynopsisdiv"> | 142 | <div class="refsynopsisdiv"> |
141 | <h2>Groups</h2> | 143 | <h2>Groups</h2> |
142 | <pre class="synopsis"> | 144 | <p> |
143 | %s | 145 | %s |
144 | </pre> | 146 | </p> |
145 | </div> | 147 | </div> |
146 | 148 | ||
147 | 149 | ||
@@ -181,8 +183,8 @@ class HTMLFormatter: | |||
181 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | 183 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
182 | %s | 184 | %s |
183 | <h2>Documentation Entrance</h2> | 185 | <h2>Documentation Entrance</h2> |
184 | <a href="groups.html">All available groups</a><br> | 186 | <a href="all_groups.html">All available groups</a><br> |
185 | <a href="keys.html">All available keys</a><br> | 187 | <a href="all_keys.html">All available keys</a><br> |
186 | </body> | 188 | </body> |
187 | """ % self.createNavigator() | 189 | """ % self.createNavigator() |
188 | 190 | ||
@@ -206,13 +208,21 @@ class HTMLFormatter: | |||
206 | </body> | 208 | </body> |
207 | """ % (self.createNavigator(), keys) | 209 | """ % (self.createNavigator(), keys) |
208 | 210 | ||
209 | def createGroupSite(self,gr, items): | 211 | def createGroupSite(self, gr, items, _description = None): |
210 | """ | 212 | """ |
211 | Create a site for a group: | 213 | Create a site for a group: |
212 | Group the name of the group, items contain the name of the keys | 214 | Group the name of the group, items contain the name of the keys |
213 | inside this group | 215 | inside this group |
214 | """ | 216 | """ |
215 | groups = "" | 217 | groups = "" |
218 | description = "" | ||
219 | |||
220 | # create a section with the group descriptions | ||
221 | if _description: | ||
222 | description += "<h2 Description of Grozp %s</h2>" % gr | ||
223 | description += _description | ||
224 | |||
225 | items.sort(lambda x,y:cmp(x.name(),y.name())) | ||
216 | for group in items: | 226 | for group in items: |
217 | groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name()) | 227 | groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name()) |
218 | 228 | ||
@@ -221,6 +231,7 @@ class HTMLFormatter: | |||
221 | <link rel="stylesheet" href="style.css" type="text/css"> | 231 | <link rel="stylesheet" href="style.css" type="text/css"> |
222 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | 232 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
223 | %s | 233 | %s |
234 | %s | ||
224 | <div class="refsynopsisdiv"> | 235 | <div class="refsynopsisdiv"> |
225 | <h2>Keys in Group %s</h2> | 236 | <h2>Keys in Group %s</h2> |
226 | <pre class="synopsis"> | 237 | <pre class="synopsis"> |
@@ -228,7 +239,7 @@ class HTMLFormatter: | |||
228 | </pre> | 239 | </pre> |
229 | </div> | 240 | </div> |
230 | </body> | 241 | </body> |
231 | """ % (gr, self.createNavigator(), gr, groups) | 242 | """ % (gr, self.createNavigator(), description, gr, groups) |
232 | 243 | ||
233 | 244 | ||
234 | 245 | ||
@@ -508,10 +519,10 @@ def main(): | |||
508 | f = file('index.html', 'w') | 519 | f = file('index.html', 'w') |
509 | print >> f, html_slave.createIndex() | 520 | print >> f, html_slave.createIndex() |
510 | 521 | ||
511 | f = file('groups.html', 'w') | 522 | f = file('all_groups.html', 'w') |
512 | print >> f, html_slave.createGroupsSite(doc) | 523 | print >> f, html_slave.createGroupsSite(doc) |
513 | 524 | ||
514 | f = file('keys.html', 'w') | 525 | f = file('all_keys.html', 'w') |
515 | print >> f, html_slave.createKeysSite(doc) | 526 | print >> f, html_slave.createKeysSite(doc) |
516 | 527 | ||
517 | # now for each group create the site | 528 | # now for each group create the site |
diff --git a/bitbake/doc/manual/usermanual.xml b/bitbake/doc/manual/usermanual.xml index 277e615100..33150b10f2 100644 --- a/bitbake/doc/manual/usermanual.xml +++ b/bitbake/doc/manual/usermanual.xml | |||
@@ -12,7 +12,7 @@ | |||
12 | <corpauthor>BitBake Team</corpauthor> | 12 | <corpauthor>BitBake Team</corpauthor> |
13 | </authorgroup> | 13 | </authorgroup> |
14 | <copyright> | 14 | <copyright> |
15 | <year>2004, 2005</year> | 15 | <year>2004, 2005, 2006</year> |
16 | <holder>Chris Larson</holder> | 16 | <holder>Chris Larson</holder> |
17 | <holder>Phil Blundell</holder> | 17 | <holder>Phil Blundell</holder> |
18 | </copyright> | 18 | </copyright> |
@@ -111,9 +111,9 @@ share common metadata between many packages.</para></listitem> | |||
111 | <section> | 111 | <section> |
112 | <title>Appending (.=) and prepending (=.) without spaces</title> | 112 | <title>Appending (.=) and prepending (=.) without spaces</title> |
113 | <para><screen><varname>B</varname> = "bval" | 113 | <para><screen><varname>B</varname> = "bval" |
114 | <varname>B</varname> += "additionaldata" | 114 | <varname>B</varname> .= "additionaldata" |
115 | <varname>C</varname> = "cval" | 115 | <varname>C</varname> = "cval" |
116 | <varname>C</varname> =+ "test"</screen></para> | 116 | <varname>C</varname> =. "test"</screen></para> |
117 | <para>In this example, <varname>B</varname> is now <literal>bvaladditionaldata</literal> and <varname>C</varname> is <literal>testcval</literal>. In contrast to the above Appending and Prepending operators no additional space | 117 | <para>In this example, <varname>B</varname> is now <literal>bvaladditionaldata</literal> and <varname>C</varname> is <literal>testcval</literal>. In contrast to the above Appending and Prepending operators no additional space |
118 | will be introduced.</para> | 118 | will be introduced.</para> |
119 | </section> | 119 | </section> |
@@ -228,6 +228,86 @@ of the event and the content of the <varname>FILE</varname> variable.</para> | |||
228 | </section> | 228 | </section> |
229 | </section> | 229 | </section> |
230 | </chapter> | 230 | </chapter> |
231 | |||
232 | <chapter> | ||
233 | <title>File Download support</title> | ||
234 | <section> | ||
235 | <title>Overview</title> | ||
236 | <para>BitBake provides support to download files this procedure is called fetching. The SRC_URI is normally used to indicate BitBake which files to fetch. The next sections will describe th available fetchers and the options they have. Each Fetcher honors a set of Variables and | ||
237 | a per URI parameters separated by a <quote>;</quote> consisting of a key and a value. The semantic of the Variables and Parameters are defined by the Fetcher. BitBakes tries to have a consistent semantic between the different Fetchers. | ||
238 | </para> | ||
239 | </section> | ||
240 | |||
241 | <section> | ||
242 | <title>Local File Fetcher</title> | ||
243 | <para>The URN for the Local File Fetcher is <emphasis>file</emphasis>. The filename can be either absolute or relative. If the filename is relative <varname>FILESPATH</varname> and <varname>FILESDIR</varname> will be used to find the appropriate relative file depending on the <varname>OVERRIDES</varname>. Single files and complete directories can be specified. | ||
244 | <screen><varname>SRC_URI</varname>= "file://relativefile.patch" | ||
245 | <varname>SRC_URI</varname>= "file://relativefile.patch;this=ignored" | ||
246 | <varname>SRC_URI</varname>= "file:///Users/ich/very_important_software" | ||
247 | </screen> | ||
248 | </para> | ||
249 | </section> | ||
250 | |||
251 | <section> | ||
252 | <title>CVS File Fetcher</title> | ||
253 | <para>The URN for the CVS Fetcher is <emphasis>cvs</emphasis>. This Fetcher honors the variables <varname>DL_DIR</varname>, <varname>SRCDATE</varname>, <varname>FETCHCOMMAND_cvs</varname>, <varname>UPDATECOMMAND_cvs</varname>. <varname>DL_DIRS</varname> specifies where a temporary checkout is saved, <varname>SRCDATE</varname> specifies which date to use when doing the fetching, <varname>FETCHCOMMAND</varname> and <varname>UPDATECOMMAND</varname> specify which executables should be used when doing the CVS checkout or update. | ||
254 | </para> | ||
255 | <para>The supported Parameters are <varname>module</varname>, <varname>tag</varname>, <varname>date</varname>, <varname>method</varname>, <varname>localdir</varname>, <varname>rsh</varname>. The <varname>module</varname> specifies which module to check out, the <varname>tag</varname> describes which CVS TAG should be used for the checkout by default the TAG is empty. A <varname>date</varname> can be specified to override the SRCDATE of the configuration to checkout a specific date. <varname>method</varname> is by default <emphasis>pserver</emphasis>, if <emphasis>ext</emphasis> is used the <varname>rsh</varname> parameter will be evaluated and <varname>CVS_RSH</varname> will be set. Finally <varname>localdir</varname> is used to checkout into a special directory relative to <varname>CVSDIR></varname>. | ||
256 | <screen><varname>SRC_URI</varname> = "cvs://CVSROOT;module=mymodule;tag=some-version;method=ext" | ||
257 | <varname>SRC_URI</varname> = "cvs://CVSROOT;module=mymodule;date=20060126;localdir=usethat" | ||
258 | </screen> | ||
259 | </para> | ||
260 | </section> | ||
261 | |||
262 | <section> | ||
263 | <title>HTTP/FTP Fetcher</title> | ||
264 | <para>The URNs for the HTTP/FTP are <emphasis>http</emphasis>, <emphasis>https</emphasis> and <emphasis>ftp</emphasis>. This Fetcher honors the variables <varname>DL_DIR</varname>, <varname>FETCHCOMMAND_wget</varname>, <varname>PREMIRRORS</varname>, <varname>MIRRORS</varname>. The <varname>DL_DIR</varname> defines where to store the fetched file, <varname>FETCHCOMMAND</varname> contains the command used for fetching. <quote>${URI}</quote> and <quote>${FILES}</quote> will be replaced by the uri and basename of the to be fetched file. <varname>PREMIRRORS</varname> | ||
265 | will be tried first when fetching a file if that fails the actual file will be tried and finally all <varname>MIRRORS</varname> will be tried. | ||
266 | </para> | ||
267 | <para>The only supported Parameter is <varname>md5sum</varname>. After a fetch the <varname>md5sum</varname> of the file will be calculated and the two sums will be compared. | ||
268 | </para> | ||
269 | <para><screen><varname>SRC_URI</varname> = "http://oe.handhelds.org/not_there.aac;md5sum=12343" | ||
270 | <varname>SRC_URI</varname> = "ftp://oe.handhelds.org/not_there_as_well.aac;md5sum=1234" | ||
271 | <varname>SRC_URI</varname> = "ftp://you@oe.handheld.sorg/home/you/secret.plan;md5sum=1234" | ||
272 | </screen></para> | ||
273 | </section> | ||
274 | |||
275 | <section> | ||
276 | <title>SVK Fetcher</title> | ||
277 | <para> | ||
278 | <emphasis>Currently NOT suppoered</emphasis> | ||
279 | </para> | ||
280 | </section> | ||
281 | |||
282 | <section> | ||
283 | <title>SVN Fetcher</title> | ||
284 | <para>The URN for the SVN Fetcher is <emphasis>svn</emphasis>. | ||
285 | </para> | ||
286 | <para>The Variables <varname>FETCHCOMMAND_svn</varname>, <varname>DL_DIR</varname> are used by the SVN Fetcher. <varname>FETCHCOMMAND</varname> contains the subversion command, <varname>DL_DIR</varname> is the directory where tarballs will be saved. | ||
287 | </para> | ||
288 | <para>The supported Parameters are <varname>proto</varname>, <varname>rev</varname>. <varname>proto</varname> is the subversion prototype, <varname>rev</varname> is the subversions revision. | ||
289 | </para> | ||
290 | <para><screen><varname>SRC_URI</varname> = "svn://svn.oe.handhelds.org/svn;module=vip;proto=http;rev=667" | ||
291 | <varname>SRC_URI</varname> = "svn://svn.oe.handhelds.org/svn/;module=opie;proto=svn+ssh;date=20060126" | ||
292 | </screen></para> | ||
293 | </section> | ||
294 | |||
295 | <section> | ||
296 | <title>GIT Fetcher</title> | ||
297 | <para>The URN for the GIT Fetcher is <emphasis>git</emphasis>. | ||
298 | </para> | ||
299 | <para>The Variables <varname>DL_DIR</varname>, <varname>GITDIR</varname> are used. <varname>DL_DIR</varname> will be used to store the checkedout version. <varname>GITDIR</varname> will be used as the base directory where the git tree is cloned to. | ||
300 | </para> | ||
301 | <para>The Parameters are <emphasis>tag</emphasis>, <emphasis>protocol</emphasis>. <emphasis>tag</emphasis> is a git tag, the default is <quote>master</quote>. <emphasis>protocol</emphasis> is the git protocol to use and defaults to <quote>rsync</quote>. | ||
302 | </para> | ||
303 | <para><screen><varname>SRC_URI</varname> = "git://git.oe.handhelds.org/git/vip.git;tag=version-1" | ||
304 | <varname>SRC_URI</varname> = "git://git.oe.handhelds.org/git/vip.git;protocol=http" | ||
305 | </screen></para> | ||
306 | </section> | ||
307 | |||
308 | </chapter> | ||
309 | |||
310 | |||
231 | <chapter> | 311 | <chapter> |
232 | <title>Commands</title> | 312 | <title>Commands</title> |
233 | <section> | 313 | <section> |
@@ -320,7 +400,7 @@ options: | |||
320 | <title>Depending on another .bb</title> | 400 | <title>Depending on another .bb</title> |
321 | <para>a.bb: | 401 | <para>a.bb: |
322 | <screen>PN = "package-a" | 402 | <screen>PN = "package-a" |
323 | DEPENDS += "package-b"</screen> | 403 | DEPENDS += "package-b"</screen> |
324 | </para> | 404 | </para> |
325 | <para>b.bb: | 405 | <para>b.bb: |
326 | <screen>PN = "package-b"</screen> | 406 | <screen>PN = "package-b"</screen> |
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py index dabe978bf5..c6c0beb792 100644 --- a/bitbake/lib/bb/__init__.py +++ b/bitbake/lib/bb/__init__.py | |||
@@ -23,7 +23,7 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |||
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | 23 | Place, Suite 330, Boston, MA 02111-1307 USA. |
24 | """ | 24 | """ |
25 | 25 | ||
26 | __version__ = "1.3.3.0" | 26 | __version__ = "1.3.3.4" |
27 | 27 | ||
28 | __all__ = [ | 28 | __all__ = [ |
29 | 29 | ||
@@ -1229,38 +1229,6 @@ class digraph: | |||
1229 | mygraph.okeys=self.okeys[:] | 1229 | mygraph.okeys=self.okeys[:] |
1230 | return mygraph | 1230 | return mygraph |
1231 | 1231 | ||
1232 | ####################################################################### | ||
1233 | ####################################################################### | ||
1234 | # | ||
1235 | # SECTION: Config | ||
1236 | # | ||
1237 | # PURPOSE: Reading and handling of system/target-specific/local configuration | ||
1238 | # reading of package configuration | ||
1239 | # | ||
1240 | ####################################################################### | ||
1241 | ####################################################################### | ||
1242 | |||
1243 | def reader(cfgfile, feeder): | ||
1244 | """Generic configuration file reader that opens a file, reads the lines, | ||
1245 | handles continuation lines, comments, empty lines and feed all read lines | ||
1246 | into the function feeder(lineno, line). | ||
1247 | """ | ||
1248 | |||
1249 | f = open(cfgfile,'r') | ||
1250 | lineno = 0 | ||
1251 | while 1: | ||
1252 | lineno = lineno + 1 | ||
1253 | s = f.readline() | ||
1254 | if not s: break | ||
1255 | w = s.strip() | ||
1256 | if not w: continue # skip empty lines | ||
1257 | s = s.rstrip() | ||
1258 | if s[0] == '#': continue # skip comments | ||
1259 | while s[-1] == '\\': | ||
1260 | s2 = f.readline()[:-1].strip() | ||
1261 | s = s[:-1] + s2 | ||
1262 | feeder(lineno, s) | ||
1263 | |||
1264 | if __name__ == "__main__": | 1232 | if __name__ == "__main__": |
1265 | import doctest, bb | 1233 | import doctest, bb |
1266 | doctest.testmod(bb) | 1234 | doctest.testmod(bb) |
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 599b45d9d3..b59473bc23 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License along with | |||
25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | 25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig |
26 | """ | 26 | """ |
27 | 27 | ||
28 | from bb import debug, data, fetch, fatal, error, note, event, mkdirhier | 28 | from bb import debug, data, fetch, fatal, error, note, event, mkdirhier, utils |
29 | import bb, os | 29 | import bb, os |
30 | 30 | ||
31 | # data holds flags and function name for a given task | 31 | # data holds flags and function name for a given task |
@@ -122,14 +122,15 @@ def exec_func_python(func, d): | |||
122 | """Execute a python BB 'function'""" | 122 | """Execute a python BB 'function'""" |
123 | import re, os | 123 | import re, os |
124 | 124 | ||
125 | tmp = "def " + func + "():\n%s" % data.getVar(func, d) | 125 | tmp = "def " + func + "():\n%s" % data.getVar(func, d) |
126 | comp = compile(tmp + '\n' + func + '()', bb.data.getVar('FILE', d, 1) + ':' + func, "exec") | 126 | tmp += '\n' + func + '()' |
127 | comp = utils.better_compile(tmp, func, bb.data.getVar('FILE', d, 1) ) | ||
127 | prevdir = os.getcwd() | 128 | prevdir = os.getcwd() |
128 | g = {} # globals | 129 | g = {} # globals |
129 | g['bb'] = bb | 130 | g['bb'] = bb |
130 | g['os'] = os | 131 | g['os'] = os |
131 | g['d'] = d | 132 | g['d'] = d |
132 | exec comp in g | 133 | utils.better_exec(comp,g,tmp, bb.data.getVar('FILE',d,1)) |
133 | if os.path.exists(prevdir): | 134 | if os.path.exists(prevdir): |
134 | os.chdir(prevdir) | 135 | os.chdir(prevdir) |
135 | 136 | ||
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index b7d707a920..56ee977f66 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -31,7 +31,7 @@ if sys.argv[0][-5:] == "pydoc": | |||
31 | path = os.path.dirname(os.path.dirname(sys.argv[1])) | 31 | path = os.path.dirname(os.path.dirname(sys.argv[1])) |
32 | else: | 32 | else: |
33 | path = os.path.dirname(os.path.dirname(sys.argv[0])) | 33 | path = os.path.dirname(os.path.dirname(sys.argv[0])) |
34 | sys.path.append(path) | 34 | sys.path.insert(0,path) |
35 | 35 | ||
36 | from bb import note, debug, data_smart | 36 | from bb import note, debug, data_smart |
37 | 37 | ||
@@ -211,6 +211,11 @@ def delVarFlag(var, flag, d): | |||
211 | def setVarFlags(var, flags, d): | 211 | def setVarFlags(var, flags, d): |
212 | """Set the flags for a given variable | 212 | """Set the flags for a given variable |
213 | 213 | ||
214 | Note: | ||
215 | setVarFlags will not clear previous | ||
216 | flags. Think of this method as | ||
217 | addVarFlags | ||
218 | |||
214 | Example: | 219 | Example: |
215 | >>> d = init() | 220 | >>> d = init() |
216 | >>> myflags = {} | 221 | >>> myflags = {} |
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 741790502f..52f391dec1 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -29,7 +29,7 @@ Based on functions from the base bb module, Copyright 2003 Holger Schurig | |||
29 | """ | 29 | """ |
30 | 30 | ||
31 | import copy, os, re, sys, time, types | 31 | import copy, os, re, sys, time, types |
32 | from bb import note, debug, fatal | 32 | from bb import note, debug, fatal, utils |
33 | 33 | ||
34 | try: | 34 | try: |
35 | import cPickle as pickle | 35 | import cPickle as pickle |
@@ -287,8 +287,8 @@ class DataSmartPackage(DataSmart): | |||
287 | self.unpickle_prep() | 287 | self.unpickle_prep() |
288 | funcstr = self.getVar('__functions__', 0) | 288 | funcstr = self.getVar('__functions__', 0) |
289 | if funcstr: | 289 | if funcstr: |
290 | comp = compile(funcstr, "<pickled>", "exec") | 290 | comp = utils.better_compile(funcstr, "<pickled>", self.bbfile) |
291 | exec comp in __builtins__ | 291 | utils.better_exec(comp, __builtins__, funcstr, self.bbfile) |
292 | 292 | ||
293 | def linkDataSet(self): | 293 | def linkDataSet(self): |
294 | if not self.parent == None: | 294 | if not self.parent == None: |
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index c4e88fa35d..cbe6d2a11a 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -25,6 +25,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. | |||
25 | 25 | ||
26 | import os, re | 26 | import os, re |
27 | import bb.data | 27 | import bb.data |
28 | import bb.utils | ||
28 | 29 | ||
29 | class Event: | 30 | class Event: |
30 | """Base class for events""" | 31 | """Base class for events""" |
@@ -50,8 +51,8 @@ def tmpHandler(event): | |||
50 | return NotHandled | 51 | return NotHandled |
51 | 52 | ||
52 | def defaultTmpHandler(): | 53 | def defaultTmpHandler(): |
53 | tmp = "def tmpHandler(e):\n\t\"\"\"heh\"\"\"\n\treturn 0" | 54 | tmp = "def tmpHandler(e):\n\t\"\"\"heh\"\"\"\n\treturn NotHandled" |
54 | comp = compile(tmp, "tmpHandler(e)", "exec") | 55 | comp = bb.utils.better_compile(tmp, "tmpHandler(e)", "bb.event.defaultTmpHandler") |
55 | return comp | 56 | return comp |
56 | 57 | ||
57 | def fire(event): | 58 | def fire(event): |
@@ -71,12 +72,12 @@ def register(handler): | |||
71 | if handler is not None: | 72 | if handler is not None: |
72 | # handle string containing python code | 73 | # handle string containing python code |
73 | if type(handler).__name__ == "str": | 74 | if type(handler).__name__ == "str": |
74 | return registerCode(handler) | 75 | return _registerCode(handler) |
75 | # prevent duplicate registration | 76 | # prevent duplicate registration |
76 | if not handler in handlers: | 77 | if not handler in handlers: |
77 | handlers.append(handler) | 78 | handlers.append(handler) |
78 | 79 | ||
79 | def registerCode(handlerStr): | 80 | def _registerCode(handlerStr): |
80 | """Register a 'code' Event. | 81 | """Register a 'code' Event. |
81 | Deprecated interface; call register instead. | 82 | Deprecated interface; call register instead. |
82 | 83 | ||
@@ -85,7 +86,7 @@ def registerCode(handlerStr): | |||
85 | the code will be within a function, so should have had | 86 | the code will be within a function, so should have had |
86 | appropriate tabbing put in place.""" | 87 | appropriate tabbing put in place.""" |
87 | tmp = "def tmpHandler(e):\n%s" % handlerStr | 88 | tmp = "def tmpHandler(e):\n%s" % handlerStr |
88 | comp = compile(tmp, "tmpHandler(e)", "exec") | 89 | comp = bb.utils.better_compile(tmp, "tmpHandler(e)", "bb.event._registerCode") |
89 | # prevent duplicate registration | 90 | # prevent duplicate registration |
90 | if not comp in handlers: | 91 | if not comp in handlers: |
91 | handlers.append(comp) | 92 | handlers.append(comp) |
@@ -94,16 +95,16 @@ def remove(handler): | |||
94 | """Remove an Event handler""" | 95 | """Remove an Event handler""" |
95 | for h in handlers: | 96 | for h in handlers: |
96 | if type(handler).__name__ == "str": | 97 | if type(handler).__name__ == "str": |
97 | return removeCode(handler) | 98 | return _removeCode(handler) |
98 | 99 | ||
99 | if handler is h: | 100 | if handler is h: |
100 | handlers.remove(handler) | 101 | handlers.remove(handler) |
101 | 102 | ||
102 | def removeCode(handlerStr): | 103 | def _removeCode(handlerStr): |
103 | """Remove a 'code' Event handler | 104 | """Remove a 'code' Event handler |
104 | Deprecated interface; call remove instead.""" | 105 | Deprecated interface; call remove instead.""" |
105 | tmp = "def tmpHandler(e):\n%s" % handlerStr | 106 | tmp = "def tmpHandler(e):\n%s" % handlerStr |
106 | comp = compile(tmp, "tmpHandler(e)", "exec") | 107 | comp = bb.utils.better_compile(tmp, "tmpHandler(e)", "bb.event._removeCode") |
107 | handlers.remove(comp) | 108 | handlers.remove(comp) |
108 | 109 | ||
109 | def getName(e): | 110 | def getName(e): |
@@ -117,7 +118,7 @@ def getName(e): | |||
117 | class PkgBase(Event): | 118 | class PkgBase(Event): |
118 | """Base class for package events""" | 119 | """Base class for package events""" |
119 | 120 | ||
120 | def __init__(self, t, d = {}): | 121 | def __init__(self, t, d = bb.data.init()): |
121 | self._pkg = t | 122 | self._pkg = t |
122 | Event.__init__(self, d) | 123 | Event.__init__(self, d) |
123 | 124 | ||
@@ -133,10 +134,11 @@ class PkgBase(Event): | |||
133 | class BuildBase(Event): | 134 | class BuildBase(Event): |
134 | """Base class for bbmake run events""" | 135 | """Base class for bbmake run events""" |
135 | 136 | ||
136 | def __init__(self, n, p, c): | 137 | def __init__(self, n, p, c, failures = 0): |
137 | self._name = n | 138 | self._name = n |
138 | self._pkgs = p | 139 | self._pkgs = p |
139 | Event.__init__(self, c) | 140 | Event.__init__(self, c) |
141 | self._failures = failures | ||
140 | 142 | ||
141 | def getPkgs(self): | 143 | def getPkgs(self): |
142 | return self._pkgs | 144 | return self._pkgs |
@@ -156,6 +158,12 @@ class BuildBase(Event): | |||
156 | def setCfg(self, cfg): | 158 | def setCfg(self, cfg): |
157 | self.data = cfg | 159 | self.data = cfg |
158 | 160 | ||
161 | def getFailures(self): | ||
162 | """ | ||
163 | Return the number of failed packages | ||
164 | """ | ||
165 | return self._failures | ||
166 | |||
159 | pkgs = property(getPkgs, setPkgs, None, "pkgs property") | 167 | pkgs = property(getPkgs, setPkgs, None, "pkgs property") |
160 | name = property(getName, setName, None, "name property") | 168 | name = property(getName, setName, None, "name property") |
161 | cfg = property(getCfg, setCfg, None, "cfg property") | 169 | cfg = property(getCfg, setCfg, None, "cfg property") |
@@ -204,7 +212,43 @@ class UnsatisfiedDep(DepBase): | |||
204 | class RecursiveDep(DepBase): | 212 | class RecursiveDep(DepBase): |
205 | """Recursive Dependency""" | 213 | """Recursive Dependency""" |
206 | 214 | ||
215 | class NoProvider(Event): | ||
216 | """No Provider for an Event""" | ||
217 | |||
218 | def __init__(self, item, data,runtime=False): | ||
219 | Event.__init__(self, data) | ||
220 | self._item = item | ||
221 | self._runtime = runtime | ||
222 | |||
223 | def getItem(self): | ||
224 | return self._item | ||
225 | |||
226 | def isRuntime(self): | ||
227 | return self._runtime | ||
207 | 228 | ||
208 | class MultipleProviders(PkgBase): | 229 | class MultipleProviders(Event): |
209 | """Multiple Providers""" | 230 | """Multiple Providers""" |
210 | 231 | ||
232 | def __init__(self, item, candidates, data, runtime = False): | ||
233 | Event.__init__(self, data) | ||
234 | self._item = item | ||
235 | self._candidates = candidates | ||
236 | self._is_runtime = runtime | ||
237 | |||
238 | def isRuntime(self): | ||
239 | """ | ||
240 | Is this a runtime issue? | ||
241 | """ | ||
242 | return self._is_runtime | ||
243 | |||
244 | def getItem(self): | ||
245 | """ | ||
246 | The name for the to be build item | ||
247 | """ | ||
248 | return self._item | ||
249 | |||
250 | def getCandidates(self): | ||
251 | """ | ||
252 | Get the possible Candidates for a PROVIDER. | ||
253 | """ | ||
254 | return self._candidates | ||
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index da5b10c4b6..0515f2a5e9 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py | |||
@@ -158,18 +158,47 @@ class Fetch(object): | |||
158 | return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1 ) | 158 | return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1 ) |
159 | getSRCDate = staticmethod(getSRCDate) | 159 | getSRCDate = staticmethod(getSRCDate) |
160 | 160 | ||
161 | #if __name__ == "__main__": | 161 | def try_mirror(d, tarfn): |
162 | """ | ||
163 | Try to use a mirrored version of the sources. We do this | ||
164 | to avoid massive loads on foreign cvs and svn servers. | ||
165 | This method will be used by the different fetcher | ||
166 | implementations. | ||
167 | |||
168 | d Is a bb.data instance | ||
169 | tarfn is the name of the tarball | ||
170 | """ | ||
171 | tarpath = os.path.join(data.getVar("DL_DIR", d, 1), tarfn) | ||
172 | if os.access(tarpath, os.R_OK): | ||
173 | return True | ||
174 | |||
175 | pn = data.getVar('PN', d, True) | ||
176 | src_tarball_stash = None | ||
177 | if pn: | ||
178 | src_tarball_stash = (data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) or "").split() | ||
179 | |||
180 | for stash in src_tarball_stash: | ||
181 | fetchcmd = data.getVar("FETCHCOMMAND_mirror", d, True) or data.getVar("FETCHCOMMAND_wget", d, True) | ||
182 | uri = stash + tarfn | ||
183 | bb.note("fetch " + uri) | ||
184 | fetchcmd = fetchcmd.replace("${URI}", uri) | ||
185 | ret = os.system(fetchcmd) | ||
186 | if ret == 0: | ||
187 | bb.note("Fetched %s from tarball stash, skipping checkout" % tarfn) | ||
188 | return True | ||
189 | return False | ||
190 | try_mirror = staticmethod(try_mirror) | ||
162 | 191 | ||
163 | import bk | ||
164 | import cvs | 192 | import cvs |
165 | import git | 193 | import git |
166 | import local | 194 | import local |
167 | import svn | 195 | import svn |
168 | import wget | 196 | import wget |
197 | import svk | ||
169 | 198 | ||
170 | methods.append(bk.Bk()) | ||
171 | methods.append(cvs.Cvs()) | 199 | methods.append(cvs.Cvs()) |
172 | methods.append(git.Git()) | 200 | methods.append(git.Git()) |
173 | methods.append(local.Local()) | 201 | methods.append(local.Local()) |
174 | methods.append(svn.Svn()) | 202 | methods.append(svn.Svn()) |
175 | methods.append(wget.Wget()) | 203 | methods.append(wget.Wget()) |
204 | methods.append(svk.Svk()) | ||
diff --git a/bitbake/lib/bb/fetch/bk.py b/bitbake/lib/bb/fetch/bk.py deleted file mode 100644 index 6bd6c018fb..0000000000 --- a/bitbake/lib/bb/fetch/bk.py +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | ||
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
4 | """ | ||
5 | BitBake 'Fetch' implementations | ||
6 | |||
7 | Classes for obtaining upstream sources for the | ||
8 | BitBake build tools. | ||
9 | |||
10 | Copyright (C) 2003, 2004 Chris Larson | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify it under | ||
13 | the terms of the GNU General Public License as published by the Free Software | ||
14 | Foundation; either version 2 of the License, or (at your option) any later | ||
15 | version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License along with | ||
22 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | |||
25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
26 | """ | ||
27 | |||
28 | import os, re | ||
29 | import bb | ||
30 | from bb import data | ||
31 | from bb.fetch import Fetch | ||
32 | |||
33 | class Bk(Fetch): | ||
34 | def supports(url, d): | ||
35 | """Check to see if a given url can be fetched via bitkeeper. | ||
36 | Expects supplied url in list form, as outputted by bb.decodeurl(). | ||
37 | """ | ||
38 | (type, host, path, user, pswd, parm) = bb.decodeurl(data.expand(url, d)) | ||
39 | return type in ['bk'] | ||
40 | supports = staticmethod(supports) | ||
diff --git a/bitbake/lib/bb/fetch/cvs.py b/bitbake/lib/bb/fetch/cvs.py index 461a2f50f9..10ec700dc9 100644 --- a/bitbake/lib/bb/fetch/cvs.py +++ b/bitbake/lib/bb/fetch/cvs.py | |||
@@ -133,21 +133,9 @@ class Cvs(Fetch): | |||
133 | bb.debug(1, "%s already exists, skipping cvs checkout." % tarfn) | 133 | bb.debug(1, "%s already exists, skipping cvs checkout." % tarfn) |
134 | continue | 134 | continue |
135 | 135 | ||
136 | pn = data.getVar('PN', d, 1) | 136 | # try to use the tarball stash |
137 | cvs_tarball_stash = None | 137 | if Fetch.try_mirror(d, tarfn): |
138 | if pn: | 138 | continue |
139 | cvs_tarball_stash = data.getVar('CVS_TARBALL_STASH_%s' % pn, d, 1) | ||
140 | if cvs_tarball_stash == None: | ||
141 | cvs_tarball_stash = data.getVar('CVS_TARBALL_STASH', d, 1) | ||
142 | if cvs_tarball_stash: | ||
143 | fetchcmd = data.getVar("FETCHCOMMAND_wget", d, 1) | ||
144 | uri = cvs_tarball_stash + tarfn | ||
145 | bb.note("fetch " + uri) | ||
146 | fetchcmd = fetchcmd.replace("${URI}", uri) | ||
147 | ret = os.system(fetchcmd) | ||
148 | if ret == 0: | ||
149 | bb.note("Fetched %s from tarball stash, skipping checkout" % tarfn) | ||
150 | continue | ||
151 | 139 | ||
152 | if date: | 140 | if date: |
153 | options.append("-D %s" % date) | 141 | options.append("-D %s" % date) |
@@ -194,7 +182,7 @@ class Cvs(Fetch): | |||
194 | bb.debug(1, "Running %s" % cvscmd) | 182 | bb.debug(1, "Running %s" % cvscmd) |
195 | myret = os.system(cvscmd) | 183 | myret = os.system(cvscmd) |
196 | 184 | ||
197 | if myret != 0: | 185 | if myret != 0 or not os.access(moddir, os.R_OK): |
198 | try: | 186 | try: |
199 | os.rmdir(moddir) | 187 | os.rmdir(moddir) |
200 | except OSError: | 188 | except OSError: |
diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py index 296b926392..439d522188 100644 --- a/bitbake/lib/bb/fetch/git.py +++ b/bitbake/lib/bb/fetch/git.py | |||
@@ -58,6 +58,28 @@ def gettag(parm): | |||
58 | 58 | ||
59 | return tag | 59 | return tag |
60 | 60 | ||
61 | def getprotocol(parm): | ||
62 | if 'protocol' in parm: | ||
63 | proto = parm['protocol'] | ||
64 | else: | ||
65 | proto = "" | ||
66 | if not proto: | ||
67 | proto = "rsync" | ||
68 | |||
69 | return proto | ||
70 | |||
71 | def localfile(url, d): | ||
72 | """Return the filename to cache the checkout in""" | ||
73 | (type, host, path, user, pswd, parm) = bb.decodeurl(data.expand(url, d)) | ||
74 | |||
75 | #if user sets localpath for file, use it instead. | ||
76 | if "localpath" in parm: | ||
77 | return parm["localpath"] | ||
78 | |||
79 | tag = gettag(parm) | ||
80 | |||
81 | return data.expand('git_%s%s_%s.tar.gz' % (host, path.replace('/', '.'), tag), d) | ||
82 | |||
61 | class Git(Fetch): | 83 | class Git(Fetch): |
62 | """Class to fetch a module or modules from git repositories""" | 84 | """Class to fetch a module or modules from git repositories""" |
63 | def supports(url, d): | 85 | def supports(url, d): |
@@ -69,17 +91,8 @@ class Git(Fetch): | |||
69 | supports = staticmethod(supports) | 91 | supports = staticmethod(supports) |
70 | 92 | ||
71 | def localpath(url, d): | 93 | def localpath(url, d): |
72 | (type, host, path, user, pswd, parm) = bb.decodeurl(data.expand(url, d)) | ||
73 | |||
74 | #if user sets localpath for file, use it instead. | ||
75 | if "localpath" in parm: | ||
76 | return parm["localpath"] | ||
77 | 94 | ||
78 | tag = gettag(parm) | 95 | return os.path.join(data.getVar("DL_DIR", d, 1), localfile(url, d)) |
79 | |||
80 | localname = data.expand('git_%s%s_%s.tar.gz' % (host, path.replace('/', '.'), tag), d) | ||
81 | |||
82 | return os.path.join(data.getVar("DL_DIR", d, 1),data.expand('%s' % (localname), d)) | ||
83 | 96 | ||
84 | localpath = staticmethod(localpath) | 97 | localpath = staticmethod(localpath) |
85 | 98 | ||
@@ -92,10 +105,12 @@ class Git(Fetch): | |||
92 | (type, host, path, user, pswd, parm) = bb.decodeurl(data.expand(loc, d)) | 105 | (type, host, path, user, pswd, parm) = bb.decodeurl(data.expand(loc, d)) |
93 | 106 | ||
94 | tag = gettag(parm) | 107 | tag = gettag(parm) |
108 | proto = getprotocol(parm) | ||
95 | 109 | ||
96 | gitsrcname = '%s%s' % (host, path.replace('/', '.')) | 110 | gitsrcname = '%s%s' % (host, path.replace('/', '.')) |
97 | 111 | ||
98 | repofile = os.path.join(data.getVar("DL_DIR", d, 1), 'git_%s.tar.gz' % (gitsrcname)) | 112 | repofilename = 'git_%s.tar.gz' % (gitsrcname) |
113 | repofile = os.path.join(data.getVar("DL_DIR", d, 1), repofilename) | ||
99 | repodir = os.path.join(data.expand('${GITDIR}', d), gitsrcname) | 114 | repodir = os.path.join(data.expand('${GITDIR}', d), gitsrcname) |
100 | 115 | ||
101 | coname = '%s' % (tag) | 116 | coname = '%s' % (tag) |
@@ -103,63 +118,37 @@ class Git(Fetch): | |||
103 | 118 | ||
104 | cofile = self.localpath(loc, d) | 119 | cofile = self.localpath(loc, d) |
105 | 120 | ||
106 | # Always update to current if tag=="master" | 121 | # tag=="master" must always update |
107 | #if os.access(cofile, os.R_OK) and (tag != "master"): | 122 | if (tag != "master") and Fetch.try_mirror(d, localfile(loc, d)): |
108 | if os.access(cofile, os.R_OK): | 123 | bb.debug(1, "%s already exists (or was stashed). Skipping git checkout." % cofile) |
109 | bb.debug(1, "%s already exists, skipping git checkout." % cofile) | ||
110 | continue | 124 | continue |
111 | 125 | ||
112 | # Still Need to add GIT_TARBALL_STASH Support... | 126 | if not os.path.exists(repodir): |
113 | # pn = data.getVar('PN', d, 1) | 127 | if Fetch.try_mirror(d, repofilename): |
114 | # cvs_tarball_stash = None | 128 | bb.mkdirhier(repodir) |
115 | # if pn: | 129 | os.chdir(repodir) |
116 | # cvs_tarball_stash = data.getVar('CVS_TARBALL_STASH_%s' % pn, d, 1) | 130 | rungitcmd("tar -xzf %s" % (repofile),d) |
117 | # if cvs_tarball_stash == None: | 131 | else: |
118 | # cvs_tarball_stash = data.getVar('CVS_TARBALL_STASH', d, 1) | 132 | rungitcmd("git clone %s://%s%s %s" % (proto, host, path, repodir),d) |
119 | # if cvs_tarball_stash: | ||
120 | # fetchcmd = data.getVar("FETCHCOMMAND_wget", d, 1) | ||
121 | # uri = cvs_tarball_stash + tarfn | ||
122 | # bb.note("fetch " + uri) | ||
123 | # fetchcmd = fetchcmd.replace("${URI}", uri) | ||
124 | # ret = os.system(fetchcmd) | ||
125 | # if ret == 0: | ||
126 | # bb.note("Fetched %s from tarball stash, skipping checkout" % tarfn) | ||
127 | # continue | ||
128 | |||
129 | #if os.path.exists(repodir): | ||
130 | #prunedir(repodir) | ||
131 | |||
132 | bb.mkdirhier(repodir) | ||
133 | os.chdir(repodir) | ||
134 | |||
135 | #print("Changing to %s" % repodir) | ||
136 | 133 | ||
137 | if os.access(repofile, os.R_OK): | ||
138 | rungitcmd("tar -xzf %s" % (repofile),d) | ||
139 | else: | ||
140 | rungitcmd("git clone rsync://%s%s %s" % (host, path, repodir),d) | ||
141 | |||
142 | rungitcmd("rsync -a --verbose --stats --progress rsync://%s%s/ %s" % (host, path, os.path.join(repodir, ".git", "")),d) | ||
143 | |||
144 | #print("Changing to %s" % repodir) | ||
145 | os.chdir(repodir) | 134 | os.chdir(repodir) |
146 | rungitcmd("git pull rsync://%s%s" % (host, path),d) | 135 | rungitcmd("git pull %s://%s%s" % (proto, host, path),d) |
136 | rungitcmd("git pull --tags %s://%s%s" % (proto, host, path),d) | ||
137 | # old method of downloading tags | ||
138 | #rungitcmd("rsync -a --verbose --stats --progress rsync://%s%s/ %s" % (host, path, os.path.join(repodir, ".git", "")),d) | ||
147 | 139 | ||
148 | #print("Changing to %s" % repodir) | ||
149 | os.chdir(repodir) | 140 | os.chdir(repodir) |
141 | bb.note("Creating tarball of git repository") | ||
150 | rungitcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ),d) | 142 | rungitcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ),d) |
151 | 143 | ||
152 | if os.path.exists(codir): | 144 | if os.path.exists(codir): |
153 | prunedir(codir) | 145 | prunedir(codir) |
154 | 146 | ||
155 | #print("Changing to %s" % repodir) | ||
156 | bb.mkdirhier(codir) | 147 | bb.mkdirhier(codir) |
157 | os.chdir(repodir) | 148 | os.chdir(repodir) |
158 | rungitcmd("git read-tree %s" % (tag),d) | 149 | rungitcmd("git read-tree %s" % (tag),d) |
159 | |||
160 | rungitcmd("git checkout-index -q -f --prefix=%s -a" % (os.path.join(codir, "git", "")),d) | 150 | rungitcmd("git checkout-index -q -f --prefix=%s -a" % (os.path.join(codir, "git", "")),d) |
161 | 151 | ||
162 | #print("Changing to %s" % codir) | ||
163 | os.chdir(codir) | 152 | os.chdir(codir) |
153 | bb.note("Creating tarball of git checkout") | ||
164 | rungitcmd("tar -czf %s %s" % (cofile, os.path.join(".", "*") ),d) | 154 | rungitcmd("tar -czf %s %s" % (cofile, os.path.join(".", "*") ),d) |
165 | |||
diff --git a/bitbake/lib/bb/fetch/svn.py b/bitbake/lib/bb/fetch/svn.py index ac5eebf5c0..6e3a9277ab 100644 --- a/bitbake/lib/bb/fetch/svn.py +++ b/bitbake/lib/bb/fetch/svn.py | |||
@@ -98,20 +98,14 @@ class Svn(Fetch): | |||
98 | 98 | ||
99 | date = Fetch.getSRCDate(d) | 99 | date = Fetch.getSRCDate(d) |
100 | 100 | ||
101 | if "method" in parm: | ||
102 | method = parm["method"] | ||
103 | else: | ||
104 | method = "pserver" | ||
105 | |||
106 | if "proto" in parm: | 101 | if "proto" in parm: |
107 | proto = parm["proto"] | 102 | proto = parm["proto"] |
108 | else: | 103 | else: |
109 | proto = "svn" | 104 | proto = "svn" |
110 | 105 | ||
111 | svn_rsh = None | 106 | svn_rsh = None |
112 | if method == "ext": | 107 | if proto == "svn+ssh" and "rsh" in parm: |
113 | if "rsh" in parm: | 108 | svn_rsh = parm["rsh"] |
114 | svn_rsh = parm["rsh"] | ||
115 | 109 | ||
116 | tarfn = data.expand('%s_%s_%s_%s_%s.tar.gz' % (module.replace('/', '.'), host, path.replace('/', '.'), revision, date), localdata) | 110 | tarfn = data.expand('%s_%s_%s_%s_%s.tar.gz' % (module.replace('/', '.'), host, path.replace('/', '.'), revision, date), localdata) |
117 | data.setVar('TARFILES', dlfile, localdata) | 111 | data.setVar('TARFILES', dlfile, localdata) |
@@ -122,24 +116,13 @@ class Svn(Fetch): | |||
122 | bb.debug(1, "%s already exists, skipping svn checkout." % tarfn) | 116 | bb.debug(1, "%s already exists, skipping svn checkout." % tarfn) |
123 | continue | 117 | continue |
124 | 118 | ||
125 | svn_tarball_stash = data.getVar('CVS_TARBALL_STASH', d, 1) | 119 | # try to use the tarball stash |
126 | if svn_tarball_stash: | 120 | if Fetch.try_mirror(d, tarfn): |
127 | fetchcmd = data.getVar("FETCHCOMMAND_wget", d, 1) | 121 | continue |
128 | uri = svn_tarball_stash + tarfn | ||
129 | bb.note("fetch " + uri) | ||
130 | fetchcmd = fetchcmd.replace("${URI}", uri) | ||
131 | ret = os.system(fetchcmd) | ||
132 | if ret == 0: | ||
133 | bb.note("Fetched %s from tarball stash, skipping checkout" % tarfn) | ||
134 | continue | ||
135 | 122 | ||
136 | olddir = os.path.abspath(os.getcwd()) | 123 | olddir = os.path.abspath(os.getcwd()) |
137 | os.chdir(data.expand(dldir, localdata)) | 124 | os.chdir(data.expand(dldir, localdata)) |
138 | 125 | ||
139 | # setup svnroot | ||
140 | # svnroot = ":" + method + ":" + user | ||
141 | # if pswd: | ||
142 | # svnroot += ":" + pswd | ||
143 | svnroot = host + path | 126 | svnroot = host + path |
144 | 127 | ||
145 | data.setVar('SVNROOT', svnroot, localdata) | 128 | data.setVar('SVNROOT', svnroot, localdata) |
diff --git a/bitbake/lib/bb/parse/parse_c/BBHandler.py b/bitbake/lib/bb/parse/parse_c/BBHandler.py new file mode 100644 index 0000000000..300871d9e3 --- /dev/null +++ b/bitbake/lib/bb/parse/parse_c/BBHandler.py | |||
@@ -0,0 +1,65 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # Copyright (C) 2006 Holger Hans Peter Freyther | ||
5 | # | ||
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
7 | # of this software and associated documentation files (the "Software"), to deal | ||
8 | # in the Software without restriction, including without limitation the rights | ||
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
10 | # copies of the Software, and to permit persons to whom the Software is | ||
11 | # furnished to do so, subject to the following conditions: | ||
12 | # | ||
13 | # The above copyright notice and this permission notice shall be included in all | ||
14 | # copies or substantial portions of the Software. | ||
15 | # | ||
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT | ||
19 | # SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
20 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
21 | # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR | ||
22 | # THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
23 | # | ||
24 | |||
25 | from bb import data | ||
26 | from bb.parse import ParseError | ||
27 | |||
28 | # | ||
29 | # This is the Python Part of the Native Parser Implementation. | ||
30 | # We will only parse .bbclass, .inc and .bb files but no | ||
31 | # configuration files. | ||
32 | # supports, init and handle are the public methods used by | ||
33 | # parser module | ||
34 | # | ||
35 | # The rest of the methods are internal implementation details. | ||
36 | |||
37 | |||
38 | |||
39 | # | ||
40 | # internal | ||
41 | # | ||
42 | |||
43 | |||
44 | # | ||
45 | # public | ||
46 | # | ||
47 | def supports(fn, data): | ||
48 | return fn[-3:] == ".bb" or fn[-8:] == ".bbclass" or fn[-4:] == ".inc" | ||
49 | |||
50 | def init(fn, data): | ||
51 | print "Init" | ||
52 | |||
53 | def handle(fn, data, include): | ||
54 | print "" | ||
55 | print "fn: %s" % fn | ||
56 | print "data: %s" % data | ||
57 | print "include: %s" % include | ||
58 | |||
59 | pass | ||
60 | |||
61 | # Inform bitbake that we are a parser | ||
62 | # We need to define all three | ||
63 | from bb.parse import handlers | ||
64 | handlers.append( {'supports' : supports, 'handle': handle, 'init' : init}) | ||
65 | del handlers | ||
diff --git a/bitbake/lib/bb/parse/parse_c/README.build b/bitbake/lib/bb/parse/parse_c/README.build new file mode 100644 index 0000000000..eb6ad8c862 --- /dev/null +++ b/bitbake/lib/bb/parse/parse_c/README.build | |||
@@ -0,0 +1,12 @@ | |||
1 | To ease portability (lemon, flex, etc) we keep the | ||
2 | result of flex and lemon in the source code. We agree | ||
3 | to not manually change the scanner and parser. | ||
4 | |||
5 | |||
6 | |||
7 | How we create the files: | ||
8 | flex -t bitbakescanner.l > bitbakescanner.cc | ||
9 | lemon bitbakeparser.y | ||
10 | mv bitbakeparser.c bitbakeparser.cc | ||
11 | |||
12 | Now manually create two files | ||
diff --git a/bitbake/lib/bb/parse/parse_c/__init__.py b/bitbake/lib/bb/parse/parse_c/__init__.py new file mode 100644 index 0000000000..bbb318e51f --- /dev/null +++ b/bitbake/lib/bb/parse/parse_c/__init__.py | |||
@@ -0,0 +1,28 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # Copyright (C) 2006 Holger Hans Peter Freyther | ||
5 | # | ||
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
7 | # of this software and associated documentation files (the "Software"), to deal | ||
8 | # in the Software without restriction, including without limitation the rights | ||
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
10 | # copies of the Software, and to permit persons to whom the Software is | ||
11 | # furnished to do so, subject to the following conditions: | ||
12 | # | ||
13 | # The above copyright notice and this permission notice shall be included in all | ||
14 | # copies or substantial portions of the Software. | ||
15 | # | ||
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT | ||
19 | # SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
20 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
21 | # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR | ||
22 | # THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
23 | # | ||
24 | |||
25 | __version__ = '0.1' | ||
26 | __all__ = [ 'BBHandler' ] | ||
27 | |||
28 | import BBHandler | ||
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakeparser.cc b/bitbake/lib/bb/parse/parse_c/bitbakeparser.cc new file mode 100644 index 0000000000..3a3c53dd46 --- /dev/null +++ b/bitbake/lib/bb/parse/parse_c/bitbakeparser.cc | |||
@@ -0,0 +1,1105 @@ | |||
1 | /* Driver template for the LEMON parser generator. | ||
2 | ** The author disclaims copyright to this source code. | ||
3 | */ | ||
4 | /* First off, code is include which follows the "include" declaration | ||
5 | ** in the input file. */ | ||
6 | #include <stdio.h> | ||
7 | #line 43 "bitbakeparser.y" | ||
8 | |||
9 | #include "token.h" | ||
10 | #include "lexer.h" | ||
11 | #include "python_output.h" | ||
12 | #line 14 "bitbakeparser.c" | ||
13 | /* Next is all token values, in a form suitable for use by makeheaders. | ||
14 | ** This section will be null unless lemon is run with the -m switch. | ||
15 | */ | ||
16 | /* | ||
17 | ** These constants (all generated automatically by the parser generator) | ||
18 | ** specify the various kinds of tokens (terminals) that the parser | ||
19 | ** understands. | ||
20 | ** | ||
21 | ** Each symbol here is a terminal symbol in the grammar. | ||
22 | */ | ||
23 | /* Make sure the INTERFACE macro is defined. | ||
24 | */ | ||
25 | #ifndef INTERFACE | ||
26 | # define INTERFACE 1 | ||
27 | #endif | ||
28 | /* The next thing included is series of defines which control | ||
29 | ** various aspects of the generated parser. | ||
30 | ** YYCODETYPE is the data type used for storing terminal | ||
31 | ** and nonterminal numbers. "unsigned char" is | ||
32 | ** used if there are fewer than 250 terminals | ||
33 | ** and nonterminals. "int" is used otherwise. | ||
34 | ** YYNOCODE is a number of type YYCODETYPE which corresponds | ||
35 | ** to no legal terminal or nonterminal number. This | ||
36 | ** number is used to fill in empty slots of the hash | ||
37 | ** table. | ||
38 | ** YYFALLBACK If defined, this indicates that one or more tokens | ||
39 | ** have fall-back values which should be used if the | ||
40 | ** original value of the token will not parse. | ||
41 | ** YYACTIONTYPE is the data type used for storing terminal | ||
42 | ** and nonterminal numbers. "unsigned char" is | ||
43 | ** used if there are fewer than 250 rules and | ||
44 | ** states combined. "int" is used otherwise. | ||
45 | ** bbparseTOKENTYPE is the data type used for minor tokens given | ||
46 | ** directly to the parser from the tokenizer. | ||
47 | ** YYMINORTYPE is the data type used for all minor tokens. | ||
48 | ** This is typically a union of many types, one of | ||
49 | ** which is bbparseTOKENTYPE. The entry in the union | ||
50 | ** for base tokens is called "yy0". | ||
51 | ** YYSTACKDEPTH is the maximum depth of the parser's stack. | ||
52 | ** bbparseARG_SDECL A static variable declaration for the %extra_argument | ||
53 | ** bbparseARG_PDECL A parameter declaration for the %extra_argument | ||
54 | ** bbparseARG_STORE Code to store %extra_argument into yypParser | ||
55 | ** bbparseARG_FETCH Code to extract %extra_argument from yypParser | ||
56 | ** YYNSTATE the combined number of states. | ||
57 | ** YYNRULE the number of rules in the grammar | ||
58 | ** YYERRORSYMBOL is the code number of the error symbol. If not | ||
59 | ** defined, then do no error processing. | ||
60 | */ | ||
61 | #define YYCODETYPE unsigned char | ||
62 | #define YYNOCODE 42 | ||
63 | #define YYACTIONTYPE unsigned char | ||
64 | #define bbparseTOKENTYPE token_t | ||
65 | typedef union { | ||
66 | bbparseTOKENTYPE yy0; | ||
67 | int yy83; | ||
68 | } YYMINORTYPE; | ||
69 | #define YYSTACKDEPTH 100 | ||
70 | #define bbparseARG_SDECL lex_t* lex; | ||
71 | #define bbparseARG_PDECL ,lex_t* lex | ||
72 | #define bbparseARG_FETCH lex_t* lex = yypParser->lex | ||
73 | #define bbparseARG_STORE yypParser->lex = lex | ||
74 | #define YYNSTATE 74 | ||
75 | #define YYNRULE 41 | ||
76 | #define YYERRORSYMBOL 28 | ||
77 | #define YYERRSYMDT yy83 | ||
78 | #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) | ||
79 | #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) | ||
80 | #define YY_ERROR_ACTION (YYNSTATE+YYNRULE) | ||
81 | |||
82 | /* Next are that tables used to determine what action to take based on the | ||
83 | ** current state and lookahead token. These tables are used to implement | ||
84 | ** functions that take a state number and lookahead value and return an | ||
85 | ** action integer. | ||
86 | ** | ||
87 | ** Suppose the action integer is N. Then the action is determined as | ||
88 | ** follows | ||
89 | ** | ||
90 | ** 0 <= N < YYNSTATE Shift N. That is, push the lookahead | ||
91 | ** token onto the stack and goto state N. | ||
92 | ** | ||
93 | ** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. | ||
94 | ** | ||
95 | ** N == YYNSTATE+YYNRULE A syntax error has occurred. | ||
96 | ** | ||
97 | ** N == YYNSTATE+YYNRULE+1 The parser accepts its input. | ||
98 | ** | ||
99 | ** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused | ||
100 | ** slots in the yy_action[] table. | ||
101 | ** | ||
102 | ** The action table is constructed as a single large table named yy_action[]. | ||
103 | ** Given state S and lookahead X, the action is computed as | ||
104 | ** | ||
105 | ** yy_action[ yy_shift_ofst[S] + X ] | ||
106 | ** | ||
107 | ** If the index value yy_shift_ofst[S]+X is out of range or if the value | ||
108 | ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] | ||
109 | ** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table | ||
110 | ** and that yy_default[S] should be used instead. | ||
111 | ** | ||
112 | ** The formula above is for computing the action when the lookahead is | ||
113 | ** a terminal symbol. If the lookahead is a non-terminal (as occurs after | ||
114 | ** a reduce action) then the yy_reduce_ofst[] array is used in place of | ||
115 | ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of | ||
116 | ** YY_SHIFT_USE_DFLT. | ||
117 | ** | ||
118 | ** The following are the tables generated in this section: | ||
119 | ** | ||
120 | ** yy_action[] A single table containing all actions. | ||
121 | ** yy_lookahead[] A table containing the lookahead for each entry in | ||
122 | ** yy_action. Used to detect hash collisions. | ||
123 | ** yy_shift_ofst[] For each state, the offset into yy_action for | ||
124 | ** shifting terminals. | ||
125 | ** yy_reduce_ofst[] For each state, the offset into yy_action for | ||
126 | ** shifting non-terminals after a reduce. | ||
127 | ** yy_default[] Default action for each state. | ||
128 | */ | ||
129 | static const YYACTIONTYPE yy_action[] = { | ||
130 | /* 0 */ 28, 47, 5, 57, 33, 58, 30, 25, 24, 37, | ||
131 | /* 10 */ 45, 14, 2, 29, 41, 3, 16, 4, 23, 39, | ||
132 | /* 20 */ 69, 8, 11, 17, 26, 48, 47, 32, 21, 42, | ||
133 | /* 30 */ 31, 57, 57, 73, 44, 10, 66, 7, 34, 38, | ||
134 | /* 40 */ 57, 51, 72, 116, 1, 62, 6, 49, 52, 35, | ||
135 | /* 50 */ 36, 59, 54, 9, 20, 64, 43, 22, 40, 50, | ||
136 | /* 60 */ 46, 71, 67, 60, 15, 65, 61, 70, 53, 56, | ||
137 | /* 70 */ 27, 12, 68, 63, 84, 55, 18, 84, 13, 84, | ||
138 | /* 80 */ 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, | ||
139 | /* 90 */ 84, 19, | ||
140 | }; | ||
141 | static const YYCODETYPE yy_lookahead[] = { | ||
142 | /* 0 */ 1, 2, 3, 21, 4, 23, 6, 7, 8, 9, | ||
143 | /* 10 */ 31, 32, 13, 14, 1, 16, 39, 18, 19, 20, | ||
144 | /* 20 */ 37, 38, 22, 24, 25, 1, 2, 4, 10, 6, | ||
145 | /* 30 */ 7, 21, 21, 23, 23, 22, 35, 36, 11, 12, | ||
146 | /* 40 */ 21, 5, 23, 29, 30, 33, 34, 5, 5, 10, | ||
147 | /* 50 */ 12, 10, 5, 22, 39, 15, 40, 11, 10, 5, | ||
148 | /* 60 */ 26, 17, 17, 10, 32, 35, 33, 17, 5, 5, | ||
149 | /* 70 */ 1, 22, 37, 1, 41, 5, 39, 41, 27, 41, | ||
150 | /* 80 */ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, | ||
151 | /* 90 */ 41, 39, | ||
152 | }; | ||
153 | #define YY_SHIFT_USE_DFLT (-19) | ||
154 | #define YY_SHIFT_MAX 43 | ||
155 | static const signed char yy_shift_ofst[] = { | ||
156 | /* 0 */ -19, -1, 18, 40, 45, 24, 18, 40, 45, -19, | ||
157 | /* 10 */ -19, -19, -19, -19, 0, 23, -18, 13, 19, 10, | ||
158 | /* 20 */ 11, 27, 53, 50, 63, 64, 69, 49, 51, 72, | ||
159 | /* 30 */ 70, 36, 42, 43, 39, 38, 41, 47, 48, 44, | ||
160 | /* 40 */ 46, 31, 54, 34, | ||
161 | }; | ||
162 | #define YY_REDUCE_USE_DFLT (-24) | ||
163 | #define YY_REDUCE_MAX 13 | ||
164 | static const signed char yy_reduce_ofst[] = { | ||
165 | /* 0 */ 14, -21, 12, 1, -17, 32, 33, 30, 35, 37, | ||
166 | /* 10 */ 52, -23, 15, 16, | ||
167 | }; | ||
168 | static const YYACTIONTYPE yy_default[] = { | ||
169 | /* 0 */ 76, 74, 115, 115, 115, 115, 94, 99, 103, 107, | ||
170 | /* 10 */ 107, 107, 107, 113, 115, 115, 115, 115, 115, 115, | ||
171 | /* 20 */ 115, 89, 115, 115, 115, 115, 115, 115, 77, 115, | ||
172 | /* 30 */ 115, 115, 115, 115, 115, 90, 115, 115, 115, 115, | ||
173 | /* 40 */ 91, 115, 115, 114, 111, 75, 112, 78, 77, 79, | ||
174 | /* 50 */ 80, 81, 82, 83, 84, 85, 86, 106, 108, 87, | ||
175 | /* 60 */ 88, 92, 93, 95, 96, 97, 98, 100, 101, 102, | ||
176 | /* 70 */ 104, 105, 109, 110, | ||
177 | }; | ||
178 | #define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0])) | ||
179 | |||
180 | /* The next table maps tokens into fallback tokens. If a construct | ||
181 | ** like the following: | ||
182 | ** | ||
183 | ** %fallback ID X Y Z. | ||
184 | ** | ||
185 | ** appears in the grammer, then ID becomes a fallback token for X, Y, | ||
186 | ** and Z. Whenever one of the tokens X, Y, or Z is input to the parser | ||
187 | ** but it does not parse, the type of the token is changed to ID and | ||
188 | ** the parse is retried before an error is thrown. | ||
189 | */ | ||
190 | #ifdef YYFALLBACK | ||
191 | static const YYCODETYPE yyFallback[] = { | ||
192 | }; | ||
193 | #endif /* YYFALLBACK */ | ||
194 | |||
195 | /* The following structure represents a single element of the | ||
196 | ** parser's stack. Information stored includes: | ||
197 | ** | ||
198 | ** + The state number for the parser at this level of the stack. | ||
199 | ** | ||
200 | ** + The value of the token stored at this level of the stack. | ||
201 | ** (In other words, the "major" token.) | ||
202 | ** | ||
203 | ** + The semantic value stored at this level of the stack. This is | ||
204 | ** the information used by the action routines in the grammar. | ||
205 | ** It is sometimes called the "minor" token. | ||
206 | */ | ||
207 | struct yyStackEntry { | ||
208 | int stateno; /* The state-number */ | ||
209 | int major; /* The major token value. This is the code | ||
210 | ** number for the token at this stack level */ | ||
211 | YYMINORTYPE minor; /* The user-supplied minor token value. This | ||
212 | ** is the value of the token */ | ||
213 | }; | ||
214 | typedef struct yyStackEntry yyStackEntry; | ||
215 | |||
216 | /* The state of the parser is completely contained in an instance of | ||
217 | ** the following structure */ | ||
218 | struct yyParser { | ||
219 | int yyidx; /* Index of top element in stack */ | ||
220 | int yyerrcnt; /* Shifts left before out of the error */ | ||
221 | bbparseARG_SDECL /* A place to hold %extra_argument */ | ||
222 | yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ | ||
223 | }; | ||
224 | typedef struct yyParser yyParser; | ||
225 | |||
226 | #ifndef NDEBUG | ||
227 | #include <stdio.h> | ||
228 | static FILE *yyTraceFILE = 0; | ||
229 | static char *yyTracePrompt = 0; | ||
230 | #endif /* NDEBUG */ | ||
231 | |||
232 | #ifndef NDEBUG | ||
233 | /* | ||
234 | ** Turn parser tracing on by giving a stream to which to write the trace | ||
235 | ** and a prompt to preface each trace message. Tracing is turned off | ||
236 | ** by making either argument NULL | ||
237 | ** | ||
238 | ** Inputs: | ||
239 | ** <ul> | ||
240 | ** <li> A FILE* to which trace output should be written. | ||
241 | ** If NULL, then tracing is turned off. | ||
242 | ** <li> A prefix string written at the beginning of every | ||
243 | ** line of trace output. If NULL, then tracing is | ||
244 | ** turned off. | ||
245 | ** </ul> | ||
246 | ** | ||
247 | ** Outputs: | ||
248 | ** None. | ||
249 | */ | ||
250 | void bbparseTrace(FILE *TraceFILE, char *zTracePrompt){ | ||
251 | yyTraceFILE = TraceFILE; | ||
252 | yyTracePrompt = zTracePrompt; | ||
253 | if( yyTraceFILE==0 ) yyTracePrompt = 0; | ||
254 | else if( yyTracePrompt==0 ) yyTraceFILE = 0; | ||
255 | } | ||
256 | #endif /* NDEBUG */ | ||
257 | |||
258 | #ifndef NDEBUG | ||
259 | /* For tracing shifts, the names of all terminals and nonterminals | ||
260 | ** are required. The following table supplies these names */ | ||
261 | static const char *const yyTokenName[] = { | ||
262 | "$", "SYMBOL", "VARIABLE", "EXPORT", | ||
263 | "OP_ASSIGN", "STRING", "OP_IMMEDIATE", "OP_COND", | ||
264 | "OP_PREPEND", "OP_APPEND", "TSYMBOL", "BEFORE", | ||
265 | "AFTER", "ADDTASK", "ADDHANDLER", "FSYMBOL", | ||
266 | "EXPORT_FUNC", "ISYMBOL", "INHERIT", "INCLUDE", | ||
267 | "REQUIRE", "PROC_BODY", "PROC_OPEN", "PROC_CLOSE", | ||
268 | "PYTHON", "FAKEROOT", "DEF_BODY", "DEF_ARGS", | ||
269 | "error", "program", "statements", "statement", | ||
270 | "variable", "task", "tasks", "func", | ||
271 | "funcs", "inherit", "inherits", "proc_body", | ||
272 | "def_body", | ||
273 | }; | ||
274 | #endif /* NDEBUG */ | ||
275 | |||
276 | #ifndef NDEBUG | ||
277 | /* For tracing reduce actions, the names of all rules are required. | ||
278 | */ | ||
279 | static const char *const yyRuleName[] = { | ||
280 | /* 0 */ "program ::= statements", | ||
281 | /* 1 */ "statements ::= statements statement", | ||
282 | /* 2 */ "statements ::=", | ||
283 | /* 3 */ "variable ::= SYMBOL", | ||
284 | /* 4 */ "variable ::= VARIABLE", | ||
285 | /* 5 */ "statement ::= EXPORT variable OP_ASSIGN STRING", | ||
286 | /* 6 */ "statement ::= EXPORT variable OP_IMMEDIATE STRING", | ||
287 | /* 7 */ "statement ::= EXPORT variable OP_COND STRING", | ||
288 | /* 8 */ "statement ::= variable OP_ASSIGN STRING", | ||
289 | /* 9 */ "statement ::= variable OP_PREPEND STRING", | ||
290 | /* 10 */ "statement ::= variable OP_APPEND STRING", | ||
291 | /* 11 */ "statement ::= variable OP_IMMEDIATE STRING", | ||
292 | /* 12 */ "statement ::= variable OP_COND STRING", | ||
293 | /* 13 */ "task ::= TSYMBOL BEFORE TSYMBOL AFTER TSYMBOL", | ||
294 | /* 14 */ "task ::= TSYMBOL AFTER TSYMBOL BEFORE TSYMBOL", | ||
295 | /* 15 */ "task ::= TSYMBOL", | ||
296 | /* 16 */ "task ::= TSYMBOL BEFORE TSYMBOL", | ||
297 | /* 17 */ "task ::= TSYMBOL AFTER TSYMBOL", | ||
298 | /* 18 */ "tasks ::= tasks task", | ||
299 | /* 19 */ "tasks ::= task", | ||
300 | /* 20 */ "statement ::= ADDTASK tasks", | ||
301 | /* 21 */ "statement ::= ADDHANDLER SYMBOL", | ||
302 | /* 22 */ "func ::= FSYMBOL", | ||
303 | /* 23 */ "funcs ::= funcs func", | ||
304 | /* 24 */ "funcs ::= func", | ||
305 | /* 25 */ "statement ::= EXPORT_FUNC funcs", | ||
306 | /* 26 */ "inherit ::= ISYMBOL", | ||
307 | /* 27 */ "inherits ::= inherits inherit", | ||
308 | /* 28 */ "inherits ::= inherit", | ||
309 | /* 29 */ "statement ::= INHERIT inherits", | ||
310 | /* 30 */ "statement ::= INCLUDE ISYMBOL", | ||
311 | /* 31 */ "statement ::= REQUIRE ISYMBOL", | ||
312 | /* 32 */ "proc_body ::= proc_body PROC_BODY", | ||
313 | /* 33 */ "proc_body ::=", | ||
314 | /* 34 */ "statement ::= variable PROC_OPEN proc_body PROC_CLOSE", | ||
315 | /* 35 */ "statement ::= PYTHON SYMBOL PROC_OPEN proc_body PROC_CLOSE", | ||
316 | /* 36 */ "statement ::= PYTHON PROC_OPEN proc_body PROC_CLOSE", | ||
317 | /* 37 */ "statement ::= FAKEROOT SYMBOL PROC_OPEN proc_body PROC_CLOSE", | ||
318 | /* 38 */ "def_body ::= def_body DEF_BODY", | ||
319 | /* 39 */ "def_body ::=", | ||
320 | /* 40 */ "statement ::= SYMBOL DEF_ARGS def_body", | ||
321 | }; | ||
322 | #endif /* NDEBUG */ | ||
323 | |||
324 | /* | ||
325 | ** This function returns the symbolic name associated with a token | ||
326 | ** value. | ||
327 | */ | ||
328 | const char *bbparseTokenName(int tokenType){ | ||
329 | #ifndef NDEBUG | ||
330 | if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ | ||
331 | return yyTokenName[tokenType]; | ||
332 | }else{ | ||
333 | return "Unknown"; | ||
334 | } | ||
335 | #else | ||
336 | return ""; | ||
337 | #endif | ||
338 | } | ||
339 | |||
340 | /* | ||
341 | ** This function allocates a new parser. | ||
342 | ** The only argument is a pointer to a function which works like | ||
343 | ** malloc. | ||
344 | ** | ||
345 | ** Inputs: | ||
346 | ** A pointer to the function used to allocate memory. | ||
347 | ** | ||
348 | ** Outputs: | ||
349 | ** A pointer to a parser. This pointer is used in subsequent calls | ||
350 | ** to bbparse and bbparseFree. | ||
351 | */ | ||
352 | void *bbparseAlloc(void *(*mallocProc)(size_t)){ | ||
353 | yyParser *pParser; | ||
354 | pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) ); | ||
355 | if( pParser ){ | ||
356 | pParser->yyidx = -1; | ||
357 | } | ||
358 | return pParser; | ||
359 | } | ||
360 | |||
361 | /* The following function deletes the value associated with a | ||
362 | ** symbol. The symbol can be either a terminal or nonterminal. | ||
363 | ** "yymajor" is the symbol code, and "yypminor" is a pointer to | ||
364 | ** the value. | ||
365 | */ | ||
366 | static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){ | ||
367 | switch( yymajor ){ | ||
368 | /* Here is inserted the actions which take place when a | ||
369 | ** terminal or non-terminal is destroyed. This can happen | ||
370 | ** when the symbol is popped from the stack during a | ||
371 | ** reduce or during error processing or when a parser is | ||
372 | ** being destroyed before it is finished parsing. | ||
373 | ** | ||
374 | ** Note: during a reduce, the only symbols destroyed are those | ||
375 | ** which appear on the RHS of the rule, but which are not used | ||
376 | ** inside the C code. | ||
377 | */ | ||
378 | case 1: | ||
379 | case 2: | ||
380 | case 3: | ||
381 | case 4: | ||
382 | case 5: | ||
383 | case 6: | ||
384 | case 7: | ||
385 | case 8: | ||
386 | case 9: | ||
387 | case 10: | ||
388 | case 11: | ||
389 | case 12: | ||
390 | case 13: | ||
391 | case 14: | ||
392 | case 15: | ||
393 | case 16: | ||
394 | case 17: | ||
395 | case 18: | ||
396 | case 19: | ||
397 | case 20: | ||
398 | case 21: | ||
399 | case 22: | ||
400 | case 23: | ||
401 | case 24: | ||
402 | case 25: | ||
403 | case 26: | ||
404 | case 27: | ||
405 | #line 50 "bitbakeparser.y" | ||
406 | { (yypminor->yy0).release_this (); } | ||
407 | #line 409 "bitbakeparser.c" | ||
408 | break; | ||
409 | default: break; /* If no destructor action specified: do nothing */ | ||
410 | } | ||
411 | } | ||
412 | |||
413 | /* | ||
414 | ** Pop the parser's stack once. | ||
415 | ** | ||
416 | ** If there is a destructor routine associated with the token which | ||
417 | ** is popped from the stack, then call it. | ||
418 | ** | ||
419 | ** Return the major token number for the symbol popped. | ||
420 | */ | ||
421 | static int yy_pop_parser_stack(yyParser *pParser){ | ||
422 | YYCODETYPE yymajor; | ||
423 | yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; | ||
424 | |||
425 | if( pParser->yyidx<0 ) return 0; | ||
426 | #ifndef NDEBUG | ||
427 | if( yyTraceFILE && pParser->yyidx>=0 ){ | ||
428 | fprintf(yyTraceFILE,"%sPopping %s\n", | ||
429 | yyTracePrompt, | ||
430 | yyTokenName[yytos->major]); | ||
431 | } | ||
432 | #endif | ||
433 | yymajor = yytos->major; | ||
434 | yy_destructor( yymajor, &yytos->minor); | ||
435 | pParser->yyidx--; | ||
436 | return yymajor; | ||
437 | } | ||
438 | |||
439 | /* | ||
440 | ** Deallocate and destroy a parser. Destructors are all called for | ||
441 | ** all stack elements before shutting the parser down. | ||
442 | ** | ||
443 | ** Inputs: | ||
444 | ** <ul> | ||
445 | ** <li> A pointer to the parser. This should be a pointer | ||
446 | ** obtained from bbparseAlloc. | ||
447 | ** <li> A pointer to a function used to reclaim memory obtained | ||
448 | ** from malloc. | ||
449 | ** </ul> | ||
450 | */ | ||
451 | void bbparseFree( | ||
452 | void *p, /* The parser to be deleted */ | ||
453 | void (*freeProc)(void*) /* Function used to reclaim memory */ | ||
454 | ){ | ||
455 | yyParser *pParser = (yyParser*)p; | ||
456 | if( pParser==0 ) return; | ||
457 | while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser); | ||
458 | (*freeProc)((void*)pParser); | ||
459 | } | ||
460 | |||
461 | /* | ||
462 | ** Find the appropriate action for a parser given the terminal | ||
463 | ** look-ahead token iLookAhead. | ||
464 | ** | ||
465 | ** If the look-ahead token is YYNOCODE, then check to see if the action is | ||
466 | ** independent of the look-ahead. If it is, return the action, otherwise | ||
467 | ** return YY_NO_ACTION. | ||
468 | */ | ||
469 | static int yy_find_shift_action( | ||
470 | yyParser *pParser, /* The parser */ | ||
471 | int iLookAhead /* The look-ahead token */ | ||
472 | ){ | ||
473 | int i; | ||
474 | int stateno = pParser->yystack[pParser->yyidx].stateno; | ||
475 | |||
476 | if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){ | ||
477 | return yy_default[stateno]; | ||
478 | } | ||
479 | if( iLookAhead==YYNOCODE ){ | ||
480 | return YY_NO_ACTION; | ||
481 | } | ||
482 | i += iLookAhead; | ||
483 | if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ | ||
484 | #ifdef YYFALLBACK | ||
485 | int iFallback; /* Fallback token */ | ||
486 | if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) | ||
487 | && (iFallback = yyFallback[iLookAhead])!=0 ){ | ||
488 | #ifndef NDEBUG | ||
489 | if( yyTraceFILE ){ | ||
490 | fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", | ||
491 | yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); | ||
492 | } | ||
493 | #endif | ||
494 | return yy_find_shift_action(pParser, iFallback); | ||
495 | } | ||
496 | #endif | ||
497 | return yy_default[stateno]; | ||
498 | }else{ | ||
499 | return yy_action[i]; | ||
500 | } | ||
501 | } | ||
502 | |||
503 | /* | ||
504 | ** Find the appropriate action for a parser given the non-terminal | ||
505 | ** look-ahead token iLookAhead. | ||
506 | ** | ||
507 | ** If the look-ahead token is YYNOCODE, then check to see if the action is | ||
508 | ** independent of the look-ahead. If it is, return the action, otherwise | ||
509 | ** return YY_NO_ACTION. | ||
510 | */ | ||
511 | static int yy_find_reduce_action( | ||
512 | int stateno, /* Current state number */ | ||
513 | int iLookAhead /* The look-ahead token */ | ||
514 | ){ | ||
515 | int i; | ||
516 | /* int stateno = pParser->yystack[pParser->yyidx].stateno; */ | ||
517 | |||
518 | if( stateno>YY_REDUCE_MAX || | ||
519 | (i = yy_reduce_ofst[stateno])==YY_REDUCE_USE_DFLT ){ | ||
520 | return yy_default[stateno]; | ||
521 | } | ||
522 | if( iLookAhead==YYNOCODE ){ | ||
523 | return YY_NO_ACTION; | ||
524 | } | ||
525 | i += iLookAhead; | ||
526 | if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ | ||
527 | return yy_default[stateno]; | ||
528 | }else{ | ||
529 | return yy_action[i]; | ||
530 | } | ||
531 | } | ||
532 | |||
533 | /* | ||
534 | ** Perform a shift action. | ||
535 | */ | ||
536 | static void yy_shift( | ||
537 | yyParser *yypParser, /* The parser to be shifted */ | ||
538 | int yyNewState, /* The new state to shift in */ | ||
539 | int yyMajor, /* The major token to shift in */ | ||
540 | YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */ | ||
541 | ){ | ||
542 | yyStackEntry *yytos; | ||
543 | yypParser->yyidx++; | ||
544 | if( yypParser->yyidx>=YYSTACKDEPTH ){ | ||
545 | bbparseARG_FETCH; | ||
546 | yypParser->yyidx--; | ||
547 | #ifndef NDEBUG | ||
548 | if( yyTraceFILE ){ | ||
549 | fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); | ||
550 | } | ||
551 | #endif | ||
552 | while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); | ||
553 | /* Here code is inserted which will execute if the parser | ||
554 | ** stack every overflows */ | ||
555 | bbparseARG_STORE; /* Suppress warning about unused %extra_argument var */ | ||
556 | return; | ||
557 | } | ||
558 | yytos = &yypParser->yystack[yypParser->yyidx]; | ||
559 | yytos->stateno = yyNewState; | ||
560 | yytos->major = yyMajor; | ||
561 | yytos->minor = *yypMinor; | ||
562 | #ifndef NDEBUG | ||
563 | if( yyTraceFILE && yypParser->yyidx>0 ){ | ||
564 | int i; | ||
565 | fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState); | ||
566 | fprintf(yyTraceFILE,"%sStack:",yyTracePrompt); | ||
567 | for(i=1; i<=yypParser->yyidx; i++) | ||
568 | fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]); | ||
569 | fprintf(yyTraceFILE,"\n"); | ||
570 | } | ||
571 | #endif | ||
572 | } | ||
573 | |||
574 | /* The following table contains information about every rule that | ||
575 | ** is used during the reduce. | ||
576 | */ | ||
577 | static const struct { | ||
578 | YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ | ||
579 | unsigned char nrhs; /* Number of right-hand side symbols in the rule */ | ||
580 | } yyRuleInfo[] = { | ||
581 | { 29, 1 }, | ||
582 | { 30, 2 }, | ||
583 | { 30, 0 }, | ||
584 | { 32, 1 }, | ||
585 | { 32, 1 }, | ||
586 | { 31, 4 }, | ||
587 | { 31, 4 }, | ||
588 | { 31, 4 }, | ||
589 | { 31, 3 }, | ||
590 | { 31, 3 }, | ||
591 | { 31, 3 }, | ||
592 | { 31, 3 }, | ||
593 | { 31, 3 }, | ||
594 | { 33, 5 }, | ||
595 | { 33, 5 }, | ||
596 | { 33, 1 }, | ||
597 | { 33, 3 }, | ||
598 | { 33, 3 }, | ||
599 | { 34, 2 }, | ||
600 | { 34, 1 }, | ||
601 | { 31, 2 }, | ||
602 | { 31, 2 }, | ||
603 | { 35, 1 }, | ||
604 | { 36, 2 }, | ||
605 | { 36, 1 }, | ||
606 | { 31, 2 }, | ||
607 | { 37, 1 }, | ||
608 | { 38, 2 }, | ||
609 | { 38, 1 }, | ||
610 | { 31, 2 }, | ||
611 | { 31, 2 }, | ||
612 | { 31, 2 }, | ||
613 | { 39, 2 }, | ||
614 | { 39, 0 }, | ||
615 | { 31, 4 }, | ||
616 | { 31, 5 }, | ||
617 | { 31, 4 }, | ||
618 | { 31, 5 }, | ||
619 | { 40, 2 }, | ||
620 | { 40, 0 }, | ||
621 | { 31, 3 }, | ||
622 | }; | ||
623 | |||
624 | static void yy_accept(yyParser*); /* Forward Declaration */ | ||
625 | |||
626 | /* | ||
627 | ** Perform a reduce action and the shift that must immediately | ||
628 | ** follow the reduce. | ||
629 | */ | ||
630 | static void yy_reduce( | ||
631 | yyParser *yypParser, /* The parser */ | ||
632 | int yyruleno /* Number of the rule by which to reduce */ | ||
633 | ){ | ||
634 | int yygoto; /* The next state */ | ||
635 | int yyact; /* The next action */ | ||
636 | YYMINORTYPE yygotominor; /* The LHS of the rule reduced */ | ||
637 | yyStackEntry *yymsp; /* The top of the parser's stack */ | ||
638 | int yysize; /* Amount to pop the stack */ | ||
639 | bbparseARG_FETCH; | ||
640 | yymsp = &yypParser->yystack[yypParser->yyidx]; | ||
641 | #ifndef NDEBUG | ||
642 | if( yyTraceFILE && yyruleno>=0 | ||
643 | && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ | ||
644 | fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, | ||
645 | yyRuleName[yyruleno]); | ||
646 | } | ||
647 | #endif /* NDEBUG */ | ||
648 | |||
649 | #ifndef NDEBUG | ||
650 | /* Silence complaints from purify about yygotominor being uninitialized | ||
651 | ** in some cases when it is copied into the stack after the following | ||
652 | ** switch. yygotominor is uninitialized when a rule reduces that does | ||
653 | ** not set the value of its left-hand side nonterminal. Leaving the | ||
654 | ** value of the nonterminal uninitialized is utterly harmless as long | ||
655 | ** as the value is never used. So really the only thing this code | ||
656 | ** accomplishes is to quieten purify. | ||
657 | */ | ||
658 | memset(&yygotominor, 0, sizeof(yygotominor)); | ||
659 | #endif | ||
660 | |||
661 | switch( yyruleno ){ | ||
662 | /* Beginning here are the reduction cases. A typical example | ||
663 | ** follows: | ||
664 | ** case 0: | ||
665 | ** #line <lineno> <grammarfile> | ||
666 | ** { ... } // User supplied code | ||
667 | ** #line <lineno> <thisfile> | ||
668 | ** break; | ||
669 | */ | ||
670 | case 3: | ||
671 | #line 60 "bitbakeparser.y" | ||
672 | { yygotominor.yy0.assignString( (char*)yymsp[0].minor.yy0.string() ); | ||
673 | yymsp[0].minor.yy0.assignString( 0 ); | ||
674 | yymsp[0].minor.yy0.release_this(); } | ||
675 | #line 677 "bitbakeparser.c" | ||
676 | break; | ||
677 | case 4: | ||
678 | #line 64 "bitbakeparser.y" | ||
679 | { | ||
680 | yygotominor.yy0.assignString( (char*)yymsp[0].minor.yy0.string() ); | ||
681 | yymsp[0].minor.yy0.assignString( 0 ); | ||
682 | yymsp[0].minor.yy0.release_this(); } | ||
683 | #line 685 "bitbakeparser.c" | ||
684 | break; | ||
685 | case 5: | ||
686 | #line 70 "bitbakeparser.y" | ||
687 | { e_assign( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | ||
688 | e_export( lex, yymsp[-2].minor.yy0.string() ); | ||
689 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); | ||
690 | yy_destructor(4,&yymsp[-1].minor); | ||
691 | } | ||
692 | #line 694 "bitbakeparser.c" | ||
693 | break; | ||
694 | case 6: | ||
695 | #line 74 "bitbakeparser.y" | ||
696 | { e_immediate ( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | ||
697 | e_export( lex, yymsp[-2].minor.yy0.string() ); | ||
698 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); | ||
699 | yy_destructor(6,&yymsp[-1].minor); | ||
700 | } | ||
701 | #line 703 "bitbakeparser.c" | ||
702 | break; | ||
703 | case 7: | ||
704 | #line 78 "bitbakeparser.y" | ||
705 | { e_cond( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | ||
706 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(3,&yymsp[-3].minor); | ||
707 | yy_destructor(7,&yymsp[-1].minor); | ||
708 | } | ||
709 | #line 711 "bitbakeparser.c" | ||
710 | break; | ||
711 | case 8: | ||
712 | #line 82 "bitbakeparser.y" | ||
713 | { e_assign( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | ||
714 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(4,&yymsp[-1].minor); | ||
715 | } | ||
716 | #line 718 "bitbakeparser.c" | ||
717 | break; | ||
718 | case 9: | ||
719 | #line 85 "bitbakeparser.y" | ||
720 | { e_prepend( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | ||
721 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(8,&yymsp[-1].minor); | ||
722 | } | ||
723 | #line 725 "bitbakeparser.c" | ||
724 | break; | ||
725 | case 10: | ||
726 | #line 88 "bitbakeparser.y" | ||
727 | { e_append( lex, yymsp[-2].minor.yy0.string() , yymsp[0].minor.yy0.string() ); | ||
728 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(9,&yymsp[-1].minor); | ||
729 | } | ||
730 | #line 732 "bitbakeparser.c" | ||
731 | break; | ||
732 | case 11: | ||
733 | #line 91 "bitbakeparser.y" | ||
734 | { e_immediate( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | ||
735 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(6,&yymsp[-1].minor); | ||
736 | } | ||
737 | #line 739 "bitbakeparser.c" | ||
738 | break; | ||
739 | case 12: | ||
740 | #line 94 "bitbakeparser.y" | ||
741 | { e_cond( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | ||
742 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(7,&yymsp[-1].minor); | ||
743 | } | ||
744 | #line 746 "bitbakeparser.c" | ||
745 | break; | ||
746 | case 13: | ||
747 | #line 98 "bitbakeparser.y" | ||
748 | { e_addtask( lex, yymsp[-4].minor.yy0.string(), yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() ); | ||
749 | yymsp[-4].minor.yy0.release_this(); yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(11,&yymsp[-3].minor); | ||
750 | yy_destructor(12,&yymsp[-1].minor); | ||
751 | } | ||
752 | #line 754 "bitbakeparser.c" | ||
753 | break; | ||
754 | case 14: | ||
755 | #line 101 "bitbakeparser.y" | ||
756 | { e_addtask( lex, yymsp[-4].minor.yy0.string(), yymsp[0].minor.yy0.string(), yymsp[-2].minor.yy0.string()); | ||
757 | yymsp[-4].minor.yy0.release_this(); yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(12,&yymsp[-3].minor); | ||
758 | yy_destructor(11,&yymsp[-1].minor); | ||
759 | } | ||
760 | #line 762 "bitbakeparser.c" | ||
761 | break; | ||
762 | case 15: | ||
763 | #line 104 "bitbakeparser.y" | ||
764 | { e_addtask( lex, yymsp[0].minor.yy0.string(), NULL, NULL); | ||
765 | yymsp[0].minor.yy0.release_this();} | ||
766 | #line 768 "bitbakeparser.c" | ||
767 | break; | ||
768 | case 16: | ||
769 | #line 107 "bitbakeparser.y" | ||
770 | { e_addtask( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string(), NULL); | ||
771 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(11,&yymsp[-1].minor); | ||
772 | } | ||
773 | #line 775 "bitbakeparser.c" | ||
774 | break; | ||
775 | case 17: | ||
776 | #line 110 "bitbakeparser.y" | ||
777 | { e_addtask( lex, yymsp[-2].minor.yy0.string(), NULL, yymsp[0].minor.yy0.string()); | ||
778 | yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); yy_destructor(12,&yymsp[-1].minor); | ||
779 | } | ||
780 | #line 782 "bitbakeparser.c" | ||
781 | break; | ||
782 | case 21: | ||
783 | #line 117 "bitbakeparser.y" | ||
784 | { e_addhandler( lex, yymsp[0].minor.yy0.string()); yymsp[0].minor.yy0.release_this (); yy_destructor(14,&yymsp[-1].minor); | ||
785 | } | ||
786 | #line 788 "bitbakeparser.c" | ||
787 | break; | ||
788 | case 22: | ||
789 | #line 119 "bitbakeparser.y" | ||
790 | { e_export_func( lex, yymsp[0].minor.yy0.string()); yymsp[0].minor.yy0.release_this(); } | ||
791 | #line 793 "bitbakeparser.c" | ||
792 | break; | ||
793 | case 26: | ||
794 | #line 124 "bitbakeparser.y" | ||
795 | { e_inherit( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this (); } | ||
796 | #line 798 "bitbakeparser.c" | ||
797 | break; | ||
798 | case 30: | ||
799 | #line 130 "bitbakeparser.y" | ||
800 | { e_include( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this(); yy_destructor(19,&yymsp[-1].minor); | ||
801 | } | ||
802 | #line 804 "bitbakeparser.c" | ||
803 | break; | ||
804 | case 31: | ||
805 | #line 133 "bitbakeparser.y" | ||
806 | { e_require( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this(); yy_destructor(20,&yymsp[-1].minor); | ||
807 | } | ||
808 | #line 810 "bitbakeparser.c" | ||
809 | break; | ||
810 | case 32: | ||
811 | #line 136 "bitbakeparser.y" | ||
812 | { /* concatenate body lines */ | ||
813 | yygotominor.yy0.assignString( token_t::concatString(yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string()) ); | ||
814 | yymsp[-1].minor.yy0.release_this (); | ||
815 | yymsp[0].minor.yy0.release_this (); | ||
816 | } | ||
817 | #line 819 "bitbakeparser.c" | ||
818 | break; | ||
819 | case 33: | ||
820 | #line 141 "bitbakeparser.y" | ||
821 | { yygotominor.yy0.assignString(0); } | ||
822 | #line 824 "bitbakeparser.c" | ||
823 | break; | ||
824 | case 34: | ||
825 | #line 143 "bitbakeparser.y" | ||
826 | { e_proc( lex, yymsp[-3].minor.yy0.string(), yymsp[-1].minor.yy0.string() ); | ||
827 | yymsp[-3].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this(); yy_destructor(22,&yymsp[-2].minor); | ||
828 | yy_destructor(23,&yymsp[0].minor); | ||
829 | } | ||
830 | #line 832 "bitbakeparser.c" | ||
831 | break; | ||
832 | case 35: | ||
833 | #line 146 "bitbakeparser.y" | ||
834 | { e_proc_python ( lex, yymsp[-3].minor.yy0.string(), yymsp[-1].minor.yy0.string() ); | ||
835 | yymsp[-3].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this(); yy_destructor(24,&yymsp[-4].minor); | ||
836 | yy_destructor(22,&yymsp[-2].minor); | ||
837 | yy_destructor(23,&yymsp[0].minor); | ||
838 | } | ||
839 | #line 841 "bitbakeparser.c" | ||
840 | break; | ||
841 | case 36: | ||
842 | #line 149 "bitbakeparser.y" | ||
843 | { e_proc_python( lex, NULL, yymsp[-1].minor.yy0.string()); | ||
844 | yymsp[-1].minor.yy0.release_this (); yy_destructor(24,&yymsp[-3].minor); | ||
845 | yy_destructor(22,&yymsp[-2].minor); | ||
846 | yy_destructor(23,&yymsp[0].minor); | ||
847 | } | ||
848 | #line 850 "bitbakeparser.c" | ||
849 | break; | ||
850 | case 37: | ||
851 | #line 153 "bitbakeparser.y" | ||
852 | { e_proc_fakeroot( lex, yymsp[-3].minor.yy0.string(), yymsp[-1].minor.yy0.string() ); | ||
853 | yymsp[-3].minor.yy0.release_this (); yymsp[-1].minor.yy0.release_this (); yy_destructor(25,&yymsp[-4].minor); | ||
854 | yy_destructor(22,&yymsp[-2].minor); | ||
855 | yy_destructor(23,&yymsp[0].minor); | ||
856 | } | ||
857 | #line 859 "bitbakeparser.c" | ||
858 | break; | ||
859 | case 38: | ||
860 | #line 157 "bitbakeparser.y" | ||
861 | { /* concatenate body lines */ | ||
862 | yygotominor.yy0.assignString( token_t::concatString(yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string()) ); | ||
863 | yymsp[-1].minor.yy0.release_this (); yymsp[0].minor.yy0.release_this (); | ||
864 | } | ||
865 | #line 867 "bitbakeparser.c" | ||
866 | break; | ||
867 | case 39: | ||
868 | #line 161 "bitbakeparser.y" | ||
869 | { yygotominor.yy0.assignString( 0 ); } | ||
870 | #line 872 "bitbakeparser.c" | ||
871 | break; | ||
872 | case 40: | ||
873 | #line 163 "bitbakeparser.y" | ||
874 | { e_def( lex, yymsp[-2].minor.yy0.string(), yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string()); | ||
875 | yymsp[-2].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); } | ||
876 | #line 878 "bitbakeparser.c" | ||
877 | break; | ||
878 | }; | ||
879 | yygoto = yyRuleInfo[yyruleno].lhs; | ||
880 | yysize = yyRuleInfo[yyruleno].nrhs; | ||
881 | yypParser->yyidx -= yysize; | ||
882 | yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto); | ||
883 | if( yyact < YYNSTATE ){ | ||
884 | #ifdef NDEBUG | ||
885 | /* If we are not debugging and the reduce action popped at least | ||
886 | ** one element off the stack, then we can push the new element back | ||
887 | ** onto the stack here, and skip the stack overflow test in yy_shift(). | ||
888 | ** That gives a significant speed improvement. */ | ||
889 | if( yysize ){ | ||
890 | yypParser->yyidx++; | ||
891 | yymsp -= yysize-1; | ||
892 | yymsp->stateno = yyact; | ||
893 | yymsp->major = yygoto; | ||
894 | yymsp->minor = yygotominor; | ||
895 | }else | ||
896 | #endif | ||
897 | { | ||
898 | yy_shift(yypParser,yyact,yygoto,&yygotominor); | ||
899 | } | ||
900 | }else if( yyact == YYNSTATE + YYNRULE + 1 ){ | ||
901 | yy_accept(yypParser); | ||
902 | } | ||
903 | } | ||
904 | |||
905 | /* | ||
906 | ** The following code executes when the parse fails | ||
907 | */ | ||
908 | static void yy_parse_failed( | ||
909 | yyParser *yypParser /* The parser */ | ||
910 | ){ | ||
911 | bbparseARG_FETCH; | ||
912 | #ifndef NDEBUG | ||
913 | if( yyTraceFILE ){ | ||
914 | fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); | ||
915 | } | ||
916 | #endif | ||
917 | while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); | ||
918 | /* Here code is inserted which will be executed whenever the | ||
919 | ** parser fails */ | ||
920 | bbparseARG_STORE; /* Suppress warning about unused %extra_argument variable */ | ||
921 | } | ||
922 | |||
923 | /* | ||
924 | ** The following code executes when a syntax error first occurs. | ||
925 | */ | ||
926 | static void yy_syntax_error( | ||
927 | yyParser *yypParser, /* The parser */ | ||
928 | int yymajor, /* The major type of the error token */ | ||
929 | YYMINORTYPE yyminor /* The minor type of the error token */ | ||
930 | ){ | ||
931 | bbparseARG_FETCH; | ||
932 | #define TOKEN (yyminor.yy0) | ||
933 | #line 52 "bitbakeparser.y" | ||
934 | e_parse_error( lex ); | ||
935 | #line 938 "bitbakeparser.c" | ||
936 | bbparseARG_STORE; /* Suppress warning about unused %extra_argument variable */ | ||
937 | } | ||
938 | |||
939 | /* | ||
940 | ** The following is executed when the parser accepts | ||
941 | */ | ||
942 | static void yy_accept( | ||
943 | yyParser *yypParser /* The parser */ | ||
944 | ){ | ||
945 | bbparseARG_FETCH; | ||
946 | #ifndef NDEBUG | ||
947 | if( yyTraceFILE ){ | ||
948 | fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); | ||
949 | } | ||
950 | #endif | ||
951 | while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); | ||
952 | /* Here code is inserted which will be executed whenever the | ||
953 | ** parser accepts */ | ||
954 | bbparseARG_STORE; /* Suppress warning about unused %extra_argument variable */ | ||
955 | } | ||
956 | |||
957 | /* The main parser program. | ||
958 | ** The first argument is a pointer to a structure obtained from | ||
959 | ** "bbparseAlloc" which describes the current state of the parser. | ||
960 | ** The second argument is the major token number. The third is | ||
961 | ** the minor token. The fourth optional argument is whatever the | ||
962 | ** user wants (and specified in the grammar) and is available for | ||
963 | ** use by the action routines. | ||
964 | ** | ||
965 | ** Inputs: | ||
966 | ** <ul> | ||
967 | ** <li> A pointer to the parser (an opaque structure.) | ||
968 | ** <li> The major token number. | ||
969 | ** <li> The minor token number. | ||
970 | ** <li> An option argument of a grammar-specified type. | ||
971 | ** </ul> | ||
972 | ** | ||
973 | ** Outputs: | ||
974 | ** None. | ||
975 | */ | ||
976 | void bbparse( | ||
977 | void *yyp, /* The parser */ | ||
978 | int yymajor, /* The major token code number */ | ||
979 | bbparseTOKENTYPE yyminor /* The value for the token */ | ||
980 | bbparseARG_PDECL /* Optional %extra_argument parameter */ | ||
981 | ){ | ||
982 | YYMINORTYPE yyminorunion; | ||
983 | int yyact; /* The parser action. */ | ||
984 | int yyendofinput; /* True if we are at the end of input */ | ||
985 | int yyerrorhit = 0; /* True if yymajor has invoked an error */ | ||
986 | yyParser *yypParser; /* The parser */ | ||
987 | |||
988 | /* (re)initialize the parser, if necessary */ | ||
989 | yypParser = (yyParser*)yyp; | ||
990 | if( yypParser->yyidx<0 ){ | ||
991 | /* if( yymajor==0 ) return; // not sure why this was here... */ | ||
992 | yypParser->yyidx = 0; | ||
993 | yypParser->yyerrcnt = -1; | ||
994 | yypParser->yystack[0].stateno = 0; | ||
995 | yypParser->yystack[0].major = 0; | ||
996 | } | ||
997 | yyminorunion.yy0 = yyminor; | ||
998 | yyendofinput = (yymajor==0); | ||
999 | bbparseARG_STORE; | ||
1000 | |||
1001 | #ifndef NDEBUG | ||
1002 | if( yyTraceFILE ){ | ||
1003 | fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]); | ||
1004 | } | ||
1005 | #endif | ||
1006 | |||
1007 | do{ | ||
1008 | yyact = yy_find_shift_action(yypParser,yymajor); | ||
1009 | if( yyact<YYNSTATE ){ | ||
1010 | yy_shift(yypParser,yyact,yymajor,&yyminorunion); | ||
1011 | yypParser->yyerrcnt--; | ||
1012 | if( yyendofinput && yypParser->yyidx>=0 ){ | ||
1013 | yymajor = 0; | ||
1014 | }else{ | ||
1015 | yymajor = YYNOCODE; | ||
1016 | } | ||
1017 | }else if( yyact < YYNSTATE + YYNRULE ){ | ||
1018 | yy_reduce(yypParser,yyact-YYNSTATE); | ||
1019 | }else if( yyact == YY_ERROR_ACTION ){ | ||
1020 | int yymx; | ||
1021 | #ifndef NDEBUG | ||
1022 | if( yyTraceFILE ){ | ||
1023 | fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); | ||
1024 | } | ||
1025 | #endif | ||
1026 | #ifdef YYERRORSYMBOL | ||
1027 | /* A syntax error has occurred. | ||
1028 | ** The response to an error depends upon whether or not the | ||
1029 | ** grammar defines an error token "ERROR". | ||
1030 | ** | ||
1031 | ** This is what we do if the grammar does define ERROR: | ||
1032 | ** | ||
1033 | ** * Call the %syntax_error function. | ||
1034 | ** | ||
1035 | ** * Begin popping the stack until we enter a state where | ||
1036 | ** it is legal to shift the error symbol, then shift | ||
1037 | ** the error symbol. | ||
1038 | ** | ||
1039 | ** * Set the error count to three. | ||
1040 | ** | ||
1041 | ** * Begin accepting and shifting new tokens. No new error | ||
1042 | ** processing will occur until three tokens have been | ||
1043 | ** shifted successfully. | ||
1044 | ** | ||
1045 | */ | ||
1046 | if( yypParser->yyerrcnt<0 ){ | ||
1047 | yy_syntax_error(yypParser,yymajor,yyminorunion); | ||
1048 | } | ||
1049 | yymx = yypParser->yystack[yypParser->yyidx].major; | ||
1050 | if( yymx==YYERRORSYMBOL || yyerrorhit ){ | ||
1051 | #ifndef NDEBUG | ||
1052 | if( yyTraceFILE ){ | ||
1053 | fprintf(yyTraceFILE,"%sDiscard input token %s\n", | ||
1054 | yyTracePrompt,yyTokenName[yymajor]); | ||
1055 | } | ||
1056 | #endif | ||
1057 | yy_destructor(yymajor,&yyminorunion); | ||
1058 | yymajor = YYNOCODE; | ||
1059 | }else{ | ||
1060 | while( | ||
1061 | yypParser->yyidx >= 0 && | ||
1062 | yymx != YYERRORSYMBOL && | ||
1063 | (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE | ||
1064 | ){ | ||
1065 | yy_pop_parser_stack(yypParser); | ||
1066 | } | ||
1067 | if( yypParser->yyidx < 0 || yymajor==0 ){ | ||
1068 | yy_destructor(yymajor,&yyminorunion); | ||
1069 | yy_parse_failed(yypParser); | ||
1070 | yymajor = YYNOCODE; | ||
1071 | }else if( yymx!=YYERRORSYMBOL ){ | ||
1072 | YYMINORTYPE u2; | ||
1073 | u2.YYERRSYMDT = 0; | ||
1074 | yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2); | ||
1075 | } | ||
1076 | } | ||
1077 | yypParser->yyerrcnt = 3; | ||
1078 | yyerrorhit = 1; | ||
1079 | #else /* YYERRORSYMBOL is not defined */ | ||
1080 | /* This is what we do if the grammar does not define ERROR: | ||
1081 | ** | ||
1082 | ** * Report an error message, and throw away the input token. | ||
1083 | ** | ||
1084 | ** * If the input token is $, then fail the parse. | ||
1085 | ** | ||
1086 | ** As before, subsequent error messages are suppressed until | ||
1087 | ** three input tokens have been successfully shifted. | ||
1088 | */ | ||
1089 | if( yypParser->yyerrcnt<=0 ){ | ||
1090 | yy_syntax_error(yypParser,yymajor,yyminorunion); | ||
1091 | } | ||
1092 | yypParser->yyerrcnt = 3; | ||
1093 | yy_destructor(yymajor,&yyminorunion); | ||
1094 | if( yyendofinput ){ | ||
1095 | yy_parse_failed(yypParser); | ||
1096 | } | ||
1097 | yymajor = YYNOCODE; | ||
1098 | #endif | ||
1099 | }else{ | ||
1100 | yy_accept(yypParser); | ||
1101 | yymajor = YYNOCODE; | ||
1102 | } | ||
1103 | }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 ); | ||
1104 | return; | ||
1105 | } | ||
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakeparser.h b/bitbake/lib/bb/parse/parse_c/bitbakeparser.h new file mode 100644 index 0000000000..2e51702be8 --- /dev/null +++ b/bitbake/lib/bb/parse/parse_c/bitbakeparser.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #define T_SYMBOL 1 | ||
2 | #define T_VARIABLE 2 | ||
3 | #define T_EXPORT 3 | ||
4 | #define T_OP_ASSIGN 4 | ||
5 | #define T_STRING 5 | ||
6 | #define T_OP_IMMEDIATE 6 | ||
7 | #define T_OP_COND 7 | ||
8 | #define T_OP_PREPEND 8 | ||
9 | #define T_OP_APPEND 9 | ||
10 | #define T_TSYMBOL 10 | ||
11 | #define T_BEFORE 11 | ||
12 | #define T_AFTER 12 | ||
13 | #define T_ADDTASK 13 | ||
14 | #define T_ADDHANDLER 14 | ||
15 | #define T_FSYMBOL 15 | ||
16 | #define T_EXPORT_FUNC 16 | ||
17 | #define T_ISYMBOL 17 | ||
18 | #define T_INHERIT 18 | ||
19 | #define T_INCLUDE 19 | ||
20 | #define T_REQUIRE 20 | ||
21 | #define T_PROC_BODY 21 | ||
22 | #define T_PROC_OPEN 22 | ||
23 | #define T_PROC_CLOSE 23 | ||
24 | #define T_PYTHON 24 | ||
25 | #define T_FAKEROOT 25 | ||
26 | #define T_DEF_BODY 26 | ||
27 | #define T_DEF_ARGS 27 | ||
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakeparser.py b/bitbake/lib/bb/parse/parse_c/bitbakeparser.py deleted file mode 100644 index ed7b13eef9..0000000000 --- a/bitbake/lib/bb/parse/parse_c/bitbakeparser.py +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | """ | ||
2 | |||
3 | BitBake C Parser Python Code | ||
4 | |||
5 | Copyright (C) 2005 Holger Hans Peter Freyther | ||
6 | |||
7 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
8 | of this software and associated documentation files (the "Software"), to deal | ||
9 | in the Software without restriction, including without limitation the rights | ||
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
11 | copies of the Software, and to permit persons to whom the Software is | ||
12 | furnished to do so, subject to the following conditions: | ||
13 | |||
14 | The above copyright notice and this permission notice shall be included in all | ||
15 | copies or substantial portions of the Software. | ||
16 | |||
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT | ||
20 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
21 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
22 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR | ||
23 | THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
24 | """ | ||
25 | |||
26 | __version__ = "0xdeadbeef" | ||
27 | |||
28 | class CParser: | ||
29 | """ | ||
30 | The C-based Parser for Bitbake | ||
31 | """ | ||
32 | def __init__(self, data, type): | ||
33 | """ | ||
34 | Constructor | ||
35 | """ | ||
36 | self._data = data | ||
37 | |||
38 | def _syntax_error(self, file, line): | ||
39 | """ | ||
40 | lemon/flex reports an syntax error to us and we will | ||
41 | raise an exception | ||
42 | """ | ||
43 | pass | ||
44 | |||
45 | def _export(self, data): | ||
46 | """ | ||
47 | EXPORT VAR = "MOO" | ||
48 | we will now export VAR | ||
49 | """ | ||
50 | pass | ||
51 | |||
52 | def _assign(self, key, value): | ||
53 | """ | ||
54 | VAR = "MOO" | ||
55 | we will assign moo to VAR | ||
56 | """ | ||
57 | pass | ||
58 | |||
59 | def _assign(self, key, value): | ||
60 | """ | ||
61 | """ | ||
62 | pass | ||
63 | |||
64 | def _append(self, key, value): | ||
65 | """ | ||
66 | VAR += "MOO" | ||
67 | we will append " MOO" to var | ||
68 | """ | ||
69 | pass | ||
70 | |||
71 | def _prepend(self, key, value): | ||
72 | """ | ||
73 | VAR =+ "MOO" | ||
74 | we will prepend "MOO " to var | ||
75 | """ | ||
76 | pass | ||
77 | |||
78 | def _immediate(self, key, value): | ||
79 | """ | ||
80 | VAR := "MOO ${CVSDATE}" | ||
81 | we will assign immediately and expand vars | ||
82 | """ | ||
83 | pass | ||
84 | |||
85 | def _conditional(self, key, value): | ||
86 | """ | ||
87 | """ | ||
88 | pass | ||
89 | |||
90 | def _add_task(self, task, before = None, after = None): | ||
91 | """ | ||
92 | """ | ||
93 | pass | ||
94 | |||
95 | def _include(self, file): | ||
96 | """ | ||
97 | """ | ||
98 | pass | ||
99 | |||
100 | def _inherit(self, file): | ||
101 | """ | ||
102 | """ | ||
103 | pass | ||
104 | |||
105 | def _shell_procedure(self, name, body): | ||
106 | """ | ||
107 | """ | ||
108 | pass | ||
109 | |||
110 | def _python_procedure(self, name, body): | ||
111 | """ | ||
112 | """ | ||
113 | pass | ||
114 | |||
115 | def _fakeroot_procedure(self, name, body): | ||
116 | """ | ||
117 | """ | ||
118 | pass | ||
119 | |||
120 | def _def_procedure(self, a, b, c): | ||
121 | """ | ||
122 | """ | ||
123 | pass | ||
124 | |||
125 | def _export_func(self, name): | ||
126 | """ | ||
127 | """ | ||
128 | pass | ||
129 | |||
130 | def _add_handler(self, handler): | ||
131 | """ | ||
132 | """ | ||
133 | pass | ||
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakeparser.y b/bitbake/lib/bb/parse/parse_c/bitbakeparser.y index 4bc81a913a..252d87792f 100644 --- a/bitbake/lib/bb/parse/parse_c/bitbakeparser.y +++ b/bitbake/lib/bb/parse/parse_c/bitbakeparser.y | |||
@@ -42,13 +42,14 @@ | |||
42 | 42 | ||
43 | %include { | 43 | %include { |
44 | #include "token.h" | 44 | #include "token.h" |
45 | #include "lexer.h" | ||
46 | #include "python_output.h" | ||
45 | } | 47 | } |
46 | 48 | ||
47 | 49 | ||
48 | %token_destructor { $$.release_this (); } | 50 | %token_destructor { $$.release_this (); } |
49 | 51 | ||
50 | %syntax_error { printf ("%s:%d: syntax error\n", | 52 | %syntax_error { e_parse_error( lex ); } |
51 | lex->filename (), lex->line ()); } | ||
52 | 53 | ||
53 | program ::= statements. | 54 | program ::= statements. |
54 | 55 | ||
@@ -56,79 +57,82 @@ statements ::= statements statement. | |||
56 | statements ::= . | 57 | statements ::= . |
57 | 58 | ||
58 | variable(r) ::= SYMBOL(s). | 59 | variable(r) ::= SYMBOL(s). |
59 | { r.assignString( s.string() ); | 60 | { r.assignString( (char*)s.string() ); |
60 | s.assignString( 0 ); | 61 | s.assignString( 0 ); |
61 | s.release_this(); } | 62 | s.release_this(); } |
62 | variable(r) ::= VARIABLE(v). | 63 | variable(r) ::= VARIABLE(v). |
63 | { | 64 | { |
64 | r.assignString( v.string() ); | 65 | r.assignString( (char*)v.string() ); |
65 | v.assignString( 0 ); | 66 | v.assignString( 0 ); |
66 | v.release_this(); } | 67 | v.release_this(); } |
67 | 68 | ||
68 | statement ::= EXPORT variable(s) OP_ASSIGN STRING(v). | 69 | statement ::= EXPORT variable(s) OP_ASSIGN STRING(v). |
69 | { e_assign( s.string(), v.string() ); | 70 | { e_assign( lex, s.string(), v.string() ); |
70 | e_export( s.string() ); | 71 | e_export( lex, s.string() ); |
71 | s.release_this(); v.release_this(); } | 72 | s.release_this(); v.release_this(); } |
72 | statement ::= EXPORT variable(s) OP_IMMEDIATE STRING(v). | 73 | statement ::= EXPORT variable(s) OP_IMMEDIATE STRING(v). |
73 | { e_immediate (s.string(), v.string() ); | 74 | { e_immediate ( lex, s.string(), v.string() ); |
74 | e_export( s.string() ); | 75 | e_export( lex, s.string() ); |
75 | s.release_this(); v.release_this(); } | 76 | s.release_this(); v.release_this(); } |
76 | statement ::= EXPORT variable(s) OP_COND STRING(v). | 77 | statement ::= EXPORT variable(s) OP_COND STRING(v). |
77 | { e_cond( s.string(), v.string() ); | 78 | { e_cond( lex, s.string(), v.string() ); |
78 | s.release_this(); v.release_this(); } | 79 | s.release_this(); v.release_this(); } |
79 | 80 | ||
80 | statement ::= variable(s) OP_ASSIGN STRING(v). | 81 | statement ::= variable(s) OP_ASSIGN STRING(v). |
81 | { e_assign( s.string(), v.string() ); | 82 | { e_assign( lex, s.string(), v.string() ); |
82 | s.release_this(); v.release_this(); } | 83 | s.release_this(); v.release_this(); } |
83 | statement ::= variable(s) OP_PREPEND STRING(v). | 84 | statement ::= variable(s) OP_PREPEND STRING(v). |
84 | { e_prepend( s.string(), v.string() ); | 85 | { e_prepend( lex, s.string(), v.string() ); |
85 | s.release_this(); v.release_this(); } | 86 | s.release_this(); v.release_this(); } |
86 | statement ::= variable(s) OP_APPEND STRING(v). | 87 | statement ::= variable(s) OP_APPEND STRING(v). |
87 | { e_append( s.string() , v.string() ); | 88 | { e_append( lex, s.string() , v.string() ); |
88 | s.release_this(); v.release_this(); } | 89 | s.release_this(); v.release_this(); } |
89 | statement ::= variable(s) OP_IMMEDIATE STRING(v). | 90 | statement ::= variable(s) OP_IMMEDIATE STRING(v). |
90 | { e_immediate( s.string(), v.string() ); | 91 | { e_immediate( lex, s.string(), v.string() ); |
91 | s.release_this(); v.release_this(); } | 92 | s.release_this(); v.release_this(); } |
92 | statement ::= variable(s) OP_COND STRING(v). | 93 | statement ::= variable(s) OP_COND STRING(v). |
93 | { e_cond( s.string(), v.string() ); | 94 | { e_cond( lex, s.string(), v.string() ); |
94 | s.release_this(); v.release_this(); } | 95 | s.release_this(); v.release_this(); } |
95 | 96 | ||
96 | task ::= TSYMBOL(t) BEFORE TSYMBOL(b) AFTER TSYMBOL(a). | 97 | task ::= TSYMBOL(t) BEFORE TSYMBOL(b) AFTER TSYMBOL(a). |
97 | { e_addtask( t.string(), b.string(), a.string() ); | 98 | { e_addtask( lex, t.string(), b.string(), a.string() ); |
98 | t.release_this(); b.release_this(); a.release_this(); } | 99 | t.release_this(); b.release_this(); a.release_this(); } |
99 | task ::= TSYMBOL(t) AFTER TSYMBOL(a) BEFORE TSYMBOL(b). | 100 | task ::= TSYMBOL(t) AFTER TSYMBOL(a) BEFORE TSYMBOL(b). |
100 | { e_addtask( t.string(), b.string(), a.string()); | 101 | { e_addtask( lex, t.string(), b.string(), a.string()); |
101 | t.release_this(); a.release_this(); b.release_this(); } | 102 | t.release_this(); a.release_this(); b.release_this(); } |
102 | task ::= TSYMBOL(t). | 103 | task ::= TSYMBOL(t). |
103 | { e_addtask( t.string(), NULL, NULL); | 104 | { e_addtask( lex, t.string(), NULL, NULL); |
104 | t.release_this();} | 105 | t.release_this();} |
105 | task ::= TSYMBOL(t) BEFORE TSYMBOL(b). | 106 | task ::= TSYMBOL(t) BEFORE TSYMBOL(b). |
106 | { e_addtask( t.string(), b.string(), NULL); | 107 | { e_addtask( lex, t.string(), b.string(), NULL); |
107 | t.release_this(); b.release_this(); } | 108 | t.release_this(); b.release_this(); } |
108 | task ::= TSYMBOL(t) AFTER TSYMBOL(a). | 109 | task ::= TSYMBOL(t) AFTER TSYMBOL(a). |
109 | { e_addtask( t.string(), NULL, a.string()); | 110 | { e_addtask( lex, t.string(), NULL, a.string()); |
110 | t.release_this(); a.release_this(); } | 111 | t.release_this(); a.release_this(); } |
111 | tasks ::= tasks task. | 112 | tasks ::= tasks task. |
112 | tasks ::= task. | 113 | tasks ::= task. |
113 | statement ::= ADDTASK tasks. | 114 | statement ::= ADDTASK tasks. |
114 | 115 | ||
115 | statement ::= ADDHANDLER SYMBOL(s). | 116 | statement ::= ADDHANDLER SYMBOL(s). |
116 | { e_addhandler( s.string()); s.release_this (); } | 117 | { e_addhandler( lex, s.string()); s.release_this (); } |
117 | 118 | ||
118 | func ::= FSYMBOL(f). { e_export_func(f.string()); f.release_this(); } | 119 | func ::= FSYMBOL(f). { e_export_func( lex, f.string()); f.release_this(); } |
119 | funcs ::= funcs func. | 120 | funcs ::= funcs func. |
120 | funcs ::= func. | 121 | funcs ::= func. |
121 | statement ::= EXPORT_FUNC funcs. | 122 | statement ::= EXPORT_FUNC funcs. |
122 | 123 | ||
123 | inherit ::= ISYMBOL(i). { e_inherit(i.string() ); i.release_this (); } | 124 | inherit ::= ISYMBOL(i). { e_inherit( lex, i.string() ); i.release_this (); } |
124 | inherits ::= inherits inherit. | 125 | inherits ::= inherits inherit. |
125 | inherits ::= inherit. | 126 | inherits ::= inherit. |
126 | statement ::= INHERIT inherits. | 127 | statement ::= INHERIT inherits. |
127 | 128 | ||
128 | statement ::= INCLUDE ISYMBOL(i). | 129 | statement ::= INCLUDE ISYMBOL(i). |
129 | { e_include(i.string() ); i.release_this(); } | 130 | { e_include( lex, i.string() ); i.release_this(); } |
130 | 131 | ||
131 | proc_body(r) ::= proc_body(l) PROC_BODY(b). | 132 | statement ::= REQUIRE ISYMBOL(i). |
133 | { e_require( lex, i.string() ); i.release_this(); } | ||
134 | |||
135 | proc_body(r) ::= proc_body(l) PROC_BODY(b). | ||
132 | { /* concatenate body lines */ | 136 | { /* concatenate body lines */ |
133 | r.assignString( token_t::concatString(l.string(), b.string()) ); | 137 | r.assignString( token_t::concatString(l.string(), b.string()) ); |
134 | l.release_this (); | 138 | l.release_this (); |
@@ -136,26 +140,26 @@ proc_body(r) ::= proc_body(l) PROC_BODY(b). | |||
136 | } | 140 | } |
137 | proc_body(b) ::= . { b.assignString(0); } | 141 | proc_body(b) ::= . { b.assignString(0); } |
138 | statement ::= variable(p) PROC_OPEN proc_body(b) PROC_CLOSE. | 142 | statement ::= variable(p) PROC_OPEN proc_body(b) PROC_CLOSE. |
139 | { e_proc( p.string(), b.string() ); | 143 | { e_proc( lex, p.string(), b.string() ); |
140 | p.release_this(); b.release_this(); } | 144 | p.release_this(); b.release_this(); } |
141 | statement ::= PYTHON SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE. | 145 | statement ::= PYTHON SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE. |
142 | { e_proc_python (p.string(), b.string() ); | 146 | { e_proc_python ( lex, p.string(), b.string() ); |
143 | p.release_this(); b.release_this(); } | 147 | p.release_this(); b.release_this(); } |
144 | statement ::= PYTHON PROC_OPEN proc_body(b) PROC_CLOSE. | 148 | statement ::= PYTHON PROC_OPEN proc_body(b) PROC_CLOSE. |
145 | { e_proc_python( NULL, b.string()); | 149 | { e_proc_python( lex, NULL, b.string()); |
146 | b.release_this (); } | 150 | b.release_this (); } |
147 | 151 | ||
148 | statement ::= FAKEROOT SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE. | 152 | statement ::= FAKEROOT SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE. |
149 | { e_proc_fakeroot(p.string(), b.string() ); | 153 | { e_proc_fakeroot( lex, p.string(), b.string() ); |
150 | p.release_this (); b.release_this (); } | 154 | p.release_this (); b.release_this (); } |
151 | 155 | ||
152 | def_body(r) ::= def_body(l) DEF_BODY(b). | 156 | def_body(r) ::= def_body(l) DEF_BODY(b). |
153 | { /* concatenate body lines */ | 157 | { /* concatenate body lines */ |
154 | r.assignString( token_t::concatString(l.string(), b.string()); | 158 | r.assignString( token_t::concatString(l.string(), b.string()) ); |
155 | l.release_this (); b.release_this (); | 159 | l.release_this (); b.release_this (); |
156 | } | 160 | } |
157 | def_body(b) ::= . { b.sz = 0; } | 161 | def_body(b) ::= . { b.assignString( 0 ); } |
158 | statement ::= SYMBOL(p) DEF_ARGS(a) def_body(b). | 162 | statement ::= SYMBOL(p) DEF_ARGS(a) def_body(b). |
159 | { e_def( p.string(), a.string(), b.string()); | 163 | { e_def( lex, p.string(), a.string(), b.string()); |
160 | p.release_this(); a.release_this(); b.release_this(); } | 164 | p.release_this(); a.release_this(); b.release_this(); } |
161 | 165 | ||
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakescanner.cc b/bitbake/lib/bb/parse/parse_c/bitbakescanner.cc new file mode 100644 index 0000000000..8e95fd97c8 --- /dev/null +++ b/bitbake/lib/bb/parse/parse_c/bitbakescanner.cc | |||
@@ -0,0 +1,3126 @@ | |||
1 | |||
2 | #line 3 "<stdout>" | ||
3 | |||
4 | #define YY_INT_ALIGNED short int | ||
5 | |||
6 | /* A lexical scanner generated by flex */ | ||
7 | |||
8 | #define FLEX_SCANNER | ||
9 | #define YY_FLEX_MAJOR_VERSION 2 | ||
10 | #define YY_FLEX_MINOR_VERSION 5 | ||
11 | #define YY_FLEX_SUBMINOR_VERSION 31 | ||
12 | #if YY_FLEX_SUBMINOR_VERSION > 0 | ||
13 | #define FLEX_BETA | ||
14 | #endif | ||
15 | |||
16 | /* First, we deal with platform-specific or compiler-specific issues. */ | ||
17 | |||
18 | /* begin standard C headers. */ | ||
19 | #include <stdio.h> | ||
20 | #include <string.h> | ||
21 | #include <errno.h> | ||
22 | #include <stdlib.h> | ||
23 | |||
24 | /* end standard C headers. */ | ||
25 | |||
26 | /* flex integer type definitions */ | ||
27 | |||
28 | #ifndef FLEXINT_H | ||
29 | #define FLEXINT_H | ||
30 | |||
31 | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ | ||
32 | |||
33 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L | ||
34 | #include <inttypes.h> | ||
35 | typedef int8_t flex_int8_t; | ||
36 | typedef uint8_t flex_uint8_t; | ||
37 | typedef int16_t flex_int16_t; | ||
38 | typedef uint16_t flex_uint16_t; | ||
39 | typedef int32_t flex_int32_t; | ||
40 | typedef uint32_t flex_uint32_t; | ||
41 | #else | ||
42 | typedef signed char flex_int8_t; | ||
43 | typedef short int flex_int16_t; | ||
44 | typedef int flex_int32_t; | ||
45 | typedef unsigned char flex_uint8_t; | ||
46 | typedef unsigned short int flex_uint16_t; | ||
47 | typedef unsigned int flex_uint32_t; | ||
48 | #endif /* ! C99 */ | ||
49 | |||
50 | /* Limits of integral types. */ | ||
51 | #ifndef INT8_MIN | ||
52 | #define INT8_MIN (-128) | ||
53 | #endif | ||
54 | #ifndef INT16_MIN | ||
55 | #define INT16_MIN (-32767-1) | ||
56 | #endif | ||
57 | #ifndef INT32_MIN | ||
58 | #define INT32_MIN (-2147483647-1) | ||
59 | #endif | ||
60 | #ifndef INT8_MAX | ||
61 | #define INT8_MAX (127) | ||
62 | #endif | ||
63 | #ifndef INT16_MAX | ||
64 | #define INT16_MAX (32767) | ||
65 | #endif | ||
66 | #ifndef INT32_MAX | ||
67 | #define INT32_MAX (2147483647) | ||
68 | #endif | ||
69 | #ifndef UINT8_MAX | ||
70 | #define UINT8_MAX (255U) | ||
71 | #endif | ||
72 | #ifndef UINT16_MAX | ||
73 | #define UINT16_MAX (65535U) | ||
74 | #endif | ||
75 | #ifndef UINT32_MAX | ||
76 | #define UINT32_MAX (4294967295U) | ||
77 | #endif | ||
78 | |||
79 | #endif /* ! FLEXINT_H */ | ||
80 | |||
81 | #ifdef __cplusplus | ||
82 | |||
83 | /* The "const" storage-class-modifier is valid. */ | ||
84 | #define YY_USE_CONST | ||
85 | |||
86 | #else /* ! __cplusplus */ | ||
87 | |||
88 | #if __STDC__ | ||
89 | |||
90 | #define YY_USE_CONST | ||
91 | |||
92 | #endif /* __STDC__ */ | ||
93 | #endif /* ! __cplusplus */ | ||
94 | |||
95 | #ifdef YY_USE_CONST | ||
96 | #define yyconst const | ||
97 | #else | ||
98 | #define yyconst | ||
99 | #endif | ||
100 | |||
101 | /* Returned upon end-of-file. */ | ||
102 | #define YY_NULL 0 | ||
103 | |||
104 | /* Promotes a possibly negative, possibly signed char to an unsigned | ||
105 | * integer for use as an array index. If the signed char is negative, | ||
106 | * we want to instead treat it as an 8-bit unsigned char, hence the | ||
107 | * double cast. | ||
108 | */ | ||
109 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) | ||
110 | |||
111 | /* An opaque pointer. */ | ||
112 | #ifndef YY_TYPEDEF_YY_SCANNER_T | ||
113 | #define YY_TYPEDEF_YY_SCANNER_T | ||
114 | typedef void* yyscan_t; | ||
115 | #endif | ||
116 | |||
117 | /* For convenience, these vars (plus the bison vars far below) | ||
118 | are macros in the reentrant scanner. */ | ||
119 | #define yyin yyg->yyin_r | ||
120 | #define yyout yyg->yyout_r | ||
121 | #define yyextra yyg->yyextra_r | ||
122 | #define yyleng yyg->yyleng_r | ||
123 | #define yytext yyg->yytext_r | ||
124 | #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | ||
125 | #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) | ||
126 | #define yy_flex_debug yyg->yy_flex_debug_r | ||
127 | |||
128 | int yylex_init (yyscan_t* scanner); | ||
129 | |||
130 | /* Enter a start condition. This macro really ought to take a parameter, | ||
131 | * but we do it the disgusting crufty way forced on us by the ()-less | ||
132 | * definition of BEGIN. | ||
133 | */ | ||
134 | #define BEGIN yyg->yy_start = 1 + 2 * | ||
135 | |||
136 | /* Translate the current start state into a value that can be later handed | ||
137 | * to BEGIN to return to the state. The YYSTATE alias is for lex | ||
138 | * compatibility. | ||
139 | */ | ||
140 | #define YY_START ((yyg->yy_start - 1) / 2) | ||
141 | #define YYSTATE YY_START | ||
142 | |||
143 | /* Action number for EOF rule of a given start state. */ | ||
144 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | ||
145 | |||
146 | /* Special action meaning "start processing a new file". */ | ||
147 | #define YY_NEW_FILE yyrestart(yyin ,yyscanner ) | ||
148 | |||
149 | #define YY_END_OF_BUFFER_CHAR 0 | ||
150 | |||
151 | /* Size of default input buffer. */ | ||
152 | #ifndef YY_BUF_SIZE | ||
153 | #define YY_BUF_SIZE 16384 | ||
154 | #endif | ||
155 | |||
156 | #ifndef YY_TYPEDEF_YY_BUFFER_STATE | ||
157 | #define YY_TYPEDEF_YY_BUFFER_STATE | ||
158 | typedef struct yy_buffer_state *YY_BUFFER_STATE; | ||
159 | #endif | ||
160 | |||
161 | #define EOB_ACT_CONTINUE_SCAN 0 | ||
162 | #define EOB_ACT_END_OF_FILE 1 | ||
163 | #define EOB_ACT_LAST_MATCH 2 | ||
164 | |||
165 | /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires | ||
166 | * access to the local variable yy_act. Since yyless() is a macro, it would break | ||
167 | * existing scanners that call yyless() from OUTSIDE yylex. | ||
168 | * One obvious solution it to make yy_act a global. I tried that, and saw | ||
169 | * a 5% performance hit in a non-yylineno scanner, because yy_act is | ||
170 | * normally declared as a register variable-- so it is not worth it. | ||
171 | */ | ||
172 | #define YY_LESS_LINENO(n) \ | ||
173 | do { \ | ||
174 | int yyl;\ | ||
175 | for ( yyl = n; yyl < yyleng; ++yyl )\ | ||
176 | if ( yytext[yyl] == '\n' )\ | ||
177 | --yylineno;\ | ||
178 | }while(0) | ||
179 | |||
180 | /* Return all but the first "n" matched characters back to the input stream. */ | ||
181 | #define yyless(n) \ | ||
182 | do \ | ||
183 | { \ | ||
184 | /* Undo effects of setting up yytext. */ \ | ||
185 | int yyless_macro_arg = (n); \ | ||
186 | YY_LESS_LINENO(yyless_macro_arg);\ | ||
187 | *yy_cp = yyg->yy_hold_char; \ | ||
188 | YY_RESTORE_YY_MORE_OFFSET \ | ||
189 | yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ | ||
190 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ | ||
191 | } \ | ||
192 | while ( 0 ) | ||
193 | |||
194 | #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) | ||
195 | |||
196 | /* The following is because we cannot portably get our hands on size_t | ||
197 | * (without autoconf's help, which isn't available because we want | ||
198 | * flex-generated scanners to compile on their own). | ||
199 | */ | ||
200 | |||
201 | #ifndef YY_TYPEDEF_YY_SIZE_T | ||
202 | #define YY_TYPEDEF_YY_SIZE_T | ||
203 | typedef unsigned int yy_size_t; | ||
204 | #endif | ||
205 | |||
206 | #ifndef YY_STRUCT_YY_BUFFER_STATE | ||
207 | #define YY_STRUCT_YY_BUFFER_STATE | ||
208 | struct yy_buffer_state | ||
209 | { | ||
210 | FILE *yy_input_file; | ||
211 | |||
212 | char *yy_ch_buf; /* input buffer */ | ||
213 | char *yy_buf_pos; /* current position in input buffer */ | ||
214 | |||
215 | /* Size of input buffer in bytes, not including room for EOB | ||
216 | * characters. | ||
217 | */ | ||
218 | yy_size_t yy_buf_size; | ||
219 | |||
220 | /* Number of characters read into yy_ch_buf, not including EOB | ||
221 | * characters. | ||
222 | */ | ||
223 | int yy_n_chars; | ||
224 | |||
225 | /* Whether we "own" the buffer - i.e., we know we created it, | ||
226 | * and can realloc() it to grow it, and should free() it to | ||
227 | * delete it. | ||
228 | */ | ||
229 | int yy_is_our_buffer; | ||
230 | |||
231 | /* Whether this is an "interactive" input source; if so, and | ||
232 | * if we're using stdio for input, then we want to use getc() | ||
233 | * instead of fread(), to make sure we stop fetching input after | ||
234 | * each newline. | ||
235 | */ | ||
236 | int yy_is_interactive; | ||
237 | |||
238 | /* Whether we're considered to be at the beginning of a line. | ||
239 | * If so, '^' rules will be active on the next match, otherwise | ||
240 | * not. | ||
241 | */ | ||
242 | int yy_at_bol; | ||
243 | |||
244 | int yy_bs_lineno; /**< The line count. */ | ||
245 | int yy_bs_column; /**< The column count. */ | ||
246 | |||
247 | /* Whether to try to fill the input buffer when we reach the | ||
248 | * end of it. | ||
249 | */ | ||
250 | int yy_fill_buffer; | ||
251 | |||
252 | int yy_buffer_status; | ||
253 | |||
254 | #define YY_BUFFER_NEW 0 | ||
255 | #define YY_BUFFER_NORMAL 1 | ||
256 | /* When an EOF's been seen but there's still some text to process | ||
257 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we | ||
258 | * shouldn't try reading from the input source any more. We might | ||
259 | * still have a bunch of tokens to match, though, because of | ||
260 | * possible backing-up. | ||
261 | * | ||
262 | * When we actually see the EOF, we change the status to "new" | ||
263 | * (via yyrestart()), so that the user can continue scanning by | ||
264 | * just pointing yyin at a new input file. | ||
265 | */ | ||
266 | #define YY_BUFFER_EOF_PENDING 2 | ||
267 | |||
268 | }; | ||
269 | #endif /* !YY_STRUCT_YY_BUFFER_STATE */ | ||
270 | |||
271 | /* We provide macros for accessing buffer states in case in the | ||
272 | * future we want to put the buffer states in a more general | ||
273 | * "scanner state". | ||
274 | * | ||
275 | * Returns the top of the stack, or NULL. | ||
276 | */ | ||
277 | #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | ||
278 | ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | ||
279 | : NULL) | ||
280 | |||
281 | /* Same as previous macro, but useful when we know that the buffer stack is not | ||
282 | * NULL or when we need an lvalue. For internal use only. | ||
283 | */ | ||
284 | #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | ||
285 | |||
286 | void yyrestart (FILE *input_file ,yyscan_t yyscanner ); | ||
287 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); | ||
288 | YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); | ||
289 | void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); | ||
290 | void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); | ||
291 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); | ||
292 | void yypop_buffer_state (yyscan_t yyscanner ); | ||
293 | |||
294 | static void yyensure_buffer_stack (yyscan_t yyscanner ); | ||
295 | static void yy_load_buffer_state (yyscan_t yyscanner ); | ||
296 | static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); | ||
297 | |||
298 | #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) | ||
299 | |||
300 | YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); | ||
301 | YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); | ||
302 | YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); | ||
303 | |||
304 | void *yyalloc (yy_size_t ,yyscan_t yyscanner ); | ||
305 | void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); | ||
306 | void yyfree (void * ,yyscan_t yyscanner ); | ||
307 | |||
308 | #define yy_new_buffer yy_create_buffer | ||
309 | |||
310 | #define yy_set_interactive(is_interactive) \ | ||
311 | { \ | ||
312 | if ( ! YY_CURRENT_BUFFER ){ \ | ||
313 | yyensure_buffer_stack (yyscanner); \ | ||
314 | YY_CURRENT_BUFFER_LVALUE = \ | ||
315 | yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ | ||
316 | } \ | ||
317 | YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ | ||
318 | } | ||
319 | |||
320 | #define yy_set_bol(at_bol) \ | ||
321 | { \ | ||
322 | if ( ! YY_CURRENT_BUFFER ){\ | ||
323 | yyensure_buffer_stack (yyscanner); \ | ||
324 | YY_CURRENT_BUFFER_LVALUE = \ | ||
325 | yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ | ||
326 | } \ | ||
327 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ | ||
328 | } | ||
329 | |||
330 | #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | ||
331 | |||
332 | /* Begin user sect3 */ | ||
333 | |||
334 | #define yywrap(n) 1 | ||
335 | #define YY_SKIP_YYWRAP | ||
336 | |||
337 | typedef unsigned char YY_CHAR; | ||
338 | |||
339 | typedef int yy_state_type; | ||
340 | |||
341 | #define yytext_ptr yytext_r | ||
342 | |||
343 | static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); | ||
344 | static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); | ||
345 | static int yy_get_next_buffer (yyscan_t yyscanner ); | ||
346 | static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); | ||
347 | |||
348 | /* Done after the current pattern has been matched and before the | ||
349 | * corresponding action - sets up yytext. | ||
350 | */ | ||
351 | #define YY_DO_BEFORE_ACTION \ | ||
352 | yyg->yytext_ptr = yy_bp; \ | ||
353 | yyleng = (size_t) (yy_cp - yy_bp); \ | ||
354 | yyg->yy_hold_char = *yy_cp; \ | ||
355 | *yy_cp = '\0'; \ | ||
356 | yyg->yy_c_buf_p = yy_cp; | ||
357 | |||
358 | #define YY_NUM_RULES 45 | ||
359 | #define YY_END_OF_BUFFER 46 | ||
360 | /* This struct is not used in this scanner, | ||
361 | but its presence is necessary. */ | ||
362 | struct yy_trans_info | ||
363 | { | ||
364 | flex_int32_t yy_verify; | ||
365 | flex_int32_t yy_nxt; | ||
366 | }; | ||
367 | static yyconst flex_int16_t yy_accept[798] = | ||
368 | { 0, | ||
369 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
370 | 0, 0, 0, 0, 0, 0, 24, 24, 0, 0, | ||
371 | 0, 0, 46, 44, 43, 43, 44, 44, 44, 44, | ||
372 | 44, 4, 44, 33, 33, 33, 33, 33, 33, 33, | ||
373 | 33, 33, 26, 26, 26, 26, 26, 26, 44, 43, | ||
374 | 28, 43, 44, 44, 44, 27, 4, 44, 44, 44, | ||
375 | 44, 44, 44, 31, 31, 30, 31, 31, 31, 31, | ||
376 | 31, 4, 31, 31, 31, 31, 31, 31, 41, 36, | ||
377 | 36, 36, 36, 36, 36, 44, 38, 38, 38, 38, | ||
378 | 38, 38, 42, 37, 37, 37, 37, 37, 37, 44, | ||
379 | |||
380 | 39, 39, 39, 39, 39, 39, 24, 24, 24, 24, | ||
381 | 24, 24, 24, 4, 24, 24, 24, 24, 24, 24, | ||
382 | 23, 9, 43, 10, 9, 44, 9, 44, 9, 9, | ||
383 | 9, 4, 9, 9, 9, 9, 9, 9, 9, 40, | ||
384 | 35, 35, 35, 35, 35, 35, 35, 0, 32, 34, | ||
385 | 0, 0, 1, 3, 2, 5, 0, 33, 0, 33, | ||
386 | 33, 33, 33, 33, 33, 33, 33, 26, 26, 26, | ||
387 | 26, 26, 26, 0, 27, 0, 28, 0, 27, 0, | ||
388 | 0, 1, 2, 5, 0, 0, 0, 0, 0, 0, | ||
389 | 0, 29, 0, 0, 0, 0, 0, 36, 36, 36, | ||
390 | |||
391 | 36, 36, 36, 0, 0, 38, 38, 38, 38, 38, | ||
392 | 38, 37, 37, 37, 37, 37, 37, 0, 0, 39, | ||
393 | 39, 39, 39, 39, 39, 24, 24, 24, 24, 24, | ||
394 | 24, 1, 3, 2, 5, 24, 24, 24, 24, 24, | ||
395 | 23, 23, 9, 0, 9, 0, 10, 0, 7, 0, | ||
396 | 9, 0, 9, 0, 8, 0, 0, 9, 1, 3, | ||
397 | 2, 5, 9, 6, 9, 9, 9, 9, 35, 35, | ||
398 | 35, 35, 35, 35, 35, 35, 34, 0, 22, 0, | ||
399 | 0, 34, 33, 33, 25, 33, 33, 33, 33, 33, | ||
400 | 33, 26, 26, 25, 26, 26, 26, 0, 22, 0, | ||
401 | |||
402 | 0, 25, 0, 0, 0, 0, 0, 25, 0, 0, | ||
403 | 0, 36, 36, 25, 36, 36, 36, 0, 0, 38, | ||
404 | 38, 25, 38, 38, 38, 37, 37, 25, 37, 37, | ||
405 | 37, 0, 0, 39, 39, 25, 39, 39, 39, 24, | ||
406 | 22, 24, 24, 24, 24, 24, 24, 32, 0, 9, | ||
407 | 9, 6, 9, 9, 9, 9, 9, 35, 35, 35, | ||
408 | 35, 25, 35, 35, 35, 22, 22, 0, 33, 33, | ||
409 | 33, 33, 33, 33, 33, 33, 33, 26, 26, 26, | ||
410 | 26, 26, 26, 22, 0, 0, 0, 0, 0, 0, | ||
411 | 0, 0, 0, 0, 0, 0, 36, 36, 36, 36, | ||
412 | |||
413 | 36, 36, 0, 38, 0, 38, 38, 38, 38, 38, | ||
414 | 38, 37, 37, 37, 37, 37, 37, 0, 39, 0, | ||
415 | 39, 39, 39, 39, 39, 39, 22, 22, 24, 24, | ||
416 | 24, 24, 24, 24, 22, 9, 9, 9, 9, 9, | ||
417 | 9, 35, 35, 35, 35, 35, 35, 35, 35, 0, | ||
418 | 34, 33, 33, 33, 33, 33, 33, 33, 33, 33, | ||
419 | 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, | ||
420 | 0, 0, 0, 0, 0, 0, 0, 0, 36, 36, | ||
421 | 36, 36, 36, 36, 0, 38, 38, 38, 38, 38, | ||
422 | 38, 38, 37, 37, 37, 37, 37, 37, 0, 39, | ||
423 | |||
424 | 39, 39, 39, 39, 39, 39, 24, 24, 24, 24, | ||
425 | 24, 24, 9, 9, 9, 9, 9, 9, 35, 35, | ||
426 | 35, 18, 35, 35, 35, 35, 33, 33, 33, 19, | ||
427 | 33, 33, 33, 21, 33, 26, 26, 26, 26, 26, | ||
428 | 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
429 | 0, 0, 0, 36, 36, 36, 36, 36, 36, 38, | ||
430 | 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, | ||
431 | 37, 39, 39, 39, 39, 39, 39, 24, 24, 24, | ||
432 | 24, 24, 24, 9, 9, 9, 9, 9, 9, 35, | ||
433 | 35, 35, 17, 35, 35, 35, 33, 33, 14, 33, | ||
434 | |||
435 | 11, 13, 12, 26, 26, 14, 11, 13, 12, 0, | ||
436 | 0, 14, 11, 13, 12, 0, 0, 14, 11, 13, | ||
437 | 12, 36, 36, 14, 11, 13, 12, 38, 38, 14, | ||
438 | 11, 13, 12, 37, 37, 14, 11, 13, 12, 39, | ||
439 | 39, 14, 11, 13, 12, 24, 24, 14, 11, 13, | ||
440 | 12, 9, 9, 9, 9, 9, 9, 35, 35, 14, | ||
441 | 11, 13, 12, 33, 33, 20, 26, 26, 0, 0, | ||
442 | 0, 0, 36, 36, 38, 38, 37, 37, 39, 39, | ||
443 | 24, 24, 9, 9, 35, 35, 33, 33, 26, 26, | ||
444 | 0, 0, 0, 0, 36, 36, 38, 38, 37, 37, | ||
445 | |||
446 | 39, 39, 24, 24, 9, 9, 35, 35, 33, 15, | ||
447 | 26, 15, 0, 15, 0, 15, 36, 15, 38, 15, | ||
448 | 37, 15, 39, 15, 24, 15, 9, 9, 35, 15, | ||
449 | 33, 26, 0, 0, 36, 38, 37, 39, 24, 9, | ||
450 | 35, 33, 26, 0, 0, 36, 38, 37, 39, 24, | ||
451 | 9, 35, 33, 26, 0, 0, 36, 38, 37, 39, | ||
452 | 24, 9, 35, 33, 26, 0, 0, 36, 38, 37, | ||
453 | 39, 24, 9, 35, 33, 26, 0, 0, 36, 38, | ||
454 | 37, 39, 24, 9, 35, 16, 16, 16, 16, 16, | ||
455 | 16, 16, 16, 16, 9, 16, 0 | ||
456 | |||
457 | } ; | ||
458 | |||
459 | static yyconst flex_int32_t yy_ec[256] = | ||
460 | { 0, | ||
461 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, | ||
462 | 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, | ||
463 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
464 | 1, 2, 1, 5, 6, 7, 1, 1, 8, 9, | ||
465 | 10, 1, 11, 12, 13, 14, 15, 16, 16, 16, | ||
466 | 16, 16, 16, 16, 16, 16, 16, 17, 1, 1, | ||
467 | 18, 1, 19, 1, 20, 20, 21, 20, 22, 23, | ||
468 | 20, 20, 24, 20, 20, 20, 20, 25, 26, 27, | ||
469 | 20, 28, 29, 30, 31, 20, 20, 32, 20, 20, | ||
470 | 33, 34, 35, 1, 36, 1, 37, 38, 39, 40, | ||
471 | |||
472 | 41, 42, 20, 43, 44, 20, 45, 46, 20, 47, | ||
473 | 48, 49, 50, 51, 52, 53, 54, 20, 20, 55, | ||
474 | 56, 20, 57, 1, 58, 1, 1, 1, 1, 1, | ||
475 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
476 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
477 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
478 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
479 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
480 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
481 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
482 | |||
483 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
484 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
485 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
486 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
487 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
488 | 1, 1, 1, 1, 1 | ||
489 | } ; | ||
490 | |||
491 | static yyconst flex_int32_t yy_meta[59] = | ||
492 | { 0, | ||
493 | 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, | ||
494 | 5, 6, 5, 5, 7, 8, 1, 1, 1, 9, | ||
495 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | ||
496 | 9, 9, 10, 1, 11, 9, 9, 9, 9, 9, | ||
497 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | ||
498 | 9, 9, 9, 9, 9, 9, 1, 12 | ||
499 | } ; | ||
500 | |||
501 | static yyconst flex_int16_t yy_base[832] = | ||
502 | { 0, | ||
503 | 0, 0, 58, 0, 115, 165, 215, 265, 316, 0, | ||
504 | 374, 0, 432, 0, 490, 0, 547, 604, 661, 711, | ||
505 | 762, 0, 2156, 2157, 2157, 2157, 2152, 0, 118, 2136, | ||
506 | 2135, 2141, 2133, 115, 118, 116, 120, 124, 140, 131, | ||
507 | 129, 139, 0, 2118, 2109, 2107, 2100, 2105, 2128, 127, | ||
508 | 2157, 2127, 137, 179, 124, 2125, 128, 173, 126, 146, | ||
509 | 153, 118, 158, 2157, 190, 2157, 2157, 2139, 193, 2123, | ||
510 | 2122, 2128, 2120, 2105, 2096, 2094, 2087, 2092, 2157, 0, | ||
511 | 2100, 2091, 2089, 2082, 2087, 2070, 2119, 181, 190, 194, | ||
512 | 153, 197, 2157, 0, 2093, 2084, 2082, 2075, 2080, 2063, | ||
513 | |||
514 | 2112, 191, 199, 200, 201, 203, 2115, 2114, 2113, 2112, | ||
515 | 212, 209, 222, 217, 228, 226, 233, 208, 239, 240, | ||
516 | 248, 255, 251, 2111, 270, 251, 552, 254, 565, 575, | ||
517 | 577, 622, 627, 626, 634, 612, 669, 684, 691, 2157, | ||
518 | 0, 2081, 205, 2071, 2070, 2063, 2068, 2105, 2157, 257, | ||
519 | 289, 559, 2157, 2157, 2157, 2157, 2050, 263, 2071, 270, | ||
520 | 273, 555, 545, 556, 642, 585, 569, 0, 2078, 2064, | ||
521 | 2061, 222, 2052, 2084, 2157, 290, 2157, 291, 2097, 674, | ||
522 | 680, 2082, 2081, 2080, 283, 564, 554, 608, 262, 2093, | ||
523 | 312, 2157, 2068, 2054, 2051, 529, 2042, 0, 2064, 2050, | ||
524 | |||
525 | 2047, 611, 2038, 0, 2030, 2079, 646, 650, 652, 695, | ||
526 | 593, 0, 2058, 2044, 2041, 661, 2032, 0, 2024, 2073, | ||
527 | 680, 681, 699, 701, 702, 2076, 2075, 2074, 2073, 733, | ||
528 | 819, 2072, 2071, 2070, 2069, 720, 600, 708, 820, 821, | ||
529 | 724, 2068, 823, 824, 831, 751, 2067, 822, 830, 835, | ||
530 | 839, 843, 847, 845, 846, 858, 880, 870, 881, 889, | ||
531 | 891, 898, 903, 2067, 905, 914, 916, 926, 0, 2041, | ||
532 | 2027, 2013, 2023, 2022, 703, 2013, 902, 841, 754, 0, | ||
533 | 2027, 2157, 910, 919, 905, 913, 933, 934, 937, 940, | ||
534 | 935, 2035, 258, 0, 2014, 2018, 2004, 947, 979, 732, | ||
535 | |||
536 | 934, 2040, 912, 843, 707, 2030, 910, 2157, 2009, 2013, | ||
537 | 1999, 2026, 922, 0, 2005, 2009, 1995, 1990, 0, 861, | ||
538 | 926, 2040, 855, 947, 964, 2020, 941, 0, 1999, 2003, | ||
539 | 1989, 1984, 0, 979, 950, 2034, 978, 984, 983, 995, | ||
540 | 757, 989, 992, 2037, 996, 571, 997, 1004, 1005, 1014, | ||
541 | 1006, 2037, 1021, 1025, 1026, 1039, 1041, 2012, 1010, 1996, | ||
542 | 1988, 0, 1989, 1993, 1979, 999, 2029, 1973, 1043, 1049, | ||
543 | 1050, 1051, 1058, 1059, 1060, 1070, 1061, 2002, 1992, 1991, | ||
544 | 1973, 1975, 1981, 1087, 1053, 1061, 1062, 813, 1003, 1044, | ||
545 | 1996, 1986, 1985, 1967, 1969, 1975, 1990, 1980, 1979, 1961, | ||
546 | |||
547 | 1963, 1969, 1954, 2004, 1952, 867, 1078, 1089, 1062, 1090, | ||
548 | 1093, 1981, 1971, 1970, 1952, 1954, 1960, 1945, 1995, 1943, | ||
549 | 1094, 1099, 1101, 1100, 1105, 1103, 1117, 1997, 1111, 1114, | ||
550 | 1118, 1120, 1121, 1122, 1125, 1141, 1127, 1155, 1160, 1165, | ||
551 | 1174, 1971, 1961, 1960, 1945, 1944, 1940, 1942, 1948, 1933, | ||
552 | 1138, 1151, 1170, 1145, 1173, 1176, 1179, 1178, 1180, 1188, | ||
553 | 1960, 1942, 1936, 1947, 1942, 1934, 1114, 1173, 1136, 1183, | ||
554 | 1181, 1179, 1954, 1936, 1930, 1941, 1936, 1928, 1948, 1930, | ||
555 | 1924, 1935, 1930, 1922, 1914, 1964, 1198, 1184, 1141, 830, | ||
556 | 1194, 1195, 1940, 1922, 1916, 1927, 1922, 1914, 1906, 1956, | ||
557 | |||
558 | 1203, 1197, 1200, 1208, 1222, 1225, 1231, 1232, 1233, 1234, | ||
559 | 1237, 1238, 1248, 1249, 1257, 1265, 1267, 1282, 1932, 1914, | ||
560 | 1908, 0, 1918, 1918, 1913, 1905, 1235, 1253, 1270, 1273, | ||
561 | 1281, 1285, 1287, 1288, 1290, 1919, 1914, 1908, 1911, 1898, | ||
562 | 1909, 1228, 1285, 1283, 1281, 1290, 1291, 1913, 1908, 1902, | ||
563 | 1905, 1892, 1903, 1907, 1902, 1896, 1899, 1886, 1897, 1303, | ||
564 | 1297, 1305, 1306, 1310, 1312, 1901, 1896, 1890, 1893, 1880, | ||
565 | 1891, 1320, 1317, 1323, 1328, 1327, 1329, 1335, 1338, 1339, | ||
566 | 1341, 1342, 1345, 1347, 1356, 1357, 1371, 1392, 1396, 1895, | ||
567 | 1890, 1884, 0, 1887, 1874, 1885, 1344, 1339, 1359, 1380, | ||
568 | |||
569 | 1381, 1382, 1386, 1902, 1878, 0, 0, 0, 0, 1117, | ||
570 | 1357, 1906, 1905, 1904, 1903, 1896, 1872, 2157, 2157, 2157, | ||
571 | 2157, 1894, 1870, 0, 0, 0, 0, 1240, 1353, 1908, | ||
572 | 1907, 1906, 1905, 1888, 1864, 0, 0, 0, 0, 1399, | ||
573 | 1400, 1902, 1901, 1900, 1899, 1405, 1372, 1902, 1901, 1900, | ||
574 | 1899, 1415, 1419, 1427, 1434, 1439, 1446, 1878, 1854, 0, | ||
575 | 0, 0, 0, 1424, 1433, 1427, 1867, 1856, 1394, 1426, | ||
576 | 1863, 1849, 1858, 1845, 1445, 1409, 1851, 1840, 1451, 1449, | ||
577 | 1456, 1459, 1467, 1476, 1847, 1833, 1463, 1456, 1848, 1819, | ||
578 | 1125, 1454, 1841, 1814, 1837, 1807, 1470, 1457, 1827, 1795, | ||
579 | |||
580 | 1472, 1476, 1488, 1482, 1501, 1510, 1809, 1782, 1495, 1486, | ||
581 | 1789, 0, 1503, 1792, 1776, 2157, 1747, 0, 1504, 1756, | ||
582 | 1736, 0, 1515, 1745, 1483, 1712, 1529, 1537, 1690, 0, | ||
583 | 1516, 1675, 1513, 1610, 1609, 1522, 1608, 1525, 1491, 1546, | ||
584 | 1607, 1533, 1612, 1475, 1611, 1609, 1534, 1608, 1540, 1535, | ||
585 | 1560, 1607, 1546, 1604, 1232, 1602, 1601, 1549, 1599, 1560, | ||
586 | 1557, 1580, 1597, 1562, 1596, 1553, 1595, 1593, 1566, 1592, | ||
587 | 1567, 1574, 1588, 1591, 1574, 1581, 1226, 1575, 1572, 1582, | ||
588 | 1485, 1590, 1595, 1600, 1381, 1593, 0, 1392, 2157, 0, | ||
589 | 1347, 0, 1029, 1018, 1607, 0, 2157, 1641, 1653, 1665, | ||
590 | |||
591 | 1677, 1689, 893, 1698, 1704, 1713, 1725, 1737, 1745, 1751, | ||
592 | 1756, 1762, 1771, 1783, 1795, 1807, 1819, 1831, 1839, 1845, | ||
593 | 1848, 730, 581, 550, 1855, 289, 1863, 286, 1871, 1879, | ||
594 | 1887 | ||
595 | } ; | ||
596 | |||
597 | static yyconst flex_int16_t yy_def[832] = | ||
598 | { 0, | ||
599 | 797, 1, 797, 3, 798, 798, 799, 799, 797, 9, | ||
600 | 797, 11, 797, 13, 797, 15, 800, 800, 801, 801, | ||
601 | 797, 21, 797, 797, 797, 797, 802, 803, 797, 797, | ||
602 | 797, 797, 797, 804, 804, 804, 804, 804, 804, 804, | ||
603 | 804, 804, 805, 805, 805, 805, 805, 805, 806, 806, | ||
604 | 797, 806, 807, 806, 806, 797, 806, 806, 806, 806, | ||
605 | 806, 806, 806, 797, 808, 797, 797, 802, 797, 797, | ||
606 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 809, | ||
607 | 809, 809, 809, 809, 809, 797, 810, 810, 810, 810, | ||
608 | 810, 810, 797, 811, 811, 811, 811, 811, 811, 797, | ||
609 | |||
610 | 812, 812, 812, 812, 812, 812, 813, 813, 813, 814, | ||
611 | 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, | ||
612 | 797, 815, 797, 797, 815, 816, 817, 818, 815, 815, | ||
613 | 815, 815, 815, 815, 815, 815, 815, 815, 815, 797, | ||
614 | 819, 819, 819, 819, 819, 819, 819, 802, 797, 820, | ||
615 | 797, 797, 797, 797, 797, 797, 797, 804, 821, 804, | ||
616 | 804, 804, 804, 804, 804, 804, 804, 805, 805, 805, | ||
617 | 805, 805, 805, 806, 797, 806, 797, 807, 802, 806, | ||
618 | 806, 806, 806, 806, 806, 806, 806, 806, 806, 808, | ||
619 | 808, 797, 797, 797, 797, 797, 797, 809, 809, 809, | ||
620 | |||
621 | 809, 809, 809, 822, 797, 810, 810, 810, 810, 810, | ||
622 | 810, 811, 811, 811, 811, 811, 811, 823, 797, 812, | ||
623 | 812, 812, 812, 812, 812, 813, 797, 814, 797, 813, | ||
624 | 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, | ||
625 | 797, 797, 815, 815, 815, 797, 797, 816, 816, 816, | ||
626 | 817, 817, 817, 818, 818, 818, 815, 815, 815, 815, | ||
627 | 815, 815, 815, 797, 815, 815, 815, 815, 819, 819, | ||
628 | 819, 819, 819, 819, 819, 819, 820, 797, 797, 824, | ||
629 | 821, 797, 804, 804, 804, 804, 804, 804, 804, 804, | ||
630 | 804, 805, 805, 805, 805, 805, 805, 806, 806, 806, | ||
631 | |||
632 | 806, 806, 806, 806, 806, 797, 797, 797, 797, 797, | ||
633 | 797, 809, 809, 809, 809, 809, 809, 825, 826, 810, | ||
634 | 810, 810, 810, 810, 810, 811, 811, 811, 811, 811, | ||
635 | 811, 827, 828, 812, 812, 812, 812, 812, 812, 813, | ||
636 | 813, 813, 813, 813, 813, 813, 813, 815, 815, 815, | ||
637 | 815, 797, 815, 815, 815, 815, 815, 819, 819, 819, | ||
638 | 819, 819, 819, 819, 819, 797, 797, 829, 804, 804, | ||
639 | 804, 804, 804, 804, 804, 804, 804, 805, 805, 805, | ||
640 | 805, 805, 805, 806, 806, 806, 806, 806, 806, 806, | ||
641 | 797, 797, 797, 797, 797, 797, 809, 809, 809, 809, | ||
642 | |||
643 | 809, 809, 825, 810, 830, 810, 810, 810, 810, 810, | ||
644 | 810, 811, 811, 811, 811, 811, 811, 827, 812, 831, | ||
645 | 812, 812, 812, 812, 812, 812, 813, 797, 813, 813, | ||
646 | 813, 813, 813, 813, 815, 815, 815, 815, 815, 815, | ||
647 | 815, 819, 819, 819, 819, 819, 819, 819, 819, 829, | ||
648 | 820, 804, 804, 804, 804, 804, 804, 804, 804, 804, | ||
649 | 805, 805, 805, 805, 805, 805, 806, 806, 806, 806, | ||
650 | 806, 806, 797, 797, 797, 797, 797, 797, 809, 809, | ||
651 | 809, 809, 809, 809, 830, 810, 810, 810, 810, 810, | ||
652 | 810, 810, 811, 811, 811, 811, 811, 811, 831, 812, | ||
653 | |||
654 | 812, 812, 812, 812, 812, 812, 813, 813, 813, 813, | ||
655 | 813, 813, 815, 815, 815, 815, 815, 815, 819, 819, | ||
656 | 819, 819, 819, 819, 819, 819, 804, 804, 804, 804, | ||
657 | 804, 804, 804, 804, 804, 805, 805, 805, 805, 805, | ||
658 | 805, 806, 806, 806, 806, 806, 806, 797, 797, 797, | ||
659 | 797, 797, 797, 809, 809, 809, 809, 809, 809, 810, | ||
660 | 810, 810, 810, 810, 810, 811, 811, 811, 811, 811, | ||
661 | 811, 812, 812, 812, 812, 812, 812, 813, 813, 813, | ||
662 | 813, 813, 813, 815, 815, 815, 815, 815, 815, 819, | ||
663 | 819, 819, 819, 819, 819, 819, 804, 804, 804, 804, | ||
664 | |||
665 | 804, 804, 804, 805, 805, 805, 805, 805, 805, 806, | ||
666 | 806, 806, 806, 806, 806, 797, 797, 797, 797, 797, | ||
667 | 797, 809, 809, 809, 809, 809, 809, 810, 810, 810, | ||
668 | 810, 810, 810, 811, 811, 811, 811, 811, 811, 812, | ||
669 | 812, 812, 812, 812, 812, 813, 813, 813, 813, 813, | ||
670 | 813, 815, 815, 815, 815, 815, 815, 819, 819, 819, | ||
671 | 819, 819, 819, 804, 804, 804, 805, 805, 806, 806, | ||
672 | 797, 797, 809, 809, 810, 810, 811, 811, 812, 812, | ||
673 | 813, 813, 815, 815, 819, 819, 804, 804, 805, 805, | ||
674 | 806, 806, 797, 797, 809, 809, 810, 810, 811, 811, | ||
675 | |||
676 | 812, 812, 813, 813, 815, 815, 819, 819, 804, 804, | ||
677 | 805, 805, 806, 806, 797, 797, 809, 809, 810, 810, | ||
678 | 811, 811, 812, 812, 813, 813, 815, 815, 819, 819, | ||
679 | 804, 805, 806, 797, 809, 810, 811, 812, 813, 815, | ||
680 | 819, 804, 805, 806, 797, 809, 810, 811, 812, 813, | ||
681 | 815, 819, 804, 805, 806, 797, 809, 810, 811, 812, | ||
682 | 813, 815, 819, 804, 805, 806, 797, 809, 810, 811, | ||
683 | 812, 813, 815, 819, 804, 805, 806, 797, 809, 810, | ||
684 | 811, 812, 813, 815, 819, 804, 805, 806, 797, 809, | ||
685 | 810, 811, 812, 813, 815, 819, 0, 797, 797, 797, | ||
686 | |||
687 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
688 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
689 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
690 | 797 | ||
691 | } ; | ||
692 | |||
693 | static yyconst flex_int16_t yy_nxt[2216] = | ||
694 | { 0, | ||
695 | 24, 25, 26, 25, 24, 27, 28, 24, 29, 24, | ||
696 | 30, 24, 24, 24, 24, 24, 31, 32, 33, 34, | ||
697 | 34, 35, 34, 34, 34, 34, 34, 34, 34, 34, | ||
698 | 34, 34, 24, 24, 24, 34, 36, 34, 34, 37, | ||
699 | 38, 39, 34, 40, 34, 34, 34, 34, 41, 34, | ||
700 | 42, 34, 34, 34, 34, 34, 24, 24, 24, 25, | ||
701 | 26, 25, 24, 27, 24, 24, 29, 24, 30, 24, | ||
702 | 24, 24, 24, 24, 31, 32, 33, 43, 43, 44, | ||
703 | 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, | ||
704 | 24, 24, 24, 43, 45, 43, 43, 46, 43, 43, | ||
705 | |||
706 | 43, 47, 43, 43, 43, 43, 43, 43, 48, 43, | ||
707 | 43, 43, 43, 43, 24, 24, 50, 51, 52, 151, | ||
708 | 53, 157, 157, 54, 157, 55, 157, 152, 176, 177, | ||
709 | 157, 56, 57, 58, 175, 157, 59, 157, 183, 149, | ||
710 | 175, 182, 175, 175, 175, 157, 157, 159, 159, 160, | ||
711 | 159, 60, 159, 179, 61, 161, 159, 185, 62, 205, | ||
712 | 162, 159, 175, 159, 188, 63, 50, 51, 52, 175, | ||
713 | 53, 159, 159, 54, 175, 55, 164, 165, 163, 167, | ||
714 | 180, 56, 57, 58, 166, 186, 59, 205, 181, 175, | ||
715 | 184, 191, 192, 187, 151, 175, 205, 219, 189, 210, | ||
716 | |||
717 | 205, 60, 152, 205, 61, 219, 219, 219, 62, 219, | ||
718 | 227, 227, 207, 230, 227, 63, 65, 66, 67, 227, | ||
719 | 68, 231, 221, 69, 227, 70, 232, 234, 227, 208, | ||
720 | 227, 71, 72, 73, 209, 227, 74, 211, 222, 233, | ||
721 | 223, 227, 227, 225, 271, 235, 272, 224, 238, 241, | ||
722 | 242, 75, 246, 247, 76, 249, 244, 236, 77, 244, | ||
723 | 295, 255, 244, 157, 296, 78, 65, 66, 67, 157, | ||
724 | 68, 244, 237, 69, 244, 70, 157, 244, 175, 157, | ||
725 | 240, 71, 72, 73, 250, 239, 74, 256, 245, 159, | ||
726 | 151, 176, 177, 149, 420, 159, 283, 405, 152, 175, | ||
727 | |||
728 | 379, 75, 159, 245, 76, 159, 175, 179, 77, 300, | ||
729 | 380, 305, 284, 191, 192, 78, 24, 25, 79, 25, | ||
730 | 24, 27, 24, 24, 29, 24, 30, 24, 24, 24, | ||
731 | 24, 24, 31, 32, 33, 80, 80, 81, 80, 80, | ||
732 | 80, 80, 80, 80, 80, 80, 80, 80, 24, 24, | ||
733 | 24, 80, 82, 80, 80, 83, 80, 80, 80, 84, | ||
734 | 80, 80, 80, 80, 80, 80, 85, 80, 80, 80, | ||
735 | 80, 80, 24, 24, 24, 25, 26, 25, 24, 27, | ||
736 | 86, 24, 29, 24, 30, 24, 24, 87, 87, 24, | ||
737 | 31, 32, 33, 87, 87, 88, 87, 87, 87, 87, | ||
738 | |||
739 | 87, 87, 87, 87, 87, 87, 24, 24, 24, 87, | ||
740 | 89, 87, 87, 90, 87, 87, 87, 91, 87, 87, | ||
741 | 87, 87, 87, 87, 92, 87, 87, 87, 87, 87, | ||
742 | 24, 24, 24, 25, 93, 25, 24, 27, 24, 24, | ||
743 | 29, 24, 30, 24, 24, 24, 24, 24, 31, 32, | ||
744 | 33, 94, 94, 95, 94, 94, 94, 94, 94, 94, | ||
745 | 94, 94, 94, 94, 24, 24, 24, 94, 96, 94, | ||
746 | 94, 97, 94, 94, 94, 98, 94, 94, 94, 94, | ||
747 | 94, 94, 99, 94, 94, 94, 94, 94, 24, 24, | ||
748 | 24, 25, 26, 25, 24, 27, 100, 24, 29, 24, | ||
749 | |||
750 | 30, 24, 24, 101, 101, 24, 31, 32, 33, 101, | ||
751 | 101, 102, 101, 101, 101, 101, 101, 101, 101, 101, | ||
752 | 101, 101, 24, 24, 24, 101, 103, 101, 101, 104, | ||
753 | 101, 101, 101, 105, 101, 101, 101, 101, 101, 101, | ||
754 | 106, 101, 101, 101, 101, 101, 24, 24, 108, 109, | ||
755 | 108, 157, 110, 252, 149, 111, 252, 112, 368, 252, | ||
756 | 278, 157, 157, 113, 114, 115, 257, 309, 116, 244, | ||
757 | 175, 310, 244, 227, 258, 157, 244, 159, 244, 244, | ||
758 | 175, 244, 244, 117, 244, 253, 118, 159, 159, 332, | ||
759 | 119, 157, 259, 286, 260, 302, 285, 120, 245, 205, | ||
760 | |||
761 | 287, 159, 227, 301, 121, 108, 109, 108, 245, 110, | ||
762 | 245, 433, 111, 244, 112, 279, 244, 159, 291, 244, | ||
763 | 113, 114, 115, 244, 175, 116, 244, 244, 244, 244, | ||
764 | 244, 244, 261, 244, 244, 244, 264, 290, 244, 343, | ||
765 | 117, 244, 325, 118, 262, 245, 303, 119, 157, 315, | ||
766 | 304, 265, 205, 316, 120, 245, 205, 263, 205, 245, | ||
767 | 245, 121, 123, 124, 125, 126, 127, 245, 128, 129, | ||
768 | 244, 130, 320, 244, 159, 180, 244, 131, 132, 133, | ||
769 | 288, 298, 134, 181, 289, 244, 219, 219, 244, 321, | ||
770 | 175, 244, 244, 322, 135, 244, 175, 136, 244, 329, | ||
771 | |||
772 | 137, 205, 245, 330, 138, 219, 334, 219, 219, 266, | ||
773 | 227, 139, 123, 124, 125, 126, 127, 245, 128, 129, | ||
774 | 335, 130, 227, 175, 245, 241, 242, 131, 132, 133, | ||
775 | 267, 268, 134, 323, 230, 227, 299, 324, 318, 337, | ||
776 | 336, 363, 231, 338, 135, 364, 342, 136, 175, 344, | ||
777 | 137, 339, 246, 247, 138, 366, 367, 385, 427, 428, | ||
778 | 390, 139, 24, 25, 140, 25, 24, 27, 24, 24, | ||
779 | 29, 24, 30, 24, 24, 24, 24, 24, 31, 32, | ||
780 | 33, 141, 141, 142, 141, 141, 141, 141, 141, 141, | ||
781 | 141, 141, 141, 141, 24, 24, 24, 141, 143, 144, | ||
782 | |||
783 | 141, 145, 141, 141, 141, 146, 141, 141, 141, 141, | ||
784 | 141, 141, 147, 141, 141, 141, 141, 141, 24, 24, | ||
785 | 340, 227, 227, 227, 244, 244, 249, 244, 244, 175, | ||
786 | 244, 244, 244, 244, 249, 244, 205, 248, 244, 249, | ||
787 | 252, 149, 278, 252, 252, 149, 252, 252, 252, 348, | ||
788 | 252, 252, 255, 255, 252, 250, 245, 245, 345, 175, | ||
789 | 254, 205, 346, 250, 245, 255, 470, 205, 250, 563, | ||
790 | 347, 349, 253, 205, 244, 341, 253, 244, 256, 256, | ||
791 | 253, 257, 244, 389, 244, 244, 406, 244, 244, 258, | ||
792 | 244, 256, 244, 244, 487, 244, 244, 279, 244, 244, | ||
793 | |||
794 | 409, 150, 244, 245, 244, 244, 244, 244, 157, 244, | ||
795 | 244, 157, 244, 245, 245, 244, 157, 244, 244, 157, | ||
796 | 244, 244, 245, 244, 245, 157, 350, 244, 175, 351, | ||
797 | 244, 245, 205, 244, 159, 369, 245, 159, 245, 157, | ||
798 | 157, 157, 159, 157, 353, 159, 157, 245, 298, 245, | ||
799 | 175, 159, 392, 205, 355, 354, 219, 388, 356, 245, | ||
800 | 372, 370, 393, 175, 398, 159, 159, 159, 407, 159, | ||
801 | 205, 371, 159, 373, 399, 357, 386, 375, 408, 374, | ||
802 | 384, 367, 376, 413, 219, 219, 387, 410, 377, 219, | ||
803 | 219, 227, 422, 414, 227, 175, 340, 227, 227, 227, | ||
804 | |||
805 | 366, 367, 423, 299, 421, 244, 349, 244, 244, 244, | ||
806 | 244, 244, 244, 244, 429, 435, 367, 411, 244, 175, | ||
807 | 227, 244, 244, 424, 425, 244, 244, 244, 244, 244, | ||
808 | 244, 436, 244, 244, 430, 219, 426, 245, 245, 245, | ||
809 | 244, 432, 244, 244, 431, 244, 244, 245, 244, 157, | ||
810 | 434, 341, 443, 471, 245, 157, 157, 157, 245, 245, | ||
811 | 175, 350, 444, 437, 157, 157, 157, 157, 205, 175, | ||
812 | 452, 439, 245, 438, 245, 159, 157, 175, 175, 440, | ||
813 | 467, 159, 159, 159, 205, 453, 454, 472, 384, 367, | ||
814 | 159, 159, 159, 159, 441, 205, 205, 468, 469, 205, | ||
815 | |||
816 | 219, 455, 159, 175, 460, 219, 219, 219, 456, 219, | ||
817 | 458, 219, 457, 227, 488, 490, 227, 459, 427, 428, | ||
818 | 227, 501, 227, 227, 227, 489, 435, 367, 244, 244, | ||
819 | 175, 244, 244, 175, 244, 502, 492, 503, 507, 669, | ||
820 | 491, 175, 244, 542, 157, 244, 506, 205, 244, 713, | ||
821 | 508, 157, 175, 504, 509, 505, 244, 157, 245, 244, | ||
822 | 245, 244, 244, 514, 244, 512, 244, 244, 513, 244, | ||
823 | 159, 511, 244, 510, 245, 244, 157, 159, 244, 157, | ||
824 | 527, 244, 157, 159, 157, 157, 157, 544, 245, 175, | ||
825 | 205, 515, 562, 245, 157, 175, 529, 175, 245, 175, | ||
826 | |||
827 | 205, 205, 159, 219, 205, 159, 219, 245, 159, 219, | ||
828 | 159, 159, 159, 516, 219, 517, 528, 518, 532, 543, | ||
829 | 159, 533, 545, 531, 546, 530, 534, 560, 219, 547, | ||
830 | 561, 219, 572, 227, 227, 227, 227, 564, 535, 227, | ||
831 | 227, 157, 175, 573, 175, 565, 205, 575, 175, 244, | ||
832 | 244, 574, 244, 244, 788, 244, 244, 766, 244, 157, | ||
833 | 578, 244, 675, 610, 244, 576, 244, 159, 244, 244, | ||
834 | 597, 244, 244, 581, 244, 577, 157, 584, 579, 157, | ||
835 | 582, 245, 245, 244, 580, 159, 244, 157, 583, 244, | ||
836 | 245, 157, 598, 157, 157, 585, 157, 175, 245, 175, | ||
837 | |||
838 | 245, 175, 159, 205, 587, 159, 175, 175, 586, 205, | ||
839 | 588, 205, 205, 159, 599, 245, 205, 159, 205, 159, | ||
840 | 159, 613, 159, 219, 611, 601, 219, 612, 600, 219, | ||
841 | 603, 615, 589, 219, 219, 219, 629, 227, 628, 602, | ||
842 | 227, 227, 614, 227, 227, 157, 631, 227, 244, 630, | ||
843 | 157, 244, 633, 205, 244, 640, 641, 244, 244, 205, | ||
844 | 244, 244, 632, 244, 244, 157, 664, 642, 643, 645, | ||
845 | 646, 159, 244, 175, 227, 244, 159, 647, 244, 644, | ||
846 | 245, 649, 652, 648, 665, 651, 157, 157, 157, 245, | ||
847 | 245, 159, 157, 244, 650, 653, 244, 244, 676, 244, | ||
848 | |||
849 | 244, 654, 670, 244, 245, 219, 219, 227, 175, 796, | ||
850 | 175, 655, 159, 159, 159, 205, 244, 682, 159, 244, | ||
851 | 244, 679, 244, 244, 691, 245, 244, 681, 244, 245, | ||
852 | 157, 244, 666, 157, 244, 244, 657, 683, 244, 157, | ||
853 | 244, 244, 175, 244, 656, 680, 244, 244, 245, 698, | ||
854 | 244, 205, 245, 244, 687, 219, 159, 219, 227, 159, | ||
855 | 245, 227, 157, 205, 684, 159, 692, 245, 244, 157, | ||
856 | 175, 244, 245, 688, 244, 697, 205, 244, 219, 245, | ||
857 | 244, 701, 219, 244, 227, 227, 703, 709, 159, 702, | ||
858 | 227, 175, 157, 227, 719, 159, 723, 705, 755, 704, | ||
859 | |||
860 | 245, 157, 244, 739, 714, 244, 710, 720, 244, 245, | ||
861 | 205, 244, 725, 792, 244, 731, 706, 244, 159, 175, | ||
862 | 750, 219, 157, 733, 736, 727, 724, 159, 205, 175, | ||
863 | 244, 219, 726, 244, 245, 738, 244, 227, 244, 157, | ||
864 | 205, 244, 744, 245, 244, 742, 219, 244, 159, 740, | ||
865 | 244, 747, 157, 244, 749, 205, 753, 758, 761, 227, | ||
866 | 728, 244, 245, 760, 244, 159, 219, 244, 157, 175, | ||
867 | 245, 764, 205, 219, 769, 751, 227, 777, 159, 245, | ||
868 | 157, 244, 772, 762, 244, 771, 775, 244, 205, 244, | ||
869 | 780, 782, 244, 245, 159, 244, 219, 227, 783, 157, | ||
870 | |||
871 | 790, 244, 786, 789, 244, 773, 159, 244, 244, 787, | ||
872 | 791, 244, 784, 245, 244, 785, 781, 779, 793, 778, | ||
873 | 776, 245, 774, 794, 770, 159, 768, 767, 795, 765, | ||
874 | 763, 759, 757, 245, 756, 754, 752, 748, 746, 745, | ||
875 | 245, 49, 49, 49, 49, 49, 49, 49, 49, 49, | ||
876 | 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, | ||
877 | 64, 64, 64, 64, 64, 107, 107, 107, 107, 107, | ||
878 | 107, 107, 107, 107, 107, 107, 107, 122, 122, 122, | ||
879 | 122, 122, 122, 122, 122, 122, 122, 122, 122, 148, | ||
880 | 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, | ||
881 | |||
882 | 148, 158, 158, 158, 743, 158, 158, 158, 168, 168, | ||
883 | 741, 168, 168, 174, 227, 174, 174, 174, 174, 174, | ||
884 | 174, 174, 174, 174, 174, 178, 178, 178, 178, 178, | ||
885 | 178, 178, 178, 178, 178, 178, 178, 190, 190, 190, | ||
886 | 190, 190, 190, 190, 190, 190, 190, 190, 190, 198, | ||
887 | 198, 219, 198, 198, 206, 206, 737, 206, 206, 206, | ||
888 | 212, 212, 205, 212, 212, 220, 220, 735, 220, 220, | ||
889 | 220, 226, 226, 226, 226, 226, 226, 226, 226, 226, | ||
890 | 226, 226, 226, 228, 228, 228, 228, 228, 228, 228, | ||
891 | 228, 228, 228, 228, 228, 243, 734, 243, 243, 243, | ||
892 | |||
893 | 243, 243, 243, 243, 243, 243, 243, 248, 175, 732, | ||
894 | 248, 248, 248, 248, 248, 248, 248, 248, 248, 251, | ||
895 | 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, | ||
896 | 251, 254, 730, 729, 254, 254, 254, 254, 254, 254, | ||
897 | 254, 254, 254, 269, 269, 722, 269, 269, 277, 277, | ||
898 | 277, 721, 277, 277, 277, 281, 281, 718, 281, 403, | ||
899 | 403, 717, 403, 403, 716, 715, 403, 418, 418, 712, | ||
900 | 418, 418, 711, 708, 418, 450, 450, 707, 450, 450, | ||
901 | 700, 699, 450, 485, 485, 696, 485, 485, 695, 694, | ||
902 | 485, 499, 499, 693, 499, 499, 690, 689, 499, 686, | ||
903 | |||
904 | 685, 227, 227, 227, 227, 219, 219, 219, 219, 678, | ||
905 | 677, 205, 205, 205, 205, 674, 673, 672, 671, 175, | ||
906 | 175, 175, 175, 668, 667, 663, 662, 661, 660, 659, | ||
907 | 658, 639, 638, 637, 636, 635, 634, 627, 626, 625, | ||
908 | 624, 623, 622, 621, 620, 619, 618, 617, 616, 609, | ||
909 | 608, 607, 606, 605, 604, 596, 595, 594, 593, 592, | ||
910 | 591, 590, 219, 500, 571, 570, 569, 568, 567, 566, | ||
911 | 205, 486, 559, 558, 557, 556, 555, 554, 553, 552, | ||
912 | 551, 550, 549, 548, 541, 540, 539, 538, 537, 536, | ||
913 | 451, 526, 525, 524, 523, 522, 521, 520, 519, 428, | ||
914 | |||
915 | 500, 219, 419, 498, 497, 496, 495, 494, 493, 486, | ||
916 | 205, 404, 484, 483, 482, 481, 480, 479, 478, 477, | ||
917 | 476, 475, 474, 473, 466, 465, 464, 463, 462, 461, | ||
918 | 451, 367, 449, 448, 447, 446, 445, 442, 352, 227, | ||
919 | 219, 419, 417, 416, 415, 412, 205, 404, 402, 401, | ||
920 | 400, 397, 396, 395, 394, 391, 175, 383, 382, 381, | ||
921 | 378, 282, 365, 362, 361, 360, 359, 358, 352, 247, | ||
922 | 242, 227, 227, 227, 227, 227, 229, 227, 227, 219, | ||
923 | 333, 331, 328, 327, 326, 205, 319, 317, 314, 313, | ||
924 | 312, 311, 308, 307, 306, 192, 175, 175, 175, 149, | ||
925 | |||
926 | 175, 297, 294, 293, 292, 282, 280, 149, 276, 275, | ||
927 | 274, 273, 270, 247, 229, 227, 227, 227, 219, 218, | ||
928 | 217, 216, 215, 214, 213, 205, 204, 203, 202, 201, | ||
929 | 200, 199, 197, 196, 195, 194, 193, 156, 155, 154, | ||
930 | 153, 149, 154, 175, 175, 173, 172, 171, 170, 169, | ||
931 | 156, 155, 154, 153, 149, 797, 23, 797, 797, 797, | ||
932 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
933 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
934 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
935 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
936 | |||
937 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
938 | 797, 797, 797, 797, 797 | ||
939 | } ; | ||
940 | |||
941 | static yyconst flex_int16_t yy_chk[2216] = | ||
942 | { 0, | ||
943 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
944 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
945 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
946 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
947 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
948 | 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, | ||
949 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | ||
950 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | ||
951 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | ||
952 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | ||
953 | |||
954 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | ||
955 | 3, 3, 3, 3, 3, 3, 5, 5, 5, 29, | ||
956 | 5, 34, 36, 5, 35, 5, 37, 29, 50, 50, | ||
957 | 38, 5, 5, 5, 62, 41, 5, 40, 57, 53, | ||
958 | 55, 55, 59, 50, 57, 42, 39, 34, 36, 35, | ||
959 | 35, 5, 37, 53, 5, 36, 38, 59, 5, 91, | ||
960 | 37, 41, 60, 40, 62, 5, 6, 6, 6, 61, | ||
961 | 6, 42, 39, 6, 63, 6, 39, 40, 38, 42, | ||
962 | 54, 6, 6, 6, 41, 60, 6, 88, 54, 58, | ||
963 | 58, 65, 65, 61, 69, 54, 89, 102, 63, 91, | ||
964 | |||
965 | 90, 6, 69, 92, 6, 103, 104, 105, 6, 106, | ||
966 | 118, 112, 88, 111, 111, 6, 7, 7, 7, 114, | ||
967 | 7, 111, 102, 7, 113, 7, 112, 114, 116, 89, | ||
968 | 115, 7, 7, 7, 90, 117, 7, 92, 103, 113, | ||
969 | 104, 119, 120, 106, 143, 115, 143, 105, 118, 121, | ||
970 | 121, 7, 123, 123, 7, 126, 122, 116, 7, 122, | ||
971 | 172, 128, 122, 150, 172, 7, 8, 8, 8, 158, | ||
972 | 8, 125, 117, 8, 125, 8, 160, 125, 189, 161, | ||
973 | 120, 8, 8, 8, 126, 119, 8, 128, 122, 150, | ||
974 | 151, 176, 176, 178, 828, 158, 160, 826, 151, 185, | ||
975 | |||
976 | 293, 8, 160, 125, 8, 161, 176, 178, 8, 185, | ||
977 | 293, 189, 161, 191, 191, 8, 9, 9, 9, 9, | ||
978 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | ||
979 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | ||
980 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | ||
981 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | ||
982 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | ||
983 | 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, | ||
984 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, | ||
985 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, | ||
986 | |||
987 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, | ||
988 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, | ||
989 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, | ||
990 | 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, | ||
991 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | ||
992 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | ||
993 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | ||
994 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | ||
995 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | ||
996 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, | ||
997 | |||
998 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, | ||
999 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, | ||
1000 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, | ||
1001 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, | ||
1002 | 15, 15, 15, 15, 15, 15, 15, 15, 17, 17, | ||
1003 | 17, 163, 17, 127, 127, 17, 127, 17, 824, 127, | ||
1004 | 152, 162, 164, 17, 17, 17, 129, 196, 17, 129, | ||
1005 | 187, 196, 129, 346, 129, 167, 130, 163, 131, 130, | ||
1006 | 186, 131, 130, 17, 131, 127, 17, 162, 164, 823, | ||
1007 | 17, 166, 130, 163, 131, 187, 162, 17, 129, 211, | ||
1008 | |||
1009 | 164, 167, 237, 186, 17, 18, 18, 18, 130, 18, | ||
1010 | 131, 346, 18, 136, 18, 152, 136, 166, 167, 136, | ||
1011 | 18, 18, 18, 132, 188, 18, 132, 134, 133, 132, | ||
1012 | 134, 133, 132, 134, 133, 135, 135, 166, 135, 237, | ||
1013 | 18, 135, 211, 18, 133, 136, 188, 18, 165, 202, | ||
1014 | 188, 136, 207, 202, 18, 132, 208, 134, 209, 134, | ||
1015 | 133, 18, 19, 19, 19, 19, 19, 135, 19, 19, | ||
1016 | 137, 19, 207, 137, 165, 180, 137, 19, 19, 19, | ||
1017 | 165, 181, 19, 180, 165, 138, 221, 222, 138, 208, | ||
1018 | 180, 138, 139, 209, 19, 139, 181, 19, 139, 216, | ||
1019 | |||
1020 | 19, 210, 137, 216, 19, 223, 221, 224, 225, 137, | ||
1021 | 238, 19, 20, 20, 20, 20, 20, 138, 20, 20, | ||
1022 | 222, 20, 236, 305, 139, 241, 241, 20, 20, 20, | ||
1023 | 138, 139, 20, 210, 230, 230, 181, 210, 822, 224, | ||
1024 | 223, 275, 230, 224, 20, 275, 236, 20, 300, 238, | ||
1025 | 20, 225, 246, 246, 20, 279, 279, 300, 341, 341, | ||
1026 | 305, 20, 21, 21, 21, 21, 21, 21, 21, 21, | ||
1027 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | ||
1028 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | ||
1029 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | ||
1030 | |||
1031 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | ||
1032 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | ||
1033 | 231, 231, 239, 240, 243, 244, 248, 243, 244, 388, | ||
1034 | 243, 244, 245, 245, 249, 245, 490, 250, 245, 250, | ||
1035 | 251, 251, 278, 251, 252, 252, 251, 252, 253, 253, | ||
1036 | 252, 253, 254, 255, 253, 248, 243, 244, 239, 304, | ||
1037 | 256, 323, 239, 249, 245, 256, 388, 320, 250, 490, | ||
1038 | 240, 258, 251, 406, 258, 231, 252, 258, 254, 255, | ||
1039 | 253, 257, 259, 304, 257, 259, 320, 257, 259, 257, | ||
1040 | 260, 256, 261, 260, 406, 261, 260, 278, 261, 262, | ||
1041 | |||
1042 | 323, 803, 262, 258, 263, 262, 265, 263, 277, 265, | ||
1043 | 263, 285, 265, 257, 259, 266, 283, 267, 266, 286, | ||
1044 | 267, 266, 260, 267, 261, 284, 258, 268, 303, 263, | ||
1045 | 268, 262, 321, 268, 277, 283, 263, 285, 265, 287, | ||
1046 | 288, 291, 283, 289, 265, 286, 290, 266, 298, 267, | ||
1047 | 301, 284, 307, 324, 267, 266, 335, 303, 267, 268, | ||
1048 | 286, 284, 307, 298, 313, 287, 288, 291, 321, 289, | ||
1049 | 325, 284, 290, 287, 313, 268, 301, 289, 321, 288, | ||
1050 | 299, 299, 290, 327, 337, 334, 301, 324, 291, 339, | ||
1051 | 338, 342, 335, 327, 343, 299, 340, 340, 345, 347, | ||
1052 | |||
1053 | 366, 366, 335, 298, 334, 348, 349, 351, 348, 349, | ||
1054 | 351, 348, 349, 351, 342, 350, 350, 325, 350, 389, | ||
1055 | 794, 350, 353, 337, 338, 353, 354, 355, 353, 354, | ||
1056 | 355, 351, 354, 355, 343, 793, 339, 348, 349, 351, | ||
1057 | 356, 345, 357, 356, 343, 357, 356, 350, 357, 369, | ||
1058 | 347, 340, 359, 389, 353, 370, 371, 372, 354, 355, | ||
1059 | 390, 349, 359, 353, 373, 374, 375, 377, 409, 385, | ||
1060 | 369, 355, 356, 353, 357, 369, 376, 386, 387, 356, | ||
1061 | 385, 370, 371, 372, 407, 370, 371, 390, 384, 384, | ||
1062 | 373, 374, 375, 377, 357, 408, 410, 386, 387, 411, | ||
1063 | |||
1064 | 421, 372, 376, 384, 377, 422, 424, 423, 373, 426, | ||
1065 | 375, 425, 374, 429, 407, 409, 430, 376, 427, 427, | ||
1066 | 431, 421, 432, 433, 434, 408, 435, 435, 437, 435, | ||
1067 | 467, 437, 435, 610, 437, 422, 411, 423, 429, 610, | ||
1068 | 410, 691, 436, 467, 451, 436, 426, 489, 436, 691, | ||
1069 | 430, 454, 469, 424, 431, 425, 438, 452, 435, 438, | ||
1070 | 437, 439, 438, 437, 439, 434, 440, 439, 436, 440, | ||
1071 | 451, 433, 440, 432, 436, 441, 453, 454, 441, 455, | ||
1072 | 452, 441, 456, 452, 458, 457, 459, 469, 438, 468, | ||
1073 | 488, 438, 489, 439, 460, 472, 454, 471, 440, 470, | ||
1074 | |||
1075 | 491, 492, 453, 502, 487, 455, 503, 441, 456, 501, | ||
1076 | 458, 457, 459, 439, 504, 440, 453, 441, 457, 468, | ||
1077 | 460, 458, 470, 456, 471, 455, 459, 487, 505, 472, | ||
1078 | 488, 506, 501, 507, 508, 509, 510, 491, 460, 511, | ||
1079 | 512, 527, 777, 502, 542, 492, 628, 504, 755, 513, | ||
1080 | 514, 503, 513, 514, 777, 513, 514, 755, 515, 528, | ||
1081 | 507, 515, 628, 542, 515, 505, 516, 527, 517, 516, | ||
1082 | 527, 517, 516, 510, 517, 506, 529, 513, 508, 530, | ||
1083 | 511, 513, 514, 518, 509, 528, 518, 531, 512, 518, | ||
1084 | 515, 532, 528, 533, 534, 514, 535, 545, 516, 544, | ||
1085 | |||
1086 | 517, 543, 529, 561, 516, 530, 546, 547, 515, 560, | ||
1087 | 517, 562, 563, 531, 529, 518, 564, 532, 565, 533, | ||
1088 | 534, 545, 535, 573, 543, 532, 572, 544, 531, 574, | ||
1089 | 535, 547, 518, 576, 575, 577, 561, 578, 560, 533, | ||
1090 | 579, 580, 546, 581, 582, 598, 563, 583, 584, 562, | ||
1091 | 597, 584, 565, 791, 584, 572, 573, 585, 586, 629, | ||
1092 | 585, 586, 564, 585, 586, 599, 597, 574, 575, 577, | ||
1093 | 578, 598, 587, 611, 647, 587, 597, 579, 587, 576, | ||
1094 | 584, 581, 584, 580, 598, 583, 600, 601, 602, 585, | ||
1095 | 586, 599, 603, 588, 582, 585, 588, 589, 629, 588, | ||
1096 | |||
1097 | 589, 586, 611, 589, 587, 640, 641, 646, 788, 785, | ||
1098 | 669, 587, 600, 601, 602, 676, 652, 647, 603, 652, | ||
1099 | 653, 640, 652, 653, 669, 588, 653, 646, 654, 589, | ||
1100 | 664, 654, 600, 666, 654, 655, 589, 652, 655, 665, | ||
1101 | 656, 655, 670, 656, 588, 641, 656, 657, 652, 676, | ||
1102 | 657, 675, 653, 657, 664, 680, 664, 679, 681, 666, | ||
1103 | 654, 682, 688, 698, 653, 665, 670, 655, 683, 687, | ||
1104 | 692, 683, 656, 665, 683, 675, 697, 684, 701, 657, | ||
1105 | 684, 679, 702, 684, 704, 725, 681, 687, 688, 680, | ||
1106 | 703, 744, 710, 739, 697, 687, 701, 683, 744, 682, | ||
1107 | |||
1108 | 683, 709, 705, 725, 692, 705, 688, 698, 705, 684, | ||
1109 | 719, 706, 703, 781, 706, 709, 684, 706, 710, 713, | ||
1110 | 739, 723, 731, 713, 719, 705, 702, 709, 736, 733, | ||
1111 | 727, 738, 704, 727, 705, 723, 727, 750, 728, 742, | ||
1112 | 747, 728, 733, 706, 728, 731, 749, 740, 731, 727, | ||
1113 | 740, 736, 753, 740, 738, 758, 742, 747, 750, 761, | ||
1114 | 706, 751, 727, 749, 751, 742, 760, 751, 764, 766, | ||
1115 | 728, 753, 769, 771, 758, 740, 772, 766, 753, 740, | ||
1116 | 775, 762, 761, 751, 762, 760, 764, 762, 780, 773, | ||
1117 | 769, 771, 773, 751, 764, 773, 782, 783, 772, 786, | ||
1118 | |||
1119 | 779, 784, 775, 778, 784, 762, 775, 784, 795, 776, | ||
1120 | 780, 795, 773, 762, 795, 774, 770, 768, 782, 767, | ||
1121 | 765, 773, 763, 783, 759, 786, 757, 756, 784, 754, | ||
1122 | 752, 748, 746, 784, 745, 743, 741, 737, 735, 734, | ||
1123 | 795, 798, 798, 798, 798, 798, 798, 798, 798, 798, | ||
1124 | 798, 798, 798, 799, 799, 799, 799, 799, 799, 799, | ||
1125 | 799, 799, 799, 799, 799, 800, 800, 800, 800, 800, | ||
1126 | 800, 800, 800, 800, 800, 800, 800, 801, 801, 801, | ||
1127 | 801, 801, 801, 801, 801, 801, 801, 801, 801, 802, | ||
1128 | 802, 802, 802, 802, 802, 802, 802, 802, 802, 802, | ||
1129 | |||
1130 | 802, 804, 804, 804, 732, 804, 804, 804, 805, 805, | ||
1131 | 729, 805, 805, 806, 726, 806, 806, 806, 806, 806, | ||
1132 | 806, 806, 806, 806, 806, 807, 807, 807, 807, 807, | ||
1133 | 807, 807, 807, 807, 807, 807, 807, 808, 808, 808, | ||
1134 | 808, 808, 808, 808, 808, 808, 808, 808, 808, 809, | ||
1135 | 809, 724, 809, 809, 810, 810, 721, 810, 810, 810, | ||
1136 | 811, 811, 720, 811, 811, 812, 812, 717, 812, 812, | ||
1137 | 812, 813, 813, 813, 813, 813, 813, 813, 813, 813, | ||
1138 | 813, 813, 813, 814, 814, 814, 814, 814, 814, 814, | ||
1139 | 814, 814, 814, 814, 814, 815, 715, 815, 815, 815, | ||
1140 | |||
1141 | 815, 815, 815, 815, 815, 815, 815, 816, 714, 711, | ||
1142 | 816, 816, 816, 816, 816, 816, 816, 816, 816, 817, | ||
1143 | 817, 817, 817, 817, 817, 817, 817, 817, 817, 817, | ||
1144 | 817, 818, 708, 707, 818, 818, 818, 818, 818, 818, | ||
1145 | 818, 818, 818, 819, 819, 700, 819, 819, 820, 820, | ||
1146 | 820, 699, 820, 820, 820, 821, 821, 696, 821, 825, | ||
1147 | 825, 695, 825, 825, 694, 693, 825, 827, 827, 690, | ||
1148 | 827, 827, 689, 686, 827, 829, 829, 685, 829, 829, | ||
1149 | 678, 677, 829, 830, 830, 674, 830, 830, 673, 672, | ||
1150 | 830, 831, 831, 671, 831, 831, 668, 667, 831, 659, | ||
1151 | |||
1152 | 658, 651, 650, 649, 648, 645, 644, 643, 642, 635, | ||
1153 | 634, 633, 632, 631, 630, 623, 622, 617, 616, 615, | ||
1154 | 614, 613, 612, 605, 604, 596, 595, 594, 592, 591, | ||
1155 | 590, 571, 570, 569, 568, 567, 566, 559, 558, 557, | ||
1156 | 556, 555, 554, 553, 552, 551, 550, 549, 548, 541, | ||
1157 | 540, 539, 538, 537, 536, 526, 525, 524, 523, 521, | ||
1158 | 520, 519, 500, 499, 498, 497, 496, 495, 494, 493, | ||
1159 | 486, 485, 484, 483, 482, 481, 480, 479, 478, 477, | ||
1160 | 476, 475, 474, 473, 466, 465, 464, 463, 462, 461, | ||
1161 | 450, 449, 448, 447, 446, 445, 444, 443, 442, 428, | ||
1162 | |||
1163 | 420, 419, 418, 417, 416, 415, 414, 413, 412, 405, | ||
1164 | 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, | ||
1165 | 394, 393, 392, 391, 383, 382, 381, 380, 379, 378, | ||
1166 | 368, 367, 365, 364, 363, 361, 360, 358, 352, 344, | ||
1167 | 336, 332, 331, 330, 329, 326, 322, 318, 317, 316, | ||
1168 | 315, 312, 311, 310, 309, 306, 302, 297, 296, 295, | ||
1169 | 292, 281, 276, 274, 273, 272, 271, 270, 264, 247, | ||
1170 | 242, 235, 234, 233, 232, 229, 228, 227, 226, 220, | ||
1171 | 219, 217, 215, 214, 213, 206, 205, 203, 201, 200, | ||
1172 | 199, 197, 195, 194, 193, 190, 184, 183, 182, 179, | ||
1173 | |||
1174 | 174, 173, 171, 170, 169, 159, 157, 148, 147, 146, | ||
1175 | 145, 144, 142, 124, 110, 109, 108, 107, 101, 100, | ||
1176 | 99, 98, 97, 96, 95, 87, 86, 85, 84, 83, | ||
1177 | 82, 81, 78, 77, 76, 75, 74, 73, 72, 71, | ||
1178 | 70, 68, 56, 52, 49, 48, 47, 46, 45, 44, | ||
1179 | 33, 32, 31, 30, 27, 23, 797, 797, 797, 797, | ||
1180 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
1181 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
1182 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
1183 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
1184 | |||
1185 | 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, | ||
1186 | 797, 797, 797, 797, 797 | ||
1187 | } ; | ||
1188 | |||
1189 | /* Table of booleans, true if rule could match eol. */ | ||
1190 | static yyconst flex_int32_t yy_rule_can_match_eol[46] = | ||
1191 | { 0, | ||
1192 | 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
1193 | 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, | ||
1194 | 1, 1, 1, 1, 0, 0, }; | ||
1195 | |||
1196 | /* The intent behind this definition is that it'll catch | ||
1197 | * any uses of REJECT which flex missed. | ||
1198 | */ | ||
1199 | #define REJECT reject_used_but_not_detected | ||
1200 | #define yymore() yymore_used_but_not_detected | ||
1201 | #define YY_MORE_ADJ 0 | ||
1202 | #define YY_RESTORE_YY_MORE_OFFSET | ||
1203 | #line 1 "bitbakescanner.l" | ||
1204 | /* bbf.flex | ||
1205 | |||
1206 | written by Marc Singer | ||
1207 | 6 January 2005 | ||
1208 | |||
1209 | This program is free software; you can redistribute it and/or | ||
1210 | modify it under the terms of the GNU General Public License as | ||
1211 | published by the Free Software Foundation; either version 2 of the | ||
1212 | License, or (at your option) any later version. | ||
1213 | |||
1214 | This program is distributed in the hope that it will be useful, but | ||
1215 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1216 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1217 | General Public License for more details. | ||
1218 | |||
1219 | You should have received a copy of the GNU General Public License | ||
1220 | along with this program; if not, write to the Free Software | ||
1221 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
1222 | USA. | ||
1223 | |||
1224 | DESCRIPTION | ||
1225 | ----------- | ||
1226 | |||
1227 | flex lexer specification for a BitBake input file parser. | ||
1228 | |||
1229 | Unfortunately, flex doesn't welcome comments within the rule sets. | ||
1230 | I say unfortunately because this lexer is unreasonably complex and | ||
1231 | comments would make the code much easier to comprehend. | ||
1232 | |||
1233 | The BitBake grammar is not regular. In order to interpret all | ||
1234 | of the available input files, the lexer maintains much state as it | ||
1235 | parses. There are places where this lexer will emit tokens that | ||
1236 | are invalid. The parser will tend to catch these. | ||
1237 | |||
1238 | The lexer requires C++ at the moment. The only reason for this has | ||
1239 | to do with a very small amount of managed state. Producing a C | ||
1240 | lexer should be a reasonably easy task as long as the %reentrant | ||
1241 | option is used. | ||
1242 | |||
1243 | |||
1244 | NOTES | ||
1245 | ----- | ||
1246 | |||
1247 | o RVALUES. There are three kinds of RVALUES. There are unquoted | ||
1248 | values, double quote enclosed strings, and single quote | ||
1249 | strings. Quoted strings may contain unescaped quotes (of either | ||
1250 | type), *and* any type may span more than one line by using a | ||
1251 | continuation '\' at the end of the line. This requires us to | ||
1252 | recognize all types of values with a single expression. | ||
1253 | Moreover, the only reason to quote a value is to include | ||
1254 | trailing or leading whitespace. Whitespace within a value is | ||
1255 | preserved, ugh. | ||
1256 | |||
1257 | o CLASSES. C_ patterns define classes. Classes ought not include | ||
1258 | a repitition operator, instead letting the reference to the class | ||
1259 | define the repitition count. | ||
1260 | |||
1261 | C_SS - symbol start | ||
1262 | C_SB - symbol body | ||
1263 | C_SP - whitespace | ||
1264 | |||
1265 | */ | ||
1266 | #line 71 "bitbakescanner.l" | ||
1267 | |||
1268 | #include "token.h" | ||
1269 | #include "lexer.h" | ||
1270 | #include "bitbakeparser.h" | ||
1271 | #include <ctype.h> | ||
1272 | |||
1273 | extern void *bbparseAlloc(void *(*mallocProc)(size_t)); | ||
1274 | extern void bbparseFree(void *p, void (*freeProc)(void*)); | ||
1275 | extern void *bbparseAlloc(void *(*mallocProc)(size_t)); | ||
1276 | extern void *bbparse(void*, int, token_t, lex_t*); | ||
1277 | extern void bbparseTrace(FILE *TraceFILE, char *zTracePrompt); | ||
1278 | |||
1279 | //static const char* rgbInput; | ||
1280 | //static size_t cbInput; | ||
1281 | |||
1282 | |||
1283 | int lineError; | ||
1284 | int errorParse; | ||
1285 | |||
1286 | enum { | ||
1287 | errorNone = 0, | ||
1288 | errorUnexpectedInput, | ||
1289 | errorUnsupportedFeature, | ||
1290 | }; | ||
1291 | |||
1292 | #define YY_EXTRA_TYPE lex_t* | ||
1293 | |||
1294 | /* Read from buffer */ | ||
1295 | #define YY_INPUT(buf,result,max_size) \ | ||
1296 | { yyextra->input(buf, &result, max_size); } | ||
1297 | |||
1298 | //#define YY_DECL static size_t yylex () | ||
1299 | |||
1300 | #define ERROR(e) \ | ||
1301 | do { lineError = yylineno; errorParse = e; yyterminate (); } while (0) | ||
1302 | |||
1303 | static const char* fixup_escapes (const char* sz); | ||
1304 | |||
1305 | |||
1306 | |||
1307 | |||
1308 | |||
1309 | |||
1310 | |||
1311 | |||
1312 | |||
1313 | |||
1314 | |||
1315 | #line 1316 "<stdout>" | ||
1316 | |||
1317 | #define INITIAL 0 | ||
1318 | #define S_DEF 1 | ||
1319 | #define S_DEF_ARGS 2 | ||
1320 | #define S_DEF_BODY 3 | ||
1321 | #define S_FUNC 4 | ||
1322 | #define S_INCLUDE 5 | ||
1323 | #define S_INHERIT 6 | ||
1324 | #define S_REQUIRE 7 | ||
1325 | #define S_PROC 8 | ||
1326 | #define S_RVALUE 9 | ||
1327 | #define S_TASK 10 | ||
1328 | |||
1329 | /* Special case for "unistd.h", since it is non-ANSI. We include it way | ||
1330 | * down here because we want the user's section 1 to have been scanned first. | ||
1331 | * The user has a chance to override it with an option. | ||
1332 | */ | ||
1333 | #include <unistd.h> | ||
1334 | |||
1335 | #ifndef YY_EXTRA_TYPE | ||
1336 | #define YY_EXTRA_TYPE void * | ||
1337 | #endif | ||
1338 | |||
1339 | /* Holds the entire state of the reentrant scanner. */ | ||
1340 | struct yyguts_t | ||
1341 | { | ||
1342 | |||
1343 | /* User-defined. Not touched by flex. */ | ||
1344 | YY_EXTRA_TYPE yyextra_r; | ||
1345 | |||
1346 | /* The rest are the same as the globals declared in the non-reentrant scanner. */ | ||
1347 | FILE *yyin_r, *yyout_r; | ||
1348 | size_t yy_buffer_stack_top; /**< index of top of stack. */ | ||
1349 | size_t yy_buffer_stack_max; /**< capacity of stack. */ | ||
1350 | YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ | ||
1351 | char yy_hold_char; | ||
1352 | int yy_n_chars; | ||
1353 | int yyleng_r; | ||
1354 | char *yy_c_buf_p; | ||
1355 | int yy_init; | ||
1356 | int yy_start; | ||
1357 | int yy_did_buffer_switch_on_eof; | ||
1358 | int yy_start_stack_ptr; | ||
1359 | int yy_start_stack_depth; | ||
1360 | int *yy_start_stack; | ||
1361 | yy_state_type yy_last_accepting_state; | ||
1362 | char* yy_last_accepting_cpos; | ||
1363 | |||
1364 | int yylineno_r; | ||
1365 | int yy_flex_debug_r; | ||
1366 | |||
1367 | char *yytext_r; | ||
1368 | int yy_more_flag; | ||
1369 | int yy_more_len; | ||
1370 | |||
1371 | }; /* end struct yyguts_t */ | ||
1372 | |||
1373 | /* Accessor methods to globals. | ||
1374 | These are made visible to non-reentrant scanners for convenience. */ | ||
1375 | |||
1376 | int yylex_destroy (yyscan_t yyscanner ); | ||
1377 | |||
1378 | int yyget_debug (yyscan_t yyscanner ); | ||
1379 | |||
1380 | void yyset_debug (int debug_flag ,yyscan_t yyscanner ); | ||
1381 | |||
1382 | YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); | ||
1383 | |||
1384 | void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); | ||
1385 | |||
1386 | FILE *yyget_in (yyscan_t yyscanner ); | ||
1387 | |||
1388 | void yyset_in (FILE * in_str ,yyscan_t yyscanner ); | ||
1389 | |||
1390 | FILE *yyget_out (yyscan_t yyscanner ); | ||
1391 | |||
1392 | void yyset_out (FILE * out_str ,yyscan_t yyscanner ); | ||
1393 | |||
1394 | int yyget_leng (yyscan_t yyscanner ); | ||
1395 | |||
1396 | char *yyget_text (yyscan_t yyscanner ); | ||
1397 | |||
1398 | int yyget_lineno (yyscan_t yyscanner ); | ||
1399 | |||
1400 | void yyset_lineno (int line_number ,yyscan_t yyscanner ); | ||
1401 | |||
1402 | /* Macros after this point can all be overridden by user definitions in | ||
1403 | * section 1. | ||
1404 | */ | ||
1405 | |||
1406 | #ifndef YY_SKIP_YYWRAP | ||
1407 | #ifdef __cplusplus | ||
1408 | extern "C" int yywrap (yyscan_t yyscanner ); | ||
1409 | #else | ||
1410 | extern int yywrap (yyscan_t yyscanner ); | ||
1411 | #endif | ||
1412 | #endif | ||
1413 | |||
1414 | static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); | ||
1415 | |||
1416 | #ifndef yytext_ptr | ||
1417 | static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); | ||
1418 | #endif | ||
1419 | |||
1420 | #ifdef YY_NEED_STRLEN | ||
1421 | static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); | ||
1422 | #endif | ||
1423 | |||
1424 | #ifndef YY_NO_INPUT | ||
1425 | |||
1426 | #ifdef __cplusplus | ||
1427 | static int yyinput (yyscan_t yyscanner ); | ||
1428 | #else | ||
1429 | static int input (yyscan_t yyscanner ); | ||
1430 | #endif | ||
1431 | |||
1432 | #endif | ||
1433 | |||
1434 | static void yy_push_state (int new_state ,yyscan_t yyscanner); | ||
1435 | |||
1436 | static void yy_pop_state (yyscan_t yyscanner ); | ||
1437 | |||
1438 | static int yy_top_state (yyscan_t yyscanner ); | ||
1439 | |||
1440 | /* Amount of stuff to slurp up with each read. */ | ||
1441 | #ifndef YY_READ_BUF_SIZE | ||
1442 | #define YY_READ_BUF_SIZE 8192 | ||
1443 | #endif | ||
1444 | |||
1445 | /* Copy whatever the last rule matched to the standard output. */ | ||
1446 | #ifndef ECHO | ||
1447 | /* This used to be an fputs(), but since the string might contain NUL's, | ||
1448 | * we now use fwrite(). | ||
1449 | */ | ||
1450 | #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) | ||
1451 | #endif | ||
1452 | |||
1453 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, | ||
1454 | * is returned in "result". | ||
1455 | */ | ||
1456 | #ifndef YY_INPUT | ||
1457 | #define YY_INPUT(buf,result,max_size) \ | ||
1458 | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ | ||
1459 | { \ | ||
1460 | int c = '*'; \ | ||
1461 | size_t n; \ | ||
1462 | for ( n = 0; n < max_size && \ | ||
1463 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ | ||
1464 | buf[n] = (char) c; \ | ||
1465 | if ( c == '\n' ) \ | ||
1466 | buf[n++] = (char) c; \ | ||
1467 | if ( c == EOF && ferror( yyin ) ) \ | ||
1468 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ | ||
1469 | result = n; \ | ||
1470 | } \ | ||
1471 | else \ | ||
1472 | { \ | ||
1473 | errno=0; \ | ||
1474 | while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ | ||
1475 | { \ | ||
1476 | if( errno != EINTR) \ | ||
1477 | { \ | ||
1478 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ | ||
1479 | break; \ | ||
1480 | } \ | ||
1481 | errno=0; \ | ||
1482 | clearerr(yyin); \ | ||
1483 | } \ | ||
1484 | }\ | ||
1485 | \ | ||
1486 | |||
1487 | #endif | ||
1488 | |||
1489 | /* No semi-colon after return; correct usage is to write "yyterminate();" - | ||
1490 | * we don't want an extra ';' after the "return" because that will cause | ||
1491 | * some compilers to complain about unreachable statements. | ||
1492 | */ | ||
1493 | #ifndef yyterminate | ||
1494 | #define yyterminate() return YY_NULL | ||
1495 | #endif | ||
1496 | |||
1497 | /* Number of entries by which start-condition stack grows. */ | ||
1498 | #ifndef YY_START_STACK_INCR | ||
1499 | #define YY_START_STACK_INCR 25 | ||
1500 | #endif | ||
1501 | |||
1502 | /* Report a fatal error. */ | ||
1503 | #ifndef YY_FATAL_ERROR | ||
1504 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) | ||
1505 | #endif | ||
1506 | |||
1507 | /* end tables serialization structures and prototypes */ | ||
1508 | |||
1509 | /* Default declaration of generated scanner - a define so the user can | ||
1510 | * easily add parameters. | ||
1511 | */ | ||
1512 | #ifndef YY_DECL | ||
1513 | #define YY_DECL_IS_OURS 1 | ||
1514 | |||
1515 | extern int yylex (yyscan_t yyscanner); | ||
1516 | |||
1517 | #define YY_DECL int yylex (yyscan_t yyscanner) | ||
1518 | #endif /* !YY_DECL */ | ||
1519 | |||
1520 | /* Code executed at the beginning of each rule, after yytext and yyleng | ||
1521 | * have been set up. | ||
1522 | */ | ||
1523 | #ifndef YY_USER_ACTION | ||
1524 | #define YY_USER_ACTION | ||
1525 | #endif | ||
1526 | |||
1527 | /* Code executed at the end of each rule. */ | ||
1528 | #ifndef YY_BREAK | ||
1529 | #define YY_BREAK break; | ||
1530 | #endif | ||
1531 | |||
1532 | #define YY_RULE_SETUP \ | ||
1533 | YY_USER_ACTION | ||
1534 | |||
1535 | /** The main scanner function which does all the work. | ||
1536 | */ | ||
1537 | YY_DECL | ||
1538 | { | ||
1539 | register yy_state_type yy_current_state; | ||
1540 | register char *yy_cp, *yy_bp; | ||
1541 | register int yy_act; | ||
1542 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
1543 | |||
1544 | #line 159 "bitbakescanner.l" | ||
1545 | |||
1546 | |||
1547 | #line 1548 "<stdout>" | ||
1548 | |||
1549 | if ( yyg->yy_init ) | ||
1550 | { | ||
1551 | yyg->yy_init = 0; | ||
1552 | |||
1553 | #ifdef YY_USER_INIT | ||
1554 | YY_USER_INIT; | ||
1555 | #endif | ||
1556 | |||
1557 | if ( ! yyg->yy_start ) | ||
1558 | yyg->yy_start = 1; /* first start state */ | ||
1559 | |||
1560 | if ( ! yyin ) | ||
1561 | yyin = stdin; | ||
1562 | |||
1563 | if ( ! yyout ) | ||
1564 | yyout = stdout; | ||
1565 | |||
1566 | if ( ! YY_CURRENT_BUFFER ) { | ||
1567 | yyensure_buffer_stack (yyscanner); | ||
1568 | YY_CURRENT_BUFFER_LVALUE = | ||
1569 | yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); | ||
1570 | } | ||
1571 | |||
1572 | yy_load_buffer_state(yyscanner ); | ||
1573 | } | ||
1574 | |||
1575 | while ( 1 ) /* loops until end-of-file is reached */ | ||
1576 | { | ||
1577 | yy_cp = yyg->yy_c_buf_p; | ||
1578 | |||
1579 | /* Support of yytext. */ | ||
1580 | *yy_cp = yyg->yy_hold_char; | ||
1581 | |||
1582 | /* yy_bp points to the position in yy_ch_buf of the start of | ||
1583 | * the current run. | ||
1584 | */ | ||
1585 | yy_bp = yy_cp; | ||
1586 | |||
1587 | yy_current_state = yyg->yy_start; | ||
1588 | yy_match: | ||
1589 | do | ||
1590 | { | ||
1591 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; | ||
1592 | if ( yy_accept[yy_current_state] ) | ||
1593 | { | ||
1594 | yyg->yy_last_accepting_state = yy_current_state; | ||
1595 | yyg->yy_last_accepting_cpos = yy_cp; | ||
1596 | } | ||
1597 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | ||
1598 | { | ||
1599 | yy_current_state = (int) yy_def[yy_current_state]; | ||
1600 | if ( yy_current_state >= 798 ) | ||
1601 | yy_c = yy_meta[(unsigned int) yy_c]; | ||
1602 | } | ||
1603 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | ||
1604 | ++yy_cp; | ||
1605 | } | ||
1606 | while ( yy_current_state != 797 ); | ||
1607 | yy_cp = yyg->yy_last_accepting_cpos; | ||
1608 | yy_current_state = yyg->yy_last_accepting_state; | ||
1609 | |||
1610 | yy_find_action: | ||
1611 | yy_act = yy_accept[yy_current_state]; | ||
1612 | |||
1613 | YY_DO_BEFORE_ACTION; | ||
1614 | |||
1615 | if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) | ||
1616 | { | ||
1617 | int yyl; | ||
1618 | for ( yyl = 0; yyl < yyleng; ++yyl ) | ||
1619 | if ( yytext[yyl] == '\n' ) | ||
1620 | |||
1621 | do{ yylineno++; | ||
1622 | yycolumn=0; | ||
1623 | }while(0) | ||
1624 | ; | ||
1625 | } | ||
1626 | |||
1627 | do_action: /* This label is used only to access EOF actions. */ | ||
1628 | |||
1629 | switch ( yy_act ) | ||
1630 | { /* beginning of action switch */ | ||
1631 | case 0: /* must back up */ | ||
1632 | /* undo the effects of YY_DO_BEFORE_ACTION */ | ||
1633 | *yy_cp = yyg->yy_hold_char; | ||
1634 | yy_cp = yyg->yy_last_accepting_cpos; | ||
1635 | yy_current_state = yyg->yy_last_accepting_state; | ||
1636 | goto yy_find_action; | ||
1637 | |||
1638 | case 1: | ||
1639 | YY_RULE_SETUP | ||
1640 | #line 161 "bitbakescanner.l" | ||
1641 | { BEGIN S_RVALUE; | ||
1642 | yyextra->accept (T_OP_APPEND); } | ||
1643 | YY_BREAK | ||
1644 | case 2: | ||
1645 | YY_RULE_SETUP | ||
1646 | #line 163 "bitbakescanner.l" | ||
1647 | { BEGIN S_RVALUE; | ||
1648 | yyextra->accept (T_OP_PREPEND); } | ||
1649 | YY_BREAK | ||
1650 | case 3: | ||
1651 | YY_RULE_SETUP | ||
1652 | #line 165 "bitbakescanner.l" | ||
1653 | { BEGIN S_RVALUE; | ||
1654 | yyextra->accept (T_OP_IMMEDIATE); } | ||
1655 | YY_BREAK | ||
1656 | case 4: | ||
1657 | YY_RULE_SETUP | ||
1658 | #line 167 "bitbakescanner.l" | ||
1659 | { BEGIN S_RVALUE; | ||
1660 | yyextra->accept (T_OP_ASSIGN); } | ||
1661 | YY_BREAK | ||
1662 | case 5: | ||
1663 | YY_RULE_SETUP | ||
1664 | #line 169 "bitbakescanner.l" | ||
1665 | { BEGIN S_RVALUE; | ||
1666 | yyextra->accept (T_OP_COND); } | ||
1667 | YY_BREAK | ||
1668 | case 6: | ||
1669 | /* rule 6 can match eol */ | ||
1670 | YY_RULE_SETUP | ||
1671 | #line 172 "bitbakescanner.l" | ||
1672 | { } | ||
1673 | YY_BREAK | ||
1674 | case 7: | ||
1675 | /* rule 7 can match eol */ | ||
1676 | YY_RULE_SETUP | ||
1677 | #line 173 "bitbakescanner.l" | ||
1678 | { BEGIN INITIAL; | ||
1679 | size_t cb = yyleng; | ||
1680 | while (cb && isspace (yytext[cb - 1])) | ||
1681 | --cb; | ||
1682 | yytext[cb - 1] = 0; | ||
1683 | yyextra->accept (T_STRING, yytext + 1); } | ||
1684 | YY_BREAK | ||
1685 | case 8: | ||
1686 | /* rule 8 can match eol */ | ||
1687 | YY_RULE_SETUP | ||
1688 | #line 179 "bitbakescanner.l" | ||
1689 | { BEGIN INITIAL; | ||
1690 | size_t cb = yyleng; | ||
1691 | while (cb && isspace (yytext[cb - 1])) | ||
1692 | --cb; | ||
1693 | yytext[cb - 1] = 0; | ||
1694 | yyextra->accept (T_STRING, yytext + 1); } | ||
1695 | YY_BREAK | ||
1696 | case 9: | ||
1697 | /* rule 9 can match eol */ | ||
1698 | YY_RULE_SETUP | ||
1699 | #line 186 "bitbakescanner.l" | ||
1700 | { ERROR (errorUnexpectedInput); } | ||
1701 | YY_BREAK | ||
1702 | case 10: | ||
1703 | /* rule 10 can match eol */ | ||
1704 | YY_RULE_SETUP | ||
1705 | #line 187 "bitbakescanner.l" | ||
1706 | { BEGIN INITIAL; | ||
1707 | yyextra->accept (T_STRING, NULL); } | ||
1708 | YY_BREAK | ||
1709 | case 11: | ||
1710 | YY_RULE_SETUP | ||
1711 | #line 190 "bitbakescanner.l" | ||
1712 | { BEGIN S_INCLUDE; | ||
1713 | yyextra->accept (T_INCLUDE); } | ||
1714 | YY_BREAK | ||
1715 | case 12: | ||
1716 | YY_RULE_SETUP | ||
1717 | #line 192 "bitbakescanner.l" | ||
1718 | { BEGIN S_REQUIRE; | ||
1719 | yyextra->accept (T_REQUIRE); } | ||
1720 | YY_BREAK | ||
1721 | case 13: | ||
1722 | YY_RULE_SETUP | ||
1723 | #line 194 "bitbakescanner.l" | ||
1724 | { BEGIN S_INHERIT; | ||
1725 | yyextra->accept (T_INHERIT); } | ||
1726 | YY_BREAK | ||
1727 | case 14: | ||
1728 | YY_RULE_SETUP | ||
1729 | #line 196 "bitbakescanner.l" | ||
1730 | { BEGIN S_TASK; | ||
1731 | yyextra->accept (T_ADDTASK); } | ||
1732 | YY_BREAK | ||
1733 | case 15: | ||
1734 | YY_RULE_SETUP | ||
1735 | #line 198 "bitbakescanner.l" | ||
1736 | { yyextra->accept (T_ADDHANDLER); } | ||
1737 | YY_BREAK | ||
1738 | case 16: | ||
1739 | YY_RULE_SETUP | ||
1740 | #line 199 "bitbakescanner.l" | ||
1741 | { BEGIN S_FUNC; | ||
1742 | yyextra->accept (T_EXPORT_FUNC); } | ||
1743 | YY_BREAK | ||
1744 | case 17: | ||
1745 | YY_RULE_SETUP | ||
1746 | #line 201 "bitbakescanner.l" | ||
1747 | { yyextra->accept (T_BEFORE); } | ||
1748 | YY_BREAK | ||
1749 | case 18: | ||
1750 | YY_RULE_SETUP | ||
1751 | #line 202 "bitbakescanner.l" | ||
1752 | { yyextra->accept (T_AFTER); } | ||
1753 | YY_BREAK | ||
1754 | case 19: | ||
1755 | YY_RULE_SETUP | ||
1756 | #line 203 "bitbakescanner.l" | ||
1757 | { yyextra->accept (T_EXPORT); } | ||
1758 | YY_BREAK | ||
1759 | case 20: | ||
1760 | YY_RULE_SETUP | ||
1761 | #line 205 "bitbakescanner.l" | ||
1762 | { yyextra->accept (T_FAKEROOT); } | ||
1763 | YY_BREAK | ||
1764 | case 21: | ||
1765 | YY_RULE_SETUP | ||
1766 | #line 206 "bitbakescanner.l" | ||
1767 | { yyextra->accept (T_PYTHON); } | ||
1768 | YY_BREAK | ||
1769 | case 22: | ||
1770 | /* rule 22 can match eol */ | ||
1771 | YY_RULE_SETUP | ||
1772 | #line 207 "bitbakescanner.l" | ||
1773 | { BEGIN S_PROC; | ||
1774 | yyextra->accept (T_PROC_OPEN); } | ||
1775 | YY_BREAK | ||
1776 | case 23: | ||
1777 | /* rule 23 can match eol */ | ||
1778 | YY_RULE_SETUP | ||
1779 | #line 209 "bitbakescanner.l" | ||
1780 | { BEGIN INITIAL; | ||
1781 | yyextra->accept (T_PROC_CLOSE); } | ||
1782 | YY_BREAK | ||
1783 | case 24: | ||
1784 | /* rule 24 can match eol */ | ||
1785 | YY_RULE_SETUP | ||
1786 | #line 211 "bitbakescanner.l" | ||
1787 | { yyextra->accept (T_PROC_BODY, yytext); } | ||
1788 | YY_BREAK | ||
1789 | case 25: | ||
1790 | YY_RULE_SETUP | ||
1791 | #line 213 "bitbakescanner.l" | ||
1792 | { BEGIN S_DEF; } | ||
1793 | YY_BREAK | ||
1794 | case 26: | ||
1795 | YY_RULE_SETUP | ||
1796 | #line 214 "bitbakescanner.l" | ||
1797 | { BEGIN S_DEF_ARGS; | ||
1798 | yyextra->accept (T_SYMBOL, yytext); } | ||
1799 | YY_BREAK | ||
1800 | case 27: | ||
1801 | YY_RULE_SETUP | ||
1802 | #line 216 "bitbakescanner.l" | ||
1803 | { yyextra->accept (T_DEF_ARGS, yytext); } | ||
1804 | YY_BREAK | ||
1805 | case 28: | ||
1806 | /* rule 28 can match eol */ | ||
1807 | YY_RULE_SETUP | ||
1808 | #line 217 "bitbakescanner.l" | ||
1809 | { BEGIN S_DEF_BODY; } | ||
1810 | YY_BREAK | ||
1811 | case 29: | ||
1812 | /* rule 29 can match eol */ | ||
1813 | YY_RULE_SETUP | ||
1814 | #line 218 "bitbakescanner.l" | ||
1815 | { yyextra->accept (T_DEF_BODY, yytext); } | ||
1816 | YY_BREAK | ||
1817 | case 30: | ||
1818 | /* rule 30 can match eol */ | ||
1819 | YY_RULE_SETUP | ||
1820 | #line 219 "bitbakescanner.l" | ||
1821 | { yyextra->accept (T_DEF_BODY, yytext); } | ||
1822 | YY_BREAK | ||
1823 | case 31: | ||
1824 | YY_RULE_SETUP | ||
1825 | #line 220 "bitbakescanner.l" | ||
1826 | { BEGIN INITIAL; unput (yytext[0]); } | ||
1827 | YY_BREAK | ||
1828 | case 32: | ||
1829 | /* rule 32 can match eol */ | ||
1830 | YY_RULE_SETUP | ||
1831 | #line 222 "bitbakescanner.l" | ||
1832 | { } | ||
1833 | YY_BREAK | ||
1834 | case 33: | ||
1835 | YY_RULE_SETUP | ||
1836 | #line 224 "bitbakescanner.l" | ||
1837 | { yyextra->accept (T_SYMBOL, yytext); } | ||
1838 | YY_BREAK | ||
1839 | case 34: | ||
1840 | YY_RULE_SETUP | ||
1841 | #line 225 "bitbakescanner.l" | ||
1842 | { yyextra->accept (T_VARIABLE, yytext); } | ||
1843 | YY_BREAK | ||
1844 | case 35: | ||
1845 | YY_RULE_SETUP | ||
1846 | #line 227 "bitbakescanner.l" | ||
1847 | { yyextra->accept (T_TSYMBOL, yytext); } | ||
1848 | YY_BREAK | ||
1849 | case 36: | ||
1850 | YY_RULE_SETUP | ||
1851 | #line 228 "bitbakescanner.l" | ||
1852 | { yyextra->accept (T_FSYMBOL, yytext); } | ||
1853 | YY_BREAK | ||
1854 | case 37: | ||
1855 | YY_RULE_SETUP | ||
1856 | #line 229 "bitbakescanner.l" | ||
1857 | { yyextra->accept (T_ISYMBOL, yytext); } | ||
1858 | YY_BREAK | ||
1859 | case 38: | ||
1860 | YY_RULE_SETUP | ||
1861 | #line 230 "bitbakescanner.l" | ||
1862 | { BEGIN INITIAL; | ||
1863 | yyextra->accept (T_ISYMBOL, yytext); } | ||
1864 | YY_BREAK | ||
1865 | case 39: | ||
1866 | YY_RULE_SETUP | ||
1867 | #line 232 "bitbakescanner.l" | ||
1868 | { BEGIN INITIAL; | ||
1869 | yyextra->accept (T_ISYMBOL, yytext); } | ||
1870 | YY_BREAK | ||
1871 | case 40: | ||
1872 | /* rule 40 can match eol */ | ||
1873 | YY_RULE_SETUP | ||
1874 | #line 234 "bitbakescanner.l" | ||
1875 | { BEGIN INITIAL; } | ||
1876 | YY_BREAK | ||
1877 | case 41: | ||
1878 | /* rule 41 can match eol */ | ||
1879 | YY_RULE_SETUP | ||
1880 | #line 235 "bitbakescanner.l" | ||
1881 | { BEGIN INITIAL; } | ||
1882 | YY_BREAK | ||
1883 | case 42: | ||
1884 | /* rule 42 can match eol */ | ||
1885 | YY_RULE_SETUP | ||
1886 | #line 236 "bitbakescanner.l" | ||
1887 | { BEGIN INITIAL; } | ||
1888 | YY_BREAK | ||
1889 | case 43: | ||
1890 | /* rule 43 can match eol */ | ||
1891 | YY_RULE_SETUP | ||
1892 | #line 238 "bitbakescanner.l" | ||
1893 | /* Insignificant whitespace */ | ||
1894 | YY_BREAK | ||
1895 | case 44: | ||
1896 | YY_RULE_SETUP | ||
1897 | #line 240 "bitbakescanner.l" | ||
1898 | { ERROR (errorUnexpectedInput); } | ||
1899 | YY_BREAK | ||
1900 | /* Check for premature termination */ | ||
1901 | case YY_STATE_EOF(INITIAL): | ||
1902 | case YY_STATE_EOF(S_DEF): | ||
1903 | case YY_STATE_EOF(S_DEF_ARGS): | ||
1904 | case YY_STATE_EOF(S_DEF_BODY): | ||
1905 | case YY_STATE_EOF(S_FUNC): | ||
1906 | case YY_STATE_EOF(S_INCLUDE): | ||
1907 | case YY_STATE_EOF(S_INHERIT): | ||
1908 | case YY_STATE_EOF(S_REQUIRE): | ||
1909 | case YY_STATE_EOF(S_PROC): | ||
1910 | case YY_STATE_EOF(S_RVALUE): | ||
1911 | case YY_STATE_EOF(S_TASK): | ||
1912 | #line 243 "bitbakescanner.l" | ||
1913 | { return T_EOF; } | ||
1914 | YY_BREAK | ||
1915 | case 45: | ||
1916 | YY_RULE_SETUP | ||
1917 | #line 245 "bitbakescanner.l" | ||
1918 | ECHO; | ||
1919 | YY_BREAK | ||
1920 | #line 1921 "<stdout>" | ||
1921 | |||
1922 | case YY_END_OF_BUFFER: | ||
1923 | { | ||
1924 | /* Amount of text matched not including the EOB char. */ | ||
1925 | int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; | ||
1926 | |||
1927 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ | ||
1928 | *yy_cp = yyg->yy_hold_char; | ||
1929 | YY_RESTORE_YY_MORE_OFFSET | ||
1930 | |||
1931 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) | ||
1932 | { | ||
1933 | /* We're scanning a new file or input source. It's | ||
1934 | * possible that this happened because the user | ||
1935 | * just pointed yyin at a new source and called | ||
1936 | * yylex(). If so, then we have to assure | ||
1937 | * consistency between YY_CURRENT_BUFFER and our | ||
1938 | * globals. Here is the right place to do so, because | ||
1939 | * this is the first action (other than possibly a | ||
1940 | * back-up) that will match for the new input source. | ||
1941 | */ | ||
1942 | yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; | ||
1943 | YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; | ||
1944 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; | ||
1945 | } | ||
1946 | |||
1947 | /* Note that here we test for yy_c_buf_p "<=" to the position | ||
1948 | * of the first EOB in the buffer, since yy_c_buf_p will | ||
1949 | * already have been incremented past the NUL character | ||
1950 | * (since all states make transitions on EOB to the | ||
1951 | * end-of-buffer state). Contrast this with the test | ||
1952 | * in input(). | ||
1953 | */ | ||
1954 | if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) | ||
1955 | { /* This was really a NUL. */ | ||
1956 | yy_state_type yy_next_state; | ||
1957 | |||
1958 | yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; | ||
1959 | |||
1960 | yy_current_state = yy_get_previous_state( yyscanner ); | ||
1961 | |||
1962 | /* Okay, we're now positioned to make the NUL | ||
1963 | * transition. We couldn't have | ||
1964 | * yy_get_previous_state() go ahead and do it | ||
1965 | * for us because it doesn't know how to deal | ||
1966 | * with the possibility of jamming (and we don't | ||
1967 | * want to build jamming into it because then it | ||
1968 | * will run more slowly). | ||
1969 | */ | ||
1970 | |||
1971 | yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); | ||
1972 | |||
1973 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; | ||
1974 | |||
1975 | if ( yy_next_state ) | ||
1976 | { | ||
1977 | /* Consume the NUL. */ | ||
1978 | yy_cp = ++yyg->yy_c_buf_p; | ||
1979 | yy_current_state = yy_next_state; | ||
1980 | goto yy_match; | ||
1981 | } | ||
1982 | |||
1983 | else | ||
1984 | { | ||
1985 | yy_cp = yyg->yy_last_accepting_cpos; | ||
1986 | yy_current_state = yyg->yy_last_accepting_state; | ||
1987 | goto yy_find_action; | ||
1988 | } | ||
1989 | } | ||
1990 | |||
1991 | else switch ( yy_get_next_buffer( yyscanner ) ) | ||
1992 | { | ||
1993 | case EOB_ACT_END_OF_FILE: | ||
1994 | { | ||
1995 | yyg->yy_did_buffer_switch_on_eof = 0; | ||
1996 | |||
1997 | if ( yywrap(yyscanner ) ) | ||
1998 | { | ||
1999 | /* Note: because we've taken care in | ||
2000 | * yy_get_next_buffer() to have set up | ||
2001 | * yytext, we can now set up | ||
2002 | * yy_c_buf_p so that if some total | ||
2003 | * hoser (like flex itself) wants to | ||
2004 | * call the scanner after we return the | ||
2005 | * YY_NULL, it'll still work - another | ||
2006 | * YY_NULL will get returned. | ||
2007 | */ | ||
2008 | yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; | ||
2009 | |||
2010 | yy_act = YY_STATE_EOF(YY_START); | ||
2011 | goto do_action; | ||
2012 | } | ||
2013 | |||
2014 | else | ||
2015 | { | ||
2016 | if ( ! yyg->yy_did_buffer_switch_on_eof ) | ||
2017 | YY_NEW_FILE; | ||
2018 | } | ||
2019 | break; | ||
2020 | } | ||
2021 | |||
2022 | case EOB_ACT_CONTINUE_SCAN: | ||
2023 | yyg->yy_c_buf_p = | ||
2024 | yyg->yytext_ptr + yy_amount_of_matched_text; | ||
2025 | |||
2026 | yy_current_state = yy_get_previous_state( yyscanner ); | ||
2027 | |||
2028 | yy_cp = yyg->yy_c_buf_p; | ||
2029 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; | ||
2030 | goto yy_match; | ||
2031 | |||
2032 | case EOB_ACT_LAST_MATCH: | ||
2033 | yyg->yy_c_buf_p = | ||
2034 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; | ||
2035 | |||
2036 | yy_current_state = yy_get_previous_state( yyscanner ); | ||
2037 | |||
2038 | yy_cp = yyg->yy_c_buf_p; | ||
2039 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; | ||
2040 | goto yy_find_action; | ||
2041 | } | ||
2042 | break; | ||
2043 | } | ||
2044 | |||
2045 | default: | ||
2046 | YY_FATAL_ERROR( | ||
2047 | "fatal flex scanner internal error--no action found" ); | ||
2048 | } /* end of action switch */ | ||
2049 | } /* end of scanning one token */ | ||
2050 | } /* end of yylex */ | ||
2051 | |||
2052 | /* yy_get_next_buffer - try to read in a new buffer | ||
2053 | * | ||
2054 | * Returns a code representing an action: | ||
2055 | * EOB_ACT_LAST_MATCH - | ||
2056 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position | ||
2057 | * EOB_ACT_END_OF_FILE - end of file | ||
2058 | */ | ||
2059 | static int yy_get_next_buffer (yyscan_t yyscanner) | ||
2060 | { | ||
2061 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2062 | register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; | ||
2063 | register char *source = yyg->yytext_ptr; | ||
2064 | register int number_to_move, i; | ||
2065 | int ret_val; | ||
2066 | |||
2067 | if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) | ||
2068 | YY_FATAL_ERROR( | ||
2069 | "fatal flex scanner internal error--end of buffer missed" ); | ||
2070 | |||
2071 | if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) | ||
2072 | { /* Don't try to fill the buffer, so this is an EOF. */ | ||
2073 | if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) | ||
2074 | { | ||
2075 | /* We matched a single character, the EOB, so | ||
2076 | * treat this as a final EOF. | ||
2077 | */ | ||
2078 | return EOB_ACT_END_OF_FILE; | ||
2079 | } | ||
2080 | |||
2081 | else | ||
2082 | { | ||
2083 | /* We matched some text prior to the EOB, first | ||
2084 | * process it. | ||
2085 | */ | ||
2086 | return EOB_ACT_LAST_MATCH; | ||
2087 | } | ||
2088 | } | ||
2089 | |||
2090 | /* Try to read more data. */ | ||
2091 | |||
2092 | /* First move last chars to start of buffer. */ | ||
2093 | number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; | ||
2094 | |||
2095 | for ( i = 0; i < number_to_move; ++i ) | ||
2096 | *(dest++) = *(source++); | ||
2097 | |||
2098 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) | ||
2099 | /* don't do the read, it's not guaranteed to return an EOF, | ||
2100 | * just force an EOF | ||
2101 | */ | ||
2102 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; | ||
2103 | |||
2104 | else | ||
2105 | { | ||
2106 | size_t num_to_read = | ||
2107 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; | ||
2108 | |||
2109 | while ( num_to_read <= 0 ) | ||
2110 | { /* Not enough room in the buffer - grow it. */ | ||
2111 | |||
2112 | /* just a shorter name for the current buffer */ | ||
2113 | YY_BUFFER_STATE b = YY_CURRENT_BUFFER; | ||
2114 | |||
2115 | int yy_c_buf_p_offset = | ||
2116 | (int) (yyg->yy_c_buf_p - b->yy_ch_buf); | ||
2117 | |||
2118 | if ( b->yy_is_our_buffer ) | ||
2119 | { | ||
2120 | int new_size = b->yy_buf_size * 2; | ||
2121 | |||
2122 | if ( new_size <= 0 ) | ||
2123 | b->yy_buf_size += b->yy_buf_size / 8; | ||
2124 | else | ||
2125 | b->yy_buf_size *= 2; | ||
2126 | |||
2127 | b->yy_ch_buf = (char *) | ||
2128 | /* Include room in for 2 EOB chars. */ | ||
2129 | yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); | ||
2130 | } | ||
2131 | else | ||
2132 | /* Can't grow it, we don't own it. */ | ||
2133 | b->yy_ch_buf = 0; | ||
2134 | |||
2135 | if ( ! b->yy_ch_buf ) | ||
2136 | YY_FATAL_ERROR( | ||
2137 | "fatal error - scanner input buffer overflow" ); | ||
2138 | |||
2139 | yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; | ||
2140 | |||
2141 | num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - | ||
2142 | number_to_move - 1; | ||
2143 | |||
2144 | } | ||
2145 | |||
2146 | if ( num_to_read > YY_READ_BUF_SIZE ) | ||
2147 | num_to_read = YY_READ_BUF_SIZE; | ||
2148 | |||
2149 | /* Read in more data. */ | ||
2150 | YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), | ||
2151 | yyg->yy_n_chars, num_to_read ); | ||
2152 | |||
2153 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; | ||
2154 | } | ||
2155 | |||
2156 | if ( yyg->yy_n_chars == 0 ) | ||
2157 | { | ||
2158 | if ( number_to_move == YY_MORE_ADJ ) | ||
2159 | { | ||
2160 | ret_val = EOB_ACT_END_OF_FILE; | ||
2161 | yyrestart(yyin ,yyscanner); | ||
2162 | } | ||
2163 | |||
2164 | else | ||
2165 | { | ||
2166 | ret_val = EOB_ACT_LAST_MATCH; | ||
2167 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = | ||
2168 | YY_BUFFER_EOF_PENDING; | ||
2169 | } | ||
2170 | } | ||
2171 | |||
2172 | else | ||
2173 | ret_val = EOB_ACT_CONTINUE_SCAN; | ||
2174 | |||
2175 | yyg->yy_n_chars += number_to_move; | ||
2176 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; | ||
2177 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; | ||
2178 | |||
2179 | yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; | ||
2180 | |||
2181 | return ret_val; | ||
2182 | } | ||
2183 | |||
2184 | /* yy_get_previous_state - get the state just before the EOB char was reached */ | ||
2185 | |||
2186 | static yy_state_type yy_get_previous_state (yyscan_t yyscanner) | ||
2187 | { | ||
2188 | register yy_state_type yy_current_state; | ||
2189 | register char *yy_cp; | ||
2190 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2191 | |||
2192 | yy_current_state = yyg->yy_start; | ||
2193 | |||
2194 | for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) | ||
2195 | { | ||
2196 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | ||
2197 | if ( yy_accept[yy_current_state] ) | ||
2198 | { | ||
2199 | yyg->yy_last_accepting_state = yy_current_state; | ||
2200 | yyg->yy_last_accepting_cpos = yy_cp; | ||
2201 | } | ||
2202 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | ||
2203 | { | ||
2204 | yy_current_state = (int) yy_def[yy_current_state]; | ||
2205 | if ( yy_current_state >= 798 ) | ||
2206 | yy_c = yy_meta[(unsigned int) yy_c]; | ||
2207 | } | ||
2208 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | ||
2209 | } | ||
2210 | |||
2211 | return yy_current_state; | ||
2212 | } | ||
2213 | |||
2214 | /* yy_try_NUL_trans - try to make a transition on the NUL character | ||
2215 | * | ||
2216 | * synopsis | ||
2217 | * next_state = yy_try_NUL_trans( current_state ); | ||
2218 | */ | ||
2219 | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) | ||
2220 | { | ||
2221 | register int yy_is_jam; | ||
2222 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2223 | register char *yy_cp = yyg->yy_c_buf_p; | ||
2224 | |||
2225 | register YY_CHAR yy_c = 1; | ||
2226 | if ( yy_accept[yy_current_state] ) | ||
2227 | { | ||
2228 | yyg->yy_last_accepting_state = yy_current_state; | ||
2229 | yyg->yy_last_accepting_cpos = yy_cp; | ||
2230 | } | ||
2231 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | ||
2232 | { | ||
2233 | yy_current_state = (int) yy_def[yy_current_state]; | ||
2234 | if ( yy_current_state >= 798 ) | ||
2235 | yy_c = yy_meta[(unsigned int) yy_c]; | ||
2236 | } | ||
2237 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | ||
2238 | yy_is_jam = (yy_current_state == 797); | ||
2239 | |||
2240 | return yy_is_jam ? 0 : yy_current_state; | ||
2241 | } | ||
2242 | |||
2243 | static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) | ||
2244 | { | ||
2245 | register char *yy_cp; | ||
2246 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2247 | |||
2248 | yy_cp = yyg->yy_c_buf_p; | ||
2249 | |||
2250 | /* undo effects of setting up yytext */ | ||
2251 | *yy_cp = yyg->yy_hold_char; | ||
2252 | |||
2253 | if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) | ||
2254 | { /* need to shift things up to make room */ | ||
2255 | /* +2 for EOB chars. */ | ||
2256 | register int number_to_move = yyg->yy_n_chars + 2; | ||
2257 | register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ | ||
2258 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; | ||
2259 | register char *source = | ||
2260 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; | ||
2261 | |||
2262 | while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) | ||
2263 | *--dest = *--source; | ||
2264 | |||
2265 | yy_cp += (int) (dest - source); | ||
2266 | yy_bp += (int) (dest - source); | ||
2267 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = | ||
2268 | yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; | ||
2269 | |||
2270 | if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) | ||
2271 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); | ||
2272 | } | ||
2273 | |||
2274 | *--yy_cp = (char) c; | ||
2275 | |||
2276 | if ( c == '\n' ){ | ||
2277 | --yylineno; | ||
2278 | } | ||
2279 | |||
2280 | yyg->yytext_ptr = yy_bp; | ||
2281 | yyg->yy_hold_char = *yy_cp; | ||
2282 | yyg->yy_c_buf_p = yy_cp; | ||
2283 | } | ||
2284 | |||
2285 | #ifndef YY_NO_INPUT | ||
2286 | #ifdef __cplusplus | ||
2287 | static int yyinput (yyscan_t yyscanner) | ||
2288 | #else | ||
2289 | static int input (yyscan_t yyscanner) | ||
2290 | #endif | ||
2291 | |||
2292 | { | ||
2293 | int c; | ||
2294 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2295 | |||
2296 | *yyg->yy_c_buf_p = yyg->yy_hold_char; | ||
2297 | |||
2298 | if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) | ||
2299 | { | ||
2300 | /* yy_c_buf_p now points to the character we want to return. | ||
2301 | * If this occurs *before* the EOB characters, then it's a | ||
2302 | * valid NUL; if not, then we've hit the end of the buffer. | ||
2303 | */ | ||
2304 | if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) | ||
2305 | /* This was really a NUL. */ | ||
2306 | *yyg->yy_c_buf_p = '\0'; | ||
2307 | |||
2308 | else | ||
2309 | { /* need more input */ | ||
2310 | int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; | ||
2311 | ++yyg->yy_c_buf_p; | ||
2312 | |||
2313 | switch ( yy_get_next_buffer( yyscanner ) ) | ||
2314 | { | ||
2315 | case EOB_ACT_LAST_MATCH: | ||
2316 | /* This happens because yy_g_n_b() | ||
2317 | * sees that we've accumulated a | ||
2318 | * token and flags that we need to | ||
2319 | * try matching the token before | ||
2320 | * proceeding. But for input(), | ||
2321 | * there's no matching to consider. | ||
2322 | * So convert the EOB_ACT_LAST_MATCH | ||
2323 | * to EOB_ACT_END_OF_FILE. | ||
2324 | */ | ||
2325 | |||
2326 | /* Reset buffer status. */ | ||
2327 | yyrestart(yyin ,yyscanner); | ||
2328 | |||
2329 | /*FALLTHROUGH*/ | ||
2330 | |||
2331 | case EOB_ACT_END_OF_FILE: | ||
2332 | { | ||
2333 | if ( yywrap(yyscanner ) ) | ||
2334 | return EOF; | ||
2335 | |||
2336 | if ( ! yyg->yy_did_buffer_switch_on_eof ) | ||
2337 | YY_NEW_FILE; | ||
2338 | #ifdef __cplusplus | ||
2339 | return yyinput(yyscanner); | ||
2340 | #else | ||
2341 | return input(yyscanner); | ||
2342 | #endif | ||
2343 | } | ||
2344 | |||
2345 | case EOB_ACT_CONTINUE_SCAN: | ||
2346 | yyg->yy_c_buf_p = yyg->yytext_ptr + offset; | ||
2347 | break; | ||
2348 | } | ||
2349 | } | ||
2350 | } | ||
2351 | |||
2352 | c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ | ||
2353 | *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ | ||
2354 | yyg->yy_hold_char = *++yyg->yy_c_buf_p; | ||
2355 | |||
2356 | if ( c == '\n' ) | ||
2357 | |||
2358 | do{ yylineno++; | ||
2359 | yycolumn=0; | ||
2360 | }while(0) | ||
2361 | ; | ||
2362 | |||
2363 | return c; | ||
2364 | } | ||
2365 | #endif /* ifndef YY_NO_INPUT */ | ||
2366 | |||
2367 | /** Immediately switch to a different input stream. | ||
2368 | * @param input_file A readable stream. | ||
2369 | * @param yyscanner The scanner object. | ||
2370 | * @note This function does not reset the start condition to @c INITIAL . | ||
2371 | */ | ||
2372 | void yyrestart (FILE * input_file , yyscan_t yyscanner) | ||
2373 | { | ||
2374 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2375 | |||
2376 | if ( ! YY_CURRENT_BUFFER ){ | ||
2377 | yyensure_buffer_stack (yyscanner); | ||
2378 | YY_CURRENT_BUFFER_LVALUE = | ||
2379 | yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); | ||
2380 | } | ||
2381 | |||
2382 | yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); | ||
2383 | yy_load_buffer_state(yyscanner ); | ||
2384 | } | ||
2385 | |||
2386 | /** Switch to a different input buffer. | ||
2387 | * @param new_buffer The new input buffer. | ||
2388 | * @param yyscanner The scanner object. | ||
2389 | */ | ||
2390 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) | ||
2391 | { | ||
2392 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2393 | |||
2394 | /* TODO. We should be able to replace this entire function body | ||
2395 | * with | ||
2396 | * yypop_buffer_state(); | ||
2397 | * yypush_buffer_state(new_buffer); | ||
2398 | */ | ||
2399 | yyensure_buffer_stack (yyscanner); | ||
2400 | if ( YY_CURRENT_BUFFER == new_buffer ) | ||
2401 | return; | ||
2402 | |||
2403 | if ( YY_CURRENT_BUFFER ) | ||
2404 | { | ||
2405 | /* Flush out information for old buffer. */ | ||
2406 | *yyg->yy_c_buf_p = yyg->yy_hold_char; | ||
2407 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; | ||
2408 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; | ||
2409 | } | ||
2410 | |||
2411 | YY_CURRENT_BUFFER_LVALUE = new_buffer; | ||
2412 | yy_load_buffer_state(yyscanner ); | ||
2413 | |||
2414 | /* We don't actually know whether we did this switch during | ||
2415 | * EOF (yywrap()) processing, but the only time this flag | ||
2416 | * is looked at is after yywrap() is called, so it's safe | ||
2417 | * to go ahead and always set it. | ||
2418 | */ | ||
2419 | yyg->yy_did_buffer_switch_on_eof = 1; | ||
2420 | } | ||
2421 | |||
2422 | static void yy_load_buffer_state (yyscan_t yyscanner) | ||
2423 | { | ||
2424 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2425 | yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; | ||
2426 | yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; | ||
2427 | yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; | ||
2428 | yyg->yy_hold_char = *yyg->yy_c_buf_p; | ||
2429 | } | ||
2430 | |||
2431 | /** Allocate and initialize an input buffer state. | ||
2432 | * @param file A readable stream. | ||
2433 | * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. | ||
2434 | * @param yyscanner The scanner object. | ||
2435 | * @return the allocated buffer state. | ||
2436 | */ | ||
2437 | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) | ||
2438 | { | ||
2439 | YY_BUFFER_STATE b; | ||
2440 | |||
2441 | b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); | ||
2442 | if ( ! b ) | ||
2443 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | ||
2444 | |||
2445 | b->yy_buf_size = size; | ||
2446 | |||
2447 | /* yy_ch_buf has to be 2 characters longer than the size given because | ||
2448 | * we need to put in 2 end-of-buffer characters. | ||
2449 | */ | ||
2450 | b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner ); | ||
2451 | if ( ! b->yy_ch_buf ) | ||
2452 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | ||
2453 | |||
2454 | b->yy_is_our_buffer = 1; | ||
2455 | |||
2456 | yy_init_buffer(b,file ,yyscanner); | ||
2457 | |||
2458 | return b; | ||
2459 | } | ||
2460 | |||
2461 | /** Destroy the buffer. | ||
2462 | * @param b a buffer created with yy_create_buffer() | ||
2463 | * @param yyscanner The scanner object. | ||
2464 | */ | ||
2465 | void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) | ||
2466 | { | ||
2467 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2468 | |||
2469 | if ( ! b ) | ||
2470 | return; | ||
2471 | |||
2472 | if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ | ||
2473 | YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; | ||
2474 | |||
2475 | if ( b->yy_is_our_buffer ) | ||
2476 | yyfree((void *) b->yy_ch_buf ,yyscanner ); | ||
2477 | |||
2478 | yyfree((void *) b ,yyscanner ); | ||
2479 | } | ||
2480 | |||
2481 | /* Initializes or reinitializes a buffer. | ||
2482 | * This function is sometimes called more than once on the same buffer, | ||
2483 | * such as during a yyrestart() or at EOF. | ||
2484 | */ | ||
2485 | static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) | ||
2486 | |||
2487 | { | ||
2488 | int oerrno = errno; | ||
2489 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2490 | |||
2491 | yy_flush_buffer(b ,yyscanner); | ||
2492 | |||
2493 | b->yy_input_file = file; | ||
2494 | b->yy_fill_buffer = 1; | ||
2495 | |||
2496 | /* If b is the current buffer, then yy_init_buffer was _probably_ | ||
2497 | * called from yyrestart() or through yy_get_next_buffer. | ||
2498 | * In that case, we don't want to reset the lineno or column. | ||
2499 | */ | ||
2500 | if (b != YY_CURRENT_BUFFER){ | ||
2501 | b->yy_bs_lineno = 1; | ||
2502 | b->yy_bs_column = 0; | ||
2503 | } | ||
2504 | |||
2505 | b->yy_is_interactive = 0; | ||
2506 | |||
2507 | errno = oerrno; | ||
2508 | } | ||
2509 | |||
2510 | /** Discard all buffered characters. On the next scan, YY_INPUT will be called. | ||
2511 | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. | ||
2512 | * @param yyscanner The scanner object. | ||
2513 | */ | ||
2514 | void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) | ||
2515 | { | ||
2516 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2517 | if ( ! b ) | ||
2518 | return; | ||
2519 | |||
2520 | b->yy_n_chars = 0; | ||
2521 | |||
2522 | /* We always need two end-of-buffer characters. The first causes | ||
2523 | * a transition to the end-of-buffer state. The second causes | ||
2524 | * a jam in that state. | ||
2525 | */ | ||
2526 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; | ||
2527 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; | ||
2528 | |||
2529 | b->yy_buf_pos = &b->yy_ch_buf[0]; | ||
2530 | |||
2531 | b->yy_at_bol = 1; | ||
2532 | b->yy_buffer_status = YY_BUFFER_NEW; | ||
2533 | |||
2534 | if ( b == YY_CURRENT_BUFFER ) | ||
2535 | yy_load_buffer_state(yyscanner ); | ||
2536 | } | ||
2537 | |||
2538 | /** Pushes the new state onto the stack. The new state becomes | ||
2539 | * the current state. This function will allocate the stack | ||
2540 | * if necessary. | ||
2541 | * @param new_buffer The new state. | ||
2542 | * @param yyscanner The scanner object. | ||
2543 | */ | ||
2544 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) | ||
2545 | { | ||
2546 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2547 | if (new_buffer == NULL) | ||
2548 | return; | ||
2549 | |||
2550 | yyensure_buffer_stack(yyscanner); | ||
2551 | |||
2552 | /* This block is copied from yy_switch_to_buffer. */ | ||
2553 | if ( YY_CURRENT_BUFFER ) | ||
2554 | { | ||
2555 | /* Flush out information for old buffer. */ | ||
2556 | *yyg->yy_c_buf_p = yyg->yy_hold_char; | ||
2557 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; | ||
2558 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; | ||
2559 | } | ||
2560 | |||
2561 | /* Only push if top exists. Otherwise, replace top. */ | ||
2562 | if (YY_CURRENT_BUFFER) | ||
2563 | yyg->yy_buffer_stack_top++; | ||
2564 | YY_CURRENT_BUFFER_LVALUE = new_buffer; | ||
2565 | |||
2566 | /* copied from yy_switch_to_buffer. */ | ||
2567 | yy_load_buffer_state(yyscanner ); | ||
2568 | yyg->yy_did_buffer_switch_on_eof = 1; | ||
2569 | } | ||
2570 | |||
2571 | /** Removes and deletes the top of the stack, if present. | ||
2572 | * The next element becomes the new top. | ||
2573 | * @param yyscanner The scanner object. | ||
2574 | */ | ||
2575 | void yypop_buffer_state (yyscan_t yyscanner) | ||
2576 | { | ||
2577 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2578 | if (!YY_CURRENT_BUFFER) | ||
2579 | return; | ||
2580 | |||
2581 | yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); | ||
2582 | YY_CURRENT_BUFFER_LVALUE = NULL; | ||
2583 | if (yyg->yy_buffer_stack_top > 0) | ||
2584 | --yyg->yy_buffer_stack_top; | ||
2585 | |||
2586 | if (YY_CURRENT_BUFFER) { | ||
2587 | yy_load_buffer_state(yyscanner ); | ||
2588 | yyg->yy_did_buffer_switch_on_eof = 1; | ||
2589 | } | ||
2590 | } | ||
2591 | |||
2592 | /* Allocates the stack if it does not exist. | ||
2593 | * Guarantees space for at least one push. | ||
2594 | */ | ||
2595 | static void yyensure_buffer_stack (yyscan_t yyscanner) | ||
2596 | { | ||
2597 | int num_to_alloc; | ||
2598 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2599 | |||
2600 | if (!yyg->yy_buffer_stack) { | ||
2601 | |||
2602 | /* First allocation is just for 2 elements, since we don't know if this | ||
2603 | * scanner will even need a stack. We use 2 instead of 1 to avoid an | ||
2604 | * immediate realloc on the next call. | ||
2605 | */ | ||
2606 | num_to_alloc = 1; | ||
2607 | yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc | ||
2608 | (num_to_alloc * sizeof(struct yy_buffer_state*) | ||
2609 | , yyscanner); | ||
2610 | |||
2611 | memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); | ||
2612 | |||
2613 | yyg->yy_buffer_stack_max = num_to_alloc; | ||
2614 | yyg->yy_buffer_stack_top = 0; | ||
2615 | return; | ||
2616 | } | ||
2617 | |||
2618 | if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ | ||
2619 | |||
2620 | /* Increase the buffer to prepare for a possible push. */ | ||
2621 | int grow_size = 8 /* arbitrary grow size */; | ||
2622 | |||
2623 | num_to_alloc = yyg->yy_buffer_stack_max + grow_size; | ||
2624 | yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc | ||
2625 | (yyg->yy_buffer_stack, | ||
2626 | num_to_alloc * sizeof(struct yy_buffer_state*) | ||
2627 | , yyscanner); | ||
2628 | |||
2629 | /* zero only the new slots.*/ | ||
2630 | memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); | ||
2631 | yyg->yy_buffer_stack_max = num_to_alloc; | ||
2632 | } | ||
2633 | } | ||
2634 | |||
2635 | /** Setup the input buffer state to scan directly from a user-specified character buffer. | ||
2636 | * @param base the character buffer | ||
2637 | * @param size the size in bytes of the character buffer | ||
2638 | * @param yyscanner The scanner object. | ||
2639 | * @return the newly allocated buffer state object. | ||
2640 | */ | ||
2641 | YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) | ||
2642 | { | ||
2643 | YY_BUFFER_STATE b; | ||
2644 | |||
2645 | if ( size < 2 || | ||
2646 | base[size-2] != YY_END_OF_BUFFER_CHAR || | ||
2647 | base[size-1] != YY_END_OF_BUFFER_CHAR ) | ||
2648 | /* They forgot to leave room for the EOB's. */ | ||
2649 | return 0; | ||
2650 | |||
2651 | b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); | ||
2652 | if ( ! b ) | ||
2653 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); | ||
2654 | |||
2655 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ | ||
2656 | b->yy_buf_pos = b->yy_ch_buf = base; | ||
2657 | b->yy_is_our_buffer = 0; | ||
2658 | b->yy_input_file = 0; | ||
2659 | b->yy_n_chars = b->yy_buf_size; | ||
2660 | b->yy_is_interactive = 0; | ||
2661 | b->yy_at_bol = 1; | ||
2662 | b->yy_fill_buffer = 0; | ||
2663 | b->yy_buffer_status = YY_BUFFER_NEW; | ||
2664 | |||
2665 | yy_switch_to_buffer(b ,yyscanner ); | ||
2666 | |||
2667 | return b; | ||
2668 | } | ||
2669 | |||
2670 | /** Setup the input buffer state to scan a string. The next call to yylex() will | ||
2671 | * scan from a @e copy of @a str. | ||
2672 | * @param str a NUL-terminated string to scan | ||
2673 | * @param yyscanner The scanner object. | ||
2674 | * @return the newly allocated buffer state object. | ||
2675 | * @note If you want to scan bytes that may contain NUL values, then use | ||
2676 | * yy_scan_bytes() instead. | ||
2677 | */ | ||
2678 | YY_BUFFER_STATE yy_scan_string (yyconst char * str , yyscan_t yyscanner) | ||
2679 | { | ||
2680 | |||
2681 | return yy_scan_bytes(str,strlen(str) ,yyscanner); | ||
2682 | } | ||
2683 | |||
2684 | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will | ||
2685 | * scan from a @e copy of @a bytes. | ||
2686 | * @param bytes the byte buffer to scan | ||
2687 | * @param len the number of bytes in the buffer pointed to by @a bytes. | ||
2688 | * @param yyscanner The scanner object. | ||
2689 | * @return the newly allocated buffer state object. | ||
2690 | */ | ||
2691 | YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner) | ||
2692 | { | ||
2693 | YY_BUFFER_STATE b; | ||
2694 | char *buf; | ||
2695 | yy_size_t n; | ||
2696 | int i; | ||
2697 | |||
2698 | /* Get memory for full buffer, including space for trailing EOB's. */ | ||
2699 | n = len + 2; | ||
2700 | buf = (char *) yyalloc(n ,yyscanner ); | ||
2701 | if ( ! buf ) | ||
2702 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); | ||
2703 | |||
2704 | for ( i = 0; i < len; ++i ) | ||
2705 | buf[i] = bytes[i]; | ||
2706 | |||
2707 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; | ||
2708 | |||
2709 | b = yy_scan_buffer(buf,n ,yyscanner); | ||
2710 | if ( ! b ) | ||
2711 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); | ||
2712 | |||
2713 | /* It's okay to grow etc. this buffer, and we should throw it | ||
2714 | * away when we're done. | ||
2715 | */ | ||
2716 | b->yy_is_our_buffer = 1; | ||
2717 | |||
2718 | return b; | ||
2719 | } | ||
2720 | |||
2721 | static void yy_push_state (int new_state , yyscan_t yyscanner) | ||
2722 | { | ||
2723 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2724 | if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth ) | ||
2725 | { | ||
2726 | yy_size_t new_size; | ||
2727 | |||
2728 | yyg->yy_start_stack_depth += YY_START_STACK_INCR; | ||
2729 | new_size = yyg->yy_start_stack_depth * sizeof( int ); | ||
2730 | |||
2731 | if ( ! yyg->yy_start_stack ) | ||
2732 | yyg->yy_start_stack = (int *) yyalloc(new_size ,yyscanner ); | ||
2733 | |||
2734 | else | ||
2735 | yyg->yy_start_stack = (int *) yyrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner ); | ||
2736 | |||
2737 | if ( ! yyg->yy_start_stack ) | ||
2738 | YY_FATAL_ERROR( | ||
2739 | "out of memory expanding start-condition stack" ); | ||
2740 | } | ||
2741 | |||
2742 | yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START; | ||
2743 | |||
2744 | BEGIN(new_state); | ||
2745 | } | ||
2746 | |||
2747 | static void yy_pop_state (yyscan_t yyscanner) | ||
2748 | { | ||
2749 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2750 | if ( --yyg->yy_start_stack_ptr < 0 ) | ||
2751 | YY_FATAL_ERROR( "start-condition stack underflow" ); | ||
2752 | |||
2753 | BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]); | ||
2754 | } | ||
2755 | |||
2756 | static int yy_top_state (yyscan_t yyscanner) | ||
2757 | { | ||
2758 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2759 | return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1]; | ||
2760 | } | ||
2761 | |||
2762 | #ifndef YY_EXIT_FAILURE | ||
2763 | #define YY_EXIT_FAILURE 2 | ||
2764 | #endif | ||
2765 | |||
2766 | static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) | ||
2767 | { | ||
2768 | (void) fprintf( stderr, "%s\n", msg ); | ||
2769 | exit( YY_EXIT_FAILURE ); | ||
2770 | } | ||
2771 | |||
2772 | /* Redefine yyless() so it works in section 3 code. */ | ||
2773 | |||
2774 | #undef yyless | ||
2775 | #define yyless(n) \ | ||
2776 | do \ | ||
2777 | { \ | ||
2778 | /* Undo effects of setting up yytext. */ \ | ||
2779 | int yyless_macro_arg = (n); \ | ||
2780 | YY_LESS_LINENO(yyless_macro_arg);\ | ||
2781 | yytext[yyleng] = yyg->yy_hold_char; \ | ||
2782 | yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ | ||
2783 | yyg->yy_hold_char = *yyg->yy_c_buf_p; \ | ||
2784 | *yyg->yy_c_buf_p = '\0'; \ | ||
2785 | yyleng = yyless_macro_arg; \ | ||
2786 | } \ | ||
2787 | while ( 0 ) | ||
2788 | |||
2789 | /* Accessor methods (get/set functions) to struct members. */ | ||
2790 | |||
2791 | /** Get the user-defined data for this scanner. | ||
2792 | * @param yyscanner The scanner object. | ||
2793 | */ | ||
2794 | YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) | ||
2795 | { | ||
2796 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2797 | return yyextra; | ||
2798 | } | ||
2799 | |||
2800 | /** Get the current line number. | ||
2801 | * @param yyscanner The scanner object. | ||
2802 | */ | ||
2803 | int yyget_lineno (yyscan_t yyscanner) | ||
2804 | { | ||
2805 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2806 | |||
2807 | if (! YY_CURRENT_BUFFER) | ||
2808 | return 0; | ||
2809 | |||
2810 | return yylineno; | ||
2811 | } | ||
2812 | |||
2813 | /** Get the current column number. | ||
2814 | * @param yyscanner The scanner object. | ||
2815 | */ | ||
2816 | int yyget_column (yyscan_t yyscanner) | ||
2817 | { | ||
2818 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2819 | |||
2820 | if (! YY_CURRENT_BUFFER) | ||
2821 | return 0; | ||
2822 | |||
2823 | return yycolumn; | ||
2824 | } | ||
2825 | |||
2826 | /** Get the input stream. | ||
2827 | * @param yyscanner The scanner object. | ||
2828 | */ | ||
2829 | FILE *yyget_in (yyscan_t yyscanner) | ||
2830 | { | ||
2831 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2832 | return yyin; | ||
2833 | } | ||
2834 | |||
2835 | /** Get the output stream. | ||
2836 | * @param yyscanner The scanner object. | ||
2837 | */ | ||
2838 | FILE *yyget_out (yyscan_t yyscanner) | ||
2839 | { | ||
2840 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2841 | return yyout; | ||
2842 | } | ||
2843 | |||
2844 | /** Get the length of the current token. | ||
2845 | * @param yyscanner The scanner object. | ||
2846 | */ | ||
2847 | int yyget_leng (yyscan_t yyscanner) | ||
2848 | { | ||
2849 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2850 | return yyleng; | ||
2851 | } | ||
2852 | |||
2853 | /** Get the current token. | ||
2854 | * @param yyscanner The scanner object. | ||
2855 | */ | ||
2856 | |||
2857 | char *yyget_text (yyscan_t yyscanner) | ||
2858 | { | ||
2859 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2860 | return yytext; | ||
2861 | } | ||
2862 | |||
2863 | /** Set the user-defined data. This data is never touched by the scanner. | ||
2864 | * @param user_defined The data to be associated with this scanner. | ||
2865 | * @param yyscanner The scanner object. | ||
2866 | */ | ||
2867 | void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) | ||
2868 | { | ||
2869 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2870 | yyextra = user_defined ; | ||
2871 | } | ||
2872 | |||
2873 | /** Set the current line number. | ||
2874 | * @param line_number | ||
2875 | * @param yyscanner The scanner object. | ||
2876 | */ | ||
2877 | void yyset_lineno (int line_number , yyscan_t yyscanner) | ||
2878 | { | ||
2879 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2880 | |||
2881 | /* lineno is only valid if an input buffer exists. */ | ||
2882 | if (! YY_CURRENT_BUFFER ) | ||
2883 | yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); | ||
2884 | |||
2885 | yylineno = line_number; | ||
2886 | } | ||
2887 | |||
2888 | /** Set the current column. | ||
2889 | * @param line_number | ||
2890 | * @param yyscanner The scanner object. | ||
2891 | */ | ||
2892 | void yyset_column (int column_no , yyscan_t yyscanner) | ||
2893 | { | ||
2894 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2895 | |||
2896 | /* column is only valid if an input buffer exists. */ | ||
2897 | if (! YY_CURRENT_BUFFER ) | ||
2898 | yy_fatal_error( "yyset_column called with no buffer" , yyscanner); | ||
2899 | |||
2900 | yycolumn = column_no; | ||
2901 | } | ||
2902 | |||
2903 | /** Set the input stream. This does not discard the current | ||
2904 | * input buffer. | ||
2905 | * @param in_str A readable stream. | ||
2906 | * @param yyscanner The scanner object. | ||
2907 | * @see yy_switch_to_buffer | ||
2908 | */ | ||
2909 | void yyset_in (FILE * in_str , yyscan_t yyscanner) | ||
2910 | { | ||
2911 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2912 | yyin = in_str ; | ||
2913 | } | ||
2914 | |||
2915 | void yyset_out (FILE * out_str , yyscan_t yyscanner) | ||
2916 | { | ||
2917 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2918 | yyout = out_str ; | ||
2919 | } | ||
2920 | |||
2921 | int yyget_debug (yyscan_t yyscanner) | ||
2922 | { | ||
2923 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2924 | return yy_flex_debug; | ||
2925 | } | ||
2926 | |||
2927 | void yyset_debug (int bdebug , yyscan_t yyscanner) | ||
2928 | { | ||
2929 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2930 | yy_flex_debug = bdebug ; | ||
2931 | } | ||
2932 | |||
2933 | /* Accessor methods for yylval and yylloc */ | ||
2934 | |||
2935 | static int yy_init_globals (yyscan_t yyscanner) | ||
2936 | { | ||
2937 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2938 | /* Initialization is the same as for the non-reentrant scanner. | ||
2939 | This function is called once per scanner lifetime. */ | ||
2940 | |||
2941 | yyg->yy_buffer_stack = 0; | ||
2942 | yyg->yy_buffer_stack_top = 0; | ||
2943 | yyg->yy_buffer_stack_max = 0; | ||
2944 | yyg->yy_c_buf_p = (char *) 0; | ||
2945 | yyg->yy_init = 1; | ||
2946 | yyg->yy_start = 0; | ||
2947 | yyg->yy_start_stack_ptr = 0; | ||
2948 | yyg->yy_start_stack_depth = 0; | ||
2949 | yyg->yy_start_stack = (int *) 0; | ||
2950 | |||
2951 | /* Defined in main.c */ | ||
2952 | #ifdef YY_STDINIT | ||
2953 | yyin = stdin; | ||
2954 | yyout = stdout; | ||
2955 | #else | ||
2956 | yyin = (FILE *) 0; | ||
2957 | yyout = (FILE *) 0; | ||
2958 | #endif | ||
2959 | |||
2960 | /* For future reference: Set errno on error, since we are called by | ||
2961 | * yylex_init() | ||
2962 | */ | ||
2963 | return 0; | ||
2964 | } | ||
2965 | |||
2966 | /* User-visible API */ | ||
2967 | |||
2968 | /* yylex_init is special because it creates the scanner itself, so it is | ||
2969 | * the ONLY reentrant function that doesn't take the scanner as the last argument. | ||
2970 | * That's why we explicitly handle the declaration, instead of using our macros. | ||
2971 | */ | ||
2972 | |||
2973 | int yylex_init(yyscan_t* ptr_yy_globals) | ||
2974 | |||
2975 | { | ||
2976 | if (ptr_yy_globals == NULL){ | ||
2977 | errno = EINVAL; | ||
2978 | return 1; | ||
2979 | } | ||
2980 | |||
2981 | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); | ||
2982 | |||
2983 | if (*ptr_yy_globals == NULL){ | ||
2984 | errno = ENOMEM; | ||
2985 | return 1; | ||
2986 | } | ||
2987 | |||
2988 | memset(*ptr_yy_globals,0,sizeof(struct yyguts_t)); | ||
2989 | |||
2990 | return yy_init_globals ( *ptr_yy_globals ); | ||
2991 | } | ||
2992 | |||
2993 | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ | ||
2994 | int yylex_destroy (yyscan_t yyscanner) | ||
2995 | { | ||
2996 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
2997 | |||
2998 | /* Pop the buffer stack, destroying each element. */ | ||
2999 | while(YY_CURRENT_BUFFER){ | ||
3000 | yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); | ||
3001 | YY_CURRENT_BUFFER_LVALUE = NULL; | ||
3002 | yypop_buffer_state(yyscanner); | ||
3003 | } | ||
3004 | |||
3005 | /* Destroy the stack itself. */ | ||
3006 | yyfree(yyg->yy_buffer_stack ,yyscanner); | ||
3007 | yyg->yy_buffer_stack = NULL; | ||
3008 | |||
3009 | /* Destroy the start condition stack. */ | ||
3010 | yyfree(yyg->yy_start_stack ,yyscanner ); | ||
3011 | yyg->yy_start_stack = NULL; | ||
3012 | |||
3013 | /* Destroy the main struct (reentrant only). */ | ||
3014 | yyfree ( yyscanner , yyscanner ); | ||
3015 | return 0; | ||
3016 | } | ||
3017 | |||
3018 | /* | ||
3019 | * Internal utility routines. | ||
3020 | */ | ||
3021 | |||
3022 | #ifndef yytext_ptr | ||
3023 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) | ||
3024 | { | ||
3025 | register int i; | ||
3026 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
3027 | for ( i = 0; i < n; ++i ) | ||
3028 | s1[i] = s2[i]; | ||
3029 | } | ||
3030 | #endif | ||
3031 | |||
3032 | #ifdef YY_NEED_STRLEN | ||
3033 | static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) | ||
3034 | { | ||
3035 | register int n; | ||
3036 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; | ||
3037 | for ( n = 0; s[n]; ++n ) | ||
3038 | ; | ||
3039 | |||
3040 | return n; | ||
3041 | } | ||
3042 | #endif | ||
3043 | |||
3044 | void *yyalloc (yy_size_t size , yyscan_t yyscanner) | ||
3045 | { | ||
3046 | return (void *) malloc( size ); | ||
3047 | } | ||
3048 | |||
3049 | void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) | ||
3050 | { | ||
3051 | /* The cast to (char *) in the following accommodates both | ||
3052 | * implementations that use char* generic pointers, and those | ||
3053 | * that use void* generic pointers. It works with the latter | ||
3054 | * because both ANSI C and C++ allow castless assignment from | ||
3055 | * any pointer type to void*, and deal with argument conversions | ||
3056 | * as though doing an assignment. | ||
3057 | */ | ||
3058 | return (void *) realloc( (char *) ptr, size ); | ||
3059 | } | ||
3060 | |||
3061 | void yyfree (void * ptr , yyscan_t yyscanner) | ||
3062 | { | ||
3063 | free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ | ||
3064 | } | ||
3065 | |||
3066 | #define YYTABLES_NAME "yytables" | ||
3067 | |||
3068 | #undef YY_NEW_FILE | ||
3069 | #undef YY_FLUSH_BUFFER | ||
3070 | #undef yy_set_bol | ||
3071 | #undef yy_new_buffer | ||
3072 | #undef yy_set_interactive | ||
3073 | #undef yytext_ptr | ||
3074 | #undef YY_DO_BEFORE_ACTION | ||
3075 | |||
3076 | #ifdef YY_DECL_IS_OURS | ||
3077 | #undef YY_DECL_IS_OURS | ||
3078 | #undef YY_DECL | ||
3079 | #endif | ||
3080 | #line 245 "bitbakescanner.l" | ||
3081 | |||
3082 | |||
3083 | |||
3084 | void lex_t::accept (int token, const char* sz) | ||
3085 | { | ||
3086 | token_t t; | ||
3087 | memset (&t, 0, sizeof (t)); | ||
3088 | t.copyString(sz); | ||
3089 | |||
3090 | /* tell lemon to parse the token */ | ||
3091 | parse (parser, token, t, this); | ||
3092 | } | ||
3093 | |||
3094 | int lex_t::line ()const | ||
3095 | { | ||
3096 | return yyget_lineno (scanner); | ||
3097 | } | ||
3098 | |||
3099 | void parse (FILE* file, PyObject* data) | ||
3100 | { | ||
3101 | void* parser = bbparseAlloc (malloc); | ||
3102 | yyscan_t scanner; | ||
3103 | lex_t lex; | ||
3104 | |||
3105 | yylex_init (&scanner); | ||
3106 | |||
3107 | lex.parser = parser; | ||
3108 | lex.scanner = scanner; | ||
3109 | lex.file = file; | ||
3110 | lex.data = data; | ||
3111 | lex.parse = bbparse; | ||
3112 | yyset_extra (&lex, scanner); | ||
3113 | |||
3114 | |||
3115 | int result = yylex (scanner); | ||
3116 | |||
3117 | lex.accept (0); | ||
3118 | bbparseTrace (NULL, NULL); | ||
3119 | |||
3120 | if (result != T_EOF) | ||
3121 | printf ("premature end of file\n"); | ||
3122 | |||
3123 | yylex_destroy (scanner); | ||
3124 | bbparseFree (parser, free); | ||
3125 | } | ||
3126 | |||
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakeparser.l b/bitbake/lib/bb/parse/parse_c/bitbakescanner.l index ee4ce14839..782bc57a0f 100644 --- a/bitbake/lib/bb/parse/parse_c/bitbakeparser.l +++ b/bitbake/lib/bb/parse/parse_c/bitbakescanner.l | |||
@@ -71,6 +71,7 @@ | |||
71 | 71 | ||
72 | #include "token.h" | 72 | #include "token.h" |
73 | #include "lexer.h" | 73 | #include "lexer.h" |
74 | #include "bitbakeparser.h" | ||
74 | #include <ctype.h> | 75 | #include <ctype.h> |
75 | 76 | ||
76 | extern void *bbparseAlloc(void *(*mallocProc)(size_t)); | 77 | extern void *bbparseAlloc(void *(*mallocProc)(size_t)); |
@@ -124,6 +125,7 @@ K_AFTER "after" | |||
124 | K_BEFORE "before" | 125 | K_BEFORE "before" |
125 | K_DEF "def" | 126 | K_DEF "def" |
126 | K_INCLUDE "include" | 127 | K_INCLUDE "include" |
128 | K_REQUIRE "require" | ||
127 | K_INHERIT "inherit" | 129 | K_INHERIT "inherit" |
128 | K_PYTHON "python" | 130 | K_PYTHON "python" |
129 | K_FAKEROOT "fakeroot" | 131 | K_FAKEROOT "fakeroot" |
@@ -149,6 +151,7 @@ PROC \({C_SP}*\) | |||
149 | %s S_FUNC | 151 | %s S_FUNC |
150 | %s S_INCLUDE | 152 | %s S_INCLUDE |
151 | %s S_INHERIT | 153 | %s S_INHERIT |
154 | %s S_REQUIRE | ||
152 | %s S_PROC | 155 | %s S_PROC |
153 | %s S_RVALUE | 156 | %s S_RVALUE |
154 | %s S_TASK | 157 | %s S_TASK |
@@ -186,6 +189,8 @@ PROC \({C_SP}*\) | |||
186 | 189 | ||
187 | {K_INCLUDE} { BEGIN S_INCLUDE; | 190 | {K_INCLUDE} { BEGIN S_INCLUDE; |
188 | yyextra->accept (T_INCLUDE); } | 191 | yyextra->accept (T_INCLUDE); } |
192 | {K_REQUIRE} { BEGIN S_REQUIRE; | ||
193 | yyextra->accept (T_REQUIRE); } | ||
189 | {K_INHERIT} { BEGIN S_INHERIT; | 194 | {K_INHERIT} { BEGIN S_INHERIT; |
190 | yyextra->accept (T_INHERIT); } | 195 | yyextra->accept (T_INHERIT); } |
191 | {K_ADDTASK} { BEGIN S_TASK; | 196 | {K_ADDTASK} { BEGIN S_TASK; |
@@ -224,7 +229,8 @@ PROC \({C_SP}*\) | |||
224 | <S_INHERIT>{SYMBOL} { yyextra->accept (T_ISYMBOL, yytext); } | 229 | <S_INHERIT>{SYMBOL} { yyextra->accept (T_ISYMBOL, yytext); } |
225 | <S_INCLUDE>{FILENAME} { BEGIN INITIAL; | 230 | <S_INCLUDE>{FILENAME} { BEGIN INITIAL; |
226 | yyextra->accept (T_ISYMBOL, yytext); } | 231 | yyextra->accept (T_ISYMBOL, yytext); } |
227 | 232 | <S_REQUIRE>{FILENAME} { BEGIN INITIAL; | |
233 | yyextra->accept (T_ISYMBOL, yytext); } | ||
228 | <S_TASK>\n { BEGIN INITIAL; } | 234 | <S_TASK>\n { BEGIN INITIAL; } |
229 | <S_FUNC>\n { BEGIN INITIAL; } | 235 | <S_FUNC>\n { BEGIN INITIAL; } |
230 | <S_INHERIT>\n { BEGIN INITIAL; } | 236 | <S_INHERIT>\n { BEGIN INITIAL; } |
@@ -253,12 +259,7 @@ int lex_t::line ()const | |||
253 | return yyget_lineno (scanner); | 259 | return yyget_lineno (scanner); |
254 | } | 260 | } |
255 | 261 | ||
256 | const char* lex_t::filename ()const | 262 | void parse (FILE* file, PyObject* data) |
257 | { | ||
258 | return m_fileName; | ||
259 | } | ||
260 | |||
261 | void parse (MappedFile* mf) | ||
262 | { | 263 | { |
263 | void* parser = bbparseAlloc (malloc); | 264 | void* parser = bbparseAlloc (malloc); |
264 | yyscan_t scanner; | 265 | yyscan_t scanner; |
@@ -268,9 +269,8 @@ void parse (MappedFile* mf) | |||
268 | 269 | ||
269 | lex.parser = parser; | 270 | lex.parser = parser; |
270 | lex.scanner = scanner; | 271 | lex.scanner = scanner; |
271 | lex.mf = mf; | 272 | lex.file = file; |
272 | lex.rgbInput = mf->m_rgb; | 273 | lex.data = data; |
273 | lex.cbInput = mf->m_cb; | ||
274 | lex.parse = bbparse; | 274 | lex.parse = bbparse; |
275 | yyset_extra (&lex, scanner); | 275 | yyset_extra (&lex, scanner); |
276 | 276 | ||
@@ -281,7 +281,7 @@ void parse (MappedFile* mf) | |||
281 | bbparseTrace (NULL, NULL); | 281 | bbparseTrace (NULL, NULL); |
282 | 282 | ||
283 | if (result != T_EOF) | 283 | if (result != T_EOF) |
284 | WARNING ("premature end of file\n"); | 284 | printf ("premature end of file\n"); |
285 | 285 | ||
286 | yylex_destroy (scanner); | 286 | yylex_destroy (scanner); |
287 | bbparseFree (parser, free); | 287 | bbparseFree (parser, free); |
diff --git a/bitbake/lib/bb/parse/parse_c/lexer.h b/bitbake/lib/bb/parse/parse_c/lexer.h index 1edf72dcf5..0a985edf23 100644 --- a/bitbake/lib/bb/parse/parse_c/lexer.h +++ b/bitbake/lib/bb/parse/parse_c/lexer.h | |||
@@ -24,17 +24,29 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
24 | #ifndef LEXER_H | 24 | #ifndef LEXER_H |
25 | #define LEXER_H | 25 | #define LEXER_H |
26 | 26 | ||
27 | /* | ||
28 | * The PyObject Token. Likely to be | ||
29 | * a bb.data implementation | ||
30 | */ | ||
31 | struct PyObject; | ||
32 | |||
33 | |||
34 | /** | ||
35 | * This is used by the Parser and Scanner | ||
36 | * of BitBake. | ||
37 | * The implementation and creation is done | ||
38 | * in the scanner. | ||
39 | */ | ||
27 | struct lex_t { | 40 | struct lex_t { |
28 | void *parser; | 41 | void *parser; |
29 | void *scanner; | 42 | void *scanner; |
43 | FILE *file; | ||
44 | PyObject *data; | ||
30 | void* (*parse)(void*, int, token_t, lex_t*); | 45 | void* (*parse)(void*, int, token_t, lex_t*); |
31 | 46 | ||
32 | void accept(int token, const char* string = 0); | 47 | void accept(int token, const char* string = 0); |
33 | void input(char *buf, int *result, int_max_size); | 48 | void input(char *buf, int *result, int max_size); |
34 | int line()const; | 49 | int line()const; |
35 | const char* filename()const; | ||
36 | private: | ||
37 | const char* m_fileName; | ||
38 | }; | 50 | }; |
39 | 51 | ||
40 | 52 | ||
diff --git a/bitbake/lib/bb/parse/parse_c/python_output.h b/bitbake/lib/bb/parse/parse_c/python_output.h new file mode 100644 index 0000000000..de7544cc9d --- /dev/null +++ b/bitbake/lib/bb/parse/parse_c/python_output.h | |||
@@ -0,0 +1,51 @@ | |||
1 | #ifndef PYTHON_OUTPUT_H | ||
2 | #define PYTHON_OUTPUT_H | ||
3 | /* | ||
4 | Copyright (C) 2006 Holger Hans Peter Freyther | ||
5 | |||
6 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
7 | of this software and associated documentation files (the "Software"), to deal | ||
8 | in the Software without restriction, including without limitation the rights | ||
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
10 | copies of the Software, and to permit persons to whom the Software is | ||
11 | furnished to do so, subject to the following conditions: | ||
12 | |||
13 | The above copyright notice and this permission notice shall be included in all | ||
14 | copies or substantial portions of the Software. | ||
15 | |||
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT | ||
19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
21 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR | ||
22 | THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
23 | |||
24 | This is the glue: | ||
25 | It will be called from the lemon grammar and will call into | ||
26 | python to set certain things. | ||
27 | |||
28 | */ | ||
29 | |||
30 | struct lex_t; | ||
31 | |||
32 | extern void e_assign(lex_t*, const char*, const char*); | ||
33 | extern void e_export(lex_t*, const char*); | ||
34 | extern void e_immediate(lex_t*, const char*, const char*); | ||
35 | extern void e_cond(lex_t*, const char*, const char*); | ||
36 | extern void e_assign(lex_t*, const char*, const char*); | ||
37 | extern void e_prepend(lex_t*, const char*, const char*); | ||
38 | extern void e_append(lex_t*, const char*, const char*); | ||
39 | extern void e_addtask(lex_t*, const char*, const char*, const char*); | ||
40 | extern void e_addhandler(lex_t*,const char*); | ||
41 | extern void e_export_func(lex_t*, const char*); | ||
42 | extern void e_inherit(lex_t*, const char*); | ||
43 | extern void e_include(lex_t*, const char*); | ||
44 | extern void e_require(lex_t*, const char*); | ||
45 | extern void e_proc(lex_t*, const char*, const char*); | ||
46 | extern void e_proc_python(lex_t*, const char*, const char*); | ||
47 | extern void e_proc_fakeroot(lex_t*, const char*, const char*); | ||
48 | extern void e_def(lex_t*, const char*, const char*, const char*); | ||
49 | extern void e_parse_error(lex_t*); | ||
50 | |||
51 | #endif // PYTHON_OUTPUT_H | ||
diff --git a/bitbake/lib/bb/parse/parse_c/token.h b/bitbake/lib/bb/parse/parse_c/token.h index 2351fda6b5..c6242015b7 100644 --- a/bitbake/lib/bb/parse/parse_c/token.h +++ b/bitbake/lib/bb/parse/parse_c/token.h | |||
@@ -24,13 +24,24 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
24 | #ifndef TOKEN_H | 24 | #ifndef TOKEN_H |
25 | #define TOKEN_H | 25 | #define TOKEN_H |
26 | 26 | ||
27 | #include <ctype.h> | ||
28 | #include <string.h> | ||
29 | |||
27 | #define PURE_METHOD | 30 | #define PURE_METHOD |
28 | 31 | ||
32 | |||
33 | /** | ||
34 | * Special Value for End Of File Handling. We set it to | ||
35 | * 1001 so we can have up to 1000 Terminal Symbols on | ||
36 | * grammar. Currenlty we have around 20 | ||
37 | */ | ||
38 | #define T_EOF 1001 | ||
39 | |||
29 | struct token_t { | 40 | struct token_t { |
30 | const char* string()const PURE_METHOD; | 41 | const char* string()const PURE_METHOD; |
31 | 42 | ||
32 | static char* concatString(const char* l, const char* r); | 43 | static char* concatString(const char* l, const char* r); |
33 | void assignString(const char* str); | 44 | void assignString(char* str); |
34 | void copyString(const char* str); | 45 | void copyString(const char* str); |
35 | 46 | ||
36 | void release_this(); | 47 | void release_this(); |
@@ -51,15 +62,17 @@ inline const char* token_t::string()const | |||
51 | inline char* token_t::concatString(const char* l, const char* r) | 62 | inline char* token_t::concatString(const char* l, const char* r) |
52 | { | 63 | { |
53 | size_t cb = (l ? strlen (l) : 0) + strlen (r) + 1; | 64 | size_t cb = (l ? strlen (l) : 0) + strlen (r) + 1; |
54 | r_sz = new char[cb]; | 65 | char *r_sz = new char[cb]; |
55 | *r_sz = 0; | 66 | *r_sz = 0; |
56 | if (l) strcat (r_sz, l); | 67 | |
68 | if (l) | ||
69 | strcat (r_sz, l); | ||
57 | strcat (r_sz, r); | 70 | strcat (r_sz, r); |
58 | 71 | ||
59 | return r_sz; | 72 | return r_sz; |
60 | } | 73 | } |
61 | 74 | ||
62 | inline void token_t::assignString(const char* str) | 75 | inline void token_t::assignString(char* str) |
63 | { | 76 | { |
64 | m_string = str; | 77 | m_string = str; |
65 | m_stringLen = str ? strlen(str) : 0; | 78 | m_stringLen = str ? strlen(str) : 0; |
@@ -70,7 +83,7 @@ inline void token_t::copyString(const char* str) | |||
70 | if( str ) { | 83 | if( str ) { |
71 | m_stringLen = strlen(str); | 84 | m_stringLen = strlen(str); |
72 | m_string = new char[m_stringLen+1]; | 85 | m_string = new char[m_stringLen+1]; |
73 | strcpy(m_string, str) | 86 | strcpy(m_string, str); |
74 | } | 87 | } |
75 | } | 88 | } |
76 | 89 | ||
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index fac3e85b36..422ce6f9ef 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -22,7 +22,7 @@ | |||
22 | Place, Suite 330, Boston, MA 02111-1307 USA.""" | 22 | Place, Suite 330, Boston, MA 02111-1307 USA.""" |
23 | 23 | ||
24 | import re, bb, os, sys | 24 | import re, bb, os, sys |
25 | import bb.fetch, bb.build | 25 | import bb.fetch, bb.build, bb.utils |
26 | from bb import debug, data, fetch, fatal | 26 | from bb import debug, data, fetch, fatal |
27 | 27 | ||
28 | from ConfHandler import include, localpath, obtain, init | 28 | from ConfHandler import include, localpath, obtain, init |
@@ -206,8 +206,8 @@ def feeder(lineno, s, fn, d): | |||
206 | return | 206 | return |
207 | else: | 207 | else: |
208 | text = '\n'.join(__body__) | 208 | text = '\n'.join(__body__) |
209 | comp = compile(text, "<bb>", "exec") | 209 | comp = bb.utils.better_compile(text, "<bb>", fn ) |
210 | exec comp in __builtins__ | 210 | bb.utils.better_exec(comp, __builtins__, text, fn) |
211 | __body__ = [] | 211 | __body__ = [] |
212 | __inpython__ = False | 212 | __inpython__ = False |
213 | funcs = data.getVar('__functions__', d) or "" | 213 | funcs = data.getVar('__functions__', d) or "" |
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index e2319aa123..5b3cb38d81 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -86,10 +86,77 @@ def explode_deps(s): | |||
86 | j = [] | 86 | j = [] |
87 | if flag: | 87 | if flag: |
88 | j.append(i) | 88 | j.append(i) |
89 | if i.endswith(')'): | 89 | else: |
90 | r.append(i) | ||
91 | if flag and i.endswith(')'): | ||
90 | flag = False | 92 | flag = False |
91 | # Ignore version | 93 | # Ignore version |
92 | #r[-1] += ' ' + ' '.join(j) | 94 | #r[-1] += ' ' + ' '.join(j) |
93 | else: | ||
94 | r.append(i) | ||
95 | return r | 95 | return r |
96 | |||
97 | |||
98 | |||
99 | def _print_trace(body, line): | ||
100 | """ | ||
101 | Print the Environment of a Text Body | ||
102 | """ | ||
103 | import bb | ||
104 | |||
105 | # print the environment of the method | ||
106 | bb.error("Printing the environment of the function") | ||
107 | min_line = max(1,line-4) | ||
108 | max_line = min(line+4,len(body)-1) | ||
109 | for i in range(min_line,max_line+1): | ||
110 | bb.error("\t%.4d:%s" % (i, body[i-1]) ) | ||
111 | |||
112 | |||
113 | def better_compile(text, file, realfile): | ||
114 | """ | ||
115 | A better compile method. This method | ||
116 | will print the offending lines. | ||
117 | """ | ||
118 | try: | ||
119 | return compile(text, file, "exec") | ||
120 | except Exception, e: | ||
121 | import bb,sys | ||
122 | |||
123 | # split the text into lines again | ||
124 | body = text.split('\n') | ||
125 | bb.error("Error in compiling: ", realfile) | ||
126 | bb.error("The lines resulting into this error were:") | ||
127 | bb.error("\t%d:%s:'%s'" % (e.lineno, e.__class__.__name__, body[e.lineno-1])) | ||
128 | |||
129 | _print_trace(body, e.lineno) | ||
130 | |||
131 | # exit now | ||
132 | sys.exit(1) | ||
133 | |||
134 | def better_exec(code, context, text, realfile): | ||
135 | """ | ||
136 | Similiar to better_compile, better_exec will | ||
137 | print the lines that are responsible for the | ||
138 | error. | ||
139 | """ | ||
140 | import bb,sys | ||
141 | try: | ||
142 | exec code in context | ||
143 | except: | ||
144 | (t,value,tb) = sys.exc_info() | ||
145 | |||
146 | if t in [bb.parse.SkipPackage, bb.build.FuncFailed]: | ||
147 | raise | ||
148 | |||
149 | # print the Header of the Error Message | ||
150 | bb.error("Error in executing: ", realfile) | ||
151 | bb.error("Exception:%s Message:%s" % (t,value) ) | ||
152 | |||
153 | # let us find the line number now | ||
154 | while tb.tb_next: | ||
155 | tb = tb.tb_next | ||
156 | |||
157 | import traceback | ||
158 | line = traceback.tb_lineno(tb) | ||
159 | |||
160 | _print_trace( text.split('\n'), line ) | ||
161 | |||
162 | raise | ||