MethodCallExprAST.py (7839:9e556fb25900) MethodCallExprAST.py (8341:30daf1dd5c91)
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;

--- 146 unchanged lines hidden (view full) ---

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
160
161 if return_type.isInterface:
162 prefix = "static_cast<%s &>" % return_type.c_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;

--- 146 unchanged lines hidden (view full) ---

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
160
161 if return_type.isInterface:
162 prefix = "static_cast<%s &>" % return_type.c_ident
163 prefix = "%s((%s)." % (prefix, code)
164
163
164 if str(obj_type) == "AbstractCacheEntry" or \
165 ("interface" in obj_type and
166 obj_type["interface"] == "AbstractCacheEntry"):
167 prefix = "%s((*(%s))." % (prefix, code)
168 else:
169 prefix = "%s((%s)." % (prefix, code)
170
165 return obj_type, methodId, prefix
166
167
168class ClassMethodCallExprAST(MethodCallExprAST):
169 def __init__(self, slicc, type_ast, proc_name, expr_ast_vec):
170 s = super(ClassMethodCallExprAST, self)
171 s.__init__(slicc, proc_name, expr_ast_vec)
172

--- 15 unchanged lines hidden ---
171 return obj_type, methodId, prefix
172
173
174class ClassMethodCallExprAST(MethodCallExprAST):
175 def __init__(self, slicc, type_ast, proc_name, expr_ast_vec):
176 s = super(ClassMethodCallExprAST, self)
177 s.__init__(slicc, proc_name, expr_ast_vec)
178

--- 15 unchanged lines hidden ---