FuncDeclAST.py (9298:9a087e046c58) | FuncDeclAST.py (10307:6df951dcd7d9) |
---|---|
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; --- 43 unchanged lines hidden (view full) --- 52 self.symtab.pushFrame() 53 54 # Lookup return type 55 return_type = self.return_type.type 56 57 # Generate function header 58 for formal in self.formals: 59 # Lookup parameter types | 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; --- 43 unchanged lines hidden (view full) --- 52 self.symtab.pushFrame() 53 54 # Lookup return type 55 return_type = self.return_type.type 56 57 # Generate function header 58 for formal in self.formals: 59 # Lookup parameter types |
60 type, ident = formal.generate() 61 types.append(type) 62 params.append(ident) | 60 try: 61 type, ident = formal.generate() 62 types.append(type) 63 params.append(ident) |
63 | 64 |
65 except AttributeError: 66 types.append(formal.type) 67 params.append(None) 68 |
|
64 body = self.slicc.codeFormatter() 65 if self.statements is None: 66 self["external"] = "yes" 67 else: 68 rtype = self.statements.generate(body, return_type) 69 70 self.symtab.popFrame() 71 --- 15 unchanged lines hidden --- | 69 body = self.slicc.codeFormatter() 70 if self.statements is None: 71 self["external"] = "yes" 72 else: 73 rtype = self.statements.generate(body, return_type) 74 75 self.symtab.popFrame() 76 --- 15 unchanged lines hidden --- |