Type.py (6877:2a1a3d916ca8) | Type.py (6882:898047a3672c) |
---|---|
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 37 unchanged lines hidden (view full) --- 46 def __init__(self, return_type, param_types): 47 self.return_type = return_type 48 self.param_types = param_types 49 50class Type(Symbol): 51 def __init__(self, table, ident, location, pairs, machine=None): 52 super(Type, self).__init__(table, ident, location, pairs) 53 self.c_ident = ident | 1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 37 unchanged lines hidden (view full) --- 46 def __init__(self, return_type, param_types): 47 self.return_type = return_type 48 self.param_types = param_types 49 50class Type(Symbol): 51 def __init__(self, table, ident, location, pairs, machine=None): 52 super(Type, self).__init__(table, ident, location, pairs) 53 self.c_ident = ident |
54 self.abstract_ident = "" |
|
54 if machine: 55 if self.isExternal or self.isPrimitive: 56 if "external_name" in self: 57 self.c_ident = self["external_name"] 58 else: 59 # Append with machine name 60 self.c_ident = "%s_%s" % (machine, ident) 61 --- 87 unchanged lines hidden (view full) --- 149 return True 150 151 def dataMemberType(self, ident): 152 return self.data_members[ident].type 153 154 def methodId(self, name, param_type_vec): 155 return '_'.join([name] + [ pt.c_ident for pt in param_type_vec ]) 156 | 55 if machine: 56 if self.isExternal or self.isPrimitive: 57 if "external_name" in self: 58 self.c_ident = self["external_name"] 59 else: 60 # Append with machine name 61 self.c_ident = "%s_%s" % (machine, ident) 62 --- 87 unchanged lines hidden (view full) --- 150 return True 151 152 def dataMemberType(self, ident): 153 return self.data_members[ident].type 154 155 def methodId(self, name, param_type_vec): 156 return '_'.join([name] + [ pt.c_ident for pt in param_type_vec ]) 157 |
158 def methodIdAbstract(self, name, param_type_vec): 159 return '_'.join([name] + [ pt.abstract_ident for pt in param_type_vec ]) 160 |
|
157 def methodAdd(self, name, return_type, param_type_vec): 158 ident = self.methodId(name, param_type_vec) 159 if ident in self.methods: 160 return False 161 162 self.methods[ident] = Method(return_type, param_type_vec) 163 return True 164 --- 487 unchanged lines hidden --- | 161 def methodAdd(self, name, return_type, param_type_vec): 162 ident = self.methodId(name, param_type_vec) 163 if ident in self.methods: 164 return False 165 166 self.methods[ident] = Method(return_type, param_type_vec) 167 return True 168 --- 487 unchanged lines hidden --- |