FuncDeclAST.py (6657:ef5fae93a3b2) FuncDeclAST.py (6714:028047200ff7)
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;

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

37 self.return_type = return_type
38 self.ident = ident
39 self.formals = formals
40 self.statements = statements
41
42 def __repr__(self):
43 return "[FuncDecl: %s]" % self.ident
44
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;

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

37 self.return_type = return_type
38 self.ident = ident
39 self.formals = formals
40 self.statements = statements
41
42 def __repr__(self):
43 return "[FuncDecl: %s]" % self.ident
44
45 def files(self, hh, cc, parent=None):
45 def files(self, parent=None):
46 if "external" in self or self.statements is None:
46 if "external" in self or self.statements is None:
47 return
47 return set()
48
49 if parent:
50 ident = "%s_%s" % (parent, self.ident)
51 else:
52 ident = self.ident
48
49 if parent:
50 ident = "%s_%s" % (parent, self.ident)
51 else:
52 ident = self.ident
53 cc.add("%s.cc" % ident)
53 return set(("%s.cc" % ident,))
54
55 def generate(self):
56 types = []
57 params = []
58 void_type = self.symtab.find("void", Type)
59
60 # Generate definition code
61 self.symtab.pushFrame()

--- 27 unchanged lines hidden ---
54
55 def generate(self):
56 types = []
57 params = []
58 void_type = self.symtab.find("void", Type)
59
60 # Generate definition code
61 self.symtab.pushFrame()

--- 27 unchanged lines hidden ---