-
Notifications
You must be signed in to change notification settings - Fork 3
Intermediate Language Specification
Murphy Berzish edited this page Jul 29, 2014
·
9 revisions
The grammar of a Manifold schematic is relatively simple, and lends itself well to expression in the JSON format.
- A Schematic consists of zero or more of any of the following: User-defined Type Definitions, Port Type Definitions, Node Type Definitions, Connection Type Definitions, Constraint Type Definitions, Node Instantiations, Connection Instantiations, and Constraint Instantiations.
- A User-defined Type Definition has a String name and a TypeValue value.
- A Port Type Definition has a String name and zero or more Attribute Types.
- A Node Type Definition has a String name, zero or more Attribute Types, and zero or more Port Type Definitions.
- A Connection Type Definition has a String name and zero or more Attribute Types.
- A Constraint Type Definition has a String name and zero or more Attribute Types.
- A Node Instantiation has a String name, zero or more Attributes, and zero or more Port Instantiations.
- A Port Instantiation has a String name, zero or more Attributes, and a reference to a Node Instantiation parent.
- A Connection Instantiation has a String name, zero or more Attributes, and a reference to a Port Instantiation from-port and a Port Instantiation to-port.
- A Constraint Instantiation has a String name and zero or more Attributes.
- An Attribute Type is a pair consisting of a String name and a TypeValue value.
- An Attribute is a pair consisting of a String name and a Value.
- Every instance of a node, connection, constraint, or port is constructed from a corresponding type definition.
- For each attribute type belonging to a type definition whose name is N and whose value is T, every instance constructed from that type definition must have an attribute whose name is N and whose value has type T.
- No two entities of the same kind (X type definition, Y instantiation) may have the same name, with the exception of port type definitions, whose names must be unique only within the same node type definition. (i.e. node type A cannot have two ports both named "foo", but it is allowed for distinct node types A and B to both have ports named "foo")