interface

interface grammar version 20

'context keys': [ root ] dictionary { }
'root': component 'node'
'numerical types': [ numerical-types ] dictionary { }
'node' { [ {, } ]
	'attributes': dictionary {
		'has predecessor': stategroup = node-switch predecessor (
			| node = 'yes' { 'attribute' = predecessor }
			| none = 'no'
		)
		'type': [ : ] stategroup (
			'command' { [ command ]
				'parameters': component 'node'
			}
			'event' { [ event ]
				'parameters': component 'node'
			}
			'property' {
				'type': stategroup (
					'text' { [ text ]
						'has constraint': stategroup (
							'no' { }
							'yes' {
								'type': stategroup (
									'existing' { }
									'nonexisting' { [ new ] }
								)
								'referencer': component 'referencer'
							}
						)
					}
					'number' { [ number ]
						'type': component 'number type'
					}
					'file' { [ file ] }
					'collection' { [ collection ]
						'type': stategroup (
							'dense map' { [ dense-map ] }
							'simple' { }
						)
						'key property': [ [, ] ] reference
						'graphs': component 'graphs definition'
						'node': component 'node'
					}
					'group' { [ group ]
						'node': component 'node'
					}
					'state group' { [ stategroup ]
						'states': [ (, ) ] dictionary {
							'context rules': component 'where clause'
							'node': component 'node'
						}
					}
				)
			}
		)
	}
}
'number type' {
	'type': stategroup (
		'unbounded' { }
		'bounded' {
			'invert sign': stategroup (
				'no' { }
				'yes' { [ non ] }
			)
			'sign': stategroup (
				'positive' { [ positive ] }
				'negative' { [ negative ] }
				'zero' { [ zero ] }
			)
		}
	)
	'numerical type': reference
	'decimal places': stategroup (
		'no' { }
		'yes' { [ decimals: ]
			'places': integer
		}
	)
}
'optional evaluation annotation' {
	'phase': stategroup (
		'inherited' { }
		'downstream' { [ downstream ] }
	)
}
'explicit evaluation annotation' {
	'phase': stategroup (
		'upstream' { }
		'downstream' { [ downstream ] }
	)
}
'referencer' { [ -> ]
	'evaluation': component 'explicit evaluation annotation'
	'path': group {
		'head': component 'context node path'
		'tail': component 'node path tail'
	}
	'type': stategroup (
		'unrestricted' {
			'collection step': [ ., [] ] component 'property step'
		}
		'sibling' { [ sibling ]
			'graph participation': stategroup (
				'no' {
					'support self reference': stategroup (
						'no' { }
						'yes' { [ || self ] }
					)
				}
				'yes' { [ in ]
					'graphs': [ (, ) ] dictionary { }
				}
			)
		}
	)
	'tail': component 'node path tail'
	'rules': component 'where clause'
}
'where clause' {
	'has rule': stategroup = node-switch .'rules' (
		| nodes = 'yes' { 'first' = first }
		| none  = 'no'
	)
	'rules': dictionary { [ where ]
		'has successor': stategroup = node-switch successor (
			| node = 'yes' { 'rule' = successor }
			| none = 'no'
		)
		'evaluation': [ -> ] component 'optional evaluation annotation'
		'context': stategroup (
			'sibling rule' {
				'rule': reference
			}
			'context' {
				'path': component 'context node path'
			}
		)
		'tail': component 'node path tail'
	}
}
'graphs definition' {
	'graphs': dictionary {
		'type': [ : ] stategroup (
			'acyclic' { [ acyclic-graph ] }
			'ordered' { [ ordered-graph ]
				'path': component 'node path tail'
				'ordering property': [ > ] reference
			}
		)
	}
}
'property step' {
	'property': reference
}
'reference property step' {
	'property': component 'property step'
}
'node path tail' {
	'has steps': stategroup (
		'no' { }
		'yes' {
			'type': stategroup (
				'parent' { [ ^ ] }
				'group' { [ . ]
					'group step': component 'property step'
				}
				'state' {
					'state group step': [ . ] component 'property step'
					'state': [ ? ] reference
				}
				'reference' { [ > ]
					'reference': component 'reference property step'
				}
				'reference rule' {
					'reference': [ . ] component 'reference property step'
					'rule': [ & ] reference
				}
				'state context rule' { [ .& ]
					'context rule': reference
				}
			)
			'tail': component 'node path tail'
		}
	)
}
'context node path' {
	'context': stategroup (
		'this dataset node' { }
		'this parameter node' { [ @ ] }
		'dataset root' { [ root ] }
		'expression context' { [ $ ] }
	)
}