Parser

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true ]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0 ]; edge [color=lightslategrey, penwidth=1 ]; subgraph "cluster_abjad.parser" { graph [label="abjad.parser"]; node [color=1]; "abjad.parser.LilyPondParser.LilyPondParser" [URL="../api/abjad/system/../parser/LilyPondParser.html#abjad.parser.LilyPondParser.LilyPondParser", color=1, label="Lily\nPond\nParser", target=_top]; "abjad.parser.ReducedLyParser.ReducedLyParser" [URL="../api/abjad/system/../parser/ReducedLyParser.html#abjad.parser.ReducedLyParser.ReducedLyParser", color=1, label="Reduced\nLy\nParser", target=_top]; "abjad.parser.SchemeParser.SchemeParser" [URL="../api/abjad/system/../parser/SchemeParser.html#abjad.parser.SchemeParser.SchemeParser", color=1, label="Scheme\nParser", target=_top]; } subgraph "cluster_abjad.rhythmtrees" { graph [label="abjad.rhythmtrees"]; node [color=2]; "abjad.rhythmtrees.RhythmTreeParser" [URL="../api/abjad/system/../rhythmtrees.html#abjad.rhythmtrees.RhythmTreeParser", color=2, label="Rhythm\nTree\nParser", target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=3]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", color=3, label="Abjad\nObject", target=_top]; "abjad.system.Parser.Parser" [URL="../api/abjad/system/Parser.html#abjad.system.Parser.Parser", color=black, fontcolor=white, label=Parser, shape=oval, style="bold, filled", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.Parser.Parser"; } subgraph cluster_builtins { graph [label=builtins]; node [color=4]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", color=4, label=object, target=_top]; } "abjad.system.Parser.Parser" -> "abjad.parser.LilyPondParser.LilyPondParser" [minlen=1]; "abjad.system.Parser.Parser" -> "abjad.parser.ReducedLyParser.ReducedLyParser" [minlen=2]; "abjad.system.Parser.Parser" -> "abjad.parser.SchemeParser.SchemeParser" [minlen=1]; "abjad.system.Parser.Parser" -> "abjad.rhythmtrees.RhythmTreeParser" [minlen=2]; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject" [minlen=1]; }

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 and parser_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.