Skip to content

statement

AsmDeclaration

Bases: Statement

AsmDeclaration is used to define an assembly declaration statement in the IR.

Parameters:

Name Type Description Default
backend_name SupportsStr

Name of the backend that is to process the provided backend code.

required
backend_code SupportsStr

(Assembly) code to be processed by the specified backend.

required
Source code in opensquirrel/ir/statement.py
class AsmDeclaration(Statement):
    """``AsmDeclaration`` is used to define an assembly declaration statement in the IR.

    Args:
        backend_name: Name of the backend that is to process the provided backend code.
        backend_code: (Assembly) code to be processed by the specified backend.
    """

    def __init__(
        self,
        backend_name: SupportsStr,
        backend_code: SupportsStr,
    ) -> None:
        self.backend_name = String(backend_name)
        self.backend_code = String(backend_code)
        Statement.__init__(self)

    def accept(self, visitor: IRVisitor) -> Any:
        visitor.visit_statement(self)
        return visitor.visit_asm_declaration(self)