From b457ab9e2efc592c72e34c873302d64b63c270d2 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:36:24 +0000 Subject: [PATCH] lilypond-0.0.44 --- lily/parser.y | 345 ++++++++++++++++++++++------------------------ make/Targets.make | 33 +++-- 2 files changed, 187 insertions(+), 191 deletions(-) diff --git a/lily/parser.y b/lily/parser.y index d5d53de1d1..c379ade770 100644 --- a/lily/parser.y +++ b/lily/parser.y @@ -1,5 +1,7 @@ %{ // -*-Fundamental-*- #include + + #include "script-def.hh" #include "symtable.hh" #include "lookup.hh" @@ -19,26 +21,30 @@ #include "command-request.hh" #include "musical-request.hh" #include "voice-element.hh" +#include "my-lily-parser.hh" +#include "text-def.hh" #ifndef NDEBUG #define YYDEBUG 1 #endif -Array pre_reqs, post_reqs; -Array define_spots; -Paper_def*default_paper(); -char const* defined_ch_c_l; -char const* req_defined_ch_c_l; -int fatal_error_i = 0; -bool init_parse_b; +#define YYERROR_VERBOSE 1 + +#define YYPARSE_PARAM my_lily_parser_l +#define YYLEX_PARAM my_lily_parser_l +#define THIS ((My_lily_parser *) my_lily_parser_l) + +#define yyerror THIS->parser_error + %} %union { - Array *melreqvec; + Array *melreqvec;/* should clean up naming */ Array * strvec; Array *intvec; Box *box; + Duration *duration; Identifier *id; Input_music *music; Input_score *score; @@ -67,12 +73,28 @@ bool init_parse_b; int i; int ii[10]; } +%{ + +int +yylex(YYSTYPE *s, void * v_l) +{ + My_lily_parser *pars_l = (My_lily_parser*) v_l; + My_lily_lexer * lex_l = pars_l->lexer_p_; + lex_l->lexval_l = (void*) s; + return lex_l->yylex(); +} + + +%} +%pure_parser + +/* tokens which are not keywords */ +%token CONCAT %token BAR %token CADENZA %token CLEF %token CM_T -%token CONCAT %token DURATIONCOMMAND %token DYNAMIC %token END @@ -124,17 +146,18 @@ bool init_parse_b; %token REAL %token DURATION RESTNAME %token STRING +%token POST_QUOTES +%token PRE_QUOTES + %type box %type open_request_parens close_request_parens close_plet_parens %type music_chord music_chord_body init_music_chord %type voice_elt full_element lyrics_elt command_elt %type int -%type octave_quotes octave_quote %type script_dir %type declaration -%type default_duration explicit_duration notemode_duration -%type mudela_duration +%type explicit_duration notemode_duration %type dinterval %type intastint_list %type symtables symtables_body @@ -155,6 +178,8 @@ bool init_parse_b; %type