1 /* $XConsortium: Param.h /main/1 1996/07/29 17:00:19 cde-hp $ */
2 // Copyright (c) 1994 James Clark
3 // See the file COPYING for copying permission.
6 #define Param_INCLUDED 1
12 #include "ContentToken.h"
15 #include "MessageArg.h"
17 #include "NameToken.h"
24 // This describes a markup declaration parameter.
27 namespace SP_NAMESPACE {
35 typedef unsigned char Type;
49 attributeValueLiteral,
50 tokenizedAttributeValueLiteral,
57 reservedName, // Syntax::ReservedName is added to this
58 // this is a reserved name preceded by the RNI delimiter
59 indicatedReservedName = reservedName + Syntax::nNames
61 enum { nTypes = indicatedReservedName + Syntax::nNames };
63 Location startLocation;
66 Owner<ModelGroup> modelGroupPtr;
67 Vector<NameToken> nameTokenVector;
68 StringC token; // name nameToken; with substitution
69 Vector<const ElementType *> elementVector;
71 Param(const Param &); // undefined
72 void operator=(const Param &); // undefined
77 AllowedParams(Param::Type,
78 Param::Type = Param::invalid,
79 Param::Type = Param::invalid,
80 Param::Type = Param::invalid,
81 Param::Type = Param::invalid,
82 Param::Type = Param::invalid,
83 Param::Type = Param::invalid,
84 Param::Type = Param::invalid,
85 Param::Type = Param::invalid,
86 Param::Type = Param::invalid);
87 AllowedParams(const Param::Type *types, int nTypes);
88 Mode mainMode() const;
92 Boolean inclusions() const;
93 Boolean exclusions() const;
94 Boolean reservedName(Syntax::ReservedName) const;
95 Param::Type group() const;
96 Param::Type nameStart() const;
97 Param::Type digit() const;
98 Param::Type nmchar() const;
99 Param::Type literal() const;
102 void allow(Param::Type);
106 PackedBoolean inclusions_;
107 PackedBoolean exclusions_;
108 // invalid, minus, pero
109 Param::Type extraDelimiter_;
110 // invalid, nameGroup, nameTokenGroup, modelGroup
112 // invalid, reservedName, name, entityName, paramEntityName, attributeValue
113 Param::Type nameStart_;
114 // invalid, number, attributeValue
116 // invalid, attributeValue
117 Param::Type nmchar_; // LCNMCHAR or UCNMCHAR
118 // invalid, minimumLiteral, systemIdentifier, paramLiteral,
119 // (tokenized)attributeValueLiteral
120 Param::Type literal_;
121 PackedBoolean reservedNames_[Syntax::nNames];
122 Mode mainMode_; // mdMode mdMinusMode mdPeroMode
125 class MessageBuilder;
127 class AllowedParamsMessageArg : public MessageArg {
129 AllowedParamsMessageArg(const AllowedParams &allow,
130 const ConstPtr<Syntax> &syntax);
131 MessageArg *copy() const;
132 void append(MessageBuilder &) const;
134 AllowedParams allow_;
135 ConstPtr<Syntax> syntax_;
139 Mode AllowedParams::mainMode() const
145 Boolean AllowedParams::mdc() const
151 Boolean AllowedParams::rni() const
157 Boolean AllowedParams::dso() const
163 Boolean AllowedParams::inclusions() const
169 Boolean AllowedParams::exclusions() const
175 Boolean AllowedParams::reservedName(Syntax::ReservedName i) const
177 return reservedNames_[i];
181 Param::Type AllowedParams::group() const
187 Param::Type AllowedParams::nameStart() const
193 Param::Type AllowedParams::digit() const
199 Param::Type AllowedParams::nmchar() const
205 Param::Type AllowedParams::literal() const
214 #endif /* not Param_INCLUDED */