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; --- 11 unchanged lines hidden (view full) --- 20# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 |
28from slicc.symbols.Symbol import Symbol 29from slicc.symbols.Type import Type 30 31class Func(Symbol): 32 def __init__(self, table, ident, location, return_type, param_types, 33 param_strings, body, pairs, machine): 34 super(Func, self).__init__(table, ident, location, pairs) 35 self.return_type = return_type --- 28 unchanged lines hidden (view full) --- 64 return "%s %s(%s);" % (return_type, self.c_ident, 65 ", ".join(self.param_strings)) 66 67 def writeCodeFiles(self, path): 68 '''This write a function of object Chip''' 69 if "external" in self: 70 return 71 |
72 code = self.symtab.codeFormatter() |
73 74 # Header 75 code(''' 76/** Auto generated C++ code started by $__file__:$__line__ */ 77 78#include "mem/protocol/Types.hh" 79''') 80 --- 25 unchanged lines hidden --- |