Skip to content

Literal

woke.ast.ir.yul.literal module #

Literal class #

Bases: YulAbc

TBD

Source code in woke/ast/ir/yul/literal.py
class Literal(YulAbc):
    """
    TBD
    """

    _parent: Union[
        Assignment,
        ExpressionStatement,
        ForLoop,
        If,
        Switch,
        VariableDeclaration,
        FunctionCall,
        Case,
    ]
    _kind: YulLiteralValueKind
    _type: str
    _value: Optional[str]
    _hex_value: Optional[str]

    def __init__(self, init: IrInitTuple, literal: YulLiteral, parent: YulAbc):
        super().__init__(init, literal, parent)
        self._kind = literal.kind
        self._type = literal.type
        self._value = literal.value
        self._hex_value = literal.hex_value

    @property
    def parent(
        self,
    ) -> Union[
        Assignment,
        ExpressionStatement,
        ForLoop,
        If,
        Switch,
        VariableDeclaration,
        FunctionCall,
        Case,
    ]:
        return self._parent

    @property
    def kind(self) -> YulLiteralValueKind:
        return self._kind

    @property
    def type(self) -> str:
        return self._type

    @property
    def value(self) -> Optional[str]:
        return self._value

    @property
    def hex_value(self) -> Optional[str]:
        return self._hex_value