def pretty_print(node_):
    blocks = get_block_children(node_)
    text = constants.CHOICE_KW + ' ' + constants.AT_KW + ' ' + get_subject(node_)
    text = text + '\n' + globalprotocolblock_pretty_print(blocks[0])
    for block in blocks[1:]:
        text = text + '\n' + constants.OR_KW + '\n'
        text = text + globalprotocolblock_pretty_print(block)
    return text
def pretty_print(node_):
    text = constants.PAR_KW + '\n'
    blocks = get_block_children(node_)
    text = text + globalprotocolblock_pretty_print(blocks[0])
    for block in blocks[1:]:
        text = text + constants.AND_KW + '\n'
        text = text + globalprotocolblock_pretty_print(block)
    return text
def pretty_print(node_):
    text = constants.PAR_KW + '\n'
    blocks = get_block_children(node_)
    text = text + globalprotocolblock_pretty_print(blocks[0])
    for block in blocks[1:]:
        text = text + constants.AND_KW + '\n'
        text = text + globalprotocolblock_pretty_print(block)
    return text
def pretty_print(node_):
    text = ""
    text = text + constants.REC_KW + ' ' + get_label(node_)
        # FIXME: factor out
    block = get_block_child(node_)
    text = text + '\n' + globalprotocolblock_pretty_print(block)
    return text
Exemple #5
0
def pretty_print(node_):
    text = ""
    text = text + constants.REC_KW + ' ' + get_label(node_)
    # FIXME: factor out
    block = get_block_child(node_)
    text = text + '\n' + globalprotocolblock_pretty_print(block)
    return text
def pretty_print(node_):
    text = constants.INTERRUPTIBLE_KW
    text = text + ':' + get_scope(node_)+ '\n'
    text = text + globalprotocolblock_pretty_print(get_block_child(node_)) + '\n'
    text = text + '{\n'
    for i in get_interrupt_children(node_):
        text = text + globalinterrupt_pretty_print(i) + '\n'
    text = text + '}'
    return text
Exemple #7
0
def pretty_print(node_):
    text = constants.INTERRUPTIBLE_KW
    text = text + ':' + get_scope(node_) + '\n'
    text = text + globalprotocolblock_pretty_print(
        get_block_child(node_)) + '\n'
    text = text + '{\n'
    for i in get_interrupt_children(node_):
        text = text + globalinterrupt_pretty_print(i) + '\n'
    text = text + '}'
    return text
Exemple #8
0
def pretty_print(node_):
    ntype = get_node_type(node_)
    if ntype == constants.GLOBAL_PROTOCOL_DEF_NODE_TYPE:
        return globalprotocoldef_pretty_print(node_)
    elif ntype == constants.GLOBAL_PROTOCOL_BLOCK_NODE_TYPE:
        return globalprotocolblock_pretty_print(node_)
    elif ntype == constants.GLOBAL_MESSAGE_TRANSFER_NODE_TYPE:
        return globalmessagetransfer_pretty_print(node_)
    elif ntype == constants.GLOBAL_CHOICE_NODE_TYPE:
        return globalchoice_pretty_print(node_)
    elif ntype == constants.GLOBAL_RECURSION_NODE_TYPE:
        return globalrecursion_pretty_print(node_)
    elif ntype == constants.GLOBAL_CONTINUE_NODE_TYPE:
        return globalcontinue_pretty_print(node_)
    elif ntype == constants.GLOBAL_PARALLEL_NODE_TYPE:
        return globalparallel_pretty_print(node_)
    elif ntype == constants.GLOBAL_DO_NODE_TYPE:
        return globaldo_pretty_print(node_)
    elif ntype == constants.GLOBAL_INTERRUPTIBLE_NODE_TYPE:
        return globalinterruptible_pretty_print(node_)
    elif ntype == constants.LOCAL_SEND_NODE_TYPE:
        return localsend_pretty_print(node_)
    elif ntype == constants.LOCAL_RECEIVE_NODE_TYPE:
        return localreceive_pretty_print(node_)
    elif ntype == constants.LOCAL_CHOICE_NODE_TYPE:
        return localchoice_pretty_print(node_)
    elif ntype == constants.LOCAL_RECURSION_NODE_TYPE:
        return localrecursion_pretty_print(node_)
    elif ntype == constants.LOCAL_CONTINUE_NODE_TYPE:
        return localcontinue_pretty_print(node_)
    elif ntype == constants.LOCAL_PARALLEL_NODE_TYPE:
        return localparallel_pretty_print(node_)
    elif ntype == constants.LOCAL_DO_NODE_TYPE:
        return localdo_pretty_print(node_)
    elif ntype == constants.LOCAL_INTERRUPTIBLE_NODE_TYPE:
        return localinterruptible_pretty_print(node_)
    else:
        raise Exception("TODO: ", ntype)
Exemple #9
0
def pretty_print(node_):
    ntype = get_node_type(node_)
    if ntype == constants.GLOBAL_PROTOCOL_DEF_NODE_TYPE:
        return globalprotocoldef_pretty_print(node_)
    elif ntype == constants.GLOBAL_PROTOCOL_BLOCK_NODE_TYPE:
        return globalprotocolblock_pretty_print(node_)
    elif ntype == constants.GLOBAL_MESSAGE_TRANSFER_NODE_TYPE:
        return globalmessagetransfer_pretty_print(node_)
    elif ntype == constants.GLOBAL_CHOICE_NODE_TYPE:
        return globalchoice_pretty_print(node_)
    elif ntype == constants.GLOBAL_RECURSION_NODE_TYPE:
        return globalrecursion_pretty_print(node_)
    elif ntype == constants.GLOBAL_CONTINUE_NODE_TYPE:
        return globalcontinue_pretty_print(node_)
    elif ntype == constants.GLOBAL_PARALLEL_NODE_TYPE:
        return globalparallel_pretty_print(node_)
    elif ntype == constants.GLOBAL_DO_NODE_TYPE:
        return globaldo_pretty_print(node_)
    elif ntype == constants.GLOBAL_INTERRUPTIBLE_NODE_TYPE:
        return globalinterruptible_pretty_print(node_)
    elif ntype == constants.LOCAL_SEND_NODE_TYPE:
        return localsend_pretty_print(node_)
    elif ntype == constants.LOCAL_RECEIVE_NODE_TYPE:
        return localreceive_pretty_print(node_)
    elif ntype == constants.LOCAL_CHOICE_NODE_TYPE:
        return localchoice_pretty_print(node_)
    elif ntype == constants.LOCAL_RECURSION_NODE_TYPE:
        return localrecursion_pretty_print(node_)
    elif ntype == constants.LOCAL_CONTINUE_NODE_TYPE:
        return localcontinue_pretty_print(node_)
    elif ntype == constants.LOCAL_PARALLEL_NODE_TYPE:
        return localparallel_pretty_print(node_)
    elif ntype == constants.LOCAL_DO_NODE_TYPE:
        return localdo_pretty_print(node_)
    elif ntype == constants.LOCAL_INTERRUPTIBLE_NODE_TYPE:
        return localinterruptible_pretty_print(node_)
    else:
        raise Exception("TODO: ", ntype)
def pretty_print(node_):
    return globalprotocolblock_pretty_print(get_block_child(node_))
def pretty_print(node_):
    return globalprotocolblock_pretty_print(get_block_child(node_))