This Page

syntax.connection

Defines classes for parsing and compiling connection declarations, which consist of exactly two node declarations separated by an arrow (->):

<node> -> <node>
class ConnectionSyntax(srcNode, dstNode)[source]

Represents the abstract syntax of a connection declaration, which consists of two node syntax objects. The source node conveys data (output) to the destination node (input).

__init__(srcNode, dstNode)[source]

Initializes a new connection syntax object with the given source and destination nodes.

__str__()[source]

Converts the connection syntax back into raw text.

compile(boxes)[source]

Compiles this object into a ConnectionDeclaration by compiling the source and destination nodes in turn.

Parameters:boxes – The list of compiled box declarations.
Returns:the newly created connection declaration.
Raises :a CompilationError if any static checks fail.
classmethod parse(text)[source]

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

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