2 lexer.hh -- declare Lily_lexer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #ifndef MY_LILY_LEXER_HH
10 #define MY_LILY_LEXER_HH
12 #include "includable-lexer.hh"
15 #include "duration.hh"
22 class Lily_lexer : public Includable_lexer
24 DECLARE_SMOBS (Lily_lexer,);
27 int lookup_keyword (string);
28 int scan_bare_word (string);
29 SCM scan_markup_word (string);
30 int scan_escaped_word (string);
31 int identifier_type (SCM);
32 char escaped_char (char) const;
34 Keyword_table *keytable_;
39 vector<int> extra_token_types_;
40 string main_input_name_;
47 /* Scheme hash tables with (oct name acc) values, and symbol keys. */
48 SCM chordmodifier_tab_;
49 SCM pitchname_tab_stack_;
54 Lily_lexer (Sources *);
55 Lily_lexer (Lily_lexer const &);
58 void add_lexed_char (int);
60 void prepare_for_next_token ();
61 int try_special_identifiers (SCM *, SCM);
62 Input here_input () const;
65 SCM set_current_scope ();
68 void start_main_input ();
70 SCM lookup_identifier (string s);
71 SCM lookup_identifier_symbol (SCM s);
72 void push_extra_token (int token_type);
73 void push_chord_state (SCM tab);
74 void push_figuredbass_state ();
75 void push_lyric_state ();
76 void push_initial_state ();
77 void push_markup_state ();
78 void push_note_state (SCM tab);
80 void LexerError (char const *);
81 void set_identifier (SCM name_string, SCM);
82 int get_state () const;
83 bool is_note_state () const;
84 bool is_chord_state () const;
85 bool is_lyric_state () const;
86 bool is_figure_state () const;
89 #endif /* MY_LILY_LEXER_HH */