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