7.11.3 Pruning

Prev Up Next Page 228 of 800 Search internet

Before rendering of a diagnose lgc prunes the diagnose. A diagnose is a parse tree and pruning is a process which ensures that the parse tree is valid w.r.t. the given cache.

A parse tree is valid if all constructs in it are strings or defined constructs. A construct with reference r and index i is defined w.r.t cache c if c[r]['dictionary'][i] is a natural.

Furthermore, the number of subtrees of a construct must match the arity of the construct. The arity of a string is zero. The arity of defined constructs is c[r]['dictionary'][i].

During pruning, malformed branches of the tree are replaced by the page symbol of the page being verified. Thus, if the name of the page being verified appears in a diagnose, it is time to debug your test constructs.

Pruning is applied to all user defined processes which are supposed to return parse trees. Thus, pruning is applied to the output of unpacking, macro expansion, and verification. The fourth user defined process (rendering) is not required to return a parse tree.

Prev Up Next Page 228 of 800 Search logiweb.eu

Copyright © 2010 Klaus Grue, GRD-2010-01-05