def detect(iToken, lObjects):
    '''
    concurrent_signal_assignment_statement ::=
        [ label : ] [ postponed ] concurrent_simple_signal_assignment
      | [ label : ] [ postponed ] concurrent_conditional_signal_assignment
      | [ label : ] [ postponed ] concurrent_selected_signal_assignment
    '''

    iCurrent = iToken
    if concurrent_selected_signal_assignment.detect(iToken, lObjects):
        iCurrent = utils.tokenize_label(iCurrent, lObjects, token.label_name,
                                        token.label_colon)
        iCurrent = utils.tokenize_postponed(iCurrent, lObjects,
                                            token.postponed_keyword)
        iCurrent = concurrent_selected_signal_assignment.classify(
            iCurrent, lObjects)

    elif concurrent_conditional_signal_assignment.detect(iToken, lObjects):
        iCurrent = utils.tokenize_label(iCurrent, lObjects, token.label_name,
                                        token.label_colon)
        iCurrent = utils.tokenize_postponed(iCurrent, lObjects,
                                            token.postponed_keyword)
        iCurrent = concurrent_conditional_signal_assignment.classify(
            iCurrent, lObjects)

    elif concurrent_simple_signal_assignment.detect(iToken, lObjects):
        iCurrent = utils.tokenize_label(iCurrent, lObjects, token.label_name,
                                        token.label_colon)
        iCurrent = utils.tokenize_postponed(iCurrent, lObjects,
                                            token.postponed_keyword)
        iCurrent = concurrent_simple_signal_assignment.classify(
            iCurrent, lObjects)

    return iCurrent
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.generate_label,
                                    token.label_colon)

    iCurrent = utils.assign_next_token_required('for', token.for_keyword,
                                                iCurrent, lObjects)

    iCurrent = parameter_specification.classify_until(['generate'], iCurrent,
                                                      lObjects)

    iCurrent = utils.assign_next_token_required('generate',
                                                token.generate_keyword,
                                                iCurrent, lObjects)

    iCurrent = generate_statement_body.classify(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('end', token.end_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('generate',
                                                token.end_generate_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_if_not(';', token.end_generate_label,
                                              iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
예제 #3
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.case_label,
                                    token.label_colon)
    iCurrent = utils.assign_next_token_required('case', token.case_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_if('?', token.question_mark, iCurrent,
                                          lObjects)

    iCurrent = expression.classify_until(['is'], iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('is', token.is_keyword,
                                                iCurrent, lObjects)

    iCurrent = utils.detect_submodule(iCurrent, lObjects,
                                      case_statement_alternative)

    iCurrent = utils.assign_next_token_required('end', token.end_keyword,
                                                iToken, lObjects)
    iCurrent = utils.assign_next_token_required('case', token.end_case_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_if('?', token.question_mark, iCurrent,
                                          lObjects)
    iCurrent = utils.assign_next_token_if_not(';', token.end_case_label,
                                              iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
예제 #4
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.label,
                                    token.label_colon)
    iCurrent = utils.assign_next_token_required('null', token.null_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
예제 #5
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.label,
                                    token.label_colon)

    iCurrent = procedure_call.classify(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
예제 #6
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.label,
                                    token.label_colon)
    iCurrent = utils.assign_next_token_required('return', token.return_keyword,
                                                iCurrent, lObjects)
    if not utils.is_next_token(';', iCurrent, lObjects):
        iCurrent = expression.classify_until([';'], iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
def classify(iToken, lObjects):
    iCurrent = utils.tokenize_label(iToken, lObjects, token.generate_label,
                                    token.label_colon)

    iCurrent = utils.assign_next_token_required('if', token.if_keyword,
                                                iCurrent, lObjects)

    ### Need to handle alternaive_label ###

    iCurrent = condition.classify_until(['generate'], iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('generate',
                                                token.generate_keyword,
                                                iCurrent, lObjects)

    iCurrent = generate_statement_body.classify(iCurrent, lObjects)

    while utils.is_next_token('elsif', iCurrent, lObjects):
        iCurrent = utils.assign_next_token_required('elsif',
                                                    token.elsif_keyword,
                                                    iCurrent, lObjects)

        iCurrent = condition.classify_until(['generate'], iCurrent, lObjects)

        iCurrent = utils.assign_next_token_required('generate',
                                                    token.generate_keyword,
                                                    iCurrent, lObjects)

        iCurrent = generate_statement_body.classify(iCurrent, lObjects)

    if utils.is_next_token('else', iCurrent, lObjects):
        iCurrent = utils.assign_next_token_required('else', token.else_keyword,
                                                    iCurrent, lObjects)

        iCurrent = utils.assign_next_token_required('generate',
                                                    token.generate_keyword,
                                                    iCurrent, lObjects)

        iCurrent = generate_statement_body.classify(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('end', token.end_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('generate',
                                                token.end_generate_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_if_not(';', token.end_generate_label,
                                              iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
예제 #8
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.label_name,
                                    token.label_colon)

    iCurrent = utils.assign_next_token_if('postponed', token.postponed_keyword,
                                          iCurrent, lObjects)

    iCurrent = assertion.classify(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
예제 #9
0
def detect(iToken, lObjects):
    '''
    variable_assignment_statement ::=
        [ label : ] simple_variable_assignment
      | [ label : ] conditional_variable_assignment
      | [ label : ] selected_variable_assignment
    '''
    iCurrent = iToken
    if selected_variable_assignment.detect(iToken, lObjects):
        iCurrent = utils.tokenize_label(iCurrent, lObjects, token.label,
                                        token.label_colon)
        iCurrent = selected_variable_assignment.classify(iCurrent, lObjects)

    elif conditional_variable_assignment.detect(iToken, lObjects):
        iCurrent = utils.tokenize_label(iCurrent, lObjects, token.label,
                                        token.label_colon)
        iCurrent = conditional_variable_assignment.classify(iCurrent, lObjects)

    elif simple_variable_assignment.detect(iToken, lObjects):
        iCurrent = utils.tokenize_label(iCurrent, lObjects, token.label,
                                        token.label_colon)
        iCurrent = simple_variable_assignment.classify(iCurrent, lObjects)

    return iCurrent
예제 #10
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.label, token.label_colon)
    iCurrent = utils.assign_next_token_required('next', token.next_keyword, iCurrent, lObjects)

    if not utils.is_next_token(';', iCurrent, lObjects) and not utils.is_next_token('when', iCurrent, lObjects):
        iCurrent = utils.assign_next_token(token.loop_label, iCurrent, lObjects)

    if utils.is_next_token('when', iCurrent, lObjects):
        iCurrent = utils.assign_next_token_required('when', token.when_keyword, iCurrent, lObjects)
        iCurrent = condition.classify_until([';'], iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent, lObjects)

    return iCurrent
예제 #11
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.loop_label, token.label_colon)

    iCurrent = iteration_scheme.classify(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('loop', token.loop_keyword, iCurrent, lObjects)

    iCurrent = sequence_of_statements.detect(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('end', token.end_keyword, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('loop', token.end_loop_keyword, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_if_not(';', token.end_loop_label, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent, lObjects)

    return iCurrent
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects,
                                    token.instantiation_label,
                                    token.label_colon)

    iCurrent = instantiated_unit.classify(iCurrent, lObjects)

    iCurrent = generic_map_aspect.detect(iCurrent, lObjects)

    iCurrent = port_map_aspect.detect(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
예제 #13
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.generate_label, token.label_colon)

    iCurrent = utils.assign_next_token_required('case', token.case_keyword, iCurrent, lObjects)

    iCurrent = expression.classify_until(['generate'], iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('generate', token.generate_keyword, iCurrent, lObjects)

    iToken = utils.detect_submodule(iToken, lObjects, case_generate_alternative)

    iCurrent = utils.assign_next_token_required('end', token.end_keyword, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('generate', token.end_generate_keyword, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_if_not(';', token.end_generate_label, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent, lObjects)

    return iCurrent
예제 #14
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.label,
                                    token.label_colon)
    iCurrent = utils.assign_next_token_required('wait', token.wait_keyword,
                                                iCurrent, lObjects)

    if sensitivity_clause.detect(iCurrent, lObjects):
        iCurrent = sensitivity_clause.classify_until([';', 'for', 'until'],
                                                     iCurrent, lObjects)

    if condition_clause.detect(iCurrent, lObjects):
        iCurrent = condition_clause.classify_until([';', 'for'], iCurrent,
                                                   lObjects)

    if timeout_clause.detect(iCurrent, lObjects):
        iCurrent = timeout_clause.classify_until([';'], iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
예제 #15
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.block_label,
                                    token.label_colon)
    iCurrent = utils.assign_next_token_required('block', token.block_keyword,
                                                iCurrent, lObjects)

    if utils.is_next_token('(', iCurrent, lObjects):
        iCurrent = utils.assign_next_token_required(
            '(', token.guard_open_parenthesis, iCurrent, lObjects)
        iCurrent = utils.assign_next_token_if_not(')', token.guard_condition,
                                                  iCurrent, lObjects)
        iCurrent = utils.assign_next_token_required(
            ')', token.guard_close_parenthesis, iCurrent, lObjects)

    iCurrent = utils.assign_next_token_if('is', token.is_keyword, iCurrent,
                                          lObjects)

    iCurrent = block_header.detect(iCurrent, lObjects)

    iCurrent = block_declarative_part.detect(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('begin', token.begin_keyword,
                                                iCurrent, lObjects)

    iCurrent = block_statement_part.detect(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('end', token.end_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('block',
                                                token.end_block_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_if_not(';', token.end_block_label,
                                              iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iCurrent
예제 #16
0
def classify_opening_declaration(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.process_label,
                                    token.label_colon)
    iCurrent = utils.assign_next_token_if('postponed', token.postponed_keyword,
                                          iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('process',
                                                token.process_keyword,
                                                iCurrent, lObjects)

    if utils.is_next_token('(', iCurrent, lObjects):
        iCurrent = utils.assign_next_token_required('(',
                                                    token.open_parenthesis,
                                                    iCurrent, lObjects)
        iCurrent = process_sensitivity_list.classify(iCurrent, lObjects)
        iCurrent = utils.assign_next_token_required(')',
                                                    token.close_parenthesis,
                                                    iCurrent, lObjects)

    iCurrent = utils.assign_next_token_if('is', token.is_keyword, iCurrent,
                                          lObjects)

    return iCurrent
예제 #17
0
def classify(iToken, lObjects):

    iCurrent = utils.tokenize_label(iToken, lObjects, token.if_label, token.label_colon)
    iCurrent = utils.assign_next_token_required('if', token.if_keyword, iCurrent, lObjects)
    iCurrent = condition.classify_until(['then'], iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('then', token.then_keyword, iCurrent, lObjects)

    iCurrent = sequence_of_statements.detect(iCurrent, lObjects)

    while utils.is_next_token_one_of(['else', 'elsif'], iCurrent, lObjects):
        if utils.is_next_token('elsif', iCurrent, lObjects):
            iCurrent = utils.assign_next_token_required('elsif', token.elsif_keyword, iCurrent, lObjects)
            iCurrent = condition.classify_until(['then'], iCurrent, lObjects)
            iCurrent = utils.assign_next_token_required('then', token.then_keyword, iCurrent, lObjects)
            iCurrent = sequence_of_statements.detect(iCurrent, lObjects)
        else:
            iCurrent = utils.assign_next_token_required('else', token.else_keyword, iCurrent, lObjects)
            iCurrent = sequence_of_statements.detect(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('end', token.end_keyword, iToken, lObjects)
    iCurrent = utils.assign_next_token_required('if', token.end_if_keyword, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_if_not(';', token.end_if_label, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent, lObjects)
    return iCurrent