]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/lily-lexer.hh
* configure.in: Test for and accept lmodern if EC fonts not found.
[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   SCM encoding_;
28   
29 private:
30   int lookup_keyword (String);
31   int scan_bare_word (String);
32   SCM scan_markup_word (String);
33   int scan_escaped_word (String);
34   int identifier_type (SCM);
35   char escaped_char (char) const;
36
37   Keyword_table *keytable_;
38 public:
39   String main_input_name_;
40   void *lexval;
41   bool main_input_b_;
42   
43   Sources *sources_; 
44
45   /* Scheme hash tables with (oct name acc)  values, and symbol keys.  */
46   SCM chordmodifier_tab_;
47   SCM pitchname_tab_stack_;
48
49   int error_level_;
50   Input last_input_;
51
52   Lily_lexer (Sources*);
53   Lily_lexer (Lily_lexer const&);
54   int yylex ();
55
56   void prepare_for_next_token ();
57   int try_special_identifiers (SCM* ,SCM);
58   Input here_input () const;
59   
60   void add_scope (SCM);
61   SCM remove_scope ();
62   
63   void start_main_input ();
64
65   SCM lookup_identifier (String s);
66   SCM lookup_identifier_symbol (SCM s);
67   void push_chord_state (SCM tab);
68   void push_figuredbass_state ();
69   void push_lyric_state ();
70   void push_initial_state ();
71   void push_markup_state ();
72   void push_note_state (SCM tab);
73   void pop_state ();
74   void LexerError (char const *);
75   void set_encoding (String);
76   SCM encoding () const;
77   void set_identifier (SCM name_string, SCM);
78   bool is_note_state () const;
79   bool is_chord_state () const;
80   bool is_lyric_state () const;
81   bool is_figure_state () const;
82 };
83
84 #endif /* MY_LILY_LEXER_HH */