gui_model

webclient grammar version xindi.1.1

'has user node': stategroup (
	'yes' { [ users ]
		'context': component 'gui static conditional path'
		'users': [ . ] reference
	}
	'no' { }
)
'root': [ root ] component 'gui node'
'numerical types': [ numerical types ] dictionary {
	'representation type': [ {, } ] stategroup (
		'model' {
			'style': stategroup (
				'decimal' { }
				'currency' { [ currency ] }
				'scientific' { [ scientific ] }
				'engineering' { [ engineering ] }
			)
		}
		'date' { [ date ] }
		'date and time' { [ date-time ] }
		'HTML date and time' { [ HTML html-time ] }
		'duration' { [ duration: ]
			'unit': stategroup (
				'seconds' { [ seconds ] }
				'minutes' { [ minutes ] }
				'hours' { [ hours ] }
			)
		}
	)
}
'duplication node mapping' {
	'properties': [ (, ) ] dictionary {
		'type': stategroup (
			'number' { [ number ] }
			'text' { [ text ] }
			'file' { [ file ] }
			'group' { [ group ]
				'mapping': component 'duplication node mapping'
			}
			'state group' { [ stategroup ]
				'states': [ (, ) ] dictionary { [ | ]
					'mapping': component 'duplication node mapping'
				}
			}
			'collection' { [ collection ] }
		)
	}
}
'gui static singular path' {
	'head': component 'ancestor node path'
	'has steps': stategroup (
		'no' { }
		'yes' {
			'type': stategroup (
				'group' {
					'group': [ + ] reference
				}
			)
			'tail': component 'gui static singular path'
		}
	)
}
'gui static conditional path' {
	'has steps': stategroup (
		'yes' {
			'step': stategroup (
				'group' {
					'group': [ . ] reference
				}
				'state' {
					'stategroup': [ . ] reference
					'state': [ | ] reference
				}
			)
			'tail': component 'gui static conditional path'
		}
		'no' { }
	)
}
'file name expression' {
	'has steps': stategroup (
		'no' { }
		'yes' { [ & ]
			'type': stategroup (
				'static' {
					'text': text
				}
				'property' {
					'path': component 'gui static singular path'
					'type': stategroup (
						'text' { [ : ]
							'text': reference
						}
						'number' { [ # ]
							'number': reference
						}
						'state group' { [ ? ]
							'state group': reference
							'states': [ (, ) ] dictionary {
								'state file name expression': [ (, ) ] component 'file name expression'
							}
						}
					)
				}
			)
			'tail': component 'file name expression'
		}
	)
}
'text validation' {
	'regular expression': text
}
'number limit' {
	'type': stategroup (
		'static' {
			'limit': integer
		}
		'dynamic' {
			'base': stategroup (
				'today' { [ today ] }
				'now' { [ now ] }
			)
			'with offset': stategroup (
				'no' { }
				'yes' { [ + ]
					'offset': integer
				}
			)
		}
	)
}
'where rules' {
	'rules': dictionary { [ (, ) ]
		'referenced node': [ -> ] component 'gui node type path'
		'validate': stategroup (
			'no' { }
			'yes' { [ validate: resolvable ] }
		)
	}
}
'gui node' { [ {, } ]
	'attributes': dictionary {
		'type': stategroup (
			'reference set' { [ : reference-set ] }
			'command' { [ : command ]
				'type': stategroup (
					'global' {
						'parameters': component 'gui node'
					}
					'component' { }
				)
			}
			'action' { [ : action ]
				'parameters': component 'gui node'
				'views': [ (, ) ] dictionary {
					'view context': [ : ] component 'gui node type path'
				}
				'action': component 'gui action'
			}
			'property' { [ : ]
				'type': stategroup (
					'collection' { [ collection ]
						'has ordered graphs': stategroup (
							'no' { }
							'yes' { [ ordered-graphs: ]
								'ordered graphs': dictionary { }
							}
						)
						'default': stategroup (
							'no' { }
							'yes' { [ default: model expression ] }
						)
						'node': component 'gui node'
						'duplication mapping': stategroup (
							'none' { }
							'from current context' { [ duplicate with ]
								'mapping': component 'duplication node mapping'
							}
						)
					}
					'group' { [ group ]
						'gui node': component 'gui node'
					}
					'number' { [ number ]
						'numerical type': reference
						'default': stategroup (
							'no' { }
							'yes' { [ default: ]
								'value': stategroup (
									'today' { [ today ] }
									'now' { [ now ] }
									'zero' { [ zero ] }
									'one' { [ one ] }
									'expression' { [ model expression ] }
								)
							}
						)
						'validation': group {
							'has minimum': stategroup (
								'no' { }
								'yes' { [ min: ]
									'minimum': component 'number limit'
								}
								'expression' { [ min: model expression ] }
							)
							'has maximum': stategroup (
								'no' { }
								'yes' { [ max: ]
									'maximum': component 'number limit'
								}
								'expression' { [ max: model expression ] }
							)
						}
						'summarize': stategroup (
							'no' { }
							'total' { [ show-total ] }
						)
					}
					'text' { [ text ]
						'navigable': stategroup (
							'yes' {
								'type': stategroup (
									'optional' { [ ~> ] }
									'mandatory' { [ -> ] }
								)
								'referenced node': component 'gui node type path'
								'validate': stategroup (
									'no' { }
									'yes' { [ validate: resolvable ] }
								)
								'rules': component 'where rules'
							}
							'no' {
								'password property': stategroup (
									'yes' { [ password ] }
									'no' { }
								)
							}
						)
						'validation': stategroup (
							'none' { }
							'model' { [ validate: model expression ] }
							'custom' { [ validate: ]
								'rules': component 'text validation'
							}
						)
						'default': stategroup (
							'no' { }
							'yes' { [ default: ]
								'source': stategroup (
									'guid' { [ guid ] }
									'current user' { [ user ] }
									'expression' { [ model expression ] }
									'auto select only candidate' { [ only candidate ] }
									'select source' { [ source of ]
										'graph': reference
									}
								)
							}
						)
					}
					'file' { [ file ]
						'file name source': stategroup (
							'expression' { }
							'generated' {
								'file name expression': [ name: ] component 'file name expression'
							}
						)
						'has extension validation': stategroup (
							'no' { }
							'yes' { [ validate: ]
								'rules': component 'text validation'
							}
						)
					}
					'state group' { [ stategroup ]
						'default': stategroup (
							'no' { }
							'yes' { [ default: ]
								'source': stategroup (
									'state' {
										'state': reference
									}
									'state switch' { [ model expression ] }
								)
							}
						)
						'has states': stategroup = node-switch .'states' (
							| nodes = 'yes' { 'first' = first }
							| none  = 'no'
						)
						'states': [ (, ) ] dictionary {
							'has successor': stategroup = node-switch successor (
								| node = 'yes' { 'successor' = successor }
								| none = 'no'
							)
							'rules': component 'where rules'
							'gui node': component 'gui node'
						}
					}
				)
			}
		)
	}
}
'ancestor node path' {
	'has steps': stategroup (
		'no' { }
		'yes' { [ ^ ]
			'tail': component 'ancestor node path'
		}
	)
}
'gui node type path step' {
	'has steps': stategroup (
		'no' { }
		'yes' {
			'attribute': [ . ] reference
			'type': stategroup (
				'node' { }
				'state' {
					'state': [ ? ] reference
				}
			)
			'tail': component 'gui node type path step'
		}
	)
}
'gui node type path' {
	'steps': component 'gui node type path step'
}
'gui action expression' {
	'operation': stategroup (
		'state switch' { [ state-switch ]
			'states': [ (, ) ] dictionary { [ | ]
				'expression': [ => ] component 'gui action expression'
			}
		}
		'node switch' { [ node-switch ]
			'cases': [ (, ) ] group {
				'true case': [ | nodes ] group {
					'expression': [ => ] component 'gui action expression'
				}
				'false case': [ | none ] group {
					'expression': [ => ] component 'gui action expression'
				}
			}
		}
		'walk' { [ walk ]
			'expression': [ (, ) ] component 'gui action expression'
		}
		'ignore' { [ ignore ]
			/* target */
		}
		'update properties' { [ update ]
			'target': stategroup (
				'node' {
					'bind view': reference
					'expression': component 'object expression'
				}
				'property' { [ property ]
					'action view': stategroup (
						'available' { [ view: ]
							'bind view': reference
						}
						'unavailable' { }
					)
					'expression': component 'gui action expression'
				}
			)
		}
		'execute operation' { [ execute ]
			'bind view': [ view ] reference
			'expression': component 'object expression'
			'operation': stategroup (
				'command' { [ command ] }
				'action' { [ action ]
					'sub action': [ {, } ] component 'gui action'
				}
			)
		}
		'produce value' {
			'value': stategroup (
				'object' {
					'expression': component 'object expression'
				}
				'state group' { [ state ]
					'expression': component 'object expression'
				}
				'scalar' { }
			)
		}
		'entry list' { [ list (, ) ]
			'entries': component 'entry expression list'
		}
		'entry' {
			'type': stategroup (
				'create' { [ create ]
					'expression': component 'object expression'
					'collection type': stategroup (
						'parameter' { }
						'node' {
							'bind view': reference
						}
					)
				}
				'delete' { [ delete ]
					'bind view': reference
				}
			)
		}
	)
}
'object expression' {
	'properties': [ (, ) ] dictionary {
		'default': [ = ] component 'gui action expression'
	}
}
'entry expression list' {
	'expression': component 'gui action expression'
	'more entries': stategroup (
		'no' { }
		'yes' { [ , ]
			'tail': component 'entry expression list'
		}
	)
}
'gui action' {
	'expression': [ do ] component 'gui action expression'
	'has next action': stategroup (
		'yes' { [ and ]
			'action': component 'gui action'
		}
		'no' { }
	)
}