| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd"> |
| |
| <document> |
| <header> |
| <title>Parser Transformer</title> |
| <version>0.1</version> |
| <type>Technical document</type> |
| <authors> |
| <person id="SMS" name="Stephan Michels" email="stephan@apache.org"/> |
| </authors> |
| <abstract>This document describes the parser transformer of Cocoon.</abstract> |
| </header> |
| <body> |
| <s1 title="Parser Transformer"> |
| <p>The parser transformer builds a syntax tree of a list of lexemes |
| (tokens), by using a grammar file.</p> |
| |
| <ul> |
| <li>Name: parser</li> |
| <li>Class: org.apache.cocoon.transformation.ParserTransformer</li> |
| <li>Cacheable: yes - uses the last modification date of the grammar |
| document for validation.</li> |
| </ul> |
| |
| <p>The parser uses the following elements from the SAX stream, and |
| replaces them through a syntax tree.</p> |
| |
| <source><![CDATA[ |
| <lexemes xmlns="http://chaperon.sourceforge.net/schema/lexemes/1.0"> |
| <lexeme symbol="word" text="..."/> |
| <lexeme symbol="word" text="..."/> |
| <lexeme symbol="word" text="..."/> |
| <lexeme symbol="punctation" text="..."/> |
| </lexemes> |
| ]]></source> |
| |
| <p>The parser transformer will replace those elements with a syntax tree. |
| </p> |
| |
| <source><![CDATA[ |
| <paragraph xmlns="http://chaperon.sourceforge.net/schema/syntaxtree/1.0"> |
| <sentence> |
| <word>...</word> |
| <word>...</word> |
| <word>...</word> |
| <punctation>...</punctation> |
| </sentence> |
| </paragraph> |
| ]]></source> |
| |
| <p>A detailed explanation of function and the grammar format can be found at <link |
| href="http://chaperon.sourceforge.net/">Chaperon</link>.</p> |
| |
| </s1> |
| </body> |
| </document> |