Next / Previous / Contents / Shipman's homepage

20. class Maps2006Compiler: Compiler for MAPS 2006 files

This class compiles the 2006 protocol. It is the same as BaseCompiler except that there is no WRP molt cycle code in the input or output.

baseclasses.py
# - - - - -   c l a s s   M a p s 2 0 0 6 C o m p i l e r   - - - - -

class Maps2006Compiler(BaseCompiler):
    '''Compiler logic for the MAPS 2004 protocol.

      Exports:  As inherited.
    '''

20.1. Maps2006Compiler.scanEncounter()

This method is identical to the same method in BaseCompiler except that it uses the Maps2006Encounter class instead of the BaseEncounter class.

baseclasses.py
# - - -   M a p s 2 0 0 6 C o m p i l e r . s c a n E n c o u n t e r

    def scanEncounter(self):
        '''Process an encounter line.
        '''
        #-- 1 --
        # [ if the line in self.scan is a valid MAPS 2006
        #   encounter line ->
        #     self.oldEncounter  :=  a Maps2006Encounter object
        #                            representing that record
        #     yield that Maps2006Encounter object
        #   else ->
        #     Log()  +:=  error message(s) ]
        try:
            encounter = Maps2006Encounter.scanLine(self, self.scan)
            self.oldEncounter = encounter
            yield encounter
            
        except SyntaxError:
            pass