Blame src/input.h

Packit b27855
/* This may look like C code, but it is really -*- C++ -*- */
Packit b27855
Packit b27855
/* Input routines.
Packit b27855
Packit b27855
   Copyright (C) 1989-1998, 2002-2003 Free Software Foundation, Inc.
Packit b27855
   Written by Douglas C. Schmidt <schmidt@ics.uci.edu>
Packit b27855
   and Bruno Haible <bruno@clisp.org>.
Packit b27855
Packit b27855
   This file is part of GNU GPERF.
Packit b27855
Packit b27855
   This program is free software: you can redistribute it and/or modify
Packit b27855
   it under the terms of the GNU General Public License as published by
Packit b27855
   the Free Software Foundation; either version 3 of the License, or
Packit b27855
   (at your option) any later version.
Packit b27855
Packit b27855
   This program is distributed in the hope that it will be useful,
Packit b27855
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit b27855
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit b27855
   GNU General Public License for more details.
Packit b27855
Packit b27855
   You should have received a copy of the GNU General Public License
Packit b27855
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit b27855
Packit b27855
#ifndef input_h
Packit b27855
#define input_h 1
Packit b27855
Packit b27855
#include <stdio.h>
Packit b27855
#include "keyword-list.h"
Packit b27855
Packit b27855
class Input
Packit b27855
{
Packit b27855
public:
Packit b27855
                        Input (FILE *stream, Keyword_Factory *keyword_factory);
Packit b27855
                        ~Input ();
Packit b27855
  void                  read_input ();
Packit b27855
private:
Packit b27855
  /* Input stream.  */
Packit b27855
  FILE *                _stream;
Packit b27855
  /* Creates the keywords.  */
Packit b27855
  Keyword_Factory * const _factory;
Packit b27855
public:
Packit b27855
  /* Memory block containing the entire input.  */
Packit b27855
  char *                _input;
Packit b27855
  char *                _input_end;
Packit b27855
  /* The C code from the declarations section.  */
Packit b27855
  const char *          _verbatim_declarations;
Packit b27855
  const char *          _verbatim_declarations_end;
Packit b27855
  unsigned int          _verbatim_declarations_lineno;
Packit b27855
  /* The C code from the end of the file.  */
Packit b27855
  const char *          _verbatim_code;
Packit b27855
  const char *          _verbatim_code_end;
Packit b27855
  unsigned int          _verbatim_code_lineno;
Packit b27855
  /* Declaration of struct type for a keyword and its attributes.  */
Packit b27855
  const char *          _struct_decl;
Packit b27855
  unsigned int          _struct_decl_lineno;
Packit b27855
  /* Return type of the lookup function.  */
Packit b27855
  const char *          _return_type;
Packit b27855
  /* Shorthand for user-defined struct tag type.  */
Packit b27855
  const char *          _struct_tag;
Packit b27855
  /* List of all keywords.  */
Packit b27855
  Keyword_List *        _head;
Packit b27855
  /* Whether the keyword chars would have different values in a different
Packit b27855
     character set.  */
Packit b27855
  bool                  _charset_dependent;
Packit b27855
};
Packit b27855
Packit b27855
#endif