Skip to content

variable

variable

pygerber.nodes.math.variable module contains definition of Variable class.

Variable

Bases: Expression

Represents math expression variable.

Source code in src/pygerber/gerberx3/ast/nodes/math/variable.py
class Variable(Expression):
    """Represents math expression variable."""

    variable: str

    def visit(self, visitor: AstVisitor) -> Variable:
        """Handle visitor call."""
        return visitor.on_variable(self)

    def get_visitor_callback_function(
        self, visitor: AstVisitor
    ) -> Callable[[Self], Variable]:
        """Get callback function for the node."""
        return visitor.on_variable

visit

visit(visitor: AstVisitor) -> Variable

Handle visitor call.

Source code in src/pygerber/gerberx3/ast/nodes/math/variable.py
def visit(self, visitor: AstVisitor) -> Variable:
    """Handle visitor call."""
    return visitor.on_variable(self)

get_visitor_callback_function

get_visitor_callback_function(
    visitor: AstVisitor,
) -> Callable[[Self], Variable]

Get callback function for the node.

Source code in src/pygerber/gerberx3/ast/nodes/math/variable.py
def get_visitor_callback_function(
    self, visitor: AstVisitor
) -> Callable[[Self], Variable]:
    """Get callback function for the node."""
    return visitor.on_variable