pyccel.ast.bitwise_operators module#

Module handling all Python builtin operators These operators all have a precision as detailed here: https://docs.python.org/3/reference/expressions.html#operator-precedence They also have specific rules to determine the datatype, rank, shape

class pyccel.ast.bitwise_operators.PyccelBitAnd(arg1, arg2)[source]#

Bases: PyccelBitComparisonOperator

Class representing a call to the Python bitwise AND operator.

Class representing a call to the Python bitwise AND operator. I.e:

a & b

is equivalent to: >>> PyccelBitAnd(a, b)

Parameters:
  • arg1 (TypedAstNode) – The first argument passed to the operator.

  • arg2 (TypedAstNode) – The second argument passed to the operator.

op = '&'#
class pyccel.ast.bitwise_operators.PyccelBitComparisonOperator(arg1, arg2)[source]#

Bases: PyccelBitOperator

Abstract superclass representing a bitwise comparison operator.

Abstract superclass representing a Python bitwise comparison operator with two arguments

Parameters:
  • arg1 (TypedAstNode) – The first argument passed to the operator.

  • arg2 (TypedAstNode) – The second argument passed to the operator.

class pyccel.ast.bitwise_operators.PyccelBitOperator(arg1, arg2)[source]#

Bases: PyccelBinaryOperator

Abstract superclass representing a Python bitwise operator with two arguments.

Abstract superclass representing a Python bitwise operator with two arguments.

Parameters:
  • arg1 (TypedAstNode) – The first argument passed to the operator.

  • arg2 (TypedAstNode) – The second argument passed to the operator.

class pyccel.ast.bitwise_operators.PyccelBitOr(arg1, arg2)[source]#

Bases: PyccelBitComparisonOperator

Class representing a call to the Python bitwise OR operator.

Class representing a call to the Python bitwise OR operator. I.e:

a | b

is equivalent to: >>> PyccelBitOr(a, b)

Parameters:
  • arg1 (TypedAstNode) – The first argument passed to the operator.

  • arg2 (TypedAstNode) – The second argument passed to the operator.

op = '|'#
class pyccel.ast.bitwise_operators.PyccelBitXor(arg1, arg2)[source]#

Bases: PyccelBitComparisonOperator

Class representing a call to the Python bitwise XOR operator.

Class representing a call to the Python bitwise XOR operator. I.e:

a ^ b

is equivalent to: >>> PyccelBitXor(a, b)

Parameters:
  • arg1 (TypedAstNode) – The first argument passed to the operator.

  • arg2 (TypedAstNode) – The second argument passed to the operator.

op = '^'#
class pyccel.ast.bitwise_operators.PyccelInvert(arg)[source]#

Bases: PyccelUnaryOperator

Class representing a call to the Python bitwise not operator.

Class representing a call to the Python bitwise not operator. I.e:

~a

is equivalent to: >>> PyccelInvert(a)

Parameters:

arg (TypedAstNode) – The argument passed to the operator.

class pyccel.ast.bitwise_operators.PyccelLShift(arg1, arg2)[source]#

Bases: PyccelBitOperator

Class representing a call to the Python right shift operator.

Class representing a call to the Python right shift operator. I.e:

a << b

is equivalent to: >>> PyccelRShift(a, b)

Parameters:
  • arg1 (TypedAstNode) – The first argument passed to the operator.

  • arg2 (TypedAstNode) – The second argument passed to the operator.

op = '<<'#
class pyccel.ast.bitwise_operators.PyccelRShift(arg1, arg2)[source]#

Bases: PyccelBitOperator

Class representing a call to the Python right shift operator.

Class representing a call to the Python right shift operator. I.e:

a >> b

is equivalent to: >>> PyccelRShift(a, b)

Parameters:
  • arg1 (TypedAstNode) – The first argument passed to the operator.

  • arg2 (TypedAstNode) – The second argument passed to the operator.

op = '>>'#