1 | /* This may look like C code, but it is really -*- C++ -*- */ |
2 | |
3 | /* Input routines. |
4 | |
5 | Copyright (C) 1989-1998, 2002-2003 Free Software Foundation, Inc. |
6 | Written by Douglas C. Schmidt <schmidt@ics.uci.edu> |
7 | and Bruno Haible <bruno@clisp.org>. |
8 | |
9 | This file is part of GNU GPERF. |
10 | |
11 | This program is free software: you can redistribute it and/or modify |
12 | it under the terms of the GNU General Public License as published by |
13 | the Free Software Foundation; either version 3 of the License, or |
14 | (at your option) any later version. |
15 | |
16 | This program is distributed in the hope that it will be useful, |
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 | GNU General Public License for more details. |
20 | |
21 | You should have received a copy of the GNU General Public License |
22 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
23 | |
24 | #ifndef input_h |
25 | #define input_h 1 |
26 | |
27 | #include <stdio.h> |
28 | #include "keyword-list.h" |
29 | |
30 | class Input |
31 | { |
32 | public: |
33 | Input (FILE *stream, Keyword_Factory *keyword_factory); |
34 | ~Input (); |
35 | void read_input (); |
36 | private: |
37 | /* Input stream. */ |
38 | FILE * _stream; |
39 | /* Creates the keywords. */ |
40 | Keyword_Factory * const _factory; |
41 | public: |
42 | /* Memory block containing the entire input. */ |
43 | char * _input; |
44 | char * _input_end; |
45 | /* The C code from the declarations section. */ |
46 | const char * _verbatim_declarations; |
47 | const char * _verbatim_declarations_end; |
48 | unsigned int _verbatim_declarations_lineno; |
49 | /* The C code from the end of the file. */ |
50 | const char * _verbatim_code; |
51 | const char * _verbatim_code_end; |
52 | unsigned int _verbatim_code_lineno; |
53 | /* Declaration of struct type for a keyword and its attributes. */ |
54 | const char * _struct_decl; |
55 | unsigned int _struct_decl_lineno; |
56 | /* Return type of the lookup function. */ |
57 | const char * _return_type; |
58 | /* Shorthand for user-defined struct tag type. */ |
59 | const char * _struct_tag; |
60 | /* List of all keywords. */ |
61 | Keyword_List * _head; |
62 | /* Whether the keyword chars would have different values in a different |
63 | character set. */ |
64 | bool _charset_dependent; |
65 | }; |
66 | |
67 | #endif |
68 | |