base

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.parsers.base" { graph [label="abjad.parsers.base"]; node [color=1]; "abjad.parsers.base.Parser" [URL="../api/abjad/parsers/base.html#abjad.parsers.base.Parser", color=black, fontcolor=white, label=Parser, target=_top]; } subgraph "cluster_abjad.parsers.parser" { graph [label="abjad.parsers.parser"]; node [color=2]; "abjad.parsers.parser.LilyPondParser" [URL="../api/abjad/parsers/parser.html#abjad.parsers.parser.LilyPondParser", label="Lily\nPond\nParser", target=_top]; } subgraph "cluster_abjad.parsers.reduced" { graph [label="abjad.parsers.reduced"]; node [color=3]; "abjad.parsers.reduced.ReducedLyParser" [URL="../api/abjad/parsers/reduced.html#abjad.parsers.reduced.ReducedLyParser", label="Reduced\nLy\nParser", target=_top]; } subgraph "cluster_abjad.parsers.scheme" { graph [label="abjad.parsers.scheme"]; node [color=4]; "abjad.parsers.scheme.SchemeParser" [URL="../api/abjad/parsers/scheme.html#abjad.parsers.scheme.SchemeParser", label="Scheme\nParser", target=_top]; } subgraph "cluster_abjad.rhythmtrees" { graph [label="abjad.rhythmtrees"]; node [color=5]; "abjad.rhythmtrees.RhythmTreeParser" [URL="../api/abjad/parsers/../rhythmtrees.html#abjad.rhythmtrees.RhythmTreeParser", label="Rhythm\nTree\nParser", target=_top]; } subgraph cluster_builtins { graph [label=builtins]; node [color=6]; "builtins.object" [URL="https://docs.python.org/3.10/library/functions.html#object", label=object, target=_top]; } "abjad.parsers.base.Parser" -> "abjad.parsers.parser.LilyPondParser" [minlen=1]; "abjad.parsers.base.Parser" -> "abjad.parsers.reduced.ReducedLyParser" [minlen=2]; "abjad.parsers.base.Parser" -> "abjad.parsers.scheme.SchemeParser" [minlen=1]; "abjad.parsers.base.Parser" -> "abjad.rhythmtrees.RhythmTreeParser" [minlen=2]; "builtins.object" -> "abjad.parsers.base.Parser" [minlen=1]; }


Classes

Parser

Abstract base class for Abjad parsers.

class abjad.parsers.base.Parser(debug=False)[source]

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.

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.

pickle_path

Gets output path for the parser's pickled parsing tables.

tokenize

Tokenize string and print results.


Special methods

overridden __call__(string)[source]

Parse string and return result.


Methods

tokenize(string)[source]

Tokenize string and print results.


Read-only properties

debug

Is true when parser runs in debugging mode.

lexer

Gets parser’s PLY Lexer instance.

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.

pickle_path

Gets output path for the parser’s pickled parsing tables.