FuncDeclAST.py (6999:f226c098c393) FuncDeclAST.py (8478:435179113834)
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;

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

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

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

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

--- 26 unchanged lines hidden ---
46 def generate(self):
47 types = []
48 params = []
49 void_type = self.symtab.find("void", Type)
50
51 # Generate definition code
52 self.symtab.pushFrame()
53

--- 26 unchanged lines hidden ---