def classify(iToken, lObjects):
    '''
    selected_waveforms ::=
        { waveform when choices , }
        waveform when choices
    '''
    iCurrent = iToken

    iCurrent = utils.assign_tokens_until('when', parser.todo, iCurrent,
                                         lObjects)
    iCurrent = utils.assign_next_token_required('when', token.when_keyword,
                                                iCurrent, lObjects)
    sEnd = utils.find_earliest_occurance([',', ';'], iCurrent, lObjects)
    iCurrent = utils.assign_tokens_until(sEnd, parser.todo, iCurrent, lObjects)

    while utils.is_next_token(',', iCurrent, lObjects):
        iCurrent = utils.assign_next_token_required(',', token.comma, iCurrent,
                                                    lObjects)
        iCurrent = utils.assign_tokens_until('when', parser.todo, iCurrent,
                                             lObjects)
        iCurrent = utils.assign_next_token_required('when', token.when_keyword,
                                                    iCurrent, lObjects)
        sEnd = utils.find_earliest_occurance([',', ';'], iCurrent, lObjects)
        iCurrent = utils.assign_tokens_until(sEnd, parser.todo, iCurrent,
                                             lObjects)

    return iCurrent
Пример #2
0
def classify(iToken, lObjects):

    iCurrent = utils.assign_tokens_until(':=', token.target, iToken, lObjects)
    iCurrent = utils.assign_next_token_required(':=', token.assignment, 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.assign_tokens_until('<=', token.target, iToken, lObjects)
    iCurrent = utils.assign_next_token_required('<=', token.assignment,
                                                iCurrent, lObjects)

    iCurrent = delay_mechanism.detect(iCurrent, lObjects)

    iCurrent = waveform.classify_until([';'], iCurrent, lObjects)

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

    return iCurrent
Пример #4
0
def classify(iToken, lObjects):

    iCurrent = utils.assign_tokens_until('<=', token.target, iToken, lObjects)
    iCurrent = utils.assign_next_token_required('<=', token.assignment,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('force', token.force_keyword,
                                                iCurrent, lObjects)

    iCurrent = force_mode.detect(iCurrent, lObjects)
    iCurrent = expression.classify_until([';'], 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('with', token.with_keyword, iToken, lObjects)
    iCurrent = expression.classify_until(['select'], iToken, lObjects)
    iCurrent = utils.assign_next_token_required('select', token.select_keyword, iToken, lObjects)
    iCurrent = utils.assign_next_token_if('?', token.question_mark, iCurrent, lObjects)
    iCurrent = utils.assign_tokens_until('<=', token.target, iCurrent, lObjects)
    iCurrent = utils.assign_next_token_required('<=', token.assignment, iCurrent, lObjects)

    iCurrent = delay_mechanism.detect(iCurrent, lObjects)

    iCurrent = selected_waveforms.classify_until([';'], iToken, lObjects)

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

    return iCurrent
def classify(iStart, iEnd, lObjects, sEnd):
    iCurrent = iStart
    sPrint = ''
    for oObject in lObjects[iStart:iEnd + 1]:
        sPrint += oObject.get_value()
    # Classify formal part if it exists
    if utils.find_in_index_range('=>', iStart, iEnd, lObjects):
        iCurrent = utils.assign_tokens_until('=>', token.formal_part, iCurrent,
                                             lObjects)
        iCurrent = utils.assign_next_token_required('=>', token.assignment,
                                                    iCurrent, lObjects)

    # Classify actual part
    for iCurrent in range(iCurrent, iEnd):
        if utils.is_item(lObjects, iCurrent):
            utils.assign_token(lObjects, iCurrent, token.actual_part)

    return iCurrent
def classify(iToken, lObjects):
    '''
    concurrent_conditional_signal_assignment ::=
        target <= [ guarded ] [ delay_mechanism ] conditional_waveforms ;
    '''
    iCurrent = utils.assign_tokens_until('<=', token.target, iToken, lObjects)
    iCurrent = utils.assign_next_token_required('<=', token.assignment,
                                                iCurrent, lObjects)
    iCurrent = utils.assign_next_token_if('guarded', token.guarded_keyword,
                                          iCurrent, lObjects)

    iCurrent = delay_mechanism.detect(iCurrent, lObjects)

    iCurrent = conditional_waveforms.classify_until([';'], iCurrent, lObjects)

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

    return iCurrent