# Section Parser

Identifier: org.eclipse.ui.examples.readmetool.sectionParser

Description: This extension point allows tools to provide a parser for Readme files which identifies the sections of the file. The sections determined by this parser will show up in the outliner when a Readme file is open in the editor. The sections will also appear in the "Readme sections" view.

The default section parser provided with the Readme Tool is a simple parser which considers sections to be numbered at the beginning of a line. Top-level sections are signified by a number followed by a period, such as in the following regular expression: "[0-9]+\.". Examples are "1.", "0.", and "12345.". Subsections are signified by the regular expression: "([0-9]+\.)+[0-9]+". Examples of subsections are "1.1", "1.1.1.1", and "123.456.7890". Any level of subsection nesting may occur. Section and subsection markers must occur before any other non-whitespace characters on a line.

Configuration Markup:

`<!ATTLIST sectionParser`
`name CDATA #REQUIRED`
`id CDATA #REQUIRED`
`class CDATA #REQUIRED`
`>`

- name - a string describing this contribution.
- id - a unique identifier that can be used to reference this extension.
- class - a fully qualified name of the class which provides this extension.

Examples:

The following is an example of a sectionParser extension point:

`<extension point="org.eclipse.ui.examples.readmetool.sectionParser">`
`<parser`
`name="Custom README Section Parser"`
`id="com.xyz.CustomSectionParser"`
`class="com.xyz.CustomSectionParser">`
`</parser>`
`</extension>`

In the example above, the class com.xyz.CustomSectionParser will be used as the section parser for Readme files.

API Information: Value of the action attribute class must be a fully qualified class name of a Java class that implements the interface org.eclipse.ui.examples.readmetool.IReadmeFileParser. This interface is loaded as late as possible to avoid loading the entire tool before it is really needed.

Supplied Implementation: As described above, the default section parser uses a simple grammar of sections identified by numbers followed by periods, and subsections identified by the pattern of a number followed by a period, repeated an arbitrary number of times, and ending with a number.