]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/my-lily-lexer.hh
* lily/my-lily-parser.cc: remove paper_description function
[lilypond.git] / lily / include / my-lily-lexer.hh
1 /*
2   lexer.hh -- declare My_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 LEXER_HH
10 #define LEXER_HH
11
12 #include "includable-lexer.hh"
13
14 #include "input.hh"
15 #include "lily-proto.hh"
16 #include "flower-proto.hh"
17 #include "array.hh"
18 #include "string.hh"
19 #include "duration.hh"
20 #include "pitch.hh"
21 #include "protected-scm.hh"
22
23 bool busy_parsing ();
24 void kill_lexer ();
25 void set_lexer ();
26
27 class My_lily_lexer : public Includable_lexer 
28 {
29   Protected_scm scopes_;
30   Protected_scm encoding_;
31 public:
32   String main_input_name_;
33   void *lexval;
34   bool main_input_b_;
35   
36   Sources * sources_; 
37
38   /*
39    Scheme hash tables with (oct name acc)  values, and symbol keys
40    */
41   Protected_scm chordmodifier_tab_;
42   Protected_scm pitchname_tab_stack_;
43
44   Keyword_table * keytable_;
45   int errorlevel_;
46
47   My_lily_lexer (Sources*);
48   ~My_lily_lexer ();
49   int yylex ();
50
51   Input last_input_;
52   void prepare_for_next_token ();
53   int try_special_identifiers (SCM* ,SCM);
54   Input here_input () const;
55   
56   void add_scope (SCM);
57   SCM remove_scope ();
58   
59   void start_main_input ();
60
61   SCM lookup_identifier (String s);
62   void push_note_state (SCM tab);
63   void push_chord_state (SCM tab);
64   void push_markup_state ();
65   void push_figuredbass_state ();
66   void push_lyric_state ();
67   void pop_state ();
68   void LexerError (char const *);
69   void set_encoding (String);
70   SCM encoding () const;
71   void set_identifier (SCM name_string, SCM);
72   bool is_note_state () const;
73   bool is_chord_state () const;
74   bool is_lyric_state () const;
75   bool is_figure_state () const;
76 private:
77   int lookup_keyword (String);
78   int scan_bare_word (String);
79   SCM scan_markup_word (String);
80   int scan_escaped_word (String);
81   int identifier_type (SCM);
82   char escaped_char (char) const;
83 };
84
85 #endif