(
Lexer().HaveComments()) {
113module->SetSourceLine(
Lexer().CurrentLine());
124 catch(exception& e) {
129 #if defined(NCBI_DTDPARSER_TRACE) 140modules->AddModule(module);
149 boolconditional_ignore =
false;
150 intconditional_level = 0;
172conditional_ignore =
true;
178 if(conditional_level == 0) {
179 ParseError(
"Incorrect format: unexpected end of conditional section",
189 if(conditional_ignore) {
192conditional_ignore =
false;
224 catch(exception& e) {
234list<string>::const_iterator
i;
262 if(
Lexer().TokenStarted()) {
329 ParseError(
"incorrect format",
"element category");
368 for(skip =
false; ;) {
376 ParseError(
"Unrecognized token",
"token");
379 ParseError(
"Unexpected end of file",
"token");
383 if(id_name.empty()) {
384 ParseError(
"Incorrect format",
"identifier");
397 switch(symbol =
NextToken().GetSymbol()) {
401id_name +=
"__emb#__";
417 if(id_name.empty()) {
418 ParseError(
"Incorrect format",
"identifier");
426 ParseError(
"Unrecognized symbol",
"symbol");
443 ParseError(
"Unexpected element contents",
"");
445 constlist<string>& content = node.
GetContent();
447 if(find(content.begin(), content.end(), id_name) != content.end()) {
452list<string>::const_iterator
i;
454 for(
i= content.begin();
i!= content.end(); ++
i) {
456 if(!elem.
GetName().empty() &&
470 if(occ_candidate != occ_elem) {
475 if(occ_candidate != occ_elem) {
491 if(separator ==
','|| separator ==
'|') {
492node.
SetType(separator ==
','?
500 if(separator ==
','|| separator ==
'|') {
501node.
SetType(separator ==
','?
522 switch(symbol =
NextToken().GetSymbol()) {
548new_var =
"AnyContent";
550 string tmp, refname;
551list<string>::const_iterator
i;
553 constlist<string>& refs = node.
GetContent();
555 for(
i= refs.begin();
i!= refs.end(); ++
i) {
558refname =
r->second.GetName();
560 if(refname.empty()) {
563 if(!refname.empty()) {
564string::size_type name = refname.find(
':');
565name = (name != string::npos && (name+1) < refname.size()) ? (name+1) : 0;
566new_var += (char)
toupper((
unsigned char) refname[name]);
568 if(new_var.size() > 8) {
586 constlist<string>& refs = node.
GetContent();
588 for(list<string>::const_iterator
i= refs.begin();
i!= refs.end(); ++
i) {
595find(refs.begin(),refs.end(),testName) == refs.end() &&
596find(fixed.begin(),fixed.end(),testName) == fixed.end();
598 constlist<string>& refrefs = refNode.
GetContent();
599list<string>::const_iterator
r= refrefs.begin();
600 for(; allowed &&
r!= refrefs.end(); ++
r) {
602allowed =
t!= testName;
606fixed.push_back(testName);
688 string msg(
"Undefined entity: ");
698 if(!
file.Exists()) {
699 ParseError(
"file not found", fullname.c_str());
703 ParseError(
"cannot access file",fullname.c_str());
707lexer_name = fullname;
775 const string& id_name)
900 i->second.GetName().empty() &&
913 i->second.HasAttributes());
915 if(generate && !
i->second.IsEmbedded())
917 if(name_space !=
"*"&&
918 i->second.GetNamespaceName() != name_space) {
921 stringqname =
i->second.GetName() +
i->second.GetNamespaceName();
941 boolfromInside,
boolignoreAttrib)
954 boolfromInside,
boolignoreAttrib)
960 constlist<string>& refs = node.
GetContent();
961 if(refs.size() == 1) {
962 stringrefName = refs.front();
991 boolref = fromInside && !node.
IsEmbedded();
992 boolref_to_parent =
false;
997ref_to_parent = ref =
1003keep_global = (cont && uniseq && (attrib ||
1007keep_global = keep_global || ref;
1059base =
b->second.GetName();
1062base =
b->second.GetTypeName();
1068 type->SetIsAlias(
true);
1069 type->SetIsTypeAlias(
true);
1124 ParseError(
"Unknown WSDL element type",
"element");
1130 ParseError(
"Unknown element",
"element");
1141 type->SetNillable();
1151 stringrefname(node.
GetName());
1152refname.insert(0,
"E");
1155container->SetSourceLine(
type->GetSourceLine());
1156member->SetOptional();
1158member->SetNoPrefix();
1159container->AddMember(member);
1165 if(!embtype.empty()) {
1180 string(
"Element: ") + node.
GetName() +
1184 ": failed to define default value");
1230 tmp.SetNillable(
false);
1232 if(!ignoreAttrib) {
1237 type->SetNillable();
1239member->SetNillable();
1240member->SetNoPrefix();
1241container->AddMember(member);
1251 if(!ignoreAttrib) {
1254 constlist<string>& refs = node.
GetContent();
1255 for(list<string>::const_iterator
i= refs.begin();
i!= refs.end(); ++
i) {
1259smember->SetNotag();
1260smember->SetNoPrefix();
1261container->AddMember(smember);
1265 if(refNode.
GetName().empty()) {
1278 boolstdtype =
type->IsStdType();
1281 booloptional =
false, uniseq =
false, uniseq2 =
false, refseq =
false;
1290 if(uniseq || (optional && refseq)) {
1292 stringrefname(refNode.
GetName());
1293 if(uniseq2 || (optional && refseq)) {
1294refname.insert(0,
"E");
1298type_container->SetSourceLine(
type->GetSourceLine());
1300member->SetOptional();
1303member->SetNoPrefix();
1304type_container->AddMember(member);
1307 else if(uniseq2 && setnil) {
1318 type.reset(uniType);
1325member->SetOptional();
1331member->SetDefault(
Value(refNode));
1334member->SetNillable();
1336member->SetNoPrefix();
1343container->AddMember(member);
1362 intline =
type->GetSourceLine();
1364 type->SetSourceLine( line );
1370member->SetOptional();
1374member->SetDefault(
Value(node));
1378member->SetNillable();
1380member->SetNoPrefix();
1382member->SetSimpleType();
1384container->AddMember(member);
1397member->SetNoPrefix();
1398member->SetAttlist();
1400container->AddMember(member);
1408 boolhas_nsq =
false;
1409 for(list<DTDAttribute>::const_iterator
i= att.begin();
1410 i!= att.end(); ++
i) {
1413 stringdefValue(
i->GetValue());
1414 if(!defValue.empty()) {
1418member->SetOptional();
1420member->SetNoPrefix();
1421member->Comments() =
i->GetComments();
1425container->AddMember(member);
1429container->SetNsQualified(
true);
1441 ParseError(
"Unknown attribute",
"attribute");
1444 ParseError(
"Unknown attribute",
"attribute");
1487 const string& defvalue)
1492 ParseError(
"Unknown attribute",
"attribute");
1495 ParseError(
"Unknown attribute",
"attribute");
1537list<string>::const_iterator
i;
1538 for(
i= attEnums.begin();
i!= attEnums.end(); ++
i, ++v) {
1552 constlist<string>& enums = node.
GetContent();
1553list<string>::const_iterator
i;
1554 for(
i= enums.begin();
i!= enums.end(); ++
i, ++v) {
1565 if(comments->
Empty()) {
1575 #if defined(NCBI_DTDPARSER_TRACE) 1576 voidDTDParser::PrintDocumentTree(
void)
1580cout <<
" === Elements ==="<< endl;
1590PrintDocumentNode(
i->first,
i->second);
1593 boolstarted =
false;
1598cout <<
" === Embedded elements ==="<< endl;
1601PrintDocumentNode(
i->first,
i->second);
1613cout <<
" === REFERENCED simpletype elements ==="<< endl;
1616PrintDocumentNode(
i->first,
i->second);
1629cout <<
" === UNREFERENCED simpletype elements ==="<< endl;
1632PrintDocumentNode(
i->first,
i->second);
1638 voidDTDParser::PrintEntities(
void)
1641cout <<
" === Entities ==="<< endl;
1644cout <<
i->first <<
" = \""<<
i->second.GetData() <<
"\""<< endl << endl;
1649 voidDTDParser::PrintDocumentNode(
const string& name,
const DTDElement& node)
1651cout << name <<
": ";
1693cout <<
", default=";
1694cout <<
"\""<< node.
GetDefault() <<
"\"";
1699cout <<
"form: "<< (node.
IsQualified() ?
"qualified":
"unqualified") << endl;
1703cout <<
" === Comments ==="<< endl;
1707cout <<
" === AttribComments ==="<< endl;
1711PrintNodeAttributes(node);
1713 constlist<string>& refs = node.
GetContent();
1714 if(!refs.empty()) {
1715cout <<
" === Contents ==="<< endl;
1716 for(list<string>::const_iterator ir= refs.begin();
1717ir != refs.end(); ++ir) {
1736 voidDTDParser::PrintNodeAttributes(
const DTDElement& node)
1739cout <<
" === Attributes ==="<< endl;
1740 for(list<DTDAttribute>::const_iterator
i= att.begin();
1741 i!= att.end(); ++
i) {
1742PrintAttribute( *
i);
1774 if(!enumV.empty()) {
1776 for(list<string>::const_iterator ie= enumV.begin();
1777ie != enumV.end(); ++ie) {
1778 if(ie != enumV.begin()) {
1794cout <<
"\""<< attrib.
GetValue() <<
"\"";
1797cout <<
"form:"<< (attrib.
IsQualified() ?
"qualified":
"unqualified") << endl;
1803cout <<
" === Comments ==="<< endl;
void SetParser(AbstractParser *parser)
void FlushCommentsTo(CComments &comments)
const AbstractToken & NextToken(void) const
void ConsumeSymbol(char symbol)
AbstractLexer & Lexer(void)
void SetLexer(AbstractLexer *lexer)
virtual void ParseError(const char *error, const char *expected, const AbstractToken &token)
void CopyComments(CComments &comments)
virtual string GetLocation(void)
string GetText(void) const
void AddDefinition(const string &name, const AutoPtr< CDataType > &type)
void SetSourceLine(int line)
void SetSourceLine(int line)
TValue & AddValue(const string &name, TEnumValueType value)
virtual bool IsInteger(void) const
void SetNoPrefix(bool noprefix)
void SetNonEmpty(bool nonEmpty)
void SetWsdlType(EType type)
int GetEnumValueId(const string &value) const
const string & GetNamespaceName(void) const
const string & GetValue(void) const
EType GetType(void) const
const CComments & GetComments(void) const
void AddEnumValue(const string &value, int line, int id=0)
bool IsQualified(void) const
void SetValueType(EValueType valueType)
int GetEnumValueSourceLine(const string &value) const
const list< string > & GetEnumValues(void) const
void SetValue(const string &value)
const string & GetName(void) const
int GetSourceLine(void) const
void SetSourceLine(int line)
CComments & Comments(void)
EValueType GetValueType(void) const
void SetName(const string &name)
const string & GetTypeName(void) const
void AddContent(const string &ref_name)
bool IsGlobalGroup(void) const
void SetTypeIfUnknown(EType type)
bool IsEmbedded(void) const
const CComments & GetAttribComments(void) const
const list< CMemberFacet > & GetRestrictions(void) const
void SetSourceLine(int line)
void SetOccurrence(const string &ref_name, EOccurrence occ)
list< DTDAttribute > & GetNonconstAttributes(void)
const string & GetDefault(void) const
@ eWsdlUnsupportedEndpoint
bool IsNillable(void) const
bool IsGlobalType(void) const
EOccurrence GetOccurrence(const string &ref_name) const
CComments & AttribComments(void)
bool IsQualified(void) const
CComments & Comments(void)
void SetNamed(bool named=true)
bool HasAttributes(void) const
const CComments & GetComments(void) const
const list< DTDAttribute > & GetAttributes(void) const
const string & GetName(void) const
const string & GetNamespaceName(void) const
int GetSourceLine(void) const
const list< string > & GetContent(void) const
bool RemoveContent(const string &ref_name)
void AddAttribute(DTDAttribute &attrib)
bool IsReferenced(void) const
string CreateEmbeddedName(int depth) const
void SetEmbedded(bool set=true)
EType GetType(void) const
void SetData(const string &data)
void SetName(const string &name)
void ParseAttributesContent(DTDElement &node)
CDataValue * x_AttribValue(const DTDAttribute &att, const string &value)
CDataType * TypesBlock(CDataMemberContainerType *containerType, const DTDElement &node, bool ignoreAttrib=false)
void GenerateDataTree(CDataTypeModule &module, const string &name_space)
void ConsumeAttributeContent(DTDElement &node, const string &id_name)
AutoPtr< CDataValue > x_Value(const DTDElement &node)
CDataType * CompositeNode(const DTDElement &node, DTDElement::EOccurrence occ)
void BeginElementContent(void)
CDataType * NillableBlock(const DTDElement &node, bool ignoreAttrib=false)
void AddAttributes(AutoPtr< CDataMemberContainerType > &container, const DTDElement &node)
string CreateEmbeddedName(const DTDElement &node, int depth) const
virtual void EndCommentBlock(void) override
void BeginEntityContent(void)
map< string, DTDEntity > m_MapEntity
void BeginAttributesContent(void)
void FixEmbeddedNames(DTDElement &node)
CDataType * AttribBlock(const DTDElement &node)
AutoPtr< CFileModules > Modules(const string &fileName)
string GetNextTokenText(void)
AutoPtr< CDataValue > Value(const DTDElement &node)
virtual void BeginDocumentTree(void)
map< string, DTDElement > m_MapElement
CDataType * x_AttribType(const DTDAttribute &att)
void SkipConditionalSection(void)
void ParseEnumeratedList(DTDAttribute &attrib)
AutoPtr< CDataType > Type(const DTDElement &node, DTDElement::EOccurrence occ, bool fromInside, bool ignoreAttrib=false)
virtual bool PopEntityLexer(void)
list< string > m_StackLexerName
CDataType * x_Type(const DTDElement &node, DTDElement::EOccurrence occ, bool fromInside, bool ignoreAttrib=false)
virtual void BuildDataTree(AutoPtr< CFileModules > &modules, AutoPtr< CDataTypeModule > &module)
virtual void BuildDocumentTree(CDataTypeModule &module)
void EndElementContent(DTDElement &node)
virtual AbstractLexer * CreateEntityLexer(CNcbiIstream &in, const string &name, bool autoDelete=true)
stack< AbstractLexer * > m_StackLexer
void ModuleType(CDataTypeModule &module, const DTDElement &node)
virtual string GetLocation(void) override
CDataType * EnumeratedBlock(const DTDAttribute &att, CEnumDataType *enumType)
void SetCommentsIfEmpty(CComments *comments)
void Module(AutoPtr< CFileModules > &modules, const string &name)
void ParseEntityContent(const string &name)
virtual DTDEntity * PushEntityLexer(const string &name)
void ParseElementContent(const string &name, bool embedded)
DTDParser(DTDLexer &lexer)
stack< string > m_StackPath
static const string & s_SpecialName
void ConsumeElementContent(DTDElement &node)
TToken GetNextToken(void)
list< string > m_ElementEmbTypes
set< string > m_GeneratedTypes
void AddElementContent(DTDElement &node, string &id_name, char separator=0)
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 unsigned char depth[2 *(256+1+29)+1]
element_type * release(void)
Release will release ownership of pointer to caller.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define NCBI_RETHROW_SAME(prev_exception, message)
Generic macro to re-throw the same exception.
void Warning(CExceptionArgs_Base &args)
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
string GetDir(EIfEmptyPath mode=eIfEmptyPath_Current) const
Get the directory component for this directory entry.
string GetBase(void) const
Get the base entry name without extension.
static string MakePath(const string &dir=kEmptyStr, const string &base=kEmptyStr, const string &ext=kEmptyStr)
Assemble a path from basic components.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static bool StringToBool(const CTempString str)
Convert string to bool.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to Int8.
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
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 enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
@ fDecimalPosix
StringToDouble*(): For decimal point, use C locale.
Definition of all error codes used in serial libraries (xser.lib, xcser.lib).
const GenericPointer< typename T::ValueType > T2 value
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
std::istream & in(std::istream &in_, double &x_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
CDataValueTmpl< bool > CBoolDataValue
CDataValueTmpl< string > CStringDataValue
CDataValueTmpl< Int8 > CIntDataValue
CDataValueTmpl< double > CDoubleDataValue
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