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


Name

parent — Reference to a named pattern from the parent grammar

Synopsis

"parent" identifier

Restrictions

pattern

May be included in

(pattern), attribute, datatypeName param exceptPattern, element, list, mixed, pattern&pattern, pattern*, pattern+, pattern,pattern, pattern?, pattern|pattern

XML syntax equivalent

parentRef

Description

The parent pattern is a reference to a named pattern belonging to the parent grammar, the grammar in which the current grammar is included. The scope of named patterns is usually limited to the grammar in which they are defined. The parent pattern provides a way to extend this scope and refer to named patterns defined in the parent grammar.

Example

born-element = parent born-element

start =
   attribute id { parent id-content },
   attribute available { parent available-content },
   element isbn { parent isbn-content },
   element title { parent title-content },
   element author { parent author-content }*,
   element character { parent character-content }*

This text is released under the Free Software Foundation GFDL.