ExprStatementAST.py (6999:f226c098c393) ExprStatementAST.py (10226:056363356d15)
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 return "[ExprStatementAST: %s]" % (self.expr)
38
39 def generate(self, code, return_type):
40 actual_type,rcode = self.expr.inline(True)
41 code("$rcode;")
42
43 # The return type must be void
44 if actual_type != self.symtab.find("void", Type):
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 return "[ExprStatementAST: %s]" % (self.expr)
38
39 def generate(self, code, return_type):
40 actual_type,rcode = self.expr.inline(True)
41 code("$rcode;")
42
43 # The return type must be void
44 if actual_type != self.symtab.find("void", Type):
45 self.expr.error("Non-void return must not be ignored, " + \
46 "return type is '%s'", actual_type.ident)
45 self.expr.warning("Non-void return ignored, " + \
46 "return type is '%s'", actual_type.ident)
47
48 def findResources(self, resources):
49 self.expr.findResources(resources)
50
47
48 def findResources(self, resources):
49 self.expr.findResources(resources)
50