コード例 #1
0
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
コード例 #2
0
def detect(iToken, lObjects):
    '''
    package_header ::=
        [ generic_clause
        [ generic_map_aspect ; ] ]
    '''

    iCurrent = generic_clause.detect(iToken, lObjects)

    iLast = iCurrent
    iCurrent = generic_map_aspect.detect(iCurrent, lObjects)
    if iCurrent != iLast:
        return utils.assign_next_token_required(';', token.semicolon, iCurrent,
                                                lObjects)

    return iToken
コード例 #3
0
def classify(iToken, lObjects):

    if utils.find_in_next_n_tokens('(', 2, iToken, lObjects):
        iCurrent = utils.assign_next_token_required('generic',
                                                    token.generic_keyword,
                                                    iToken, lObjects)
        iCurrent = utils.assign_next_token_required('(',
                                                    token.open_parenthesis,
                                                    iCurrent, lObjects)

        iCurrent = generic_list.classify(iCurrent, lObjects)

        iCurrent = utils.assign_next_token_required(')',
                                                    token.close_parenthesis,
                                                    iCurrent, lObjects)

    iCurrent = generic_map_aspect.detect(iToken, lObjects)

    return iCurrent
def classify(iToken, lObjects):

    iCurrent = subprogram_kind.classify(iToken, lObjects)

    iCurrent = utils.assign_next_token(token.identifier, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('is', token.is_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('new', token.new_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token(token.uninstantiated_subprogram_name,
                                       iCurrent, lObjects)

    iCurrent = signature.detect(iCurrent, lObjects)

    iCurrent = generic_map_aspect.detect(iCurrent, lObjects)

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

    return iCurrent
コード例 #5
0
def classify(iToken, lObjects):

    iCurrent = utils.assign_next_token_required('package',
                                                token.package_keyword, iToken,
                                                lObjects)

    iCurrent = identifier.classify(iCurrent, lObjects)

    iCurrent = utils.assign_next_token_required('is', token.is_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('new', token.new_keyword,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token(token.uninstantiated_package_name,
                                       iCurrent, lObjects)

    iCurrent = generic_map_aspect.detect(iCurrent, lObjects)

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

    return iCurrent
コード例 #6
0
def detect(iToken, lObjects):
    '''
    block_header ::=
        [ generic_clause
        [ generic_map_aspect ; ] ]
        [ port_clause
        [ port_map_aspect ; ] ]
    '''

    iCurrent = generic_clause.detect(iToken, lObjects)

    iLast = iCurrent
    iCurrent = generic_map_aspect.detect(iCurrent, lObjects)
    if iLast != iCurrent:
        iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent, lObjects)

    iCurrent = port_clause.detect(iCurrent, lObjects)

    iLast = iCurrent
    iCurrent = port_map_aspect.detect(iCurrent, lObjects)
    if iLast != iCurrent:
        iCurrent = utils.assign_next_token_required(';', token.semicolon, iCurrent, lObjects)

    return iCurrent