Next / Previous / Contents / Shipman's homepage

19.12. BaseCompiler.scanPrefix(): Process a band prefiix line

The logic that parses a band prefix line is a static method of the Prefix class. For remarks about why the Prefix() constructor itself doesn't do the parsing, see the parallel routine Section 19.11, “BaseCompiler.scanPageHeader(): Process a page header line”.

baseclasses.py
# - - -   B a s e C o m p i l e r . s c a n P r e f i x   - - -

    def scanPrefix(self):
        '''Scan a new band prefix line.

          [ the line in self.scan is a band prefix line advanced
            just past the initial PREFIX_SYMBOL ->
              if the line in self.scan is a valid prefix line ->
                self.prefix  :=  a new Prefix object that represents
                                 that line
              else ->
                Log()  +:=  error message(s)
              In any case ->
                self.scan  :=  self.scan advanced no further than
                               end of line ]
        '''

See Section 25.2, “Prefix.scanLine(): Scan a band prefix line”.

baseclasses.py
        try:
            self.prefix = Prefix.scanLine(self.scan)
        except SyntaxError:
            pass