summaryrefslogtreecommitdiffstats
path: root/Tools/bgen
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-06 12:55:40 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-06-06 12:55:40 (GMT)
commitae8a68f40cd56aa952520260970ebd5b9d3fb95c (patch)
treee1d470857f4a2fb83fe4fae48509f0babb93852c /Tools/bgen
parentc7cfb9555974e2e3789a629f1b7509eaa73ee2c6 (diff)
downloadcpython-ae8a68f40cd56aa952520260970ebd5b9d3fb95c.zip
cpython-ae8a68f40cd56aa952520260970ebd5b9d3fb95c.tar.gz
cpython-ae8a68f40cd56aa952520260970ebd5b9d3fb95c.tar.bz2
Trying again to check it in. Changes to:
- Use Universal Headers as input - Change addpack calls to not depend on Guido's disklayout - Checkge testprograms to use new names for some functions
Diffstat (limited to 'Tools/bgen')
-rw-r--r--Tools/bgen/bgen/bgenBuffer.py6
-rw-r--r--Tools/bgen/bgen/macsupport.py8
-rw-r--r--Tools/bgen/bgen/scantools.py10
3 files changed, 15 insertions, 9 deletions
diff --git a/Tools/bgen/bgen/bgenBuffer.py b/Tools/bgen/bgen/bgenBuffer.py
index b7abe9d..af9fb19 100644
--- a/Tools/bgen/bgen/bgenBuffer.py
+++ b/Tools/bgen/bgen/bgenBuffer.py
@@ -68,9 +68,9 @@ class FixedInputOutputBufferType(InputOnlyType):
self.size)
Output("goto %s__error__;", name)
OutRbrace()
- self.transferSize()
+ self.transferSize(name)
- def transferSize():
+ def transferSize(self, name):
Output("%s__len__ = %s__in_len__;", name, name)
def passOutput(self, name):
@@ -174,7 +174,7 @@ class StructInputOutputBufferType(FixedInputOutputBufferType):
def getargsArgs(self, name):
return "(char **)&%s__in__, &%s__in_len__" % (name, name)
- def transferSize(self):
+ def transferSize(self, name):
pass
def passInput(self, name):
diff --git a/Tools/bgen/bgen/macsupport.py b/Tools/bgen/bgen/macsupport.py
index 4839cb6..f17bb96 100644
--- a/Tools/bgen/bgen/macsupport.py
+++ b/Tools/bgen/bgen/macsupport.py
@@ -32,11 +32,15 @@ ResType = OSTypeType("ResType")
# Handles (always resources in our case)
Handle = OpaqueByValueType("Handle", "ResObj")
MenuHandle = OpaqueByValueType("MenuHandle", "MenuObj")
+MenuRef = MenuHandle
ControlHandle = OpaqueByValueType("ControlHandle", "CtlObj")
+ControlRef = ControlHandle
# Windows and Dialogs
WindowPtr = OpaqueByValueType("WindowPtr", "WinObj")
+WindowRef = WindowPtr
DialogPtr = OpaqueByValueType("DialogPtr", "DlgObj")
+DialogRef = DialogPtr
ExistingWindowPtr = OpaqueByValueType("WindowPtr", "WinObj_WhichWindow", "BUG")
ExistingDialogPtr = OpaqueByValueType("DialogPtr", "WinObj_WhichWindow", "BUG")
@@ -137,8 +141,8 @@ class MacModule(Module):
_SetOutputFileName = SetOutputFileName # Save original
def SetOutputFileName(file = None):
- "Set the output file name and set its creator&type to KAHL&TEXT"
+ "Set the output file name and set its creator&type to MPCC&TEXT"
_SetOutputFileName(file)
if file:
import MacOS
- MacOS.SetCreatorAndType(file, 'KAHL', 'TEXT')
+ MacOS.SetCreatorAndType(file, 'MPCC', 'TEXT')
diff --git a/Tools/bgen/bgen/scantools.py b/Tools/bgen/bgen/scantools.py
index ff76d6c..3d546d8 100644
--- a/Tools/bgen/bgen/scantools.py
+++ b/Tools/bgen/bgen/scantools.py
@@ -27,8 +27,10 @@ except ImportError:
MacOS = None
# Default preferences
-CREATOR = 'KAHL' # My favorite text editor on the Mac
-INCLUDEDIR = "D:Development:THINK C:Mac #includes:Apple #includes:"
+#CREATOR = 'KAHL' # Guido's favorite text editor on the Mac
+#INCLUDEDIR = "D:Development:THINK C:Mac #includes:Apple #includes:"
+CREATOR = 'MPCC' # Jack's favorite text editor on the Mac
+INCLUDEDIR = "Moes:CW5 GOLD Ä:Metrowerks C/C++ Ä:Headers Ä:Universal Headers 2.0a3 Ä:"
Error = "scantools.Error"
@@ -203,9 +205,9 @@ class Scanner:
self.includepath = [':', INCLUDEDIR]
def initpatterns(self):
- self.head_pat = "^pascal[ \t]+" # XXX Mac specific!
+ self.head_pat = "^extern pascal[ \t]+" # XXX Mac specific!
self.tail_pat = "[;={}]"
- self.type_pat = "pascal[ \t\n]+\(<type>[a-zA-Z0-9_]+\)[ \t\n]+"
+ self.type_pat = "pascal[ \t\n]+\(<type>[a-zA-Z0-9_ \t]*[a-zA-Z0-9_]\)[ \t\n]+"
self.name_pat = "\(<name>[a-zA-Z0-9_]+\)[ \t\n]*"
self.args_pat = "(\(<args>\([^(;=)]+\|([^(;=)]*)\)*\))"
self.whole_pat = self.type_pat + self.name_pat + self.args_pat