Link with C++ linker
[oweals/cde.git] / cde / programs / nsgmls / ModeInfo.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: ModeInfo.h /main/1 1996/07/29 16:58:04 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
26
27 #ifndef ModeInfo_INCLUDED
28 #define ModeInfo_INCLUDED 1
29 #ifdef __GNUG__
30 #pragma interface
31 #endif
32
33 #include <stdlib.h>
34 #include "Boolean.h"
35 #include "Syntax.h"
36 #include "Mode.h"
37 #include "Priority.h"
38
39 #ifdef SP_NAMESPACE
40 namespace SP_NAMESPACE {
41 #endif
42
43 struct TokenInfo {
44   enum Type {
45     delimType,
46     setType,
47     functionType,
48     delimDelimType,
49     delimSetType
50     };
51   Type type;
52   Priority::Type priority;
53   Token token;
54   Syntax::DelimGeneral delim1;
55   union {
56     Syntax::DelimGeneral delim2;
57     Syntax::Set set;
58     Syntax::StandardFunction function;
59   };
60 };
61
62 class Sd;
63 struct PackedTokenInfo;
64
65 class ModeInfo {
66 public:
67   ModeInfo(Mode mode, const Sd &sd);
68   Boolean nextToken(TokenInfo *);
69   Boolean includesShortref() const;
70 private:
71   Mode mode_;
72   const PackedTokenInfo *p_;            // points to next
73   size_t count_;
74   unsigned missingRequirements_;
75 };
76
77 inline Boolean ModeInfo::includesShortref() const
78 {
79   return mode_ >= minShortrefMode;
80 }
81
82 #ifdef SP_NAMESPACE
83 }
84 #endif
85
86 #endif /* not ModeInfo_INCLUDED */