Module refinery.lib.scripts.vba.model

Expand source code Browse git
from __future__ import annotations

import enum

from dataclasses import dataclass, field
from typing import Generator

from refinery.lib.scripts import Expression, Node, Script, Statement


class VbaLoopConditionType(enum.Enum):
    WHILE = 'While'
    UNTIL = 'Until'


class VbaLoopConditionPosition(enum.Enum):
    PRE = 'pre'
    POST = 'post'


class VbaScopeModifier(enum.Enum):
    NONE = ''
    PUBLIC = 'Public'
    PRIVATE = 'Private'
    FRIEND = 'Friend'
    DIM = 'Dim'
    GLOBAL = 'Global'
    STATIC = 'Static'


class VbaPropertyKind(enum.Enum):
    GET = 'Get'
    LET = 'Let'
    SET = 'Set'


class VbaExitKind(enum.Enum):
    SUB = 'Sub'
    FUNCTION = 'Function'
    DO = 'Do'
    FOR = 'For'
    PROPERTY = 'Property'


class VbaOnErrorAction(enum.Enum):
    NONE = ''
    GOTO = 'GoTo'
    RESUME = 'Resume'
    RESUME_NEXT = 'ResumeNext'


class VbaOnBranchKind(enum.Enum):
    GOTO = 'GoTo'
    GOSUB = 'GoSub'


class VbaParameterPassing(enum.Enum):
    NONE = ''
    BY_VAL = 'ByVal'
    BY_REF = 'ByRef'


@dataclass(repr=False)
class VbaErrorNode(Node):
    text: str = ''
    message: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaIdentifier(Expression):
    name: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaTypedIdentifier(Expression):
    name: str = ''
    suffix: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaMeExpression(Expression):
    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaIntegerLiteral(Expression):
    value: int = 0
    raw: str = '0'

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaFloatLiteral(Expression):
    value: float = 0.0
    raw: str = '0'

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaStringLiteral(Expression):
    value: str = ''
    raw: str = '""'

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaDateLiteral(Expression):
    raw: str = '##'

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaBooleanLiteral(Expression):
    value: bool = False

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaNothingLiteral(Expression):
    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaNullLiteral(Expression):
    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaEmptyLiteral(Expression):
    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaBinaryExpression(Expression):
    left: Expression | None = None
    operator: str = ''
    right: Expression | None = None

    def __post_init__(self):
        self._adopt(self.left, self.right)

    def children(self) -> Generator[Node, None, None]:
        if self.left is not None:
            yield self.left
        if self.right is not None:
            yield self.right


@dataclass(repr=False)
class VbaUnaryExpression(Expression):
    operator: str = ''
    operand: Expression | None = None

    def __post_init__(self):
        self._adopt(self.operand)

    def children(self) -> Generator[Node, None, None]:
        if self.operand is not None:
            yield self.operand


@dataclass(repr=False)
class VbaNamedArgument(Expression):
    name: str = ''
    expression: Expression | None = None

    def __post_init__(self):
        self._adopt(self.expression)

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression


@dataclass(repr=False)
class VbaByValArgument(Expression):
    expression: Expression | None = None

    def __post_init__(self):
        self._adopt(self.expression)

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression


@dataclass(repr=False)
class VbaCallExpression(Expression):
    callee: Expression | None = None
    arguments: list[Expression | None] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.callee, *[a for a in self.arguments if a is not None])

    def children(self) -> Generator[Node, None, None]:
        if self.callee is not None:
            yield self.callee
        for arg in self.arguments:
            if arg is not None:
                yield arg


@dataclass(repr=False)
class VbaMemberAccess(Expression):
    object: Expression | None = None
    member: str = ''

    def __post_init__(self):
        self._adopt(self.object)

    def children(self) -> Generator[Node, None, None]:
        if self.object is not None:
            yield self.object


@dataclass(repr=False)
class VbaBangAccess(Expression):
    object: Expression | None = None
    member: str = ''

    def __post_init__(self):
        self._adopt(self.object)

    def children(self) -> Generator[Node, None, None]:
        if self.object is not None:
            yield self.object


@dataclass(repr=False)
class VbaIndexExpression(Expression):
    object: Expression | None = None
    arguments: list[Expression | None] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.object, *[a for a in self.arguments if a is not None])

    def children(self) -> Generator[Node, None, None]:
        if self.object is not None:
            yield self.object
        for arg in self.arguments:
            if arg is not None:
                yield arg


@dataclass(repr=False)
class VbaNewExpression(Expression):
    class_name: Expression | None = None

    def __post_init__(self):
        self._adopt(self.class_name)

    def children(self) -> Generator[Node, None, None]:
        if self.class_name is not None:
            yield self.class_name


@dataclass(repr=False)
class VbaTypeOfIsExpression(Expression):
    operand: Expression | None = None
    type_name: Expression | None = None

    def __post_init__(self):
        self._adopt(self.operand, self.type_name)

    def children(self) -> Generator[Node, None, None]:
        if self.operand is not None:
            yield self.operand
        if self.type_name is not None:
            yield self.type_name


@dataclass(repr=False)
class VbaParenExpression(Expression):
    expression: Expression | None = None

    def __post_init__(self):
        self._adopt(self.expression)

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression


@dataclass(repr=False)
class VbaRangeExpression(Expression):
    start: Expression | None = None
    end: Expression | None = None

    def __post_init__(self):
        self._adopt(self.start, self.end)

    def children(self) -> Generator[Node, None, None]:
        if self.start is not None:
            yield self.start
        if self.end is not None:
            yield self.end


@dataclass(repr=False)
class VbaModule(Script):
    pass


@dataclass(repr=False)
class VbaOptionStatement(Statement):
    keyword: str = ''
    value: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaDeclareStatement(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    lib: str = ''
    alias: str = ''
    is_function: bool = False
    params: list[VbaParameter] = field(default_factory=list)
    return_type: str = ''
    raw: str = ''

    def __post_init__(self):
        self._adopt(*self.params)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params


@dataclass(repr=False)
class VbaTypeDefinition(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    members: list[VbaVariableDeclarator] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.members)

    def children(self) -> Generator[Node, None, None]:
        yield from self.members


@dataclass(repr=False)
class VbaEnumDefinition(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    members: list[VbaEnumMember] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.members)

    def children(self) -> Generator[Node, None, None]:
        yield from self.members


@dataclass(repr=False)
class VbaEnumMember(Node):
    name: str = ''
    value: Expression | None = None

    def __post_init__(self):
        self._adopt(self.value)

    def children(self) -> Generator[Node, None, None]:
        if self.value is not None:
            yield self.value


@dataclass(repr=False)
class VbaConstDeclarator(Node):
    name: str = ''
    type_name: str = ''
    value: Expression | None = None

    def __post_init__(self):
        self._adopt(self.value)

    def children(self) -> Generator[Node, None, None]:
        if self.value is not None:
            yield self.value


@dataclass(repr=False)
class VbaConstDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    declarators: list[VbaConstDeclarator] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.declarators)

    def children(self) -> Generator[Node, None, None]:
        yield from self.declarators


