skipEof =
false;
102 ParseError(
"Unexpected end-of-file",
"keyword");
146 stringstr1, str2, data2;
161 ParseError(
"Unexpected data",
"attribute (name=\"value\")");
176string::size_type
first= 0,
last= data2.length()-1;
177 if(data2.length() < 2 ||
178(data2[
first] !=
'\"'&& data2[
first] !=
'\'') ||
179(data2[
last] !=
'\"'&& data2[
last] !=
'\'') ) {
180 ParseError(
"Unexpected data",
"attribute (name=\"value\")");
231 if(ns ==
"http://www.w3.org/2001/XMLSchema") {
233}
else if(ns ==
"http://schemas.xmlsoap.org/wsdl/") {
235}
else if(ns ==
"http://schemas.xmlsoap.org/wsdl/soap/") {
258 IsValue(
"normalizedString") ||
268}
else if(
IsValue(
"boolean")) {
272||
IsValue(
"negativeInteger") ||
IsValue(
"nonNegativeInteger")
273||
IsValue(
"positiveInteger") ||
IsValue(
"nonPositiveInteger")
275||
IsValue(
"unsignedByte") ) {
279}
else if(
IsValue(
"hexBinary")) {
281}
else if(
IsValue(
"base64Binary")) {
299}
else if(
IsValue(
"ID")) {
301}
else if(
IsValue(
"IDREF")) {
303}
else if(
IsValue(
"IDREFS")) {
305}
else if(
IsValue(
"NMTOKEN")) {
307}
else if(
IsValue(
"NMTOKENS")) {
309}
else if(
IsValue(
"ENTITY")) {
311}
else if(
IsValue(
"ENTITIES")) {
314}
else if(
IsValue(
"boolean")) {
318||
IsValue(
"negativeInteger") ||
IsValue(
"nonNegativeInteger")
319||
IsValue(
"positiveInteger") ||
IsValue(
"nonPositiveInteger")
321||
IsValue(
"unsignedByte") ) {
327}
else if(
IsValue(
"base64Binary")) {
357}
else if(
IsAttribute(
"elementFormDefault")) {
359}
else if(
IsAttribute(
"attributeFormDefault")) {
387 if(node.
GetName().empty()) {
401 if(
IsValue(
"http://www.w3.org/XML/1998/namespace") ||
403 stringname =
"xml:lang";
416 if(node.
GetName().empty()) {
455 while(
l.ProcessDocumentation())
505 for( tok =
l.Skip(); ; tok =
l.Skip()) {
551 if(m == -1 || m > 1) {
570 stringname,
value, name_space;
571 boolref=
false, named_type=
false;
579 ParseError(
"ref attribute not allowed for root elements",
"");
618qualified =
IsValue(
"qualified");
626 if(owner && !name.empty()) {
635 boolhasContents =
false;
640 if(!ref && !named_type) {
704 boolhasContents=
false;
773 if(emb != 0 && extended) {
936 boolextended=
false;
957 boolextended=
false;
1025 ParseError(
"enum restriction not supported",
"string or integer type");
1046 boolref=
false, named_type=
false;
1068 if(
IsValue(
"required")) {
1070}
else if(
IsValue(
"optional")) {
1072}
else if(
IsValue(
"prohibited")) {
1080qualified =
IsValue(
"qualified");
1086 if(!ref && !named_type) {
1103 a.SetTypeName(
id);
1150<<
"Unsupported element type: union; in node " 1165<<
"Unsupported element type: list; in node " 1291 boolhasint =
false;
1318<<
"Unsupported attribute type: union; in attribute " 1332<<
"Unsupported attribute type: list; in attribute " 1344 stringemb_name(name);
1345emb_name +=
"__emb#__";
1360 id=
string(
"type:") + name;
1363 id=
string(
"group:") + name;
1366 id=
string(
"attgroup:") + name;
1369 id=
string(
"interface:") + name;
1372 id=
string(
"binding:") + name;
1380 string msg(
"Namespace prefix not defined: ");
1393 stringid, name,
data;
1425 booldoctag_open =
false;
1427 if(tok ==
T_EOF) {
1433 if(!comm.
Empty()) {
1440 if(!closing.empty()) {
1441 if(!comments.
Empty()) {
1449doctag_open =
false;
1459 if(
m_Raw==
"/>") {
1465doctag_open =
true;
1484 if(!comments.
Empty()) {
1514 if(j->second.GetName() == node.
GetName() &&
1515j->second.GetTypeName() == node.
GetTypeName() &&
1536 if(item.
GetName().empty() ||
1580 if(!k->second.IsEmbedded() && k->second.IsNamed() &&
1581k->second.GetName() == node.
GetName() &&
1582k->second.GetTypeName() != node.
GetTypeName()) {
1607 if(item.
GetName().empty()) {
1608 ParseError(
"Anonymous group",
"group name");
1631 else if(processed.
find(
i->second.GetName() +
i->second.GetNamespaceName())
1632== processed.
end()) {
1638processed.
insert(
i->second.GetName() +
i->second.GetNamespaceName());
1653list<DTDAttribute>::iterator
a;
1654 for(
a= atts.begin();
a!= atts.end(); ++
a) {
1656 if(!
a->GetTypeName().empty()) {
1685list<DTDAttribute>::iterator
a;
1686 for(
a= atts.begin();
a!= atts.end(); ++
a) {
1688 a->GetTypeName().empty() &&
1701 i->second.MergeAttributes();
1757 #if defined(NCBI_DTDPARSER_TRACE) 1758 voidXSDParser::PrintDocumentTree(
void)
1760cout <<
" === Namespaces ==="<< endl;
1763cout <<
i->first <<
": "<<
i->second << endl;
1766cout <<
" === Target namespace ==="<< endl;
1769cout <<
" === Element form default ==="<< endl;
1771cout <<
" === Attribute form default ==="<< endl;
1775DTDParser::PrintDocumentTree();
1778cout <<
" === Standalone Attribute definitions ==="<< endl;
1781PrintAttribute(
a->second,
false);
void FlushCommentsTo(CComments &comments)
int CurrentLine(void) const
const AbstractToken & NextToken(void) const
AbstractLexer & Lexer(void)
virtual void ParseError(const char *error, const char *expected, const AbstractToken &token)
void CopyComments(CComments &comments)
string GetText(void) const
CComments & Comments(void)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
EType GetType(void) const
void AddEnumValue(const string &value, int line, int id=0)
void SetName(const string &name)
void SetQualified(bool qualified)
void SetValueType(EValueType valueType)
void SetTypeIfUnknown(EType type)
void SetValue(const string &value)
void SetTypeName(const string &name)
const string & GetName(void) const
void SetSourceLine(int line)
CComments & Comments(void)
void SetName(const string &name)
const string & GetTypeName(void) const
void AddContent(const string &ref_name)
void SetTypeIfUnknown(EType type)
void SetTypeName(const string &name)
void AddFacet(const CMemberFacet &c)
bool IsEmbedded(void) const
void ResetType(EType type)
const list< CMemberFacet > & GetRestrictions(void) const
void SetSourceLine(int line)
void SetOccurrence(const string &ref_name, EOccurrence occ)
void SetGlobalType(bool def)
list< DTDAttribute > & GetNonconstAttributes(void)
EOccurrence GetOccurrence(const string &ref_name) const
CComments & AttribComments(void)
bool IsQualified(void) const
void SetQualified(bool qualified)
CComments & Comments(void)
void SetNamed(bool named=true)
bool HasAttributes(void) const
const string & GetName(void) const
const string & GetNamespaceName(void) const
void SetGlobalGroup(bool def)
const list< string > & GetContent(void) const
void AddAttribute(DTDAttribute &attrib)
void SetEmbedded(bool set=true)
void SetNamespaceName(const string &name)
EType GetType(void) const
const string & GetData(void) const
void GetParseAttributes(string &namespaceName, bool &elementForm, bool &attributeForm, map< string, string > &prefixToNamespace) const
const string & GetName(void) const
EType GetType(void) const
void SetData(const string &data)
void SetName(const string &name)
virtual void EndCommentBlock(void) override
map< string, DTDEntity > m_MapEntity
void FixEmbeddedNames(DTDElement &node)
map< string, DTDElement > m_MapElement
virtual bool PopEntityLexer(void)
list< string > m_StackLexerName
stack< AbstractLexer * > m_StackLexer
virtual string GetLocation(void) override
void SetCommentsIfEmpty(CComments *comments)
virtual DTDEntity * PushEntityLexer(const string &name)
static const string & s_SpecialName
TToken GetNextToken(void)
void AddElementContent(DTDElement &node, string &id_name, char separator=0)
string ParseAttributeContent(void)
bool DefineAttributeType(DTDAttribute &att)
void ProcessNamedTypes(void)
stack< bool > m_StackAttributeFormDefault
stack< string > m_StackTargetNamespace
map< string, pair< string, string > > m_RawAttributes
virtual void BuildDocumentTree(CDataTypeModule &module) override
EElementNamespace GetElementNamespace(const string &prefix)
void ParseGroupRef(DTDElement &node)
void ParseSimpleType(DTDElement &node)
virtual bool PopEntityLexer(void) override
void ParseComplexType(DTDElement &node)
bool m_ElementFormDefault
map< string, string > m_PrefixToNamespace
void ParseUnion(DTDElement &node)
DTDElement::EOccurrence ParseMinOccurs(DTDElement &node, DTDElement::EOccurrence occNow)
TToken GetNextToken(void)
string ParseElementContent(DTDElement *owner, int emb)
string CreateTmpEmbeddedName(const string &name, int emb)
bool GetAttribute(const string &att)
bool DefineElementType(DTDElement &node)
void ParseAnnotation(void)
stack< bool > m_StackElementFormDefault
DTDElement::EOccurrence ParseMaxOccurs(DTDElement &node, DTDElement::EOccurrence occNow)
stack< map< string, string > > m_StackPrefixToNamespace
void ParseDocumentation(void)
void ParseAttribute(DTDElement &node)
void ParseSimpleContent(DTDElement &node)
XSDParser(XSDLexer &lexer)
virtual DTDEntity * PushEntityLexer(const string &name) override
stack< map< string, string > > m_StackNamespaceToPrefix
void ParseExtension(DTDElement &node)
void ParseAttributeGroup(DTDElement &node)
void ParseTypeDefinition(DTDEntity &ent)
bool IsAttribute(const char *att) const
void CreateTypeDefinition(DTDEntity::EType type)
map< string, string > m_NamespaceToPrefix
bool m_EnableNamespaceRedefinition
void ParseAny(DTDElement &node)
string ParseGroup(DTDElement *owner, int emb)
string CreateEntityId(const string &name, DTDEntity::EType type, const string *prefix=NULL)
void BeginScope(DTDEntity *ent)
void ParseList(DTDElement &node)
void ParseAttributeGroupRef(DTDElement &node)
virtual AbstractLexer * CreateEntityLexer(CNcbiIstream &in, const string &name, bool autoDelete=true) override
map< string, DTDAttribute > m_MapAttribute
virtual void BeginDocumentTree(void) override
TToken GetRawAttributeSet(void)
bool IsValue(const char *value) const
bool m_AttributeFormDefault
set< string > m_EmbeddedNames
void ParseFacet(DTDElement &node, TToken tok)
void ParseContainer(DTDElement &node)
void ParseRestriction(DTDElement &node)
void ParseEnumeration(DTDElement &node)
bool ParseContent(DTDElement &node, bool extended=false)
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
void Warning(CExceptionArgs_Base &args)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static int strcmp(const char *s1, const char *s2)
String compare.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in serial libraries (xser.lib, xcser.lib).
constexpr bool empty(list< Ts... >) noexcept
const GenericPointer< typename T::ValueType > T2 value
std::istream & in(std::istream &in_, double &x_)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4