Deleted Added
sdiff udiff text old ( 8337:b9ba22cb23f2 ) new ( 8478:435179113834 )
full compact
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;

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

59 return_type += "&"
60 elif "return_by_pointer" in self and self.return_type != void_type:
61 return_type += "*"
62
63 return "%s %s(%s);" % (return_type, self.c_ident,
64 ", ".join(self.param_strings))
65
66 def writeCodeFiles(self, path):
67 return
68
69 def generateCode(self):
70 '''This write a function of object Chip'''
71 if "external" in self:
72 return ""
73
74 code = self.symtab.codeFormatter()
75
76 # Generate function header
77 void_type = self.symtab.find("void", Type)
78 return_type = self.return_type.c_ident
79 if "return_by_ref" in self and self.return_type != void_type:
80 return_type += "&"
81 if "return_by_pointer" in self and self.return_type != void_type:
82 return_type += "*"
83

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

90
91 code('''
92$return_type
93${klass}::${{self.c_ident}}($params)
94{
95${{self.body}}
96}
97''')
98 return str(code)
99
100__all__ = [ "Func" ]