X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Fparser.yy;h=a76260f9ddb51a7ca60d7e1a0e50bb4c5b6b2089;hb=7ed4019033adf7db7a8f64c4eb7b7f6d0449402f;hp=f6e9764a17d55a379bb222255a4b3b9e3329da54;hpb=6dfa9e3be119a27e17be77c6374ada2e173cda3e;p=lilypond.git diff --git a/lily/parser.yy b/lily/parser.yy index f6e9764a17..a76260f9dd 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -5,16 +5,14 @@ source file of the GNU LilyPond music typesetter - (c) 1997 Han-Wen Nienhuys + (c) 1997--1999 Han-Wen Nienhuys Jan Nieuwenhuizen */ #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" @@ -24,45 +22,42 @@ #include "file-path.hh" #include "keyword.hh" #include "debug.hh" -#include "parseconstruct.hh" #include "dimensions.hh" #include "identifier.hh" #include "command-request.hh" #include "musical-request.hh" #include "my-lily-parser.hh" -#include "text-def.hh" +#include "context-specced-music.hh" #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 "lyric-combine-music.hh" #include "transposed-music.hh" +#include "time-scaled-music.hh" +#include "repeated-music.hh" +#include "mudela-version.hh" +#include "grace-music.hh" +#include "auto-change-music.hh" // mmm -Mudela_version oldest_version ("1.0.6"); -Mudela_version version ("1.0.6"); +Mudela_version oldest_version ("1.3.4"); + +void +print_mudela_versions (ostream &os) +{ + os << _f ("Oldest supported input version: %s", oldest_version.str ()) + << endl; +} // 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 -}; - -Paper_def* current_paper = 0; - #ifndef NDEBUG #define YYDEBUG 1 #endif @@ -74,49 +69,44 @@ Paper_def* current_paper = 0; #define THIS ((My_lily_parser *) my_lily_parser_l) #define yyerror THIS->parser_error -#define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s)) - +#define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f ("Expecting %d arguments", s)) %} %union { - Array* intarr; + Array* realarr; Array *pitch_arr; - Array * strvec; + Link_array *reqvec; Array *intvec; - Box *box; - Simultaneous_music *chord; + Notename_table *chordmodifiertab; Duration *duration; Identifier *id; - Translator* trans; + String * string; Music *music; Music_list *music_list; Score *score; - Header *header; + Scope *scope; Interval *interval; 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; - String *string; - Atom * symbol; - Symtable * symtable; - Symtables* symtables; - Text_def * textdef; + + /* We use SCMs to do strings, because it saves us the trouble of +deleting them. Let's hope that a stack overflow doesnt trigger a move +of the parse stack onto the heap. */ + SCM scm; + Tempo_req *tempo; + Translator_group* trans; char c; - const char *consstr; int i; - int pair[2]; int ii[10]; } %{ @@ -137,72 +127,78 @@ yylex (YYSTYPE *s, void * v_l) %pure_parser /* tokens which are not keywords */ - -%token ABSDYNAMIC +%token AUTOCHANGE +%token TEXTSCRIPT %token ACCEPTS +%token ALTERNATIVE %token BAR -%token BEAMPLET +%token BREATHE %token CADENZA +%token CHORDMODIFIERS +%token CHORDS +%token HYPHEN %token CLEF %token CM_T %token CONSISTS +%token SEQUENTIAL +%token SIMULTANEOUS +%token CONSISTSEND %token DURATION -%token END +%token EXTENDER %token FONT -%token GROUPING +%token GRACE %token HEADER %token IN_T +%token INVALID %token KEY %token KEYSIGNATURE -%token LYRIC -%token MAEBTELP +%token LYRICS %token MARK %token MEASURES %token MIDI %token MM_T -%token MUSIC %token MUSICAL_PITCH %token NAME %token NOTENAMES %token NOTES -%token OCTAVE -%token OUTPUT %token PAPER %token PARTIAL %token PENALTY -%token PLET %token PROPERTY %token PT_T %token RELATIVE %token REMOVE +%token REPEAT +%token REPETITIONS +%token ADDLYRICS +%token SCM_T %token SCORE %token SCRIPT %token SHAPE %token SKIP -%token SPANDYNAMIC -%token SYMBOLTABLES -%token TABLE -%token TELP +%token SPANREQUEST %token TEMPO %token TIME_T +%token TIMES %token TRANSLATOR %token TRANSPOSE %token TYPE -%token VERSION +%token CONTEXT /* escaped */ -%token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR +%token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER +%token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET -%type dots +%type exclamations questions %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 -%token COMMAND_IDENTIFIER +%token REQUEST_IDENTIFIER %token REAL_IDENTIFIER %token STRING_IDENTIFIER %token TRANS_IDENTIFIER @@ -210,78 +206,85 @@ 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 +%token DURATION RESTNAME +%token STRING +%token SCM_T %token UNSIGNED %type output_def -%type
mudela_header mudela_header_body -%type box -%type open_request_parens close_request_parens -%type open_abbrev_parens -%type open_plet_parens close_plet_parens +%type mudela_header mudela_header_body +%type open_request_parens close_request_parens open_request close_request +%type request_with_dir request_that_take_dir verbose_request %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 steno_duration notemode_duration +%type optional_modality +%type identifier_init +%type steno_duration optional_notemode_duration %type entered_notemode_duration explicit_duration -%type dinterval -%type intastint_list int_list -%type symtables symtables_body - +%type int_list +%type pre_requests post_requests +%type gen_text_def %type explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch -%type steno_notepitch +%type steno_tonic_pitch + %type pitch_list +%type chord +%type chord_additions chord_subtractions chord_notes chord_step +%type chord_note chord_inversion chord_bass %type midi_block midi_body %type duration_length -%type scalar -%type Music relative_music Sequential_music Simultaneous_music +%type embedded_scm scalar +%type Music Sequential_music Simultaneous_music Music_sequence +%type relative_music re_rhythmed_music %type property_def translator_change %type Music_list %type paper_block paper_def_body -%type dim real -%type real_mult_expression real_primary -%type unit +%type real real_with_dimension %type abbrev_command_req -%type post_request structured_post_request -%type plet_fraction +%type post_request %type command_req verbose_command_req -%type script_req dynamic_req -%type string -%type string_primary +%type extender_req +%type hyphen_req +%type string %type score_block score_body -%type shape_array -%type