User Tools

Site Tools


Action disabled: source
syntax

XCend File Syntax

The page is incomplete and outdated.

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> (?|* (<name>)?)? {
  <body>
}
 
# and
 
attribute <name> (?)? {
  <body>
}

Elements can be optional or repeated, attributes can only be optional. For repeated elements, the implicit disambiguation identifier can be renamed and accessed like a normal attribute. 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.txt · Last modified: 2012/07/25 12:14 by Patrick Michel