2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
23 /* $XConsortium: Param.h /main/1 1996/07/29 17:00:19 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
27 #ifndef Param_INCLUDED
28 #define Param_INCLUDED 1
34 #include "ContentToken.h"
37 #include "MessageArg.h"
39 #include "NameToken.h"
46 // This describes a markup declaration parameter.
49 namespace SP_NAMESPACE {
57 typedef unsigned char Type;
71 attributeValueLiteral,
72 tokenizedAttributeValueLiteral,
79 reservedName, // Syntax::ReservedName is added to this
80 // this is a reserved name preceded by the RNI delimiter
81 indicatedReservedName = reservedName + Syntax::nNames
83 enum { nTypes = indicatedReservedName + Syntax::nNames };
85 Location startLocation;
88 Owner<ModelGroup> modelGroupPtr;
89 Vector<NameToken> nameTokenVector;
90 StringC token; // name nameToken; with substitution
91 Vector<const ElementType *> elementVector;
93 Param(const Param &); // undefined
94 void operator=(const Param &); // undefined
99 AllowedParams(Param::Type,
100 Param::Type = Param::invalid,
101 Param::Type = Param::invalid,
102 Param::Type = Param::invalid,
103 Param::Type = Param::invalid,
104 Param::Type = Param::invalid,
105 Param::Type = Param::invalid,
106 Param::Type = Param::invalid,
107 Param::Type = Param::invalid,
108 Param::Type = Param::invalid);
109 AllowedParams(const Param::Type *types, int nTypes);
110 Mode mainMode() const;
114 Boolean inclusions() const;
115 Boolean exclusions() const;
116 Boolean reservedName(Syntax::ReservedName) const;
117 Param::Type group() const;
118 Param::Type nameStart() const;
119 Param::Type digit() const;
120 Param::Type nmchar() const;
121 Param::Type literal() const;
124 void allow(Param::Type);
128 PackedBoolean inclusions_;
129 PackedBoolean exclusions_;
130 // invalid, minus, pero
131 Param::Type extraDelimiter_;
132 // invalid, nameGroup, nameTokenGroup, modelGroup
134 // invalid, reservedName, name, entityName, paramEntityName, attributeValue
135 Param::Type nameStart_;
136 // invalid, number, attributeValue
138 // invalid, attributeValue
139 Param::Type nmchar_; // LCNMCHAR or UCNMCHAR
140 // invalid, minimumLiteral, systemIdentifier, paramLiteral,
141 // (tokenized)attributeValueLiteral
142 Param::Type literal_;
143 PackedBoolean reservedNames_[Syntax::nNames];
144 Mode mainMode_; // mdMode mdMinusMode mdPeroMode
147 class MessageBuilder;
149 class AllowedParamsMessageArg : public MessageArg {
151 AllowedParamsMessageArg(const AllowedParams &allow,
152 const ConstPtr<Syntax> &syntax);
153 MessageArg *copy() const;
154 void append(MessageBuilder &) const;
156 AllowedParams allow_;
157 ConstPtr<Syntax> syntax_;
161 Mode AllowedParams::mainMode() const
167 Boolean AllowedParams::mdc() const
173 Boolean AllowedParams::rni() const
179 Boolean AllowedParams::dso() const
185 Boolean AllowedParams::inclusions() const
191 Boolean AllowedParams::exclusions() const
197 Boolean AllowedParams::reservedName(Syntax::ReservedName i) const
199 return reservedNames_[i];
203 Param::Type AllowedParams::group() const
209 Param::Type AllowedParams::nameStart() const
215 Param::Type AllowedParams::digit() const
221 Param::Type AllowedParams::nmchar() const
227 Param::Type AllowedParams::literal() const
236 #endif /* not Param_INCLUDED */