Public Member Functions | |
def | __init__ (self, fname, manager) |
def | collectPureVirtualPrototypes (self) |
def | collectAdapterPrototypes (self) |
def | processing (self) |
def | report (self, fout) |
def | getmtime (self) |
Private Member Functions | |
def | __tokenGenerator (self) |
def | __collectClassInfo (self, tokenIterator) |
def | __unexpectedToken (self, status, tokenId, tokenLineNo) |
def | __collectPublicMethodPrototypes (self, tokenIterator) |
One instance is build for each translator. The abbreviation of the source file--part after 'translator_'--is used as the identification of the object. The empty string is used for the abstract Translator class from translator.h. The other information is extracted from inside the source file.
Definition at line 119 of file translator.py.
def translator.Transl.__init__ | ( | self, | |
fname, | |||
manager | |||
) |
Bind to the manager and initialize.
Definition at line 127 of file translator.py.
|
private |
Collect the information about the class and base class. The tokens including the opening left curly brace of the class are consumed.
Definition at line 411 of file translator.py.
|
private |
Collects prototypes of public methods and fills self.prototypeDic. The dictionary is filled by items: uniPrototype -> prototype. The method is expected to be called only for TranslatorXxxx classes, i.e. for the classes that implement translation to some language. It assumes that the openning curly brace of the class was already consumed. The source is consumed until the end of the class. The caller should consume the source until the eof to cause closing the source file.
Definition at line 724 of file translator.py.
|
private |
Generator that reads the file and yields tokens as 4-tuples. The tokens have the form (tokenId, tokenString, lineNo). The last returned token has the form ('eof', None, None). When trying to access next token afer that, the exception would be raised.
Definition at line 157 of file translator.py.
|
private |
Reports unexpected token and quits with exit code 1.
Definition at line 507 of file translator.py.
def translator.Transl.collectAdapterPrototypes | ( | self | ) |
Returns the dictionary of prototypes implemented by adapters. It is created to process the translator_adapter.h. The returned dictionary has the form: unifiedPrototype -> (version, classId) thus by looking for the prototype, we get the information what is the newest (least adapting) adapter that is sufficient for implementing the method.
Definition at line 976 of file translator.py.
def translator.Transl.collectPureVirtualPrototypes | ( | self | ) |
Returns dictionary 'unified prototype' -> 'full prototype'. The method is expected to be called only for the translator.h. It extracts only the pure virtual method and build the dictionary where key is the unified prototype without argument identifiers.
Definition at line 519 of file translator.py.
def translator.Transl.getmtime | ( | self | ) |
Returns the last modification time of the source file.
Definition at line 1198 of file translator.py.
def translator.Transl.processing | ( | self | ) |
Processing of the source file -- only for TranslatorXxxx classes.
Definition at line 1043 of file translator.py.
def translator.Transl.report | ( | self, | |
fout | |||
) |
Returns the report part for the source as a multiline string. No output for up-to-date translators without problem.
Definition at line 1146 of file translator.py.
translator.Transl.adaptMinClass |
Definition at line 155 of file translator.py.
translator.Transl.baseClassId |
Definition at line 142 of file translator.py.
translator.Transl.classId |
Definition at line 141 of file translator.py.
translator.Transl.fname |
Definition at line 131 of file translator.py.
translator.Transl.implementedMethods |
Definition at line 154 of file translator.py.
translator.Transl.lang |
Definition at line 145 of file translator.py.
translator.Transl.langReadable |
Definition at line 146 of file translator.py.
translator.Transl.manager |
Definition at line 132 of file translator.py.
translator.Transl.missingMethods |
Definition at line 153 of file translator.py.
translator.Transl.note |
Definition at line 147 of file translator.py.
translator.Transl.obsoleteMethods |
Definition at line 152 of file translator.py.
translator.Transl.prototypeDic |
Definition at line 148 of file translator.py.
translator.Transl.readableStatus |
Definition at line 143 of file translator.py.
translator.Transl.status |
Definition at line 144 of file translator.py.
translator.Transl.translateMeFlag |
Definition at line 150 of file translator.py.
translator.Transl.translateMeText |
Definition at line 149 of file translator.py.
translator.Transl.txtMAX_DOT_GRAPH_HEIGHT_flag |
Definition at line 151 of file translator.py.