ObjDeclAST.py (10005:8c2b0dc16ccd) ObjDeclAST.py (10075:7322d2b2ec76)
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;

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

34
35 self.type_ast = type_ast
36 self.ident = ident
37
38 def __repr__(self):
39 return "[ObjDecl: %r]" % self.ident
40
41 def generate(self):
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;

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

34
35 self.type_ast = type_ast
36 self.ident = ident
37
38 def __repr__(self):
39 return "[ObjDecl: %r]" % self.ident
40
41 def generate(self):
42 machineComponentSym = False
43
44 if "network" in self and not ("virtual_network" in self or
45 "physical_network" in self) :
46 self.error("Network queues require a 'virtual_network' attribute")
47
48 type = self.type_ast.type
49 if type.isBuffer and "ordered" not in self:
50 self.error("Buffer object decls require an 'ordered' attribute")
51

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

79
80 v = Var(self.symtab, self.ident, self.location, type, c_code,
81 self.pairs, machine)
82
83 if machine:
84 machine.addObject(v)
85
86 self.symtab.newSymbol(v)
42 if "network" in self and not ("virtual_network" in self or
43 "physical_network" in self) :
44 self.error("Network queues require a 'virtual_network' attribute")
45
46 type = self.type_ast.type
47 if type.isBuffer and "ordered" not in self:
48 self.error("Buffer object decls require an 'ordered' attribute")
49

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

77
78 v = Var(self.symtab, self.ident, self.location, type, c_code,
79 self.pairs, machine)
80
81 if machine:
82 machine.addObject(v)
83
84 self.symtab.newSymbol(v)
87
88 # used to cheat-- that is, access components in other machines
89 if machineComponentSym:
90 self.symtab.newMachComponentSym(v)