]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/input.hh
Run `make grand-replace'.
[lilypond.git] / lily / include / input.hh
1 /*
2   input.hh -- declare Input
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef INPUT_HH
10 #define INPUT_HH
11
12 #include "lily-proto.hh"
13
14 /**
15    Base class for anything that records its poisition in the parse file.
16 */
17 class Input
18 {
19   char const *start_;
20   char const *end_;
21   Source_file *source_file_;
22 public:
23   Source_file *get_source_file () const;
24   char const *start () const;
25   char const *end () const;
26
27   void set (Source_file *, char const *, char const *);
28   void warning (string) const;
29   void programming_error (string) const;
30   void non_fatal_error (string) const;
31   void error (string) const;
32   void message (string) const;
33   void set_spot (Input const &);
34   void step_forward ();
35   void set_location (Input const &, Input const &);
36
37   Input spot () const;
38
39   string location_string () const;
40   string line_number_string () const;
41   string file_string ()const;
42
43   int line_number ()const;
44   int column_number ()const;
45   int end_line_number ()const;
46   int end_column_number ()const;
47
48   void get_counts (int *line, int *char_count, int *col) const;
49
50   Input (Input const &i);
51   Input ();
52 };
53
54
55 #include "smobs.hh"
56
57 SCM make_input (Input spot);
58 Input *unsmob_input (SCM);
59
60 extern Input dummy_input_global;
61
62 #endif // INPUT_HH