6.19.9. The pass frame

The _pass frame_ contains data gleaned during a single pass over a master document. The pass frame is reinitialised for each pass, so that defaults are re-established.

For each master document thread, multiple passes on a document are performed sequentially: a pass may depend on previous passes.

The thread generating a document is said to converge if an successive passes reach a fixed point; that is, if all the outputs from one pass are the same as from the previous pass.

Conceptually, interscript repeats passes indefinitely until the passes converge; in practice, a limit is placed on the number of passes for two reasons: the first is to prevent unstable definitions locking up the computer, and the second is to allow for the fact that detection of convergence is, in general, difficult and not fully implemented.

For example, although comparison of output files is a useful tool, minor variations between passes, such as time stamps, may lead to failed comparisons based on representation rather than semantic content.

Start python section to interscript/frames/passf.py[1 /2 ] Next Last
     1: #line 26 "pass_frame.ipk"
     2: import string
     3: import traceback
     4: import sys
     5: import interscript
     6: 
     7: from interscript.drivers.sources import source_open_error
     8: from interscript.drivers.sources.disk import named_file_source
     9: from interscript.drivers.sources.base import eoi
    10: from interscript.frames.inputf import input_frame
    11: from interscript.weavers.auto import auto_weaver
    12: from interscript.drivers.sources.base import eoi
    13: from interscript.parsers.html import sgml_wrapper, html_filter
    14: 
    15: class pass_frame:
    16:   def __init__(self,master, passno, skiplist):
    17:     self.skiplist = skiplist
    18:     # the display
    19:     self.master = master
    20:     self.process = master.process
    21:     if 'frames' in self.process.trace:
    22:       self.process.acquire_object(self, 'PASS FRAME')
    23:     self.passno = passno
    24: 
    25:     self.autoweave = master.autoweave
    26: 
    27:     self.ids = {}
    28:     self.flist = []
    29:     self.fdict = {}
    30:     self.iflist = []
    31:     self.toc = []
    32:     self.include_files = []
    33:     self.classes = {}
    34:     self.functions = {}
    35:     self.testno = 0
    36:     self.sequence = 0
    37:     self.tests = {}
    38:     self.section_index = {}
    39:     self.ftp_list = []
    40: 
    41:     if 'weavers' in self.process.trace:
    42:       print 'Autoweave',self.autoweave
    43: 
    44:     file = self.master.filename
    45:     encoding = self.master.encoding
    46:     encoding = string.replace(string.lower(encoding),'-','_')
    47:     if 'frames' in self.process.trace:
    48:       print 'Processing',file,'Pass',passno+1,'Encoding',encoding
    49: 
End python section to interscript/frames/passf.py[1]


6.19.9.1. Construct input object