Skip to content

numeric

Classes:

Complex

Complex(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: Number

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Complex32

Complex32(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: Complex

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Complex64

Complex64(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: Complex

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Float16

Float16(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: Floating

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Float32

Float32(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: Floating

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Float64

Float64(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: Floating

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Floating

Floating(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: Number

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Int128

Int128(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: SignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Int16

Int16(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: SignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Int32

Int32(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: SignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Int64

Int64(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: SignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Int8

Int8(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: SignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Integer

Integer(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: AnyType

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

Number

Number(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: AnyType

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

SignedInteger

SignedInteger(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: Integer

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

UInt128

UInt128(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: UnsignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

UInt16

UInt16(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: UnsignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

UInt32

UInt32(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: UnsignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

UInt64

UInt64(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: UnsignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

UInt8

UInt8(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: UnsignedInteger

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )

UnsignedInteger

UnsignedInteger(
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
)

Bases: Integer

Methods:

Source code in packages/astx/src/astx/base.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
def __init__(
    self,
    loc: SourceLocation = NO_SOURCE_LOCATION,
    parent: Optional[ASTNodes] = None,
) -> None:
    """
    title: Initialize the data type.
    parameters:
      loc:
        type: SourceLocation
      parent:
        type: Optional[ASTNodes]
    """
    super().__init__(loc=loc, parent=parent)
    self.name = f"temp_{DataType._tmp_id}"
    DataType._tmp_id += 1
    # set it as a generic data type
    self.type_: ExprType = ExprType()

get_struct

get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/base.py
685
686
687
688
689
690
691
692
693
694
695
696
def get_struct(self, simplified: bool = False) -> ReprStruct:
    """
    title: Return a simple structure that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: ReprStruct
    """
    key = f"DATA-TYPE[{self.__class__.__name__}]"
    value = self.name
    return self._prepare_struct(key, value, simplified)

to_json

to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409
def to_json(self, simplified: bool = False) -> str:
    """
    title: Return an json string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return json.dumps(self.get_struct(simplified=simplified), indent=2)

to_yaml

to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398
def to_yaml(self, simplified: bool = False) -> str:
    """
    title: Return an yaml string that represents the object.
    parameters:
      simplified:
        type: bool
    returns:
      type: str
    """
    return str(
        yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
    )