Parser¶
-
abstract class
abjad.system.Parser.
Parser
(debug=False)¶ Abstract base class for Abjad parsers.
Rules objects for lexing and parsing must be defined by overriding the abstract properties
lexer_rules_object
andparser_rules_object
.For most parsers these properties should simply return
self
.Attributes Summary
__call__
Parse string
and return result.debug
Is true when parser runs in debugging mode. lexer
Gets parser’s PLY Lexer instance. lexer_rules_object
Gets object containing the parser’s lexical rule definitions. logger
Gets parser’s logger. logger_path
Gets parser’s logfile output path. output_path
Gets output path for files associated with the parser. parser
Gets parser’s PLY LRParser instance. parser_rules_object
Gets object containing the parser’s syntactical rule definitions. pickle_path
Gets output path for the parser’s pickled parsing tables. tokenize
Tokenize string
and print results.Special methods
-
__call__
(string)¶ Parse
string
and return result.
-
(
AbjadObject
).__format__
(format_specification='')¶ Formats Abjad object.
Set
format_specification
to''
or'storage'
. Interprets''
equal to'storage'
.Returns string.
-
(
AbjadObject
).__repr__
()¶ Gets interpreter representation of Abjad object.
Returns string.
Methods
-
tokenize
(string)¶ Tokenize
string
and print results.
Read-only properties
-
debug
¶ Is true when parser runs in debugging mode.
-
lexer
¶ Gets parser’s PLY Lexer instance.
-
abstract
lexer_rules_object
¶ Gets object containing the parser’s lexical rule definitions.
-
logger
¶ Gets parser’s logger.
-
logger_path
¶ Gets parser’s logfile output path.
-
output_path
¶ Gets output path for files associated with the parser.
-
parser
¶ Gets parser’s PLY LRParser instance.
-
abstract
parser_rules_object
¶ Gets object containing the parser’s syntactical rule definitions.
-
pickle_path
¶ Gets output path for the parser’s pickled parsing tables.
-