User Tools

Site Tools


syntax

This is an old revision of the document!


XCend File Syntax

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"
}
syntax.1317030535.txt.gz · Last modified: 2011/09/26 11:48 by Patrick Michel