Package lemon :: Package external :: Package Cheetah :: Module Compiler :: Class ModuleCompiler
[show private | hide private]
[frames | no frames]

Class ModuleCompiler

                              GenUtils --+
                                         |
_SettingsCollector --+                   |
                     |                   |
       SettingsManager --+               |
                         |               |
          SourceReader --+               |
                         |               |
               PythonLexer --+           |
                             |           |
                  CheetahLexer --+       |
                                 |       |
          _LowLevelSemanticsParser --+   |
                                     |   |
             _HighLevelSemanticsParser --+
                                         |
                                        ModuleCompiler


Method Summary
  __init__(self, source, file, moduleName, mainClassName, mainMethodName, templateObj, settings)
  __getattr__(self, name)
Provide access to the methods and attributes of the ClassCompiler: one-way namespace sharing WARNING: Use .setMethods to assign the attributes of the ClassCompiler from the methods of this class!!! or you will be assigning to attributes of this object instead.
  __str__(self)
  addActiveClassCompiler(self, classCompiler)
  addComment(self, comm)
  addGlobalCodeChunk(self, codeChunk)
  addGlobalVars(self, varNames)
  addImportStatement(self, importStatement)
  addModuleDocString(self, line)
  addModuleHeader(self, line)
  addShBang(self, shBang)
  addSpecialVar(self, basename, contents)
  classDefs(self)
  closeDirective(self, isLineClearToStartToken, endOfFirstLinePos)
  compile(self)
  finishedClasses(self)
  getActiveClassCompiler(self)
  globalVars(self)
  importStatements(self)
  isErrorCatcherOn(self)
  moduleConstants(self)
  moduleDef(self)
  moduleDocstring(self)
  moduleFooter(self)
  moduleHeader(self)
  setupState(self)
  spawnClassCompiler(self, className, klass, mainMethodName)
  specialVars(self)
  swallowClassCompiler(self, classCompiler)
  timestamp(self, theTime)
  turnErrorCatcherOff(self)
  turnErrorCatcherOn(self)
  wrapModuleDef(self)
  _initializeSettings(self)
A hook that allows for complex setting initialization sequences that involve references to 'self' or other settings.
    Inherited from _HighLevelSemanticsParser
  closeBlock(self, methodName)
  eatAssert(self)
  eatAttr(self)
  eatBlock(self)
  eatBreak(self)
  eatBreakPoint(self)
  eatCache(self)
  eatComment(self)
  eatCompiler(self)
  eatCompilerSettings(self)
  eatContinue(self)
  eatDedentDirective(self, isLineClearToStartToken)
  eatDef(self)
  eatDel(self)
  eatDirective(self)
  eatEcho(self)
  eatElse(self)
else, elif and else if...
  eatEndBlock(self, isLineClearToStartToken)
  eatEndCache(self, isLineClearToStartToken)
  eatEndDef(self, isLineClearToStartToken)
  eatEndDirective(self)
  eatEndErrorCatcher(self, isLineClearToStartToken)
  eatEndFilter(self, isLineClearToStartToken)
  eatEndFor(self, isLineClearToStartToken)
  eatEndIf(self, isLineClearToStartToken)
  eatEndRepeat(self, isLineClearToStartToken)
  eatEndTry(self, isLineClearToStartToken)
  eatEndUnless(self, isLineClearToStartToken)
  eatEndWhile(self, isLineClearToStartToken)
  eatErrorCatcher(self)
  eatExcept(self)
  eatExtends(self)
  eatFilter(self)
  eatFinally(self)
  eatFor(self)
  eatIf(self)
  eatImplements(self)
  eatImport(self)
  eatInclude(self)
  eatMultiLineComment(self)
  eatPass(self)
  eatPlaceholder(self)
  eatPSP(self)
  eatRaise(self)
  eatRaw(self)
  eatRepeat(self)
  eatReturn(self)
  eatSet(self)
  eatShbang(self)
  eatSilent(self)
  eatSimpleExprDirective(self)
  eatSlurp(self)
  eatStop(self)
  eatStrConstant(self)
  eatTry(self)
  eatUnless(self)
  eatWhile(self)
  initDirectives(self)
  parse(self)
  startMultiLineDef(self, methodName, argsList, startPos, isLineClearToStartToken)
  startSingleLineDef(self, methodName, argsList, startPos, endPos)
    Inherited from _LowLevelSemanticsParser
  configureParser(self)
  getAssignmentOperator(self)
  getCacheToken(self)
  getCallArgString(self, enclosures)
