]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/gperf/src/input.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / gperf / src / input.h
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    GNU GPERF 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 2, or (at your option)
14    any later version.
15
16    GNU GPERF 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; see the file COPYING.
23    If not, write to the Free Software Foundation, Inc.,
24    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
25
26 #ifndef input_h
27 #define input_h 1
28
29 #include <stdio.h>
30 #include "keyword-list.h"
31
32 class Input
33 {
34 public:
35                         Input (FILE *stream, Keyword_Factory *keyword_factory);
36                         ~Input ();
37   void                  read_input ();
38 private:
39   /* Input stream.  */
40   FILE *                _stream;
41   /* Creates the keywords.  */
42   Keyword_Factory * const _factory;
43 public:
44   /* Memory block containing the entire input.  */
45   char *                _input;
46   char *                _input_end;
47   /* The C code from the declarations section.  */
48   const char *          _verbatim_declarations;
49   const char *          _verbatim_declarations_end;
50   unsigned int          _verbatim_declarations_lineno;
51   /* The C code from the end of the file.  */
52   const char *          _verbatim_code;
53   const char *          _verbatim_code_end;
54   unsigned int          _verbatim_code_lineno;
55   /* Declaration of struct type for a keyword and its attributes.  */
56   const char *          _struct_decl;
57   unsigned int          _struct_decl_lineno;
58   /* Return type of the lookup function.  */
59   const char *          _return_type;
60   /* Shorthand for user-defined struct tag type.  */
61   const char *          _struct_tag;
62   /* List of all keywords.  */
63   Keyword_List *        _head;
64   /* Whether the keyword chars would have different values in a different
65      character set.  */
66   bool                  _charset_dependent;
67 };
68
69 #endif