astx.types.operators

astx.types.operators

Source: packages/astx/src/astx/types/operators.py

title: ASTx Data Types module.

Classes

DataTypeOps(DataType)

title: Overload some magic functions used for the main operations.

UnaryOp(DataTypeOps)

title: AST class for the unary operator.
attributes:
  kind:
    type: ASTKind
  op_code:
    type: str
  operand:
    type: DataType

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

BinaryOp(DataTypeOps)

title: AST class for the binary operator.
attributes:
  kind:
    type: ASTKind
  type_:
    type: ExprType
  lhs:
    type: DataType
  rhs:
    type: DataType
  op_code:
    type: str

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure that represents the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

BoolBinaryOp(BinaryOp)

title: Base AST class for boolean binary operations.
attributes:
  type_:
    type: ExprType
  lhs:
    type: DataType
  rhs:
    type: DataType
  op_code:
    type: str
  kind:
    type: ASTKind

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure that represents the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

BoolUnaryOp(UnaryOp)

title: Base AST class for boolean unary operations.
attributes:
  op_code:
    type: str
  operand:
    type: DataType
  kind:
    type: ASTKind

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure that represents the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

AndOp(BoolBinaryOp)

title: AST class for logical AND operation.
attributes:
  type_:
    type: ExprType
  lhs:
    type: DataType
  rhs:
    type: DataType
  op_code:
    type: str
  kind:
    type: ASTKind

OrOp(BoolBinaryOp)

title: AST class for logical OR operation.
attributes:
  type_:
    type: ExprType
  lhs:
    type: DataType
  rhs:
    type: DataType
  op_code:
    type: str
  kind:
    type: ASTKind

XorOp(BoolBinaryOp)

title: AST class for logical XOR operation.
attributes:
  type_:
    type: ExprType
  lhs:
    type: DataType
  rhs:
    type: DataType
  op_code:
    type: str
  kind:
    type: ASTKind

NandOp(BoolBinaryOp)

title: AST class for logical NAND operation.
attributes:
  type_:
    type: ExprType
  lhs:
    type: DataType
  rhs:
    type: DataType
  op_code:
    type: str
  kind:
    type: ASTKind

NorOp(BoolBinaryOp)

title: AST class for logical NOR operation.
attributes:
  type_:
    type: ExprType
  lhs:
    type: DataType
  rhs:
    type: DataType
  op_code:
    type: str
  kind:
    type: ASTKind

XnorOp(BoolBinaryOp)

title: AST class for logical XNOR operation.
attributes:
  type_:
    type: ExprType
  lhs:
    type: DataType
  rhs:
    type: DataType
  op_code:
    type: str
  kind:
    type: ASTKind

NotOp(BoolUnaryOp)

title: AST class for logical NOT operation.
attributes:
  op_code:
    type: str
  operand:
    type: DataType
  kind:
    type: ASTKind