Jack Jansen | 0c06992 | 2002-08-04 21:34:24 +0000 | [diff] [blame] | 1 | # IBCarbonscan.py |
| 2 | |
| 3 | import sys |
| 4 | import os |
| 5 | import string |
| 6 | import MacOS |
| 7 | |
Jack Jansen | acbaefd | 2002-08-04 21:59:37 +0000 | [diff] [blame] | 8 | BGENDIR= '/Users/jack/src/python/Tools/bgen/bgen' |
Jack Jansen | 0c06992 | 2002-08-04 21:34:24 +0000 | [diff] [blame] | 9 | sys.path.append(BGENDIR) |
| 10 | print sys.path, sys.prefix |
| 11 | from bgenlocations import TOOLBOXDIR |
| 12 | |
| 13 | from scantools import Scanner_OSX |
| 14 | |
| 15 | def main(): |
| 16 | print "---Scanning IBCarbonRuntime.h---" |
| 17 | input = ["IBCarbonRuntime.h"] |
| 18 | output = "IBCarbongen.py" |
| 19 | defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py" |
| 20 | scanner = IBCarbon_Scanner(input, output, defsoutput) |
| 21 | scanner.scan() |
| 22 | scanner.close() |
| 23 | print "--done scanning, importing--" |
| 24 | import IBCarbonsupport |
| 25 | print "done" |
| 26 | |
| 27 | class IBCarbon_Scanner(Scanner_OSX): |
Jack Jansen | acbaefd | 2002-08-04 21:59:37 +0000 | [diff] [blame] | 28 | |
Jack Jansen | 0c06992 | 2002-08-04 21:34:24 +0000 | [diff] [blame] | 29 | def destination(self, type, name, arglist): |
| 30 | classname = "IBCarbonFunction" |
| 31 | listname = "functions" |
| 32 | if arglist: |
| 33 | t, n, m = arglist[0] |
| 34 | if t == "IBNibRef" and m == "InMode": |
| 35 | classname = "IBCarbonMethod" |
| 36 | listname = "methods" |
| 37 | return classname, listname |
| 38 | |
| 39 | def makeblacklistnames(self): |
| 40 | return [ |
| 41 | "DisposeNibReference", # taken care of by destructor |
| 42 | "CreateNibReferenceWithCFBundle", ## need to wrap CFBundle.h properly first |
| 43 | ] |
Jack Jansen | acbaefd | 2002-08-04 21:59:37 +0000 | [diff] [blame] | 44 | |
| 45 | def makerepairinstructions(self): |
| 46 | return [] |
| 47 | |
Jack Jansen | 0c06992 | 2002-08-04 21:34:24 +0000 | [diff] [blame] | 48 | |
| 49 | if __name__ == "__main__": |
| 50 | main() |