]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/keyword.cc
release: 1.0.1
[lilypond.git] / lily / keyword.cc
index 0274d1653fc2bdd5a8bcc75749e8e48cf6c27343..b273df2d6e2dbcb1d25bd645cdbbdeb94bcbe154 100644 (file)
@@ -4,22 +4,8 @@
 
 #include <stdlib.h>
 
-#include "my-lily-lexer.hh"
 
-/* for the keyword table */
-struct Keyword_ent
-{
-  char const *name;
-  int     tokcode;
-};
-
-struct Keyword_table
-{
-  Keyword_ent *table;
-  int     maxkey;
-  Keyword_table (Keyword_ent *);
-  int     lookup (char const *s) const;
-};
+#include "keyword.hh"
 
 
 /* for qsort */
@@ -27,7 +13,7 @@ int
       tabcmp (void const * p1, void const * p2)
 {
   return strcmp (((Keyword_ent const *) p1)->name,
-                ((Keyword_ent const *) p2)->name);
+                ((Keyword_ent const *) p2)->name);
 }
 
 Keyword_table::Keyword_table (Keyword_ent *tab)
@@ -35,7 +21,8 @@ Keyword_table::Keyword_table (Keyword_ent *tab)
   table = tab;
 
   /* count keywords */
-  for (maxkey = 0; table[maxkey].name; maxkey++);
+  for (maxkey = 0; table[maxkey].name; maxkey++)
+    ;
 
   /* sort them */
   qsort (table, maxkey, sizeof (Keyword_ent), tabcmp);
@@ -47,10 +34,10 @@ Keyword_table::Keyword_table (Keyword_ent *tab)
 int
 Keyword_table::lookup (char const *s) const
 {
-  int     lo,
-          hi,
-          cmp,
-          result;
+  int lo;
+  int hi;
+  int cmp;
+  int result;
   lo = 0;
   hi = maxkey;