@dataclass(repr=False)
class VbaVariableDeclarator(Node):
    name: str = ''
    type_name: str = ''
    is_array: bool = False
    bounds: list[Expression] = field(default_factory=list)
    is_new: bool = False
    with_events: bool = False

    def __post_init__(self):
        self._adopt(*self.bounds)

    def children(self) -> Generator[Node, None, None]:
        yield from self.bounds


@dataclass(repr=False)
class VbaVariableDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    declarators: list[VbaVariableDeclarator] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.declarators)

    def children(self) -> Generator[Node, None, None]:
        yield from self.declarators


@dataclass(repr=False)
class VbaEventDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    params: list[VbaParameter] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.params)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params


@dataclass(repr=False)
class VbaParameter(Node):
    name: str = ''
    passing: VbaParameterPassing = VbaParameterPassing.NONE
    type_name: str = ''
    is_optional: bool = False
    is_paramarray: bool = False
    default: Expression | None = None
    is_array: bool = False

    def __post_init__(self):
        self._adopt(self.default)

    def children(self) -> Generator[Node, None, None]:
        if self.default is not None:
            yield self.default


@dataclass(repr=False)
class VbaSubDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    params: list[VbaParameter] = field(default_factory=list)
    body: list[Statement] = field(default_factory=list)
    is_static: bool = False

    def __post_init__(self):
        self._adopt(*self.params, *self.body)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params
        yield from self.body


@dataclass(repr=False)
class VbaFunctionDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    params: list[VbaParameter] = field(default_factory=list)
    return_type: str = ''
    body: list[Statement] = field(default_factory=list)
    is_static: bool = False

    def __post_init__(self):
        self._adopt(*self.params, *self.body)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params
        yield from self.body


@dataclass(repr=False)
class VbaPropertyDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    kind: VbaPropertyKind = VbaPropertyKind.GET
    name: str = ''
    params: list[VbaParameter] = field(default_factory=list)
    return_type: str = ''
    body: list[Statement] = field(default_factory=list)
    is_static: bool = False

    def __post_init__(self):
        self._adopt(*self.params, *self.body)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params
        yield from self.body


@dataclass(repr=False)
class VbaExpressionStatement(Statement):
    expression: Expression | None = None
    arguments: list[Expression | None] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(
            self.expression,
            *[a for a in self.arguments if a is not None],
        )

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression
        for arg in self.arguments:
            if arg is not None:
                yield arg


@dataclass(repr=False)
class VbaCallStatement(Statement):
    callee: Expression | None = None
    arguments: list[Expression | None] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(
            self.callee,
            *[a for a in self.arguments if a is not None],
        )

    def children(self) -> Generator[Node, None, None]:
        if self.callee is not None:
            yield self.callee
        for arg in self.arguments:
            if arg is not None:
                yield arg


@dataclass(repr=False)
class VbaLetStatement(Statement):
    target: Expression | None = None
    value: Expression | None = None
    explicit: bool = False
    keyword: str = ''

    def __post_init__(self):
        self._adopt(self.target, self.value)

    def children(self) -> Generator[Node, None, None]:
        if self.target is not None:
            yield self.target
        if self.value is not None:
            yield self.value


@dataclass(repr=False)
class VbaSetStatement(Statement):
    target: Expression | None = None
    value: Expression | None = None

    def __post_init__(self):
        self._adopt(self.target, self.value)

    def children(self) -> Generator[Node, None, None]:
        if self.target is not None:
            yield self.target
        if self.value is not None:
            yield self.value


@dataclass(repr=False)
class VbaElseIfClause(Node):
    condition: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.condition, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.condition is not None:
            yield self.condition
        yield from self.body


@dataclass(repr=False)
class VbaIfStatement(Statement):
    condition: Expression | None = None
    body: list[Statement] = field(default_factory=list)
    elseif_clauses: list[VbaElseIfClause] = field(default_factory=list)
    else_body: list[Statement] = field(default_factory=list)
    single_line: bool = False

    def __post_init__(self):
        self._adopt(self.condition, *self.body, *self.elseif_clauses, *self.else_body)

    def children(self) -> Generator[Node, None, None]:
        if self.condition is not None:
            yield self.condition
        yield from self.body
        yield from self.elseif_clauses
        yield from self.else_body


@dataclass(repr=False)
class VbaForStatement(Statement):
    variable: Expression | None = None
    start: Expression | None = None
    end: Expression | None = None
    step: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.variable, self.start, self.end, self.step, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.variable is not None:
            yield self.variable
        if self.start is not None:
            yield self.start
        if self.end is not None:
            yield self.end
        if self.step is not None:
            yield self.step
        yield from self.body


@dataclass(repr=False)
class VbaForEachStatement(Statement):
    variable: Expression | None = None
    collection: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.variable, self.collection, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.variable is not None:
            yield self.variable
        if self.collection is not None:
            yield self.collection
        yield from self.body


@dataclass(repr=False)
class VbaDoLoopStatement(Statement):
    condition: Expression | None = None
    condition_type: VbaLoopConditionType | None = None
    condition_position: VbaLoopConditionPosition | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.condition, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.condition is not None:
            yield self.condition
        yield from self.body


@dataclass(repr=False)
class VbaWhileStatement(Statement):
    condition: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.condition, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.condition is not None:
            yield self.condition
        yield from self.body


@dataclass(repr=False)
class VbaCaseClause(Node):
    tests: list[Expression] = field(default_factory=list)
    body: list[Statement] = field(default_factory=list)
    is_else: bool = False

    def __post_init__(self):
        self._adopt(*self.tests, *self.body)

    def children(self) -> Generator[Node, None, None]:
        yield from self.tests
        yield from self.body


@dataclass(repr=False)
class VbaSelectCaseStatement(Statement):
    expression: Expression | None = None
    cases: list[VbaCaseClause] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.expression, *self.cases)

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression
        yield from self.cases


@dataclass(repr=False)
class VbaWithStatement(Statement):
    object: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.object, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.object is not None:
            yield self.object
        yield from self.body


@dataclass(repr=False)
class VbaGotoStatement(Statement):
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaGosubStatement(Statement):
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaOnErrorStatement(Statement):
    action: VbaOnErrorAction = VbaOnErrorAction.NONE
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaOnBranchStatement(Statement):
    expression: Expression = field(default_factory=lambda: VbaIntegerLiteral(value=0))
    kind: VbaOnBranchKind = VbaOnBranchKind.GOTO
    labels: list[str] = field(default_factory=list)

    def children(self) -> Generator[Node, None, None]:
        yield self.expression


