home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / groff-1.09-src.lha / src / amiga / groff-1.09 / troff / request.h < prev    next >
C/C++ Source or Header  |  1992-08-03  |  2KB  |  81 lines

  1. // -*- C++ -*-
  2. /* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
  3.      Written by James Clark (jjc@jclark.com)
  4.  
  5. This file is part of groff.
  6.  
  7. groff is free software; you can redistribute it and/or modify it under
  8. the terms of the GNU General Public License as published by the Free
  9. Software Foundation; either version 2, or (at your option) any later
  10. version.
  11.  
  12. groff is distributed in the hope that it will be useful, but WITHOUT ANY
  13. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License along
  18. with groff; see the file COPYING.  If not, write to the Free Software
  19. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  20.  
  21. typedef void (*REQUEST_FUNCP)();
  22.  
  23. class macro;
  24.  
  25. class request_or_macro : public object {
  26. public:
  27.   request_or_macro();
  28.   virtual void invoke(symbol s) = 0;
  29.   virtual macro *to_macro();
  30. };
  31.  
  32. class request : public request_or_macro {
  33.   REQUEST_FUNCP p;
  34. public:
  35.   void invoke(symbol);
  36.   request(REQUEST_FUNCP);
  37. };
  38.  
  39. void delete_request_or_macro(request_or_macro *);
  40.  
  41. extern object_dictionary request_dictionary;
  42.  
  43. struct macro_header;
  44. struct node;
  45.  
  46. class macro : public request_or_macro {
  47.   macro_header *p;
  48.   const char *filename;        // where was it defined?
  49.   int lineno;
  50.   int length;
  51. public:
  52.   macro();
  53.   ~macro();
  54.   macro(const macro &);
  55.   macro &operator=(const macro &);
  56.   void append(unsigned char);
  57.   void append(node *);
  58.   void invoke(symbol);
  59.   macro *to_macro();
  60.   void print_size();
  61.   int empty();
  62.   friend class string_iterator;
  63.   friend void chop_macro();
  64.   friend int operator==(const macro &, const macro &);
  65. };
  66.  
  67. extern void init_input_requests();
  68. extern void init_div_requests();
  69. extern void init_node_requests();
  70. extern void init_reg_requests();
  71. extern void init_env_requests();
  72. extern void init_hyphen_requests();
  73. extern void init_request(const char *s, REQUEST_FUNCP f);
  74.  
  75. extern int no_break_flag;    // indicates whether request was invoked with . or '
  76.  
  77. class charinfo;
  78. class environment;
  79.  
  80. node *charinfo_to_node_list(charinfo *, const environment *);
  81.