MethodCallExprAST.py (6690:4dc4e494e4d8) MethodCallExprAST.py (6780:2d3fc2e6f368)
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;

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

92 def generate_prefix(self, paramTypes):
93 code = code_formatter()
94
95 # member method call
96 obj_type = self.obj_expr_ast.generate(code)
97 methodId = obj_type.methodId(self.proc_name, paramTypes)
98
99 prefix = ""
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;

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

92 def generate_prefix(self, paramTypes):
93 code = code_formatter()
94
95 # member method call
96 obj_type = self.obj_expr_ast.generate(code)
97 methodId = obj_type.methodId(self.proc_name, paramTypes)
98
99 prefix = ""
100 if methodId not in obj_type.methods:
101 self.error("Invalid method call: Type '%s' does not have a method '%s'",
102 obj_type, methodId)
100 return_type = obj_type.methods[methodId].return_type
101 if return_type.isInterface:
102 prefix = "static_cast<%s &>" % return_type.c_ident
103 prefix = "%s((%s)." % (prefix, code)
104
105 return obj_type, methodId, prefix
106
107

--- 20 unchanged lines hidden ---
103 return_type = obj_type.methods[methodId].return_type
104 if return_type.isInterface:
105 prefix = "static_cast<%s &>" % return_type.c_ident
106 prefix = "%s((%s)." % (prefix, code)
107
108 return obj_type, methodId, prefix
109
110

--- 20 unchanged lines hidden ---