Beispiel #1
0
def semantic59(head, poppedList):
    value = poppedList[1].value
    result = InputToken(head, value)

    for operation in reversed(poppedList[3].value):
        result.value = op[operation](result.value)

    return result
Beispiel #2
0
def semantic58(head, poppedList):
    identifier = poppedList[0].value
    value = symbolsTable[identifier]
    result = InputToken(head, value)

    for operation in reversed(poppedList[1].value):
        result.value = op[operation](result.value)

    return result
Beispiel #3
0
def semantic56(head,
               poppedList):  # In this instance poppedList must be [NUMBER,Si]
    number = poppedList[0].value
    lexeme = poppedList[0].lexeme
    result = InputToken(head, number)

    for operation in reversed(poppedList[1].value):
        result.value = op[operation](result.value)

    return result