]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.5
authorfred <fred>
Mon, 28 Oct 1996 23:07:20 +0000 (23:07 +0000)
committerfred <fred>
Mon, 28 Oct 1996 23:07:20 +0000 (23:07 +0000)
Sources.make
lexer.l
parser.y
table.cc

index 02eac2a6c0c0d528ec838cc250281331d5d3483d..6c420edad718bdd1b0875d7e49c6e2932b7550f2 100644 (file)
@@ -3,7 +3,7 @@ hdr=    qlp.hh       \
        pcol.hh   proto.hh pstaff.hh  line.hh\
        const.hh glob.hh molecule.hh  boxes.hh pscore.hh item.hh tex.hh\
        request.hh voice.hh command.hh staff.hh  linestaff.hh \
-       tstream.hh  mtime.hh rhythmstaf.hh\
+       tstream.hh   rhythmstaf.hh\
        parseconstruct.hh  debug.hh globvars.hh keyword.hh\
        misc.hh score.hh notename.hh lexer.hh symtable.hh\
        symbol.hh main.hh dimen.hh paper.hh lookupsyms.hh\
@@ -19,5 +19,5 @@ mycc=   qlp.cc qlpsolve.cc \
        pstaff.cc  tstream.cc version.cc\
        calcideal.cc scores.cc identifier.cc \
        dimen.cc paper.cc lookupsyms.cc scommands.cc\
-       sccol.cc stcol.cc\
+       sccol.cc stcol.cc getcommands.cc\
        template1.cc template2.cc template3.cc
diff --git a/lexer.l b/lexer.l
index 03853ca579f93777a68c5a55cdc2931331f0c224..46a30cf7526d3619145902c1d4eaf233c10cc4f6 100644 (file)
--- a/lexer.l
+++ b/lexer.l
@@ -113,9 +113,15 @@ REAL               [0-9]+(\.[0-9]*)?
        mtor << "parens\n";
        return YYText()[0];
 }
+[:]            {
+       char c = YYText()[0];
+       mtor << "misc char" <<c<<"\n";
+       return c;
+}
 [ \t\n]+       {
        
 }
+
 %.*            {
        //ignore
 }
index d60face970f2830abbe8980091da4c7dadc7593a..ebc4c54f8b340dfc0f6e03a3fbf44950579c6daf 100644 (file)
--- a/parser.y
+++ b/parser.y
@@ -7,6 +7,7 @@
 #include "score.hh"
 #include "main.hh"
 #include "keyword.hh"
+#include "scommands.hh"
 #include "debug.hh"
 #include "parseconstruct.hh"
 #include "dimen.hh"
@@ -22,7 +23,7 @@
     Real real;
     Command *command;
     Identifier *id;    
-
+    Score_commands *scommands;
     Voice *voice;    
     Voice_element *el; 
     Staff *staff;    
@@ -34,7 +35,7 @@
 }
 
 %token VOICE STAFF SCORE TITLE RHYTHMSTAFF BAR NOTENAME OUTPUT
-%token CM IN PT MM PAPER WIDTH METER
+%token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS
 
 %type <consstr> unit
 %token <id> IDENTIFIER
@@ -50,7 +51,7 @@
 %type <score> score_block score_body
 %type <staff> staff_block  rhythmstaff_block rhythmstaff_body
 %type <i> int
-
+%type <scommands> score_commands_block score_commands_body
 
 %%
 
@@ -66,9 +67,16 @@ score_block: SCORE '{' score_body '}'        { $$ = $3; }
 
 score_body:            { $$ = new Score; } 
        | score_body staff_block        { $$->add($2); }
-       | score_body score_command      { $$->add($2); }
-       | score_body paper_block        { delete $$->paper;
-               $$->paper = $2;
+       | score_body score_commands_block       { $$->set($2); }
+       | score_body paper_block                { $$->set($2);  }
+       ;
+score_commands_block:
+       COMMANDS '{' score_commands_body '}' { $$ =$3;}
+       ;
+
+score_commands_body:                   { $$ = new Score_commands; }
+       | score_commands_body score_command             {
+               $$->parser_add($2);
        }
        ;
 
@@ -82,6 +90,7 @@ paper_body:
        | paper_body OUTPUT STRING      { $$->outfile = *$3;
                delete $3;
        }
+       | paper_body UNITSPACE dim      { $$->whole_width = $3; }
        ;
 
 dim:
@@ -142,13 +151,17 @@ voice_elt:
        ;
 
 score_command:
-       BAR REAL                        {
-               $$ = get_bar_command($2);
+       SKIP int ':' REAL               {
+               $$ = get_skip_command($2, $4);
        }
-       | METER REAL int int            {
-               $$ = get_meter_command($2, $3, $4);
+       | METER  int int                {
+               $$ = get_meterchange_command($2, $3);
        }
+/*     | PARTIALMEASURE REAL           {
+               $$ = get_partial_command($2);
+       }*/
        ;
+       
 
 int:
        REAL                    {
index 72b5ccfd55eea9980a6362af23a4e1b2bbe2eaf5..da2af9575ed504101855bbbc5aa5fe792dbdf9cd 100644 (file)
--- a/table.cc
+++ b/table.cc
@@ -17,6 +17,9 @@ static Keyword_ent  the_key_tab[]={
     "paper", PAPER,
     "width", WIDTH,
     "meter", METER,
+    "unitspace", UNITSPACE,
+    "skip", SKIP,
+    "commands", COMMANDS,
     0,0
 } ;