FormalParamAST.py (6882:898047a3672c) FormalParamAST.py (7839:9e556fb25900)
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;

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

43 def name(self):
44 return self.ident
45
46 def generate(self):
47 type = self.type_ast.type
48 param = "param_%s" % self.ident
49
50 # Add to symbol table
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;

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

43 def name(self):
44 return self.ident
45
46 def generate(self):
47 type = self.type_ast.type
48 param = "param_%s" % self.ident
49
50 # Add to symbol table
51 v = Var(self.symtab, self.ident, self.location, type, param,
52 self.pairs)
53 self.symtab.newSymbol(v)
51 if self.pointer or str(type) == "TBE" or (
52 "interface" in type and type["interface"] == "AbstractCacheEntry"):
53
54 v = Var(self.symtab, self.ident, self.location, type,
55 "(*%s)" % param, self.pairs)
56 self.symtab.newSymbol(v)
57 return type, "%s* %s" % (type.c_ident, param)
58
59 else:
60 v = Var(self.symtab, self.ident, self.location, type, param,
61 self.pairs)
62 self.symtab.newSymbol(v)
63
54 return type, "%s %s" % (type.c_ident, param)
64 return type, "%s %s" % (type.c_ident, param)