X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fparser.yy;h=73a7557a4758d7be0d0324e8012df4c010377889;hb=b43244dd4eeca1a96e0cdb258231ef0b6cca1a8f;hp=f9a3094e02f639af689a3444d1b39f79d93789aa;hpb=151617937a431d3db3e94a16db011600acdb4288;p=lilypond.git diff --git a/lily/parser.yy b/lily/parser.yy index f9a3094e02..73a7557a47 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -10,11 +10,11 @@ */ #include - +#include "lily-guile.hh" +#include "notename-table.hh" #include "scalar.hh" #include "translation-property.hh" #include "script-def.hh" -#include "symtable.hh" #include "lookup.hh" #include "misc.hh" #include "my-lily-lexer.hh" @@ -25,7 +25,7 @@ #include "keyword.hh" #include "debug.hh" #include "parseconstruct.hh" -#include "dimension.hh" +#include "dimensions.hh" #include "identifier.hh" #include "command-request.hh" #include "musical-request.hh" @@ -34,31 +34,40 @@ #include "translator-group.hh" #include "score.hh" #include "music-list.hh" -#include "header.hh" #include "duration-convert.hh" #include "change-translator.hh" #include "file-results.hh" #include "mudela-version.hh" #include "scope.hh" #include "relative-music.hh" - +#include "transposed-music.hh" +#include "compressed-music.hh" +#include "repeated-music.hh" // mmm -Mudela_version oldest_version ("1.0.3"); -Mudela_version version ("1.0.3"); +Mudela_version oldest_version ("1.0.14"); +Mudela_version version ("1.0.15"); // needed for bison.simple's malloc() and free() #include -int const GUESS_PLET = 5; -int guess_plet_a[GUESS_PLET] = -{ - 1, - 3, - 2, - 3, - 4 +struct Assignment { + String *name_p_; + Identifier *id_p_; + ~Assignment () { + delete name_p_; + delete id_p_; + } + Assignment () { + name_p_ = 0; + id_p_ =0; + } + Assignment (Assignment const&s) + { + name_p_ = new String (*s.name_p_); + id_p_ = s.id_p_->clone (); + } }; Paper_def* current_paper = 0; @@ -76,7 +85,6 @@ Paper_def* current_paper = 0; #define yyerror THIS->parser_error #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s)) - %} @@ -85,39 +93,34 @@ Paper_def* current_paper = 0; Array *pitch_arr; Array * strvec; Array *intvec; - Box *box; - Simultaneous_music *chord; + Notename_table *chordmodifiertab; Duration *duration; + General_script_def * script; Identifier *id; - Translator* trans; Music *music; Music_list *music_list; Score *score; - Header *header; + Scope *scope; Interval *interval; - Lookup*lookup; - Musical_req* musreq; Music_output_def * outputdef; Musical_pitch * pitch; Midi_def* midi; Moment *moment; Note_req *notereq; + Notename_table *notenametab; Paper_def *paper; Real real; Request * request; - General_script_def * script; Scalar *scalar; + Simultaneous_music *chord; String *string; - Atom * symbol; - Symtable * symtable; - Symtables * symtables; - Text_def * textdef; Tempo_req *tempo; + Text_def * textdef; + Translator* trans; char c; const char *consstr; int i; - int pair[2]; int ii[10]; } %{ @@ -139,61 +142,54 @@ yylex (YYSTYPE *s, void * v_l) /* tokens which are not keywords */ -%token ALIAS +%token ABSDYNAMIC +%token ACCEPTS +%token ALTERNATIVE %token BAR -%token BEAMPLET -%token MAEBTELP -%token PENALTY %token CADENZA -%token CLEAR +%token CHORDMODIFIERS +%token CHORDS %token CLEF -%token CONTAINS -%token RELATIVE -%token CONSISTS -%token ACCEPTS %token CM_T +%token CONSISTS %token DURATION -%token ABSDYNAMIC -%token END +%token EXTENDER +%token FONT %token GROUPING -%token TRANSLATOR %token HEADER %token IN_T -%token LYRIC %token KEY %token KEYSIGNATURE +%token LYRICS %token MARK -%token MUSIC -%token MUSICAL_PITCH -%token NOTES +%token MEASURES %token MIDI -%token TIME_T %token MM_T - +%token MUSICAL_PITCH +%token NAME %token NOTENAMES -%token OCTAVE -%token OUTPUT +%token NOTES %token PAPER %token PARTIAL -%token PLET -%token TELP +%token PENALTY +%token PROPERTY %token PT_T +%token RELATIVE +%token REMOVE +%token REPEAT +%token SCM_T +%token SCMFILE %token SCORE %token SCRIPT %token SHAPE %token SKIP %token SPANDYNAMIC - -%token START_T -%token SYMBOLTABLES -%token TABLE -%token TRANSPOSE %token TEMPO +%token TIME_T +%token TIMES +%token TRANSLATOR +%token TRANSPOSE %token TYPE -%token FONT -%token MEASURES -%token TITLE -%token PROPERTY %token VERSION /* escaped */ @@ -202,9 +198,11 @@ yylex (YYSTYPE *s, void * v_l) %type dots %token DIGIT %token NOTENAME_PITCH +%token TONICNAME_PITCH +%token CHORDMODIFIER_PITCH %token DURATION_IDENTIFIER %token IDENTIFIER - +%token NOTENAME_TABLE_IDENTIFIER %token MUSIC_IDENTIFIER %token POST_REQUEST_IDENTIFIER %token SCRIPT_IDENTIFIER @@ -216,7 +214,6 @@ yylex (YYSTYPE *s, void * v_l) %token SCORE_IDENTIFIER %token MIDI_IDENTIFIER %token PAPER_IDENTIFIER -%token REQUEST_IDENTIFIER %token REAL %token DURATION RESTNAME %token STRING @@ -224,73 +221,104 @@ yylex (YYSTYPE *s, void * v_l) %type output_def -%type
mudela_header mudela_header_body -%type box +%type mudela_header mudela_header_body %type open_request_parens close_request_parens -%type open_abbrev_parens -%type open_plet_parens close_plet_parens %type sub_quotes sup_quotes -%type simple_element request_chord command_element +%type simple_element request_chord command_element Simple_music Composite_music +%type Alternative_music Repeated_music %type abbrev_type %type int unsigned %type script_dir -%type identifier_init simple_identifier_init +%type optional_modality +%type identifier_init simple_identifier_init block_identifier %type steno_duration notemode_duration %type entered_notemode_duration explicit_duration -%type dinterval %type intastint_list int_list -%type symtables symtables_body %type explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch +%type steno_tonic_pitch %type steno_notepitch %type pitch_list +%type chord notemode_chord +%type chord_additions chord_subtractions chord_notes +%type chord_addsub chord_note chord_inversion notemode_chord_inversion %type midi_block midi_body %type duration_length %type scalar -%type Music transposed_music relative_music Sequential_music Simultaneous_music +%type Music relative_music Sequential_music Simultaneous_music %type property_def translator_change %type Music_list -%type paper_block paper_body -%type dim real -%type real_mult_expression real_primary -%type unit +%type paper_block paper_def_body +%type real_expression real dimension %type abbrev_command_req %type post_request structured_post_request -%type plet_fraction %type command_req verbose_command_req -%type script_req dynamic_req +%type script_req dynamic_req extender_req %type string -%type string_primary %type score_block score_body %type shape_array %type