| Class | PageTemplate::Parser |
| In: |
lib/PageTemplate/parser.rb
|
| Parent: | Object |
The big ass parser that does all the dirty work of turning templates into compiled commands.
Parser.new() accepts a hash as an argument, and looks for these keys: (with defaults)
'namespace' => A namespace object. (A new namespace) 'glossary' => A SyntaxGlossary class singleton. (DefaultGlossary) 'preprocessor' => The preprocessor. (DefaultPreprocessor) 'default_processor' => The processor. (:process) 'source' => The Source for templates. (FileSource)
Once the parser is created, it can compile and parse any number of templates.
It can be treated as a one-template item by using Parser#load(template), and calling Parser.output
To create separate generated templates from the same engine, use Parser#parse, or Parser#load. (It will still keep the most recent one it‘s load‘d, but that will not affect previously parsed or loaded)
| args | [R] | |
| commands | [R] | |
| default_processor | [R] | |
| glossary | [R] | |
| method_separators | [R] | |
| namespace | [R] | |
| preprocessor | [R] | |
| source | [R] |
Parser.new() accepts a hash as an argument, and looks for these keys: (with defaults)
'namespace' => A namespace object. (A new namespace) 'glossary' => A SyntaxGlossary object. (a dup of DEFAULTGLOSSARY) 'preprocessor' => The preprocessor. (DefaultPreprocessor) 'default_processor' => The processor. (:process) 'source' => The Source for templates. (FileSource)