ruby: slicc: remove member buffer_expr from Var class
This was added by changeset 51f40b101a56. Instead, buffer_expr would now be associated with the InPort class.
This commit is contained in:
parent
78bf2dfeac
commit
4e898be762
|
@ -58,8 +58,9 @@ class InPortDeclAST(DeclAST):
|
||||||
queue_type)
|
queue_type)
|
||||||
|
|
||||||
type = self.queue_type.type
|
type = self.queue_type.type
|
||||||
|
self.pairs["buffer_expr"] = self.var_expr
|
||||||
in_port = Var(self.symtab, self.ident, self.location, type, str(code),
|
in_port = Var(self.symtab, self.ident, self.location, type, str(code),
|
||||||
self.pairs, machine, self.var_expr)
|
self.pairs, machine)
|
||||||
symtab.newSymbol(in_port)
|
symtab.newSymbol(in_port)
|
||||||
|
|
||||||
symtab.pushFrame()
|
symtab.pushFrame()
|
||||||
|
|
|
@ -196,7 +196,7 @@ class StateMachine(Symbol):
|
||||||
port_to_buf_map = {}
|
port_to_buf_map = {}
|
||||||
in_msg_bufs = {}
|
in_msg_bufs = {}
|
||||||
for port in self.in_ports:
|
for port in self.in_ports:
|
||||||
buf_name = "m_%s_ptr" % port.buffer_expr.name
|
buf_name = "m_%s_ptr" % port.pairs["buffer_expr"].name
|
||||||
msg_bufs.append(buf_name)
|
msg_bufs.append(buf_name)
|
||||||
port_to_buf_map[port] = msg_bufs.index(buf_name)
|
port_to_buf_map[port] = msg_bufs.index(buf_name)
|
||||||
if buf_name not in in_msg_bufs:
|
if buf_name not in in_msg_bufs:
|
||||||
|
|
|
@ -29,10 +29,9 @@ from slicc.symbols.Symbol import Symbol
|
||||||
|
|
||||||
class Var(Symbol):
|
class Var(Symbol):
|
||||||
def __init__(self, symtab, ident, location, type, code, pairs,
|
def __init__(self, symtab, ident, location, type, code, pairs,
|
||||||
machine=None, buffer_expr=""):
|
machine=None):
|
||||||
super(Var, self).__init__(symtab, ident, location, pairs)
|
super(Var, self).__init__(symtab, ident, location, pairs)
|
||||||
|
|
||||||
self.buffer_expr = buffer_expr
|
|
||||||
self.machine = machine
|
self.machine = machine
|
||||||
self.type = type
|
self.type = type
|
||||||
self.code = code
|
self.code = code
|
||||||
|
|
Loading…
Reference in a new issue