The available commands

UpHome
Sitemap
 
AST OO Layer
Tokenizer
Subcmd Description
::parsetools::token
option... string

Recognized options are:

-order
Allowed values are 'pre' and 'post'. Defines the order the implicit syntax tree is written. Default is pre-order, i.e. the root is the first token.
-command
A command called for every token in the tree. Its arguments are the type of the token, its level in the tree, the number of tokens in the sub tree started by it (not the number of children!) and the associated text from the script. Default is the empty command.
-expr
A boolean flag. Determines wether the string is parsed as script or as expression.

The command calls the tokenizer for the specified script (or expression) and then either calls the '-command' for every token found or (in the case of an empty command) returns a list containing the tokens. In that list each element is a 4-element list describing a single token. Meaning and order of the elements in that list is the same as the arguments for the command.

Abstract syntax trees
Subcmd Description
::parsetools::ast::new
name

Creates a new abstract syntax tree with the given name. Any existing AST with same name will be automatically destroyed.

The procedural interface to the AST is described in the script library. As for the object-oriented interface to it please read AST OO Layer before going to the script library.

Command database
Subcmd Description
::parsetools::cmd::*
...

The commands to manipulate the database are described in the script library.


© Andreas Kupries
Last update at Fri Apr 27 00:47:29 CEST 2001