]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/lily-lexer.hh
* lily/include/lily-lexer.hh (class Lily_lexer): lose hungarian _b
[lilypond.git] / lily / include / lily-lexer.hh
1 /*
2   lexer.hh -- declare Lily_lexer
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef MY_LILY_LEXER_HH
10 #define MY_LILY_LEXER_HH
11
12 #include "includable-lexer.hh"
13
14 #include "input.hh"
15 #include "duration.hh"
16 #include "pitch.hh"
17
18 bool busy_parsing ();
19 void kill_lexer ();
20 void set_lexer ();
21
22 class Lily_lexer : public Includable_lexer 
23 {
24   DECLARE_SMOBS(Lily_lexer,);
25 public:
26   SCM scopes_;
27   
28 private:
29   int lookup_keyword (String);
30   int scan_bare_word (String);
31   SCM scan_markup_word (String);
32   int scan_escaped_word (String);
33   int identifier_type (SCM);
34   char escaped_char (char) const;
35
36   Keyword_table *keytable_;
37
38 public:
39   String main_input_name_;
40   void *lexval;
41   Input *lexloc;
42   bool is_main_input_;
43   
44   Sources *sources_; 
45
46   /* Scheme hash tables with (oct name acc)  values, and symbol keys.  */
47   SCM chordmodifier_tab_;
48   SCM pitchname_tab_stack_;
49
50   int error_level_;
51   Input last_input_;
52
53   Lily_lexer (Sources*);
54   Lily_lexer (Lily_lexer const&);
55   int yylex ();
56
57   void add_lexed_char (int);
58
59   void prepare_for_next_token ();
60   int try_special_identifiers (SCM* ,SCM);
61   Input here_input () const;
62   
63   void add_scope (SCM);
64   SCM remove_scope ();
65   
66   void start_main_input ();
67
68   SCM lookup_identifier (String s);
69   SCM lookup_identifier_symbol (SCM s);
70   void push_chord_state (SCM tab);
71   void push_figuredbass_state ();
72   void push_lyric_state ();
73   void push_initial_state ();
74   void push_markup_state ();
75   void push_note_state (SCM tab);
76   void pop_state ();
77   void LexerError (char const *);
78   void set_identifier (SCM name_string, SCM);
79   bool is_note_state () const;
80   bool is_chord_state () const;
81   bool is_lyric_state () const;
82   bool is_figure_state () const;
83 };
84
85 #endif /* MY_LILY_LEXER_HH */