Beispiel #1
0
def p_dot_operators(p):
    """expression : expression DOTPLUS expression
        | expression DOTMINUS expression
        | expression DOTTIMES expression
        | expression DOTDIVIDE expression"""
    p[0] = AST.BinaryExpression(p[1], p[2], p[3], p.lineno(2))
Beispiel #2
0
def p_operators(p):
    """expression : expression '+' expression
        | expression '-' expression
        | expression '*' expression
        | expression '/' expression"""
    p[0] = AST.BinaryExpression(p[1], p[2], p[3], p.lineno(2))