Example #1
0
def p_expComp_unario_1(t):
    """
    expComp : datatype R_ISNULL
    | datatype R_NOTNULL
    """
    t[0] = code.UnaryOperation(newTemp(),t[1],t[2],t[1].row,t[1].column)
    repGrammar.append(t.slice)
Example #2
0
def p_datatype_operadores_unarios(t):
    """
    datatype : O_RESTA datatype %prec UO_RESTA
    | O_SUMA datatype %prec UO_SUMA
    """
    t[0] = code.UnaryOperation(newTemp(),t[2],t[1],t[2].row, t[2].column)
    repGrammar.append(t.slice)
Example #3
0
def p_expComp_unario_3(t):
    """
    expComp : datatype R_IS R_NOT R_NULL
    | datatype R_IS R_NOT R_TRUE
    | datatype R_IS R_NOT R_FALSE
    | datatype R_IS R_NOT R_UNKNOWN
    """
    t[0] = code.UnaryOperation(newTemp(),t[1],t[2]+t[3]+t[4],t[1].row,t[1].column)
    repGrammar.append(t.slice)
Example #4
0
def p_expBool_5(t):
    """
    expBool : expBool optBoolPredicate
    """
    t[0] = code.UnaryOperation(newTemp(), t[1], t[2], t[1].row, t[1].column )
    repGrammar.append(t.slice)
Example #5
0
def p_expBool_2(t):
    """
    expBool : R_NOT expBool
    """
    t[0] = code.UnaryOperation(newTemp(),t[2],t[1],t[2].row, t[2].column)
    repGrammar.append(t.slice)