mpylab.tools.plyparser module¶
mpylab.tools.plyparser module.
- class mpylab.tools.plyparser.Parser(**kw)
Bases:
objectBase class for PLY lexers and parsers whose rules are methods.
- Parameters:
**kw (object) – Parser options.
filenameselects the input source,SearchPathssupplies directories used to locate a relative filename, anddebugenables PLY diagnostics. Unknown options are ignored for compatibility with existing parser configurations.
Notes
filenamemay be a readable file-like object, a path, a filename found belowSearchPaths, or the supported legacy inlineStringIOform. If no input source is supplied,run()reads interactively from standard input.- precedence = ()
- run()
Parse the configured input source.
- Returns:
Semantic result produced by the concrete parser. The exact type is defined by its grammar; for example,
DatFilereturns a dictionary indexed by frequency.- Return type:
object
- Raises:
ValueError – If the configured input source cannot be read.
- tokens = ()