]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.9
authorfred <fred>
Mon, 11 Nov 1996 22:47:33 +0000 (22:47 +0000)
committerfred <fred>
Mon, 11 Nov 1996 22:47:33 +0000 (22:47 +0000)
hdr/parseconstruct.hh [new file with mode: 0644]
src/table.cc [new file with mode: 0644]

diff --git a/hdr/parseconstruct.hh b/hdr/parseconstruct.hh
new file mode 100644 (file)
index 0000000..259303e
--- /dev/null
@@ -0,0 +1,17 @@
+#include "proto.hh"
+
+template<class T>
+struct svec;
+
+void set_default_duration(String);
+void set_default_pitch(String);
+Staff * get_new_rhythmstaff();
+Voice_element * get_note_element(String,String);
+Voice_element* get_rest_element(String,String);
+Command *  get_bar_command(Real);
+Staff * get_new_melodicstaff();
+Command* get_meterchange_command( int,int);
+Command* get_meter_command( Real,int,int);
+Command* get_skip_command( int,Real);
+Request* get_request(char);
+void add_requests( Voice_element*v, svec<Request*>&req);
diff --git a/src/table.cc b/src/table.cc
new file mode 100644 (file)
index 0000000..1f30225
--- /dev/null
@@ -0,0 +1,67 @@
+#include "glob.hh"
+#include "debug.hh"
+#include "string.hh"
+#include "identifier.hh"
+#include "keyword.hh"
+#include "associter.hh"
+#include "parser.hh"
+
+static Keyword_ent  the_key_tab[]={
+    "voice", VOICE,
+    "rhythmstaff", RHYTHMSTAFF,
+    "melodicstaff", MELODICSTAFF,
+    "score", SCORE,
+    "bar", BAR,
+    "output", OUTPUT,
+    "cm", CM,
+    "start", START_T,
+    "pt", PT,
+    "in", IN,
+    "mm", MM,
+    "paper", PAPER,
+    "width", WIDTH,
+    "meter", METER,
+    "unitspace", UNITSPACE,
+    "skip", SKIP,
+    "octave", OCTAVECOMMAND,
+    "commands", COMMANDS,
+    "staff", STAFF,
+    "geometric", GEOMETRIC,
+    "duration", DURATIONCOMMAND,
+    0,0
+} ;
+
+
+int
+lookup_keyword(String s)
+{
+    static Keyword_table table(the_key_tab);
+    return table.lookup(s);
+}
+
+Assoc<String, Identifier*> the_id_tab;
+
+Identifier*
+lookup_identifier(String s)
+{
+    if (!the_id_tab.elt_query(s))
+       return 0;
+    
+    return the_id_tab[s];
+}
+
+void
+add_identifier(Identifier*i)
+{    
+    the_id_tab[i->name] = i;
+}
+
+void
+delete_identifiers()
+{
+    
+    for (Assoc_iter<String,Identifier*> ai(the_id_tab); ai.ok(); ai++) {
+       mtor << "deleting: " << ai.key()<<'\n';
+       delete ai.val();
+    }
+}