by Eric van der Vlist is published by O'Reilly & Associates (ISBN: 0596004214)


Name

identifier assignMethod pattern — Named pattern definition

Synopsis

define ::= 
identifier 
assignMethod 
pattern

Restrictions

pattern

May be included in

div, grammar, include

XML syntax equivalent

define

Description

When identifier assignMethod pattern is embedded in a grammar, it defines a named pattern or combines a new definition with an existing one. Named patterns are global to a grammar and can be referenced by ref in the scope of their grammar and by parentRef in the scope of the grammars directly embedded in their grammar.

When identifier assignMethod pattern is embedded in include, the new definition is a redefinition. It replaces the definitions from the included grammar unless a combine attribute is specified. If one is, the definitions are combined.

The combination is defined using the assignMethod, which may take the values: = (definition), &= (combination by interleave), or |= (combination by choice).

Restrictions

Named patterns are always global and apply only to patterns. It isn't possible to define or make reference to nonpatterns such as class names or datatype parameters.

Example

date-element = element born { xsd:data }

date-element |= element died { xsd:date }

This text is released under the Free Software Foundation GFDL.