SchemeParser

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.SchemeParser.SchemeParser" [URL="../api/abjad/parser/SchemeParser.html#abjad.parser.SchemeParser.SchemeParser", color=black, fontcolor=white, label="Scheme\nParser", target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/parser/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.Parser.Parser" [URL="../api/abjad/parser/../system/Parser.html#abjad.system.Parser.Parser", label=Parser, shape=oval, style=bold, target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.Parser.Parser"; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "abjad.system.Parser.Parser" -> "abjad.parser.SchemeParser.SchemeParser"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.parser.SchemeParser.SchemeParser(debug=False)

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.

(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

p_boolean__BOOLEAN(p)

boolean : BOOLEAN

p_constant__boolean(p)

constant : boolean

p_constant__number(p)

constant : number

p_constant__string(p)

constant : string

p_data__EMPTY(p)

data :

p_data__data__datum(p)

data : data datum

p_datum__constant(p)

datum : constant

p_datum__list(p)

datum : list

p_datum__symbol(p)

datum : symbol

p_datum__vector(p)

datum : vector

p_error(p)
p_expression__QUOTE__datum(p)

expression : QUOTE datum

p_expression__constant(p)

expression : constant

p_expression__variable(p)

expression : variable

p_form__expression(p)

form : expression

p_forms__EMPTY(p)

forms :

p_forms__forms__form(p)

forms : forms form

p_list__L_PAREN__data__R_PAREN(p)

list : L_PAREN data R_PAREN

p_list__L_PAREN__data__datum__PERIOD__datum__R_PAREN(p)

list : L_PAREN data datum PERIOD datum R_PAREN

p_number__DECIMAL(p)

number : DECIMAL

p_number__HEXADECIMAL(p)

number : HEXADECIMAL

p_number__INTEGER(p)

number : INTEGER

p_program__forms(p)

program : forms

p_string__STRING(p)

string : STRING

p_symbol__IDENTIFIER(p)

symbol : IDENTIFIER

p_variable__IDENTIFIER(p)

variable : IDENTIFIER

p_vector__HASH__L_PAREN__data__R_PAREN(p)

vector : HASH L_PAREN data R_PAREN

t_BOOLEAN(t)

#(T|F|t|f)

t_DECIMAL(t)
t_HASH(t)

#

t_HEXADECIMAL(t)
t_IDENTIFIER(t)
t_INTEGER(t)
t_L_PAREN(t)

(

t_R_PAREN(t)

)

t_anything(t)

.

t_error(t)
t_newline(t)

n+

t_quote(t)

t_quote_440(t)

\[nt'”]

t_quote_443(t)

[^"”]+

t_quote_446(t)

t_quote_456(t)

.

t_quote_error(t)
t_whitespace(t)

[ 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.