Get a method/function call argument string.
  getCheetahVar(self, plain)
discards the cache info...
  getCheetahVarBody(self, plain)
  getCheetahVarNameChunks(self)
nameChunks = list of Cheetah $var subcomponents represented as tuples [ (namemapperPart,autoCall,restOfName), ] where: namemapperPart = the dottedName base autocall = where NameMapper should use autocalling on namemapperPart restOfName = any arglist, index, or slice If restOfName contains a call arglist (e.g.
  getCheetahVarStartToken(self)
just the start token, not the enclosure or cache token...
  getCommentStartToken(self)
  getDefArgList(self, exitPos, useNameMapper)
Get an argument list.
  getDirectiveEndToken(self)
  getDirectiveStartToken(self)
  getDottedName(self)
  getExpression(self, enclosed, enclosures)
Get a Cheetah expression that includes $CheetahVars and break at directive end tokens.
  getIdentifier(self)
  getMultiLineCommentEndToken(self)
  getMultiLineCommentStartToken(self)
  getNonWhiteSpace(self, WSchars)
  getOperator(self)
  getPSPEndToken(self)
  getPSPStartToken(self)
  getTargetVarsList(self)
  getWhiteSpace(self, WSchars)
  isDirective(self, directiveKeyChars)
  isLineClearToStartToken(self, pos)
  makeCheetahVarREs(self)
Setup the regexs for Cheetah $var parsing.
  makeCommentREs(self)
Construct the regex bits that are used in comment parsing.
  makeDirectiveREs(self)
Construct the regexs that are used in directive parsing.
  makePspREs(self)
Setup the regexs for PSP parsing.
  matchAssignmentOperator(self)
  matchCheetahVarStart(self)
includes the enclosure and cache token...
  matchCommentStartToken(self)
  matchDirectiveEndToken(self)
  matchDirectiveStartToken(self)
  matchIdentifier(self, identRE)
  matchMultiLineCommentEndToken(self)
  matchMultiLineCommentStartToken(self)
  matchNonStrConst(self)
  matchNonWhiteSpace(self, WSchars)
  matchOperator(self)
  matchPSPEndToken(self)
  matchPSPStartToken(self)
  matchWhiteSpace(self, WSchars)
  readToThisEndDirective(self, directiveKey)
    Inherited from CheetahLexer
  getCheetahToken(self)
  matchCheetahToken(self)
    Inherited from PythonLexer
  getPyToken(self)
  matchPyToken(self)
    Inherited from SettingsManager
  copySettings(self)
Returns a shallow copy of the settings dictionary...
  deepcopySettings(self)
Returns a deep copy of the settings dictionary...
  getConfigString(self)
Return a string with the settings in .ini file format.
  hasSetting(self, key)
True/False...
  setSetting(self, name, value)
Set a setting in self._settings.
  setting(self, name, default)
Get a setting from self._settings, with or without a default value.
  settings(self)
Return a reference to the settings dictionary...
  updateSettings(self, newSettings, merge)
Update the settings with a selective merge or a complete overwrite.
  updateSettingsFromConfigFile(self, path, **kw)
Update the settings from a text file using the syntax accepted by Python's standard ConfigParser module (like Windows .ini files).
  updateSettingsFromConfigFileObj(self, inFile, convert, merge)
See the docstring for .updateSettingsFromConfigFile() The caller of this method is responsible for closing the inFile file object.
  updateSettingsFromConfigStr(self, configStr, convert, merge)
See the docstring for .updateSettingsFromConfigFile()...
  updateSettingsFromPySrcFile(self, path, merge)
Update the settings from variables in a Python source file.
  updateSettingsFromPySrcStr(self, theString, merge)
Update the settings from a code in a Python src string.
  writeConfigFile(self, path)
Write all the settings that can be represented as strings to an .ini style config file.
  _createConfigFile(self, outFile)
Write all the settings that can be represented as strings to an .ini style config string.
  _defaultSettings(self)
    Inherited from _SettingsCollector
  _getAllAttrsFromContainer(self, container)
Extract all the attributes of a SettingsContainer subclass.
  _isContainer(self, thing)
Check if 'thing' is a Python module or a subclass of SettingsContainer.
  normalizePath(self, path)
A hook for any neccessary path manipulations.
  readSettingsFromConfigFile(self, path, convert)
  readSettingsFromConfigFileObj(self, inFile, convert)
Return the settings from a config file that uses the syntax accepted by Python's standard ConfigParser module (like Windows .ini files).
  readSettingsFromContainer(self, container, ignoreUnderscored)
Returns all settings from a SettingsContainer or Python module.
  readSettingsFromModule(self, container, ignoreUnderscored)
Returns all settings from a SettingsContainer or Python module.
  readSettingsFromPySrcFile(self, path)
Return new settings dict from variables in a Python source file.
  readSettingsFromPySrcStr(self, theString)
Return a dictionary of the settings in a Python src string.
    Inherited from SourceReader
  __getitem__(self, i)
  __getslice__(self, i, j)
  __len__(self)
  advance(self, offset)
  atEnd(self)
  atStart(self)
  breakPoint(self)
  checkPos(self, pos)
  filename(self)
  find(self, it, pos)
  findBOL(self, pos)
  findEOL(self, pos)
  getc(self)
  getLine(self, pos)
  getRowCol(self, pos)
  getRowColLine(self, pos)
  gotoBookmark(self, name)
  hasBookmark(self, name)
  lineNum(self, pos)
  peek(self, offset)
  pos(self)
  read(self, offset)
  readTo(self, to, start)
  readToEOL(self, gobble)
  rev(self, offset)
  rfind(self, it, pos)
  setBookmark(self, name)
  setBreakPoint(self, pos)
  setPos(self, pos)
  splitlines(self)
  src(self)
  startswith(self, it, pos)
  ungetc(self, c)
  validPos(self, pos)
    Inherited from GenUtils
  genCacheInfo(self, cacheToken)
Decipher a placeholder cachetoken...
  genCacheInfoFromArgList(self, argList)
  genCheetahVar(self, nameChunks, plain)
  genNameMapperVar(self, nameChunks)
Generate valid Python code for a Cheetah $var, using NameMapper (Unified Dotted Notation with the SearchList).
  genPlainVar(self, nameChunks)
Generate Python code for a Cheetah $var without using NameMapper (Unified Dotted Notation with the SearchList).
  genTimeInterval(self, timeString)
  unescapeCheetahVars(self, theString)
Unescape any escaped Cheetah \$vars in the string.
  unescapeDirectives(self, theString)
Unescape any escaped Cheetah \$vars in the string.

Class Variable Summary
NoneType _activeClasses = None                                                                  
    Inherited from _SettingsCollector
lock _sysPathLock = <thread.lock object at 0x008AD160>

Method Details

__getattr__(self, name)
(Qualification operator)

Provide access to the methods and attributes of the ClassCompiler:
one-way namespace sharing

WARNING: Use .setMethods to assign the attributes of the ClassCompiler
from the methods of this class!!! or you will be assigning to attributes
of this object instead.

_initializeSettings(self)

A hook that allows for complex setting initialization sequences that
involve references to 'self' or other settings.  For example:
      self._settings['myCalcVal'] = self._settings['someVal'] * 15        
This method should be called by the class' __init__() method when needed.       
The dummy implementation should be reimplemented by subclasses.
Overrides:
lemon.external.Cheetah.Parser._LowLevelSemanticsParser._initializeSettings (inherited documentation)

Class Variable Details

_activeClasses

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.0 on Mon Nov 10 15:08:10 2003 http://epydoc.sf.net