Table Of Contents

Previous topic

fbrelation

Next topic

declarations

This Page

syntax

Defines syntax objects, which contain the abstract syntax of the various types of declarations that make up a program. Syntax objects are created by parsing input text.

Syntax objects have two major methods: The static parse() method constructs a new syntax object from raw input text, and compile() constructs a new, semantically valid declaration object.

syntax.program

Classes: ProgramSyntax

Defines classes for parsing and compiling programs, which consist of a series of relation constraint declarations:

<relation>
<relation>
...
<relation>

syntax.relation

Classes: RelationSyntax

Defines classes for parsing and compiling relation declarations, which consist of a name, then a series of newline-separated box and connection declarations inside a block of curly braces. Shell-style comments (prefixed with #) may be included within the body:

name
{
    <box|connection>
    <box|connection>
    ...
    <box|connection>
}

syntax.box

Classes: BoxSyntax

Defines classes for parsing and compiling box declarations, which consist of a name followed by an attribute list in square brackets. Box declarations must occupy a single line and must not contain arrows (->):

<name> [<attributelist>]

syntax.attributelist

Classes: AttributeListSyntax

Defines classes for parsing attribute lists, which are comma-separated key/value pairs, with values in double quotes and preceded by the equals sign:

<name>="<value>", <name>="<value>", ..., <name>="<value>"

syntax.connection

Classes: ConnectionSyntax

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

<node> -> <node>

syntax.node

Classes NodeSyntax

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>