Example #1
0
def p_compare_expression(p):
    """expression : expression EQ expression
                  | expression NE expression
                  | expression '>' expression
                  | expression GOE expression
                  | expression '<' expression
                  | expression LOE expression"""
    p[0] = ast.BinExpr(p[2], p[1], p[3])
Example #2
0
def p_binary_expression(p):
    """expression : expression '+' expression
                  | expression '-' expression
                  | expression '*' expression
                  | expression '/' expression"""
    p[0] = ast.BinExpr(p[2], p[1], p[3])
Example #3
0
def p_binary_matrix_expression(p):
    """expression : expression DOTADD expression
                  | expression DOTSUB expression
                  | expression DOTMLP expression
                  | expression DOTDIV expression"""
    p[0] = ast.BinExpr(p[2], p[1], p[3])