InPortDeclAST.py (10984:a86f453a7caa) InPortDeclAST.py (11025:4872dbdea907)
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;

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

67
68 # Check for Event
69 type = symtab.find("Event", Type)
70 if type is None:
71 self.error("in_port decls require 'Event' enumeration defined")
72 param_types.append(type)
73
74 # Check for Address
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;

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

67
68 # Check for Event
69 type = symtab.find("Event", Type)
70 if type is None:
71 self.error("in_port decls require 'Event' enumeration defined")
72 param_types.append(type)
73
74 # Check for Address
75 type = symtab.find("Address", Type)
75 type = symtab.find("Addr", Type)
76 if type is None:
76 if type is None:
77 self.error("in_port decls require 'Address' type to be defined")
77 self.error("in_port decls require 'Addr' type to be defined")
78
79 param_types.append(type)
80
81 if machine.EntryType != None:
82 param_types.append(machine.EntryType)
83 if machine.TBEType != None:
84 param_types.append(machine.TBEType)
85

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

102 # Check for Event2
103 type = symtab.find("Event", Type)
104 if type is None:
105 self.error("in_port decls require 'Event' enumeration")
106
107 param_types.append(type)
108
109 # Check for Address2
78
79 param_types.append(type)
80
81 if machine.EntryType != None:
82 param_types.append(machine.EntryType)
83 if machine.TBEType != None:
84 param_types.append(machine.TBEType)
85

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

102 # Check for Event2
103 type = symtab.find("Event", Type)
104 if type is None:
105 self.error("in_port decls require 'Event' enumeration")
106
107 param_types.append(type)
108
109 # Check for Address2
110 type = symtab.find("Address", Type)
110 type = symtab.find("Addr", Type)
111 if type is None:
111 if type is None:
112 self.error("in_port decls require 'Address' type to be defined")
112 self.error("in_port decls require 'Addr' type to be defined")
113
114 param_types.append(type)
115
116 if self.statements is not None:
117 rcode = self.slicc.codeFormatter()
118 rcode.indent()
119 rcode.indent()
120 self.statements.generate(rcode, None)
121 in_port["c_code_in_port"] = str(rcode)
122
123 symtab.popFrame()
124
125 # Add port to state machine
126 machine.addInPort(in_port)
113
114 param_types.append(type)
115
116 if self.statements is not None:
117 rcode = self.slicc.codeFormatter()
118 rcode.indent()
119 rcode.indent()
120 self.statements.generate(rcode, None)
121 in_port["c_code_in_port"] = str(rcode)
122
123 symtab.popFrame()
124
125 # Add port to state machine
126 machine.addInPort(in_port)