]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.38
authorfred <fred>
Sun, 24 Mar 2002 19:34:04 +0000 (19:34 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:34:04 +0000 (19:34 +0000)
src/mylexer.cc
src/symtable.cc

index 10c395759c321aca3a14b76270134301641eb4b3..7da6dddec843d7413426c724287cb7aea2763ee9 100644 (file)
@@ -1,16 +1,17 @@
 #include <strstream.h>
+
 #include "interval.hh"
 #include "identparent.hh"
-#include "associter.hh"
+#include "assoc-iter.hh"
 #include "lexer.hh"
-#include "inputfile.hh"
+#include "input-file.hh"
 #include "parser.hh"
 #include "keyword.hh"
 #include "assoc.hh"
 #include "lexer.hh"
 #include "debug.hh"
 #include "notename.hh"
-#include "sourcefile.hh"
+#include "source-file.hh"
 #include "parseconstruct.hh"
 
 static Keyword_ent the_key_tab[]={
@@ -25,7 +26,6 @@ static Keyword_ent the_key_tab[]={
     "goto", GOTO,
     "in", IN_T,
     "key", KEY,
-
     "meter", METER,
     "midi", MIDI,
     "mm", MM_T,
@@ -64,7 +64,8 @@ My_flex_lexer::ret_notename(int *p, String text, int octave_mod)
     char const* ch_c_l = here_ch_c_l();
     if ( ch_c_l ) {
        ch_c_l--;
-       while ( ( *ch_c_l == ' ' ) || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) )
+       while ( ( *ch_c_l == ' ' )
+               || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) )
            ch_c_l--;
        ch_c_l++;
     }
@@ -127,6 +128,13 @@ My_flex_lexer::~My_flex_lexer()
     }
     delete the_id_tab;
 }
+void
+My_flex_lexer::print_declarations()const
+{
+    for (Assoc_iter<String,Identifier*> ai(*the_id_tab); ai.ok(); ai++) {
+       ai.val()->print();
+    }
+}
 
 String
 My_flex_lexer::spot()const
index 87ed983da3e7187d9db0f1b36978644ca0fc823b..d55e9ac59bdd977572423dc035259af53d89ddad 100644 (file)
@@ -4,7 +4,7 @@
 #include "real.hh"
 #include "symbol.hh"
 #include "assoc.hh"
-#include "associter.hh"
+#include "assoc-iter.hh"
 #include "symtable.hh"
 
 Symtables::Symtables()
@@ -42,3 +42,20 @@ Symtables::operator()(String s)
 {
     return Assoc<String, Symtable*>::operator[](s);
 } 
+void
+Symtables::print() const
+{
+    for (Assoc_iter<String, Symtable*>  i(*this); i.ok(); i++) {
+       mtor << "table \'" << i.key() << "\' {\n";
+       i.val()->print();
+       mtor << "}\n";
+    }
+}
+void
+Symtable::print() const
+{
+    for (Assoc_iter<String, Symbol>  i(*this); i.ok(); i++) {
+       mtor << "\'" << i.key() << "\'->" << i.val().str() << "\n";
+    }
+}
+