@dataclass(repr=False)
class VbaExitStatement(Statement):
    kind: VbaExitKind = VbaExitKind.SUB

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaReturnStatement(Statement):
    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaRedimStatement(Statement):
    preserve: bool = False
    declarators: list[VbaVariableDeclarator] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.declarators)

    def children(self) -> Generator[Node, None, None]:
        yield from self.declarators


@dataclass(repr=False)
class VbaEraseStatement(Statement):
    targets: list[Expression] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.targets)

    def children(self) -> Generator[Node, None, None]:
        yield from self.targets


@dataclass(repr=False)
class VbaRaiseEventStatement(Statement):
    name: str = ''
    arguments: list[Expression] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.arguments)

    def children(self) -> Generator[Node, None, None]:
        yield from self.arguments


@dataclass(repr=False)
class VbaLabelStatement(Statement):
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaStopStatement(Statement):
    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaEndStatement(Statement):
    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaDebugPrintStatement(Statement):
    method: str = 'Print'
    arguments: list[Expression] = field(default_factory=list)
    separators: list[str] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.arguments)

    def children(self) -> Generator[Node, None, None]:
        yield from self.arguments


@dataclass(repr=False)
class VbaResumeStatement(Statement):
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()


@dataclass(repr=False)
class VbaImplementsStatement(Statement):
    name: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Classes

class VbaLoopConditionType (*args, **kwds)

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Expand source code Browse git
class VbaLoopConditionType(enum.Enum):
    WHILE = 'While'
    UNTIL = 'Until'

Ancestors

  • enum.Enum

Class variables

var WHILE

The type of the None singleton.

var UNTIL

The type of the None singleton.

class VbaLoopConditionPosition (*args, **kwds)

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Expand source code Browse git
class VbaLoopConditionPosition(enum.Enum):
    PRE = 'pre'
    POST = 'post'

Ancestors

  • enum.Enum

Class variables

var PRE

The type of the None singleton.

var POST

The type of the None singleton.

class VbaScopeModifier (*args, **kwds)

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Expand source code Browse git
class VbaScopeModifier(enum.Enum):
    NONE = ''
    PUBLIC = 'Public'
    PRIVATE = 'Private'
    FRIEND = 'Friend'
    DIM = 'Dim'
    GLOBAL = 'Global'
    STATIC = 'Static'

Ancestors

  • enum.Enum

Class variables

var NONE

The type of the None singleton.

var PUBLIC

The type of the None singleton.

var PRIVATE

The type of the None singleton.

var FRIEND

The type of the None singleton.

var DIM

The type of the None singleton.

var GLOBAL

The type of the None singleton.

var STATIC

The type of the None singleton.

class VbaPropertyKind (*args, **kwds)

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Expand source code Browse git
class VbaPropertyKind(enum.Enum):
    GET = 'Get'
    LET = 'Let'
    SET = 'Set'

Ancestors

  • enum.Enum

Class variables

var GET

The type of the None singleton.

var LET

The type of the None singleton.

var SET

The type of the None singleton.

class VbaExitKind (*args, **kwds)

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Expand source code Browse git
class VbaExitKind(enum.Enum):
    SUB = 'Sub'
    FUNCTION = 'Function'
    DO = 'Do'
    FOR = 'For'
    PROPERTY = 'Property'

Ancestors

  • enum.Enum

Class variables

var SUB

The type of the None singleton.

var FUNCTION

The type of the None singleton.

var DO

The type of the None singleton.

var FOR

The type of the None singleton.

var PROPERTY

The type of the None singleton.

class VbaOnErrorAction (*args, **kwds)

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Expand source code Browse git
class VbaOnErrorAction(enum.Enum):
    NONE = ''
    GOTO = 'GoTo'
    RESUME = 'Resume'
    RESUME_NEXT = 'ResumeNext'

Ancestors

  • enum.Enum

Class variables

var NONE

The type of the None singleton.

var GOTO

The type of the None singleton.

var RESUME

The type of the None singleton.

var RESUME_NEXT

The type of the None singleton.

class VbaOnBranchKind (*args, **kwds)

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Expand source code Browse git
class VbaOnBranchKind(enum.Enum):
    GOTO = 'GoTo'
    GOSUB = 'GoSub'

Ancestors

  • enum.Enum

Class variables

var GOTO

The type of the None singleton.

var GOSUB

The type of the None singleton.

class VbaParameterPassing (*args, **kwds)

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Expand source code Browse git
class VbaParameterPassing(enum.Enum):
    NONE = ''
    BY_VAL = 'ByVal'
    BY_REF = 'ByRef'

Ancestors

  • enum.Enum

Class variables

var NONE

The type of the None singleton.

var BY_VAL

The type of the None singleton.

var BY_REF

The type of the None singleton.

class VbaErrorNode (offset=-1, parent=None, leading_comments=<factory>, text='', message='')

