This is an old revision of the document!
A XCend file consists mainly of a pattern
, which has to be an element
at the root:
element <name> { <body> }
In general a pattern is a sequence of element
and attribute
declarations:
element <name> (?|*|+)? { <body> } # and attribute <name> (?)? { <body> }
Elements can be optional or repeated (minimum zero or one), attributes can only be optional. You can also specify choices between elements and attributes, which means that only one has to exist.
element choice { element a {} | element b {} | attribute c {} }
A body can either be empty, pattern, type or enumeration declaration:
element empty { } # and element types { string | integer | ident } # and element enumeration { "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" }