scheme

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", label=Parser, target=_top]; } subgraph "cluster_abjad.parsers.scheme" { graph [label="abjad.parsers.scheme"]; node [color=2]; "abjad.parsers.scheme.Scheme" [URL="../api/abjad/parsers/scheme.html#abjad.parsers.scheme.Scheme", color=black, fontcolor=white, label=Scheme, target=_top]; "abjad.parsers.scheme.SchemeParser" [URL="../api/abjad/parsers/scheme.html#abjad.parsers.scheme.SchemeParser", color=black, fontcolor=white, label="Scheme\nParser", target=_top]; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.10/library/functions.html#object", label=object, target=_top]; } "abjad.parsers.base.Parser" -> "abjad.parsers.scheme.SchemeParser"; "builtins.object" -> "abjad.parsers.base.Parser"; "builtins.object" -> "abjad.parsers.scheme.Scheme"; }


Classes

Scheme

Abjad model of Scheme code.

SchemeParser

SchemeParser mimics how LilyPond's embedded Scheme parser behaves.

class abjad.parsers.scheme.Scheme(value=None)[source]

Abjad model of Scheme code.


Attributes Summary

__eq__

Return self==value.

__repr__

Return repr(self).


Special methods

overridden __eq__(other)

Return self==value.

overridden __repr__()

Return repr(self).

class abjad.parsers.scheme.SchemeParser(debug=False)[source]

SchemeParser mimics how LilyPond’s embedded Scheme parser behaves.

It parses a single Scheme expression and then stops, by raising a SchemeParserFinishedError.

The parsed expression and its exact length in characters are cached on the SchemeParser instance.

It is intended to be used only in conjunction with LilyPondParser.


Attributes Summary

A

DIGIT

HEX

IDENTIFIER

INITIAL

INT

N

REAL

SUBSEQUENT

UNSIGNED

lexer_rules_object

Lexer rules object of Scheme parser.

p_boolean__BOOLEAN

boolean : BOOLEAN

p_constant__boolean

constant : boolean

p_constant__number

constant : number

p_constant__string

constant : string

p_data__EMPTY

data :

p_data__data__datum

data : data datum

p_datum__constant

datum : constant

p_datum__list

datum : list

p_datum__symbol

datum : symbol

p_datum__vector

datum : vector

p_error

p_expression__QUOTE__datum

expression : QUOTE datum

p_expression__constant

expression : constant

p_expression__variable

expression : variable

p_form__expression

form : expression

p_forms__EMPTY

forms :

p_forms__forms__form

forms : forms form

p_list__L_PAREN__data__R_PAREN

list : L_PAREN data R_PAREN

p_list__L_PAREN__data__datum__PERIOD__datum__R_PAREN

list : L_PAREN data datum PERIOD datum R_PAREN

p_number__DECIMAL

number : DECIMAL

p_number__HEXADECIMAL

number : HEXADECIMAL

p_number__INTEGER

number : INTEGER

p_program__forms

program : forms

p_string__STRING

string : STRING

p_symbol__IDENTIFIER

symbol : IDENTIFIER

p_variable__IDENTIFIER

variable : IDENTIFIER

p_vector__HASH__L_PAREN__data__R_PAREN

vector : HASH L_PAREN data R_PAREN

parser_rules_object

Parser rules object of Scheme parser.

start

<program> : <form>*

states

t_BOOLEAN

#(T|F|t|f)

t_DECIMAL

t_HASH

#

t_HEXADECIMAL

t_IDENTIFIER

t_INTEGER

t_L_PAREN

(

t_R_PAREN

)

t_anything

.

t_error

t_ignore

t_newline

n+

t_quote

"

t_quote_440

\[nt\'"]

t_quote_443

[^\""]+

t_quote_446

"

t_quote_456

.

t_quote_error

t_quote_ignore

t_whitespace

[ tr]+

tokens


Special methods

(Parser).__call__(string)

Parse string and return result.


Methods

p_boolean__BOOLEAN(p)[source]

boolean : BOOLEAN

p_constant__boolean(p)[source]

constant : boolean

p_constant__number(p)[source]

constant : number

p_constant__string(p)[source]

constant : string

p_data__EMPTY(p)[source]

data :

p_data__data__datum(p)[source]

data : data datum

p_datum__constant(p)[source]

datum : constant

p_datum__list(p)[source]

datum : list

p_datum__symbol(p)[source]

datum : symbol

p_datum__vector(p)[source]

datum : vector

p_error(p)[source]
p_expression__QUOTE__datum(p)[source]

expression : QUOTE datum

p_expression__constant(p)[source]

expression : constant

p_expression__variable(p)[source]

expression : variable

p_form__expression(p)[source]

form : expression

p_forms__EMPTY(p)[source]

forms :

p_forms__forms__form(p)[source]

forms : forms form

p_list__L_PAREN__data__R_PAREN(p)[source]

list : L_PAREN data R_PAREN

p_list__L_PAREN__data__datum__PERIOD__datum__R_PAREN(p)[source]

list : L_PAREN data datum PERIOD datum R_PAREN

p_number__DECIMAL(p)[source]

number : DECIMAL

p_number__HEXADECIMAL(p)[source]

number : HEXADECIMAL

p_number__INTEGER(p)[source]

number : INTEGER

p_program__forms(p)[source]

program : forms

p_string__STRING(p)[source]

string : STRING

p_symbol__IDENTIFIER(p)[source]

symbol : IDENTIFIER

p_variable__IDENTIFIER(p)[source]

variable : IDENTIFIER

p_vector__HASH__L_PAREN__data__R_PAREN(p)[source]

vector : HASH L_PAREN data R_PAREN

t_BOOLEAN(t)[source]

#(T|F|t|f)

t_DECIMAL(t)[source]
t_HASH(t)[source]

#

t_HEXADECIMAL(t)[source]
t_IDENTIFIER(t)[source]
t_INTEGER(t)[source]
t_L_PAREN(t)[source]

(

t_R_PAREN(t)[source]

)

t_anything(t)[source]

.

t_error(t)[source]
t_newline(t)[source]

n+

t_quote(t)[source]

"

t_quote_440(t)[source]

\[nt\’”]

t_quote_443(t)[source]

[^\””]+

t_quote_446(t)[source]

"

t_quote_456(t)[source]

.

t_quote_error(t)
t_whitespace(t)[source]

[ tr]+

(Parser).tokenize(string)

Tokenize string and print results.


Read-only properties

(Parser).debug

Is true when parser runs in debugging mode.

(Parser).lexer

Gets parser’s PLY Lexer instance.

lexer_rules_object

Lexer rules object of Scheme parser.

(Parser).logger

Gets parser’s logger.

(Parser).logger_path

Gets parser’s logfile output path.

(Parser).output_path

Gets output path for files associated with the parser.

(Parser).parser

Gets parser’s PLY LRParser instance.

parser_rules_object

Parser rules object of Scheme parser.

(Parser).pickle_path

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