MethodCallExprAST.py (8644:acf68e5a8cd7) | MethodCallExprAST.py (10075:7322d2b2ec76) |
---|---|
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; --- 126 unchanged lines hidden (view full) --- 135 if paramType.isInterface: 136 implements_interface = True 137 implemented_paramType.abstract_ident = paramType["interface"] 138 else: 139 implemented_paramType.abstract_ident = paramType.c_ident 140 141 implemented_paramTypes.append(implemented_paramType) 142 | 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; --- 126 unchanged lines hidden (view full) --- 135 if paramType.isInterface: 136 implements_interface = True 137 implemented_paramType.abstract_ident = paramType["interface"] 138 else: 139 implemented_paramType.abstract_ident = paramType.c_ident 140 141 implemented_paramTypes.append(implemented_paramType) 142 |
143 implementedMethodId = "" |
|
143 if implements_interface: | 144 if implements_interface: |
144 implementedMethodId = obj_type.methodIdAbstract(self.proc_name, 145 implemented_paramTypes) 146 else: 147 implementedMethodId = "" | 145 implementedMethodId = obj_type.methodIdAbstract( 146 self.proc_name, implemented_paramTypes) |
148 149 if implementedMethodId not in obj_type.methods: | 147 148 if implementedMethodId not in obj_type.methods: |
150 self.error("Invalid method call: " \ 151 "Type '%s' does not have a method %s, '%s' nor '%s'", 152 obj_type, self.proc_name, methodId, implementedMethodId) 153 else: 154 # 155 # Replace the methodId with the implementedMethodId found in 156 # the method list. 157 # 158 methodId = implementedMethodId 159 return_type = obj_type.methods[methodId].return_type | 149 self.error("Invalid method call: Type '%s' " \ 150 "does not have a method %s, '%s' nor '%s'", 151 obj_type, self.proc_name, methodId, 152 implementedMethodId) |
160 | 153 |
154 # Replace the methodId with the implementedMethodId 155 # found in the method list. 156 methodId = implementedMethodId 157 return_type = obj_type.methods[methodId].return_type 158 |
|
161 if return_type.isInterface: 162 prefix = "static_cast<%s &>" % return_type.c_ident 163 164 if str(obj_type) == "AbstractCacheEntry" or \ 165 str(obj_type) == "AbstractEntry" or \ 166 ("interface" in obj_type and ( 167 obj_type["interface"] == "AbstractCacheEntry" or 168 obj_type["interface"] == "AbstractEntry")): --- 27 unchanged lines hidden --- | 159 if return_type.isInterface: 160 prefix = "static_cast<%s &>" % return_type.c_ident 161 162 if str(obj_type) == "AbstractCacheEntry" or \ 163 str(obj_type) == "AbstractEntry" or \ 164 ("interface" in obj_type and ( 165 obj_type["interface"] == "AbstractCacheEntry" or 166 obj_type["interface"] == "AbstractEntry")): --- 27 unchanged lines hidden --- |