VbaErrorNode(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , text: 'str' = '', message: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaErrorNode(Node):
    text: str = ''
    message: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var text

The type of the None singleton.

var message

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaIdentifier (offset=-1, parent=None, leading_comments=<factory>, name='')

VbaIdentifier(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , name: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaIdentifier(Expression):
    name: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var name

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaTypedIdentifier (offset=-1, parent=None, leading_comments=<factory>, name='', suffix='')

VbaTypedIdentifier(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , name: 'str' = '', suffix: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaTypedIdentifier(Expression):
    name: str = ''
    suffix: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var name

The type of the None singleton.

var suffix

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaMeExpression (offset=-1, parent=None, leading_comments=<factory>)

VbaMeExpression(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaMeExpression(Expression):
    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaIntegerLiteral (offset=-1, parent=None, leading_comments=<factory>, value=0, raw='0')

VbaIntegerLiteral(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , value: 'int' = 0, raw: 'str' = '0')

Expand source code Browse git
@dataclass(repr=False)
class VbaIntegerLiteral(Expression):
    value: int = 0
    raw: str = '0'

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var value

The type of the None singleton.

var raw

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaFloatLiteral (offset=-1, parent=None, leading_comments=<factory>, value=0.0, raw='0')

VbaFloatLiteral(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , value: 'float' = 0.0, raw: 'str' = '0')

Expand source code Browse git
@dataclass(repr=False)
class VbaFloatLiteral(Expression):
    value: float = 0.0
    raw: str = '0'

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var value

The type of the None singleton.

var raw

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaStringLiteral (offset=-1, parent=None, leading_comments=<factory>, value='', raw='""')

VbaStringLiteral(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , value: 'str' = '', raw: 'str' = '""')

Expand source code Browse git
@dataclass(repr=False)
class VbaStringLiteral(Expression):
    value: str = ''
    raw: str = '""'

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var value

The type of the None singleton.

var raw

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaDateLiteral (offset=-1, parent=None, leading_comments=<factory>, raw='##')

VbaDateLiteral(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , raw: 'str' = '##')

Expand source code Browse git
@dataclass(repr=False)
class VbaDateLiteral(Expression):
    raw: str = '##'

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var raw

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaBooleanLiteral (offset=-1, parent=None, leading_comments=<factory>, value=False)

VbaBooleanLiteral(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , value: 'bool' = False)

Expand source code Browse git
@dataclass(repr=False)
class VbaBooleanLiteral(Expression):
    value: bool = False

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var value

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaNothingLiteral (offset=-1, parent=None, leading_comments=<factory>)

VbaNothingLiteral(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaNothingLiteral(Expression):
    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaNullLiteral (offset=-1, parent=None, leading_comments=<factory>)

VbaNullLiteral(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaNullLiteral(Expression):
    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaEmptyLiteral (offset=-1, parent=None, leading_comments=<factory>)

VbaEmptyLiteral(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaEmptyLiteral(Expression):
    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaBinaryExpression (offset=-1, parent=None, leading_comments=<factory>, left=None, operator='', right=None)

VbaBinaryExpression(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , left: 'Expression | None' = None, operator: 'str' = '', right: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaBinaryExpression(Expression):
    left: Expression | None = None
    operator: str = ''
    right: Expression | None = None

    def __post_init__(self):
        self._adopt(self.left, self.right)

    def children(self) -> Generator[Node, None, None]:
        if self.left is not None:
            yield self.left
        if self.right is not None:
            yield self.right

Ancestors

Instance variables

var left

The type of the None singleton.

var operator

The type of the None singleton.

var right

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.left is not None:
        yield self.left
    if self.right is not None:
        yield self.right

Inherited members

class VbaUnaryExpression (offset=-1, parent=None, leading_comments=<factory>, operator='', operand=None)

VbaUnaryExpression(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , operator: 'str' = '', operand: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaUnaryExpression(Expression):
    operator: str = ''
    operand: Expression | None = None

    def __post_init__(self):
        self._adopt(self.operand)

    def children(self) -> Generator[Node, None, None]:
        if self.operand is not None:
            yield self.operand

Ancestors

Instance variables

var operator

The type of the None singleton.

var operand

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.operand is not None:
        yield self.operand

Inherited members

class VbaNamedArgument (offset=-1, parent=None, leading_comments=<factory>, name='', expression=None)

VbaNamedArgument(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , name: 'str' = '', expression: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaNamedArgument(Expression):
    name: str = ''
    expression: Expression | None = None

    def __post_init__(self):
        self._adopt(self.expression)

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression

Ancestors

Instance variables

var name

The type of the None singleton.

var expression

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.expression is not None:
        yield self.expression

Inherited members

class VbaByValArgument (offset=-1, parent=None, leading_comments=<factory>, expression=None)

VbaByValArgument(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , expression: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaByValArgument(Expression):
    expression: Expression | None = None

    def __post_init__(self):
        self._adopt(self.expression)

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression

Ancestors

Instance variables

var expression

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.expression is not None:
        yield self.expression

Inherited members

class VbaCallExpression (offset=-1, parent=None, leading_comments=<factory>, callee=None, arguments=<factory>)

VbaCallExpression(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , callee: 'Expression | None' = None, arguments: 'list[Expression | None]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaCallExpression(Expression):
    callee: Expression | None = None
    arguments: list[Expression | None] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.callee, *[a for a in self.arguments if a is not None])

    def children(self) -> Generator[Node, None, None]:
        if self.callee is not None:
            yield self.callee
        for arg in self.arguments:
            if arg is not None:
                yield arg

Ancestors

Instance variables

var arguments

The type of the None singleton.

var callee

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.callee is not None:
        yield self.callee
    for arg in self.arguments:
        if arg is not None:
            yield arg

Inherited members

class VbaMemberAccess (offset=-1, parent=None, leading_comments=<factory>, object=None, member='')

VbaMemberAccess(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , object: 'Expression | None' = None, member: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaMemberAccess(Expression):
    object: Expression | None = None
    member: str = ''

    def __post_init__(self):
        self._adopt(self.object)

    def children(self) -> Generator[Node, None, None]:
        if self.object is not None:
            yield self.object

Ancestors

Instance variables

var object

The type of the None singleton.

var member

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.object is not None:
        yield self.object

Inherited members

class VbaBangAccess (offset=-1, parent=None, leading_comments=<factory>, object=None, member='')

VbaBangAccess(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , object: 'Expression | None' = None, member: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaBangAccess(Expression):
    object: Expression | None = None
    member: str = ''

    def __post_init__(self):
        self._adopt(self.object)

    def children(self) -> Generator[Node, None, None]:
        if self.object is not None:
            yield self.object

Ancestors

Instance variables

var object

The type of the None singleton.

var member

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.object is not None:
        yield self.object

Inherited members

class VbaIndexExpression (offset=-1, parent=None, leading_comments=<factory>, object=None, arguments=<factory>)

VbaIndexExpression(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , object: 'Expression | None' = None, arguments: 'list[Expression | None]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaIndexExpression(Expression):
    object: Expression | None = None
    arguments: list[Expression | None] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.object, *[a for a in self.arguments if a is not None])

    def children(self) -> Generator[Node, None, None]:
        if self.object is not None:
            yield self.object
        for arg in self.arguments:
            if arg is not None:
                yield arg

Ancestors

Instance variables

var arguments

The type of the None singleton.

var object

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.object is not None:
        yield self.object
    for arg in self.arguments:
        if arg is not None:
            yield arg

Inherited members

class VbaNewExpression (offset=-1, parent=None, leading_comments=<factory>, class_name=None)

VbaNewExpression(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , class_name: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaNewExpression(Expression):
    class_name: Expression | None = None

    def __post_init__(self):
        self._adopt(self.class_name)

    def children(self) -> Generator[Node, None, None]:
        if self.class_name is not None:
            yield self.class_name

Ancestors

Instance variables

var class_name

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.class_name is not None:
        yield self.class_name

Inherited members

class VbaTypeOfIsExpression (offset=-1, parent=None, leading_comments=<factory>, operand=None, type_name=None)

VbaTypeOfIsExpression(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , operand: 'Expression | None' = None, type_name: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaTypeOfIsExpression(Expression):
    operand: Expression | None = None
    type_name: Expression | None = None

    def __post_init__(self):
        self._adopt(self.operand, self.type_name)

    def children(self) -> Generator[Node, None, None]:
        if self.operand is not None:
            yield self.operand
        if self.type_name is not None:
            yield self.type_name

Ancestors

Instance variables

var operand

The type of the None singleton.

var type_name

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.operand is not None:
        yield self.operand
    if self.type_name is not None:
        yield self.type_name

Inherited members

class VbaParenExpression (offset=-1, parent=None, leading_comments=<factory>, expression=None)

VbaParenExpression(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , expression: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaParenExpression(Expression):
    expression: Expression | None = None

    def __post_init__(self):
        self._adopt(self.expression)

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression

Ancestors

Instance variables

var expression

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.expression is not None:
        yield self.expression

Inherited members

class VbaRangeExpression (offset=-1, parent=None, leading_comments=<factory>, start=None, end=None)

VbaRangeExpression(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , start: 'Expression | None' = None, end: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaRangeExpression(Expression):
    start: Expression | None = None
    end: Expression | None = None

    def __post_init__(self):
        self._adopt(self.start, self.end)

    def children(self) -> Generator[Node, None, None]:
        if self.start is not None:
            yield self.start
        if self.end is not None:
            yield self.end

Ancestors

Instance variables

var start

The type of the None singleton.

var end

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.start is not None:
        yield self.start
    if self.end is not None:
        yield self.end

Inherited members

class VbaModule (offset=-1, parent=None, leading_comments=<factory>, body=<factory>)

VbaModule(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , body: 'list[Statement]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaModule(Script):
    pass

Ancestors

Inherited members

class VbaOptionStatement (offset=-1, parent=None, leading_comments=<factory>, keyword='', value='')

VbaOptionStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , keyword: 'str' = '', value: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaOptionStatement(Statement):
    keyword: str = ''
    value: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var keyword

The type of the None singleton.

var value

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaDeclareStatement (offset=-1, parent=None, leading_comments=<factory>, scope=VbaScopeModifier.NONE, name='', lib='', alias='', is_function=False, params=<factory>, return_type='', raw='')

VbaDeclareStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , scope: 'VbaScopeModifier' = , name: 'str' = '', lib: 'str' = '', alias: 'str' = '', is_function: 'bool' = False, params: 'list[VbaParameter]' = , return_type: 'str' = '', raw: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaDeclareStatement(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    lib: str = ''
    alias: str = ''
    is_function: bool = False
    params: list[VbaParameter] = field(default_factory=list)
    return_type: str = ''
    raw: str = ''

    def __post_init__(self):
        self._adopt(*self.params)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params

Ancestors

Instance variables

var params

The type of the None singleton.

var scope

The type of the None singleton.

var name

The type of the None singleton.

var lib

The type of the None singleton.

var alias

The type of the None singleton.

var is_function

The type of the None singleton.

var return_type

The type of the None singleton.

var raw

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.params

Inherited members

class VbaTypeDefinition (offset=-1, parent=None, leading_comments=<factory>, scope=VbaScopeModifier.NONE, name='', members=<factory>)

VbaTypeDefinition(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , scope: 'VbaScopeModifier' = , name: 'str' = '', members: 'list[VbaVariableDeclarator]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaTypeDefinition(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    members: list[VbaVariableDeclarator] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.members)

    def children(self) -> Generator[Node, None, None]:
        yield from self.members

Ancestors

Instance variables

var members

The type of the None singleton.

var scope

The type of the None singleton.

var name

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.members

Inherited members

class VbaEnumDefinition (offset=-1, parent=None, leading_comments=<factory>, scope=VbaScopeModifier.NONE, name='', members=<factory>)

VbaEnumDefinition(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , scope: 'VbaScopeModifier' = , name: 'str' = '', members: 'list[VbaEnumMember]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaEnumDefinition(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    members: list[VbaEnumMember] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.members)

    def children(self) -> Generator[Node, None, None]:
        yield from self.members

Ancestors

Instance variables

var members

The type of the None singleton.

var scope

The type of the None singleton.

var name

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.members

Inherited members

class VbaEnumMember (offset=-1, parent=None, leading_comments=<factory>, name='', value=None)

VbaEnumMember(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , name: 'str' = '', value: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaEnumMember(Node):
    name: str = ''
    value: Expression | None = None

    def __post_init__(self):
        self._adopt(self.value)

    def children(self) -> Generator[Node, None, None]:
        if self.value is not None:
            yield self.value

Ancestors

Instance variables

var name

The type of the None singleton.

var value

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.value is not None:
        yield self.value

Inherited members

class VbaConstDeclarator (offset=-1, parent=None, leading_comments=<factory>, name='', type_name='', value=None)

VbaConstDeclarator(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , name: 'str' = '', type_name: 'str' = '', value: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaConstDeclarator(Node):
    name: str = ''
    type_name: str = ''
    value: Expression | None = None

    def __post_init__(self):
        self._adopt(self.value)

    def children(self) -> Generator[Node, None, None]:
        if self.value is not None:
            yield self.value

Ancestors

Instance variables

var name

The type of the None singleton.

var type_name

The type of the None singleton.

var value

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.value is not None:
        yield self.value

Inherited members

class VbaConstDeclaration (offset=-1, parent=None, leading_comments=<factory>, scope=VbaScopeModifier.NONE, declarators=<factory>)

VbaConstDeclaration(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , scope: 'VbaScopeModifier' = , declarators: 'list[VbaConstDeclarator]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaConstDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    declarators: list[VbaConstDeclarator] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.declarators)

    def children(self) -> Generator[Node, None, None]:
        yield from self.declarators

Ancestors

Instance variables

var declarators

The type of the None singleton.

var scope

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.declarators

Inherited members

class VbaVariableDeclarator (offset=-1, parent=None, leading_comments=<factory>, name='', type_name='', is_array=False, bounds=<factory>, is_new=False, with_events=False)

VbaVariableDeclarator(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , name: 'str' = '', type_name: 'str' = '', is_array: 'bool' = False, bounds: 'list[Expression]' = , is_new: 'bool' = False, with_events: 'bool' = False)

Expand source code Browse git
@dataclass(repr=False)
class VbaVariableDeclarator(Node):
    name: str = ''
    type_name: str = ''
    is_array: bool = False
    bounds: list[Expression] = field(default_factory=list)
    is_new: bool = False
    with_events: bool = False

    def __post_init__(self):
        self._adopt(*self.bounds)

    def children(self) -> Generator[Node, None, None]:
        yield from self.bounds

Ancestors

Instance variables

var bounds

The type of the None singleton.

var name

The type of the None singleton.

var type_name

The type of the None singleton.

var is_array

The type of the None singleton.

var is_new

The type of the None singleton.

var with_events

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.bounds

Inherited members

class VbaVariableDeclaration (offset=-1, parent=None, leading_comments=<factory>, scope=VbaScopeModifier.NONE, declarators=<factory>)

VbaVariableDeclaration(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , scope: 'VbaScopeModifier' = , declarators: 'list[VbaVariableDeclarator]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaVariableDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    declarators: list[VbaVariableDeclarator] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.declarators)

    def children(self) -> Generator[Node, None, None]:
        yield from self.declarators

Ancestors

Instance variables

var declarators

The type of the None singleton.

var scope

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.declarators

Inherited members

class VbaEventDeclaration (offset=-1, parent=None, leading_comments=<factory>, scope=VbaScopeModifier.NONE, name='', params=<factory>)

VbaEventDeclaration(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , scope: 'VbaScopeModifier' = , name: 'str' = '', params: 'list[VbaParameter]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaEventDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    params: list[VbaParameter] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.params)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params

Ancestors

Instance variables

var params

The type of the None singleton.

var scope

The type of the None singleton.

var name

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.params

Inherited members

class VbaParameter (offset=-1, parent=None, leading_comments=<factory>, name='', passing=VbaParameterPassing.NONE, type_name='', is_optional=False, is_paramarray=False, default=None, is_array=False)

VbaParameter(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , name: 'str' = '', passing: 'VbaParameterPassing' = , type_name: 'str' = '', is_optional: 'bool' = False, is_paramarray: 'bool' = False, default: 'Expression | None' = None, is_array: 'bool' = False)

Expand source code Browse git
@dataclass(repr=False)
class VbaParameter(Node):
    name: str = ''
    passing: VbaParameterPassing = VbaParameterPassing.NONE
    type_name: str = ''
    is_optional: bool = False
    is_paramarray: bool = False
    default: Expression | None = None
    is_array: bool = False

    def __post_init__(self):
        self._adopt(self.default)

    def children(self) -> Generator[Node, None, None]:
        if self.default is not None:
            yield self.default

Ancestors

Instance variables

var name

The type of the None singleton.

var passing

The type of the None singleton.

var type_name

The type of the None singleton.

var is_optional

The type of the None singleton.

var is_paramarray

The type of the None singleton.

var default

The type of the None singleton.

var is_array

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.default is not None:
        yield self.default

Inherited members

class VbaSubDeclaration (offset=-1, parent=None, leading_comments=<factory>, scope=VbaScopeModifier.NONE, name='', params=<factory>, body=<factory>, is_static=False)

VbaSubDeclaration(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , scope: 'VbaScopeModifier' = , name: 'str' = '', params: 'list[VbaParameter]' = , body: 'list[Statement]' = , is_static: 'bool' = False)

Expand source code Browse git
@dataclass(repr=False)
class VbaSubDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    params: list[VbaParameter] = field(default_factory=list)
    body: list[Statement] = field(default_factory=list)
    is_static: bool = False

    def __post_init__(self):
        self._adopt(*self.params, *self.body)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params
        yield from self.body

Ancestors

Instance variables

var params

The type of the None singleton.

var body

The type of the None singleton.

var scope

The type of the None singleton.

var name

The type of the None singleton.

var is_static

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.params
    yield from self.body

Inherited members

class VbaFunctionDeclaration (offset=-1, parent=None, leading_comments=<factory>, scope=VbaScopeModifier.NONE, name='', params=<factory>, return_type='', body=<factory>, is_static=False)

VbaFunctionDeclaration(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , scope: 'VbaScopeModifier' = , name: 'str' = '', params: 'list[VbaParameter]' = , return_type: 'str' = '', body: 'list[Statement]' = , is_static: 'bool' = False)

Expand source code Browse git
@dataclass(repr=False)
class VbaFunctionDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    name: str = ''
    params: list[VbaParameter] = field(default_factory=list)
    return_type: str = ''
    body: list[Statement] = field(default_factory=list)
    is_static: bool = False

    def __post_init__(self):
        self._adopt(*self.params, *self.body)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params
        yield from self.body

Ancestors

Instance variables

var params

The type of the None singleton.

var body

The type of the None singleton.

var scope

The type of the None singleton.

var name

The type of the None singleton.

var return_type

The type of the None singleton.

var is_static

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.params
    yield from self.body

Inherited members

class VbaPropertyDeclaration (offset=-1, parent=None, leading_comments=<factory>, scope=VbaScopeModifier.NONE, kind=VbaPropertyKind.GET, name='', params=<factory>, return_type='', body=<factory>, is_static=False)

VbaPropertyDeclaration(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , scope: 'VbaScopeModifier' = , kind: 'VbaPropertyKind' = , name: 'str' = '', params: 'list[VbaParameter]' = , return_type: 'str' = '', body: 'list[Statement]' = , is_static: 'bool' = False)

Expand source code Browse git
@dataclass(repr=False)
class VbaPropertyDeclaration(Statement):
    scope: VbaScopeModifier = VbaScopeModifier.NONE
    kind: VbaPropertyKind = VbaPropertyKind.GET
    name: str = ''
    params: list[VbaParameter] = field(default_factory=list)
    return_type: str = ''
    body: list[Statement] = field(default_factory=list)
    is_static: bool = False

    def __post_init__(self):
        self._adopt(*self.params, *self.body)

    def children(self) -> Generator[Node, None, None]:
        yield from self.params
        yield from self.body

Ancestors

Instance variables

var params

The type of the None singleton.

var body

The type of the None singleton.

var scope

The type of the None singleton.

var kind

The type of the None singleton.

var name

The type of the None singleton.

var return_type

The type of the None singleton.

var is_static

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.params
    yield from self.body

Inherited members

class VbaExpressionStatement (offset=-1, parent=None, leading_comments=<factory>, expression=None, arguments=<factory>)

VbaExpressionStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , expression: 'Expression | None' = None, arguments: 'list[Expression | None]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaExpressionStatement(Statement):
    expression: Expression | None = None
    arguments: list[Expression | None] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(
            self.expression,
            *[a for a in self.arguments if a is not None],
        )

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression
        for arg in self.arguments:
            if arg is not None:
                yield arg

Ancestors

Instance variables

var arguments

The type of the None singleton.

var expression

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.expression is not None:
        yield self.expression
    for arg in self.arguments:
        if arg is not None:
            yield arg

Inherited members

class VbaCallStatement (offset=-1, parent=None, leading_comments=<factory>, callee=None, arguments=<factory>)

VbaCallStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , callee: 'Expression | None' = None, arguments: 'list[Expression | None]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaCallStatement(Statement):
    callee: Expression | None = None
    arguments: list[Expression | None] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(
            self.callee,
            *[a for a in self.arguments if a is not None],
        )

    def children(self) -> Generator[Node, None, None]:
        if self.callee is not None:
            yield self.callee
        for arg in self.arguments:
            if arg is not None:
                yield arg

Ancestors

Instance variables

var arguments

The type of the None singleton.

var callee

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.callee is not None:
        yield self.callee
    for arg in self.arguments:
        if arg is not None:
            yield arg

Inherited members

class VbaLetStatement (offset=-1, parent=None, leading_comments=<factory>, target=None, value=None, explicit=False, keyword='')

VbaLetStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , target: 'Expression | None' = None, value: 'Expression | None' = None, explicit: 'bool' = False, keyword: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaLetStatement(Statement):
    target: Expression | None = None
    value: Expression | None = None
    explicit: bool = False
    keyword: str = ''

    def __post_init__(self):
        self._adopt(self.target, self.value)

    def children(self) -> Generator[Node, None, None]:
        if self.target is not None:
            yield self.target
        if self.value is not None:
            yield self.value

Ancestors

Instance variables

var target

The type of the None singleton.

var value

The type of the None singleton.

var explicit

The type of the None singleton.

var keyword

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.target is not None:
        yield self.target
    if self.value is not None:
        yield self.value

Inherited members

class VbaSetStatement (offset=-1, parent=None, leading_comments=<factory>, target=None, value=None)

VbaSetStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , target: 'Expression | None' = None, value: 'Expression | None' = None)

Expand source code Browse git
@dataclass(repr=False)
class VbaSetStatement(Statement):
    target: Expression | None = None
    value: Expression | None = None

    def __post_init__(self):
        self._adopt(self.target, self.value)

    def children(self) -> Generator[Node, None, None]:
        if self.target is not None:
            yield self.target
        if self.value is not None:
            yield self.value

Ancestors

Instance variables

var target

The type of the None singleton.

var value

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.target is not None:
        yield self.target
    if self.value is not None:
        yield self.value

Inherited members

class VbaElseIfClause (offset=-1, parent=None, leading_comments=<factory>, condition=None, body=<factory>)

VbaElseIfClause(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , condition: 'Expression | None' = None, body: 'list[Statement]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaElseIfClause(Node):
    condition: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.condition, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.condition is not None:
            yield self.condition
        yield from self.body

Ancestors

Instance variables

var body

The type of the None singleton.

var condition

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.condition is not None:
        yield self.condition
    yield from self.body

Inherited members

class VbaIfStatement (offset=-1, parent=None, leading_comments=<factory>, condition=None, body=<factory>, elseif_clauses=<factory>, else_body=<factory>, single_line=False)

VbaIfStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , condition: 'Expression | None' = None, body: 'list[Statement]' = , elseif_clauses: 'list[VbaElseIfClause]' = , else_body: 'list[Statement]' = , single_line: 'bool' = False)

Expand source code Browse git
@dataclass(repr=False)
class VbaIfStatement(Statement):
    condition: Expression | None = None
    body: list[Statement] = field(default_factory=list)
    elseif_clauses: list[VbaElseIfClause] = field(default_factory=list)
    else_body: list[Statement] = field(default_factory=list)
    single_line: bool = False

    def __post_init__(self):
        self._adopt(self.condition, *self.body, *self.elseif_clauses, *self.else_body)

    def children(self) -> Generator[Node, None, None]:
        if self.condition is not None:
            yield self.condition
        yield from self.body
        yield from self.elseif_clauses
        yield from self.else_body

Ancestors

Instance variables

var body

The type of the None singleton.

var elseif_clauses

The type of the None singleton.

var else_body

The type of the None singleton.

var condition

The type of the None singleton.

var single_line

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.condition is not None:
        yield self.condition
    yield from self.body
    yield from self.elseif_clauses
    yield from self.else_body

Inherited members

class VbaForStatement (offset=-1, parent=None, leading_comments=<factory>, variable=None, start=None, end=None, step=None, body=<factory>)

VbaForStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , variable: 'Expression | None' = None, start: 'Expression | None' = None, end: 'Expression | None' = None, step: 'Expression | None' = None, body: 'list[Statement]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaForStatement(Statement):
    variable: Expression | None = None
    start: Expression | None = None
    end: Expression | None = None
    step: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.variable, self.start, self.end, self.step, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.variable is not None:
            yield self.variable
        if self.start is not None:
            yield self.start
        if self.end is not None:
            yield self.end
        if self.step is not None:
            yield self.step
        yield from self.body

Ancestors

Instance variables

var body

The type of the None singleton.

var variable

The type of the None singleton.

var start

The type of the None singleton.

var end

The type of the None singleton.

var step

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.variable is not None:
        yield self.variable
    if self.start is not None:
        yield self.start
    if self.end is not None:
        yield self.end
    if self.step is not None:
        yield self.step
    yield from self.body

Inherited members

class VbaForEachStatement (offset=-1, parent=None, leading_comments=<factory>, variable=None, collection=None, body=<factory>)

VbaForEachStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , variable: 'Expression | None' = None, collection: 'Expression | None' = None, body: 'list[Statement]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaForEachStatement(Statement):
    variable: Expression | None = None
    collection: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.variable, self.collection, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.variable is not None:
            yield self.variable
        if self.collection is not None:
            yield self.collection
        yield from self.body

Ancestors

Instance variables

var body

The type of the None singleton.

var variable

The type of the None singleton.

var collection

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.variable is not None:
        yield self.variable
    if self.collection is not None:
        yield self.collection
    yield from self.body

Inherited members

class VbaDoLoopStatement (offset=-1, parent=None, leading_comments=<factory>, condition=None, condition_type=None, condition_position=None, body=<factory>)

VbaDoLoopStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , condition: 'Expression | None' = None, condition_type: 'VbaLoopConditionType | None' = None, condition_position: 'VbaLoopConditionPosition | None' = None, body: 'list[Statement]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaDoLoopStatement(Statement):
    condition: Expression | None = None
    condition_type: VbaLoopConditionType | None = None
    condition_position: VbaLoopConditionPosition | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.condition, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.condition is not None:
            yield self.condition
        yield from self.body

Ancestors

Instance variables

var body

The type of the None singleton.

var condition

The type of the None singleton.

var condition_type

The type of the None singleton.

var condition_position

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.condition is not None:
        yield self.condition
    yield from self.body

Inherited members

class VbaWhileStatement (offset=-1, parent=None, leading_comments=<factory>, condition=None, body=<factory>)

VbaWhileStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , condition: 'Expression | None' = None, body: 'list[Statement]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaWhileStatement(Statement):
    condition: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.condition, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.condition is not None:
            yield self.condition
        yield from self.body

Ancestors

Instance variables

var body

The type of the None singleton.

var condition

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.condition is not None:
        yield self.condition
    yield from self.body

Inherited members

class VbaCaseClause (offset=-1, parent=None, leading_comments=<factory>, tests=<factory>, body=<factory>, is_else=False)

VbaCaseClause(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , tests: 'list[Expression]' = , body: 'list[Statement]' = , is_else: 'bool' = False)

Expand source code Browse git
@dataclass(repr=False)
class VbaCaseClause(Node):
    tests: list[Expression] = field(default_factory=list)
    body: list[Statement] = field(default_factory=list)
    is_else: bool = False

    def __post_init__(self):
        self._adopt(*self.tests, *self.body)

    def children(self) -> Generator[Node, None, None]:
        yield from self.tests
        yield from self.body

Ancestors

Instance variables

var tests

The type of the None singleton.

var body

The type of the None singleton.

var is_else

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.tests
    yield from self.body

Inherited members

class VbaSelectCaseStatement (offset=-1, parent=None, leading_comments=<factory>, expression=None, cases=<factory>)

VbaSelectCaseStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , expression: 'Expression | None' = None, cases: 'list[VbaCaseClause]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaSelectCaseStatement(Statement):
    expression: Expression | None = None
    cases: list[VbaCaseClause] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.expression, *self.cases)

    def children(self) -> Generator[Node, None, None]:
        if self.expression is not None:
            yield self.expression
        yield from self.cases

Ancestors

Instance variables

var cases

The type of the None singleton.

var expression

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.expression is not None:
        yield self.expression
    yield from self.cases

Inherited members

class VbaWithStatement (offset=-1, parent=None, leading_comments=<factory>, object=None, body=<factory>)

VbaWithStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , object: 'Expression | None' = None, body: 'list[Statement]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaWithStatement(Statement):
    object: Expression | None = None
    body: list[Statement] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(self.object, *self.body)

    def children(self) -> Generator[Node, None, None]:
        if self.object is not None:
            yield self.object
        yield from self.body

Ancestors

Instance variables

var body

The type of the None singleton.

var object

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    if self.object is not None:
        yield self.object
    yield from self.body

Inherited members

class VbaGotoStatement (offset=-1, parent=None, leading_comments=<factory>, label='')

VbaGotoStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , label: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaGotoStatement(Statement):
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var label

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaGosubStatement (offset=-1, parent=None, leading_comments=<factory>, label='')

VbaGosubStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , label: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaGosubStatement(Statement):
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var label

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaOnErrorStatement (offset=-1, parent=None, leading_comments=<factory>, action=VbaOnErrorAction.NONE, label='')

VbaOnErrorStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , action: 'VbaOnErrorAction' = , label: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaOnErrorStatement(Statement):
    action: VbaOnErrorAction = VbaOnErrorAction.NONE
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var action

The type of the None singleton.

var label

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaOnBranchStatement (offset=-1, parent=None, leading_comments=<factory>, expression=<factory>, kind=VbaOnBranchKind.GOTO, labels=<factory>)

VbaOnBranchStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , expression: 'Expression' = , kind: 'VbaOnBranchKind' = , labels: 'list[str]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaOnBranchStatement(Statement):
    expression: Expression = field(default_factory=lambda: VbaIntegerLiteral(value=0))
    kind: VbaOnBranchKind = VbaOnBranchKind.GOTO
    labels: list[str] = field(default_factory=list)

    def children(self) -> Generator[Node, None, None]:
        yield self.expression

Ancestors

Instance variables

var expression

The type of the None singleton.

var labels

The type of the None singleton.

var kind

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield self.expression

Inherited members

class VbaExitStatement (offset=-1, parent=None, leading_comments=<factory>, kind=VbaExitKind.SUB)

VbaExitStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , kind: 'VbaExitKind' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaExitStatement(Statement):
    kind: VbaExitKind = VbaExitKind.SUB

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var kind

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaReturnStatement (offset=-1, parent=None, leading_comments=<factory>)

VbaReturnStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaReturnStatement(Statement):
    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaRedimStatement (offset=-1, parent=None, leading_comments=<factory>, preserve=False, declarators=<factory>)

VbaRedimStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , preserve: 'bool' = False, declarators: 'list[VbaVariableDeclarator]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaRedimStatement(Statement):
    preserve: bool = False
    declarators: list[VbaVariableDeclarator] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.declarators)

    def children(self) -> Generator[Node, None, None]:
        yield from self.declarators

Ancestors

Instance variables

var declarators

The type of the None singleton.

var preserve

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.declarators

Inherited members

class VbaEraseStatement (offset=-1, parent=None, leading_comments=<factory>, targets=<factory>)

VbaEraseStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , targets: 'list[Expression]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaEraseStatement(Statement):
    targets: list[Expression] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.targets)

    def children(self) -> Generator[Node, None, None]:
        yield from self.targets

Ancestors

Instance variables

var targets

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.targets

Inherited members

class VbaRaiseEventStatement (offset=-1, parent=None, leading_comments=<factory>, name='', arguments=<factory>)

VbaRaiseEventStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , name: 'str' = '', arguments: 'list[Expression]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaRaiseEventStatement(Statement):
    name: str = ''
    arguments: list[Expression] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.arguments)

    def children(self) -> Generator[Node, None, None]:
        yield from self.arguments

Ancestors

Instance variables

var arguments

The type of the None singleton.

var name

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.arguments

Inherited members

class VbaLabelStatement (offset=-1, parent=None, leading_comments=<factory>, label='')

VbaLabelStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , label: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaLabelStatement(Statement):
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var label

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaStopStatement (offset=-1, parent=None, leading_comments=<factory>)

VbaStopStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaStopStatement(Statement):
    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaEndStatement (offset=-1, parent=None, leading_comments=<factory>)

VbaEndStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaEndStatement(Statement):
    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaDebugPrintStatement (offset=-1, parent=None, leading_comments=<factory>, method='Print', arguments=<factory>, separators=<factory>)

VbaDebugPrintStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , method: 'str' = 'Print', arguments: 'list[Expression]' = , separators: 'list[str]' = )

Expand source code Browse git
@dataclass(repr=False)
class VbaDebugPrintStatement(Statement):
    method: str = 'Print'
    arguments: list[Expression] = field(default_factory=list)
    separators: list[str] = field(default_factory=list)

    def __post_init__(self):
        self._adopt(*self.arguments)

    def children(self) -> Generator[Node, None, None]:
        yield from self.arguments

Ancestors

Instance variables

var arguments

The type of the None singleton.

var separators

The type of the None singleton.

var method

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from self.arguments

Inherited members

class VbaResumeStatement (offset=-1, parent=None, leading_comments=<factory>, label='')

VbaResumeStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , label: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaResumeStatement(Statement):
    label: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var label

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members

class VbaImplementsStatement (offset=-1, parent=None, leading_comments=<factory>, name='')

VbaImplementsStatement(offset: 'int' = -1, parent: 'Node | None' = None, leading_comments: 'list[str]' = , name: 'str' = '')

Expand source code Browse git
@dataclass(repr=False)
class VbaImplementsStatement(Statement):
    name: str = ''

    def children(self) -> Generator[Node, None, None]:
        yield from ()

Ancestors

Instance variables

var name

The type of the None singleton.

Methods

def children(self)
Expand source code Browse git
def children(self) -> Generator[Node, None, None]:
    yield from ()

Inherited members