This module offers high-level API for parsing text into hierarchical data structures, in particular, JSON. Parsers like this can be used to create abstract syntax trees of compatible inputs. For convenience and scriptability any parser is expected to be able to dump its AST as JSON.
Bases: builtins.object
Abstract interface for parsers.
The interface is meant to be suitable for the implementation of the plainbox dev parse command. It offers a simple API for parsing strings and getting JSON in result.
Parse the specified text and return a parser-specific native Abstract Syntax Tree that represents the input.
Any exception gets logged and causes None to be returned.
Bases: plainbox.impl.parsers.IParser, plainbox.impl.secure.plugins.PlugIn
PlugIn wrapping a parser function.
Useful for wrapping checkbox parser functions.
Parse the specified text and return a parser-specific native Abstract Syntax Tree that represents the input.
Any exception gets logged and causes None to be returned.
Parse the specified text and return a JSON string representing the result.
Returns: | None in case of parse error |
---|---|
Returns: | string representing JSON version of the parsed AST |
time, in fractional seconds, that was needed to load the plugin
plugin name, arbitrary string
plugin object, arbitrary object
time, in fractional seconds, that was needed to wrap the plugin