This Page

syntax.node

Defines classes for parsing and compiling node declarations, which consist of either a plain box name (indicating a macro input or output) or a box name and node name separated by a dot:

<boxname.nodename|boxname>
class NodeSyntax(boxName, nodeName)[source]

Represents the abstract syntax for an animation node reference within a connection declaration. Consists of a box name and an optional node name to clarify which of the box’s nodes is involved in the connection. If the node name is blank, it is assumed that the box name by itself is sufficient to deduce the node, as in the case of a macro input or output box.

__init__(boxName, nodeName)[source]

Initializes a new node syntax object to refer to some optionally named node in a box with the given name.

__str__()[source]

Converts the syntax object into its raw string representation.

compile(boxes, isSrc)[source]

Compiles this node syntax structure into a NodeDeclaration object as either a source or a destination node.

Parameters:
  • boxes – The list of compiled box declarations.
  • isSrc – If True, the node is a source node (i.e., on the left side of the arrow in the connection declaration).
Returns:

The newly created node declaration.

Raises :

a CompilationError if any static checks fail.

classmethod parse(text)[source]

Parses the given input text to produce a new NodeSyntax object.

Returns:the newly created syntax object.
Raises :a ParsingError if the syntax is invalid.