def _pretty_print_aux(sig): if util.get_node_type(sig) == constants.MESSAGE_SIGNATURE_NODE_TYPE: return messagesignature_pretty_print(sig) #text = text + util.pretty_print(sig) else: # TODO: parameter raise RuntimeError("TODO: " + parameter_get_parameter_name(sig))
def check_wellformedness(checker, node_): context_ = checker.get_context() sigs = get_message_children(node_) subj = get_role(node_) # Section 4.6.9 -- bound interrupt role if not context_.is_role_declared(subj): util.report_error("Bad interrupt role: " + subj) tmp = context_.get_operators().items() for sig in sigs: if util.get_node_type(sig) == constants.MESSAGE_SIGNATURE_NODE_TYPE: #tmp = context_.get_operators().items() # Section 4.6.9 -- well-formed message signature messagesignature_check_wellformedness(checker, sig) op = context_.get_current_scope() + '.' \ + messagesignature_get_operator(sig) # interrupt sig belongs to the scope of the interruptible for (src, _), ops in tmp: if op in ops: # Section 4.6.9 -- op is not in any potential ops set of # block for subj if subj == src: util.report_error("Bad interrupt operator: " + op) #context_ = context_.add_operator() # FIXME: can't do currently: interrupt messages have no # specific dest (need to look up all possible # destinations, or could make a special broadcast value # constant?) -- top-level interruptible inside a choice # block can also be an enabling op else: raise RuntimeError("TODO: " + parameter_get_parameter_name(sig))