Kaydet (Commit) 8ed81303 authored tarafından Jack Jansen's avatar Jack Jansen

Use new multi-input-file feature of bgen in stead of @-file hack to parse…

Use new multi-input-file feature of bgen in stead of @-file hack to parse multiple header files. A side effect is that the ObjectSupportLib routines are now also available in Python.
üst 6fe608c8
This diff is collapsed.
...@@ -16,36 +16,11 @@ from bgenlocations import TOOLBOXDIR ...@@ -16,36 +16,11 @@ from bgenlocations import TOOLBOXDIR
from scantools import Scanner from scantools import Scanner
def main(): def main():
print "=== Scanning AERegistry.h for defines ===" print "=== Scanning AEDataModel.h, AppleEvents.h, AERegistry.h, AEObjects.h ==="
input = "AERegistry.h" input = ["AEDataModel.h", "AppleEvents.h", "AERegistry.h", "AEObjects.h"]
output = "@dummy-registry.py"
defsoutput = TOOLBOXDIR + "AERegistry.py"
scanner = AppleEventsRegScanner(input, output, defsoutput)
scanner.scan()
scanner.close()
print "=== Scanning AEObjects.h for defines ==="
# XXXX This isn't correct. We only scan AEObjects.h for defines, but there
# are some functions in there that are probably useful (the accessor stuff)
# once we start writing servers in python.
input = "AEObjects.h"
output = "@dummy-objects.py"
defsoutput = TOOLBOXDIR + "AEObjects.py"
scanner = AppleEventsScanner(input, output, defsoutput)
scanner.scan()
scanner.close()
print "=== Scanning AEDataModel.h ==="
input = "AEDataModel.h"
output = "aedatamodelgen.py"
defsoutput = TOOLBOXDIR + "AEDataModel.py"
scanner = AppleEventsScanner(input, output, defsoutput)
scanner.scan()
scanner.close()
print "=== Scanning AppleEvents.h ==="
input = "AppleEvents.h"
output = "aegen.py" output = "aegen.py"
defsoutput = TOOLBOXDIR + "AppleEvents.py" defsoutput = TOOLBOXDIR + "AppleEvents.py"
scanner = AppleEventsRegScanner(input, output, defsoutput) scanner = AppleEventsScanner(input, output, defsoutput)
scanner.scan() scanner.scan()
scanner.close() scanner.close()
print "=== Done Scanning and Generating, now doing 'import aesupport' ===" print "=== Done Scanning and Generating, now doing 'import aesupport' ==="
...@@ -89,6 +64,8 @@ class AppleEventsScanner(Scanner): ...@@ -89,6 +64,8 @@ class AppleEventsScanner(Scanner):
"AEArrayType", "AEArrayType",
"AECoercionHandlerUPP", "AECoercionHandlerUPP",
"UniversalProcPtr", "UniversalProcPtr",
"OSLCompareUPP",
"OSLAccessorUPP",
] ]
def makerepairinstructions(self): def makerepairinstructions(self):
...@@ -125,10 +102,5 @@ class AppleEventsScanner(Scanner): ...@@ -125,10 +102,5 @@ class AppleEventsScanner(Scanner):
def writeinitialdefs(self): def writeinitialdefs(self):
self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n") self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
class AppleEventsRegScanner(AppleEventsScanner):
def writeinitialdefs(self):
self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
self.defsfile.write("from AEDataModel import *\n")
if __name__ == "__main__": if __name__ == "__main__":
main() main()
...@@ -193,7 +193,7 @@ functions = [] ...@@ -193,7 +193,7 @@ functions = []
aedescmethods = [] aedescmethods = []
execfile('aegen.py') execfile('aegen.py')
execfile('aedatamodelgen.py') ##execfile('aedatamodelgen.py')
for f in functions: module.add(f) for f in functions: module.add(f)
for f in aedescmethods: aedescobject.add(f) for f in aedescmethods: aedescobject.add(f)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment