SourceForge Logo Python documentation  
Home


Designer documentation


Python documentation

1. Inner workings
2. Python API
3. DataSource
4. Types and exceptions


Download


Credits


Contact


Inner workings

A little top-down explanation of the inner structure of AHTS:

1. Writer

The Writer asks the Parser for a abstract represantation of the template, called an Abstract Syntax Tree. It writes this tree to the prefered outputfile, while resolving all references to variables (@identifiers@) and other templates (via the <master>-tag). It also computes the <if ...> comparisons.

The writer is implemented in ahts/writer.py.

2. Parser

The Parser drives the Scanner. It asks the Scanner for a token, and then looks where this token belongs to. (If it is an <if, it starts the part of the Parser which handles the <if ...>...</if> part.). The Parser checks whether the template adheres to the ACS Templating syntax.

The Parser emits a symbolic description of the template in a form called an Abstract Syntax Tree.

The parser is a handwritten recursive decent parser, who operates on one token lookahead.

The parser is implemented in ahts/parser.py.

3. Scanner

Your template is scanned by the Scanner, generated by Plex, This scanner splits the template into its significant parts (tokens), and strips comments from the template.

The scanner is implemented in ahts/scanner.py.

You don't need to download Plex yourself, I included a slightly modified copy. See ahts/README.plex for details.

  $Id: index.tml,v 1.1 2001/04/09 22:36:19 benderydt Exp $