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