Welcome GuestLogin

Page History: Parser configuration

Compare Page Revisions

« Older Revision - Back to Page History - Newer Revision »

Page Revision: Wednesday, 23 December 2009 08:15

The parser configuration is stored in a single XML file. This file defines all tokens and the corresponding token handlers. It defines all regular expressions in use by the parser and their corresponding match handlers. It also defines the expression modes and the order of regular expression matching within each parse mode. Finally, it defines the format strings in use for generating syntax synopsis fragments.

Token configuration

The token configuration section declares each supported token, and their corresponding token handler.

Token element

Each token element defines a single token.

<token name="@return" handler="SetReturns" match="{?(?'type'[\w\.\$]+)}?(?:\s+(?'description'[\s\S]*))?"/>

name attribute

Specifies the name of the token.


handler attribute

Specifies the name of the delegate method that handles this token.


match attribute

Specifies the regular expression for matching the data of the token; the token content. Token handlers will receive the parsed token contents as a name/value collection of sub-expression matches where names are the names as defined in the regular expression ('type' and 'description' in the example below) and values are the actual values of these sub-expression matches.


Expression configuration

All regular expressions in use by ECMADoc are defined in this configuration file. Each expression defines its name, the name of the delegate method that handles it, a simple description of what it does and the regular expression associated with it.

expression element

Required. This is the root node that contains all other content.

<expression name="Function" handler="FunctionHandler" description="matches any type of function expression">

name attribute

Specifies the name of the expression. This name must be unique.


handler attribute

Specifies the name of the delegate method that handles the expression.


description attribute

Specifies the description of the expression.

description="Matches any type of function expression"

rxp element

Specifies the regular expression associated with the expression. The regular expression will be compiled with IgnorePatternWhitespace option on, so newlines and spaces can be used to improve readability. Each sub-match expression is assigned a name, and the match handlers refer to these sub-match expression by their name.


Parse mode configuration


Format configuration


ScrewTurn Wiki version Some of the icons created by FamFamFam.