Example #1
0
def p_expBool_1(t):
    """
    expBool : expBool R_AND expBool
            | expBool R_OR expBool
    """
    t[0] = code.BinaryOperation(newTemp(), t[1], t[3], t[2], t[1].row, t[1].column)
    repGrammar.append(t.slice)
Example #2
0
def p_expCompBinario_1(t):
    """
    expComp : datatype OL_MENORQUE datatype
    | datatype OL_MAYORQUE datatype
    | datatype OL_MAYORIGUALQUE datatype
    | datatype OL_MENORIGUALQUE datatype
    | datatype S_IGUAL datatype
    | datatype OL_DISTINTODE datatype
    """
    t[0] = code.BinaryOperation(newTemp(),t[1],t[3],t[2], t[1].row, t[1].column)
    repGrammar.append(t.slice)
Example #3
0
def p_datatype_operadores_binarios1(t):
    """
    datatype : datatype O_SUMA datatype
    | datatype O_RESTA datatype
    | datatype O_PRODUCTO datatype
    | datatype O_DIVISION datatype
    | datatype O_EXPONENTE datatype
    | datatype O_MODULAR datatype
    """
    t[0] = code.BinaryOperation(newTemp(),t[1],t[3],t[2], t[1].row, t[1].column)
    repGrammar.append(t.slice)
Example #4
0
def p_expCompBinario_3(t):
    """
    expComp : datatype R_IS R_NOT R_DISTINCT R_FROM datatype
    """
    t[0] = code.BinaryOperation(newTemp(), t[1], t[6], "==", t[1].row, t[1].column)
    repGrammar.append(t.slice)
Example #5
0
def p_datatype_operadores_binarios2(t):
    """
    datatype : datatype OC_CONCATENAR datatype
    """
    t[0] = code.BinaryOperation(newTemp(),t[1],t[3],t[2], t[1].row, t[1].column)
    repGrammar.append(t.slice)