NCBI C++ ToolKit
dtdparser.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: dtdparser.cpp 93025 2021-03-01 15:16:52Z grichenk $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: Andrei Gourianov
27 *
28 * File Description:
29 * DTD parser
30 *
31 * ===========================================================================
32 */
33 
34 #include <ncbi_pch.hpp>
35 #include "exceptions.hpp"
36 #include "dtdparser.hpp"
37 #include "tokens.hpp"
38 #include "module.hpp"
39 #include "moduleset.hpp"
40 #include "type.hpp"
41 #include "statictype.hpp"
42 #include "enumtype.hpp"
43 #include "reftype.hpp"
44 #include "unitype.hpp"
45 #include "blocktype.hpp"
46 #include "choicetype.hpp"
47 #include "value.hpp"
48 #include <serial/error_codes.hpp>
49 #include <algorithm>
50 #include <corelib/ncbifile.hpp>
51 
52 
53 #define NCBI_USE_ERRCODE_X Serial_Parsers
54 
56 
57 const string& DTDParser::s_SpecialName = "#PCDATA";
58 
59 /////////////////////////////////////////////////////////////////////////////
60 // DTDParser
61 
63  : AbstractParser(lexer)
64 {
65  m_StackLexer.push(&lexer);
66  m_SrcType = eDTD;
67  m_Comments = 0;
68  m_ExpectLastComment = false;
69  lexer.SetParser(this);
70 }
71 
73 {
74 }
75 
76 
78 {
79  AutoPtr<CFileModules> modules(new CFileModules(fileName));
80  Lexer().BeginFile();
81 
82  while( GetNextToken() != T_EOF ) {
83  CDirEntry entry(fileName);
84  m_StackPath.push(entry.GetDir());
85  m_StackLexerName.push_back(fileName);
86  Module( modules, NStr::Replace( entry.GetBase(), ".", "_"));
87  m_StackLexerName.pop_back();
88  m_StackPath.pop();
89  }
90  return modules;
91 }
92 
94 {
95  if (m_Comments) {
96  if (Lexer().HaveComments()) {
98  }
99  if (m_ExpectLastComment) {
100  m_Comments = 0;
101  m_ExpectLastComment = false;
102  }
103  } else if (m_ExpectLastComment) {
104  Lexer().FlushComments();
105  m_ExpectLastComment = false;
106  }
107 }
108 
110  AutoPtr<CFileModules>& modules, const string& name)
111 {
112  AutoPtr<CDataTypeModule> module(new CDataTypeModule(name));
113  module->SetSourceLine(Lexer().CurrentLine());
114 
115  try {
116  CopyComments(module->Comments());
118  BuildDocumentTree(*module);
119  EndCommentBlock();
120  }
121  catch (CException& e) {
122  NCBI_RETHROW_SAME(e, GetLocation() + " DTDParser::BuildDocumentTree: failed");
123  }
124  catch (exception& e) {
125  ERR_POST_X(5, GetLocation() << e.what());
126  throw;
127  }
128 
129 #if defined(NCBI_DTDPARSER_TRACE)
130  PrintDocumentTree();
131 #endif
132 
133  BuildDataTree( modules, module);
134 }
135 
138 {
139  GenerateDataTree(*module, "*");
140  modules->AddModule(module);
141 }
142 
144 {
145 }
146 
148 {
149  bool conditional_ignore = false;
150  int conditional_level = 0;
151  for (;;) {
152  switch ( GetNextToken() ) {
153  case K_ELEMENT:
154  ConsumeToken();
156  break;
157  case K_ATTLIST:
158  ConsumeToken();
160  break;
161  case K_ENTITY:
162  ConsumeToken();
164  break;
165  case T_EOF:
166  return;
167  case K_INCLUDE:
168  ConsumeToken();
169  break;
170  case K_IGNORE:
171  ConsumeToken();
172  conditional_ignore = true;
173  break;
174  case T_CONDITIONAL_BEGIN:
175  ++conditional_level;
176  break;
177  case T_CONDITIONAL_END:
178  if (conditional_level == 0) {
179  ParseError("Incorrect format: unexpected end of conditional section",
180  "keyword");
181  }
182  --conditional_level;
183  break;
184  case T_SYMBOL:
185  if(NextToken().GetSymbol() != '[') {
186  ParseError("Incorrect format","[");
187  }
188  ConsumeToken();
189  if (conditional_ignore) {
191  --conditional_level;
192  conditional_ignore = false;
193  }
194  break;
195  default:
196  ParseError("Invalid keyword", "keyword");
197  return;
198  }
199  }
200 }
201 
203 {
204  for (;;) {
205  try {
206  switch ( Next() ) {
207  case T_EOF:
208  return;
209  case T_CONDITIONAL_BEGIN:
211  break;
212  case T_CONDITIONAL_END:
213  return;
214  case T_IDENTIFIER_END:
215  break;
216  default:
217  Consume();
218  break;
219  }
220  }
221  catch (CException& e) {
222  NCBI_RETHROW_SAME(e, GetLocation() + "DTDParser::BuildDocumentTree: failed");
223  }
224  catch (exception& e) {
225  ERR_POST_X(6, GetLocation() << e.what());
226  throw;
227  }
228  }
229 }
230 
232 {
233  string loc;
234  list<string>::const_iterator i;
235  size_t len = m_StackLexerName.size();
236  if (len > 0) {
237  for (--len, i = m_StackLexerName.begin(); len > 0 && i != m_StackLexerName.end(); ++i) {
238  if (i != m_StackLexerName.begin()) {
239  loc += "/";
240  }
241  loc += *i;
242  }
243  }
244  return loc + AbstractParser::GetLocation();
245 }
246 
248 {
249  for (;;) {
250  TToken tok = Next();
251  switch (tok) {
252  case T_ENTITY:
253  PushEntityLexer(NextToken().GetText());
254  break;
255  case T_IDENTIFIER_END:
256  if (!m_IdentifierText.empty()) {
257  return T_IDENTIFIER;
258  }
259  break;
260  case T_EOF:
261  if (PopEntityLexer()) {
262  if (Lexer().TokenStarted()) {
263  Consume();
264  break;
265  }
266  return tok;
267  } else {
268  if (!m_IdentifierText.empty()) {
269  return T_IDENTIFIER;
270  }
271  return tok;
272  }
273  case T_IDENTIFIER:
275  Consume();
276  break;
277  default:
278  if (!m_IdentifierText.empty()) {
279  return T_IDENTIFIER;
280  }
281  return tok;
282  }
283  }
284 // we should never be here
285  return T_EOF;
286 }
287 
289 {
290  if (!m_IdentifierText.empty()) {
291  return m_IdentifierText;
292  }
293  GetNextToken();
294  if (!m_IdentifierText.empty()) {
295  return m_IdentifierText;
296  }
297  return NextToken().GetText();
298 }
299 
301 {
302  if (!m_IdentifierText.empty()) {
303  m_IdentifierText.erase();
304  return;
305  }
306  Consume();
307 }
308 
309 /////////////////////////////////////////////////////////////////////////////
310 // DTDParser - elements
311 
313 {
314  // element name
315  string name = GetNextTokenText();
316  ConsumeToken();
317  ParseElementContent(name, false);
318 }
319 
320 void DTDParser::ParseElementContent(const string& name, bool embedded)
321 {
322  DTDElement& node = m_MapElement[ name];
323  node.SetName(name);
324  node.SetSourceLine(Lexer().CurrentLine());
325  m_Comments = &(node.Comments());
326  switch (GetNextToken()) {
327  default:
328  case T_IDENTIFIER:
329  ParseError("incorrect format","element category");
330  break;
331  case K_ANY: // category
333  ConsumeToken();
334  break;
335  case K_EMPTY: // category
337  ConsumeToken();
338  break;
339  case T_SYMBOL: // contents. the symbol must be '('
340  ConsumeElementContent(node);
341  if (embedded) {
342  node.SetEmbedded();
343  node.SetNamed(false);
344  return;
345  }
346  break;
347  }
348  // element description is ended
349  GetNextToken();
350  ConsumeSymbol('>');
351  m_ExpectLastComment = true;
352 }
353 
355 {
356 // Element content:
357 // http://www.w3.org/TR/2000/REC-xml-20001006#sec-element-content
358 
359  string id_name;
360  char symbol;
361  int emb=0;
362  bool skip;
363 
364  if(NextToken().GetSymbol() != '(') {
365  ParseError("Incorrect format","(");
366  }
367 
368  for (skip = false; ;) {
369  if (skip) {
370  skip=false;
371  } else {
372  ConsumeToken();
373  }
374  switch (GetNextToken()) {
375  default:
376  ParseError("Unrecognized token","token");
377  break;
378  case T_EOF:
379  ParseError("Unexpected end of file","token");
380  break;
381  case T_IDENTIFIER:
382  id_name = GetNextTokenText();
383  if(id_name.empty()) {
384  ParseError("Incorrect format","identifier");
385  }
386  break;
387  case K_PCDATA:
388  id_name = s_SpecialName;
389  break;
390  case K_EMPTY:
392  ConsumeToken();
393  GetNextToken();
394  EndElementContent( node);
395  return;
396  case T_SYMBOL:
397  switch (symbol = NextToken().GetSymbol()) {
398  case '(':
399  // embedded content
400  id_name = node.GetName();
401  id_name += "__emb#__";
402  id_name += NStr::IntToString(emb++);
403  ParseElementContent(id_name, true);
404  skip = true;
405  break;
406  case ')':
407  AddElementContent(node, id_name, symbol);
408  EndElementContent( node);
409  return;
410  case ',':
411  case '|':
412  AddElementContent(node, id_name, symbol);
413  break;
414  case '+':
415  case '*':
416  case '?':
417  if(id_name.empty()) {
418  ParseError("Incorrect format","identifier");
419  }
420  node.SetOccurrence(id_name,
421  symbol == '+' ? DTDElement::eOneOrMore :
422  (symbol == '*' ? DTDElement::eZeroOrMore :
424  break;
425  default:
426  ParseError("Unrecognized symbol","symbol");
427  break;
428  }
429  break;
430  }
431  }
432 }
433 
434 void DTDParser::AddElementContent(DTDElement& node, string& id_name,
435  char separator /* =0 */)
436 {
437  DTDElement::EType type = node.GetType();
438  if (type != DTDElement::eUnknown &&
441  type != DTDElement::eSet &&
443  ParseError("Unexpected element contents", "");
444  }
445  const list<string>& content = node.GetContent();
446  if (id_name == s_SpecialName) {
447  if (find(content.begin(), content.end(), id_name) != content.end()) {
448  // already there
449  return;
450  }
451  } else {
452  list<string>::const_iterator i;
453  DTDElement& candidate = m_MapElement[ id_name ];
454  for (i = content.begin(); i != content.end(); ++i) {
455  DTDElement& elem = m_MapElement[ *i ];
456  if (!elem.GetName().empty() &&
457  candidate.GetName() == elem.GetName()) {
458 /*
459  if (candidate.GetType() != elem.GetType() ||
460  candidate.GetTypeName() != elem.GetTypeName()) {
461  ParseError("Unexpected element type", "");
462  }
463 */
464  DTDElement::EOccurrence occ_candidate = node.GetOccurrence(id_name);
465  DTDElement::EOccurrence occ_elem = node.GetOccurrence(*i);
466  if (occ_candidate == DTDElement::eZero) {
467  node.RemoveContent(*i);
468  return;
469  }
470  if (occ_candidate != occ_elem) {
471  node.SetOccurrence(*i, occ_candidate);
472  }
473  occ_candidate = candidate.GetOccurrence();
474  occ_elem = elem.GetOccurrence();
475  if (occ_candidate != occ_elem) {
476  elem.SetOccurrence( occ_candidate );
477  }
478  if (!candidate.GetComments().Empty()) {
479  elem.Comments() = candidate.GetComments();
480  }
481  return;
482  }
483  }
484  }
485 
486  if (id_name == s_SpecialName) {
487  if (type == DTDElement::eUnknown && separator == ')') {
489  } else {
490  node.AddContent(id_name);
491  if (separator == ',' || separator == '|') {
492  node.SetType(separator == ',' ?
494  }
495  }
496  id_name.erase();
497  return;
498  }
499  node.AddContent(id_name);
500  if (separator == ',' || separator == '|') {
501  node.SetType(separator == ',' ?
503  } else {
505  }
506  m_MapElement[ id_name].SetReferenced();
507  id_name.erase();
508 }
509 
511 {
512  if (NextToken().GetSymbol() != ')') {
513  ParseError("Incorrect format", ")");
514  }
515  ConsumeToken();
516 // occurrence
517  char symbol;
518  switch (GetNextToken()) {
519  default:
520  break;
521  case T_SYMBOL:
522  switch (symbol = NextToken().GetSymbol()) {
523  default:
524  break;
525  case '+':
526  case '*':
527  case '?':
528  node.SetOccurrence(
529  symbol == '+' ? DTDElement::eOneOrMore :
530  (symbol == '*' ? DTDElement::eZeroOrMore :
532  ConsumeToken();
533  break;
534  }
535  break;
536  }
537  FixEmbeddedNames(node);
538 }
539 
540 string DTDParser::CreateEmbeddedName(const DTDElement& node, int depth) const
541 {
542 #ifdef _DEBUG
543  string old_var = node.CreateEmbeddedName(depth);
544 #endif
545  string new_var;
546 
547  if (node.GetType() == DTDElement::eAny) {
548  new_var = "AnyContent";
549  } else {
550  string tmp, refname;
551  list<string>::const_iterator i;
553  const list<string>& refs = node.GetContent();
554 
555  for ( i = refs.begin(); i != refs.end(); ++i) {
556  r = m_MapElement.find(*i);
557  if (r != m_MapElement.end()) {
558  refname = r->second.GetName();
559  }
560  if (refname.empty()) {
561  refname = *i;
562  }
563  if (!refname.empty()) {
564  string::size_type name = refname.find(':');
565  name = (name != string::npos && (name+1) < refname.size()) ? (name+1) : 0;
566  new_var += (char)toupper((unsigned char) refname[name]);
567 // try to avoid very long names
568  if (new_var.size() > 8) {
569  break;
570  }
571  }
572  }
573  if (depth > 1) {
574  new_var += '_';
575  new_var += NStr::IntToString(depth);
576  }
577  }
578  return new_var;
579 }
580 
582 {
583  if (node.GetType() == DTDElement::eEnum || node.GetType() == DTDElement::eIntEnum) {
584  return;
585  }
586  const list<string>& refs = node.GetContent();
587  list<string> fixed;
588  for (list<string>::const_iterator i= refs.begin(); i != refs.end(); ++i) {
589  DTDElement& refNode = m_MapElement[*i];
590  if (refNode.IsEmbedded() && !refNode.IsNamed() && refNode.GetName() == *i) {
591  for ( int depth=1; depth<100; ++depth) {
592 
593  string testName = CreateEmbeddedName(refNode,depth);
594  bool allowed =
595  find(refs.begin(),refs.end(),testName) == refs.end() &&
596  find(fixed.begin(),fixed.end(),testName) == fixed.end();
597  if (allowed) {
598  const list<string>& refrefs = refNode.GetContent();
599  list<string>::const_iterator r= refrefs.begin();
600  for (; allowed && r != refrefs.end(); ++r) {
601  const string& t = m_MapElement[*r].GetName();
602  allowed = t != testName;
603  }
604  }
605  if (allowed) {
606  fixed.push_back(testName);
607  refNode.SetName(testName);
608  break;
609  }
610  }
611  }
612  }
613  }
614 
615 /////////////////////////////////////////////////////////////////////////////
616 // DTDParser - entities
617 
619 {
620 // Entity:
621 // http://www.w3.org/TR/2000/REC-xml-20001006#sec-entity-decl
622 
623  TToken tok = GetNextToken();
624  if (tok == T_IDENTIFIER) {
625 // skip
626  ConsumeToken();
627  tok = GetNextToken();
628  if (tok == K_CDATA) {
629  ConsumeToken();
630  tok = GetNextToken();
631  }
632  if (tok!=T_STRING) {
633  ParseError("string");
634  }
635  ConsumeToken();
636  GetNextToken();
637  ConsumeSymbol('>');
638  return;
639  }
640  if (tok != T_SYMBOL || NextToken().GetSymbol() != '%') {
641  ParseError("Incorrect format", "%");
642  }
643 
644  ConsumeToken();
645  tok = GetNextToken();
646  if (tok != T_IDENTIFIER) {
647  ParseError("identifier");
648  }
649  // entity name
650  string name = GetNextTokenText();
651  ConsumeToken();
652  ParseEntityContent(name);
653 }
654 
655 void DTDParser::ParseEntityContent(const string& name)
656 {
657  DTDEntity& node = m_MapEntity[name];
658  node.SetName(name);
659 
660  TToken tok = GetNextToken();
661  if ((tok==K_SYSTEM) || (tok==K_PUBLIC)) {
662  node.SetExternal();
663  ConsumeToken();
664  if (tok==K_PUBLIC) {
665  // skip public id
666  tok = GetNextToken();
667  if (tok!=T_STRING) {
668  ParseError("string");
669  }
670  ConsumeToken();
671  }
672  tok = GetNextToken();
673  }
674  if (tok!=T_STRING) {
675  ParseError("string");
676  }
677  node.SetData(GetNextTokenText());
678  ConsumeToken();
679  // entity description is ended
680  GetNextToken();
681  ConsumeSymbol('>');
682 }
683 
685 {
687  if (i == m_MapEntity.end()) {
688  string msg("Undefined entity: ");
689  msg += name;
690  ParseError(msg.c_str(),"entity definition");
691  }
692  CNcbiIstream* in;
693  string lexer_name;
694  if (m_MapEntity[name].IsExternal()) {
695  string filename(m_MapEntity[name].GetData());
696  string fullname = CDirEntry::MakePath(m_StackPath.top(), filename);
697  CFile file(fullname);
698  if (!file.Exists()) {
699  ParseError("file not found", fullname.c_str());
700  }
701  in = new CNcbiIfstream(fullname.c_str());
702  if (!((CNcbiIfstream*)in)->is_open()) {
703  ParseError("cannot access file",fullname.c_str());
704  }
705  m_StackPath.push(file.GetDir());
706  m_StackLexerName.push_back(fullname);
707  lexer_name = fullname;
708  } else {
709  in = new CNcbiIstrstream(m_MapEntity[name].GetData());
710  m_StackPath.push("");
711  m_StackLexerName.push_back(name);
712  lexer_name = name;
713  }
714  AbstractLexer *lexer = CreateEntityLexer(*in,lexer_name);
715  lexer->SetParser(this);
716  Lexer().FlushCommentsTo(*lexer);
717  m_StackLexer.push(lexer);
718  SetLexer(lexer);
719  if (m_MapEntity[name].IsExternal()) {
720  Lexer().BeginFile();
721  }
722  return &(m_MapEntity[name]);
723 }
724 
726 {
727  if (m_StackLexer.size() > 1) {
728  delete m_StackLexer.top();
729  m_StackLexer.pop();
730  SetLexer(m_StackLexer.top());
731  m_StackPath.pop();
732  m_StackLexerName.pop_back();
733  return true;
734  }
735  return false;
736 }
737 
739  CNcbiIstream& in, const string& name, bool /*autoDelete*/ /*=true*/)
740 {
741  return new DTDEntityLexer(in,name);
742 }
743 
744 /////////////////////////////////////////////////////////////////////////////
745 // DTDParser - attributes
746 
748 {
749 // Attributes
750 // http://www.w3.org/TR/2000/REC-xml-20001006#attdecls
751  // element name
752  string name = GetNextTokenText();
753  ConsumeToken();
755 }
756 
758 {
759  m_Comments = &(node.AttribComments());
760  m_ExpectLastComment = true;
761  string id_name;
762  while (GetNextToken()==T_IDENTIFIER) {
763  // attribute name
764  id_name = GetNextTokenText();
765  ConsumeToken();
766  ConsumeAttributeContent(node, id_name);
767  }
768  // attlist description is ended
769  GetNextToken();
770  ConsumeSymbol('>');
771  m_ExpectLastComment = true;
772 }
773 
775  const string& id_name)
776 {
777  bool done=false;
778  DTDAttribute a;
779  a.SetName(id_name);
780  node.AddAttribute(a);
781  DTDAttribute& attrib = node.GetNonconstAttributes().back();
782  attrib.SetSourceLine(Lexer().CurrentLine());
783  m_Comments = &(attrib.Comments());
784  for (done=false; !done;) {
785  switch(GetNextToken()) {
786  default:
787  ParseError("Unknown token", "token");
788  break;
789  case T_IDENTIFIER:
790  if (attrib.GetType() == DTDAttribute::eUnknown) {
791  ParseError(attrib.GetName().c_str(), "attribute type");
792  }
793  done = true;
794  break;
795  case T_SYMBOL:
796  switch (NextToken().GetSymbol()) {
797  default:
798  done = true;
799  break;
800  case '(':
801  // parse enumerated list
803  ConsumeToken();
804  ParseEnumeratedList(attrib);
805  break;
806  }
807  break;
808  case T_STRING:
809  attrib.SetValue(GetNextTokenText());
810  m_ExpectLastComment = true;
811  break;
812  case K_CDATA:
814  break;
815  case K_ID:
816  attrib.SetType(DTDAttribute::eId);
817  break;
818  case K_IDREF:
820  break;
821  case K_IDREFS:
823  break;
824  case K_NMTOKEN:
826  break;
827  case K_NMTOKENS:
829  break;
830  case K_ENTITY:
832  break;
833  case K_ENTITIES:
835  break;
836  case K_NOTATION:
838  break;
839  case K_DEFAULT:
841  m_ExpectLastComment = true;
842  break;
843  case K_REQUIRED:
845  m_ExpectLastComment = true;
846  break;
847  case K_IMPLIED:
849  m_ExpectLastComment = true;
850  break;
851  case K_FIXED:
853  m_ExpectLastComment = true;
854  break;
855  }
856  if (!done) {
857  ConsumeToken();
858  }
859  }
860 }
861 
863 {
864  for (;;) {
865  switch(GetNextToken()) {
866  default:
867  ParseError("Unknown token", "token");
868  break;
869  case T_IDENTIFIER:
870  case T_NMTOKEN:
871  attrib.AddEnumValue(GetNextTokenText(),Lexer().CurrentLine());
872  ConsumeToken();
873  break;
874  case T_SYMBOL:
875  // may be either '|' or ')'
876  if (NextToken().GetSymbol() == ')') {
877  return;
878  }
879  if (NextToken().GetSymbol() != '|') {
880  ParseError("Unknown token", "|");
881  }
882  ConsumeToken();
883  break;
884  }
885  }
886 }
887 
888 /////////////////////////////////////////////////////////////////////////////
889 // model generation
890 
891 void DTDParser::GenerateDataTree(CDataTypeModule& module, const string& name_space)
892 {
894  m_ElementEmbTypes.clear();
896  for (i = m_MapElement.begin(); i != m_MapElement.end(); ++i) {
897 
898  DTDElement::EType type = i->second.GetType();
899  if (m_SrcType != eJson &&
900  i->second.GetName().empty() &&
901  i->first != s_SpecialName &&
902  type != DTDElement::eAny) {
903  ParseError(i->first.c_str(),"definition");
904  }
905 
906  bool generate = type != DTDElement::eUnknown &&
909  if (m_SrcType == eDTD) {
910  generate = ( type == DTDElement::eSequence ||
912  type == DTDElement::eSet ||
913  i->second.HasAttributes());
914  }
915  if (generate && !i->second.IsEmbedded())
916  {
917  if (name_space != "*" &&
918  i->second.GetNamespaceName() != name_space) {
919  continue;
920  }
921  string qname = i->second.GetName() + i->second.GetNamespaceName();
922  if (m_GeneratedTypes.find(qname) == m_GeneratedTypes.end()) {
923  m_GeneratedTypes.insert(qname);
924  m_ElementEmbTypes.push_back(qname);
925  ModuleType(module, i->second);
926  m_ElementEmbTypes.clear();
927  }
928  }
929  }
930 }
931 
933 {
934  AutoPtr<CDataType> type = Type(node, node.GetOccurrence(), false);
935  module.AddDefinition(node.GetName(), type);
936 }
937 
938 
940  const DTDElement& node, DTDElement::EOccurrence occ,
941  bool fromInside, bool ignoreAttrib)
942 {
943  AutoPtr<CDataType> type(x_Type(node, occ, fromInside, ignoreAttrib));
944  if (m_SrcType != eDTD && !fromInside) {
945  type->Comments() = node.GetComments();
946  type->SetEmptyExternalName( !node.IsNamed());
947  }
948  return type;
949 }
950 
951 
953  const DTDElement& node, DTDElement::EOccurrence occ,
954  bool fromInside, bool ignoreAttrib)
955 {
956  CDataType* type;
957 
958 // if the node contains single embedded element - prune it
959  if ((!fromInside || node.IsEmbedded()) && !node.HasAttributes()) {
960  const list<string>& refs = node.GetContent();
961  if (refs.size() == 1) {
962  string refName = refs.front();
963  DTDElement& refNode = m_MapElement[refName];
964  if (refNode.IsEmbedded() && !refNode.IsNamed() &&
965  (node.GetOccurrence(refName) == DTDElement::eOne) &&
966  refNode.GetType() != DTDElement::eAny) {
967  DTDElement::EOccurrence ref_occ = refNode.GetOccurrence();
968  DTDElement::EOccurrence new_occ =
969  (fromInside || ref_occ == DTDElement::eOne) ? occ : ref_occ;
970  if (m_SrcType == eJson) {
971  new_occ = ref_occ;
972  }
973  type = x_Type(refNode, new_occ, fromInside);
974  if (node.IsEmbedded() && m_SrcType != eJson) {
975  DTDElement& emb = const_cast<DTDElement&>(node);
976  emb.SetName(refNode.GetName());
977  }
978  type->SetNamespaceName( node.GetNamespaceName());
979  type->SetNsQualified(node.IsQualified());
980  return type;
981  }
982  }
983  }
984 
985  bool uniseq = (occ == DTDElement::eOneOrMore ||
986  occ == DTDElement::eZeroOrMore);
987  bool cont = (node.GetType() == DTDElement::eSequence ||
988  node.GetType() == DTDElement::eChoice ||
989  node.GetType() == DTDElement::eSet);
990  bool attrib = !ignoreAttrib && node.HasAttributes();
991  bool ref = fromInside && !node.IsEmbedded();
992  bool ref_to_parent = false;
993 
994  string embtype;
995  if (fromInside && node.IsEmbedded() && !node.GetTypeName().empty()) {
996  embtype = node.GetName() + node.GetTypeName() + "###";
997  ref_to_parent = ref =
998  find(m_ElementEmbTypes.begin(), m_ElementEmbTypes.end(), embtype) != m_ElementEmbTypes.end();
999  m_ElementEmbTypes.push_back(embtype);
1000  }
1001 
1002  bool keep_global;
1003  keep_global = (cont && uniseq && (attrib ||
1004  (node.IsEmbedded() && !node.IsNamed() && fromInside))) ||
1005  (!cont && attrib);
1006  if (m_SrcType != eDTD) {
1007  keep_global = keep_global || ref;
1008  }
1009 
1010  if (keep_global) {
1011  if (ref) {
1012  type = new CReferenceDataType(node.GetName(), ref_to_parent);
1013  } else {
1014  type = CompositeNode(node, occ);
1015  uniseq = false;
1016  }
1017  } else {
1018  switch (node.GetType()) {
1019  case DTDElement::eSequence:
1020  if (ref) {
1021  type = new CReferenceDataType(node.GetName());
1022  } else {
1023  if (node.IsNillable()) {
1024  type = NillableBlock(node,ignoreAttrib);
1025  } else {
1026  type = TypesBlock(new CDataSequenceType(),node,ignoreAttrib);
1027  }
1028  }
1029  break;
1030  case DTDElement::eChoice:
1031  if (ref) {
1032  type = new CReferenceDataType(node.GetName());
1033  } else {
1034  if (node.IsNillable()) {
1035  type = NillableBlock(node,ignoreAttrib);
1036  } else {
1037  type = TypesBlock(new CChoiceDataType(),node,ignoreAttrib);
1038  }
1039  }
1040  break;
1041  case DTDElement::eSet:
1042  if (ref) {
1043  type = new CReferenceDataType(node.GetName());
1044  } else {
1045  if (node.IsNillable()) {
1046  type = NillableBlock(node,ignoreAttrib);
1047  } else {
1048  type = TypesBlock(new CDataSetType(),node,ignoreAttrib);
1049  }
1050  }
1051  break;
1052  case DTDElement::eAlias:
1053  {
1054  string base(node.GetTypeName());
1056  for (b = m_MapElement.find(base);
1057  b != m_MapElement.end(); b = m_MapElement.find(base)) {
1058  if (b->second.GetType() != DTDElement::eAlias) {
1059  base = b->second.GetName();
1060  break;
1061  }
1062  base = b->second.GetTypeName();
1063  }
1064  if (node.IsNillable()) {
1065  type = NillableBlock(node,ignoreAttrib);
1066  } else {
1067  type = new CReferenceDataType(base);
1068  type->SetIsAlias(true);
1069  type->SetIsTypeAlias(true);
1070  }
1071  }
1072  break;
1073  case DTDElement::eEnum:
1074  type = EnumeratedBlock(node, new CEnumDataType());
1075  break;
1076  case DTDElement::eIntEnum:
1077  type = EnumeratedBlock(node, new CIntEnumDataType());
1078  break;
1079  case DTDElement::eString:
1080  type = new CStringDataType();
1081  break;
1082  case DTDElement::eAny:
1083  type = new CAnyContentDataType();
1084  break;
1085  case DTDElement::eEmpty:
1086  type = new CNullDataType();
1087  break;
1088 
1089  case DTDElement::eBoolean:
1090  type = new CBoolDataType();
1091  break;
1092  case DTDElement::eInteger:
1093  type = new CIntDataType();
1094  break;
1095  case DTDElement::eBigInt:
1096  type = new CBigIntDataType();
1097  break;
1098  case DTDElement::eDouble:
1099  type = new CRealDataType();
1100  break;
1102  type = new COctetStringDataType();
1103  break;
1105  type = new CBase64BinaryDataType();
1106  break;
1107 
1108  default:
1109  if (node.GetType() >= DTDElement::eWsdlService) {
1110  CWsdlDataType* w = new CWsdlDataType();
1112  switch (node.GetType()) {
1116  break;
1123  default:
1124  ParseError("Unknown WSDL element type", "element");
1125  break;
1126  }
1127  w->SetWsdlType(wt);
1128  type = TypesBlock(w,node,ignoreAttrib);
1129  } else {
1130  ParseError("Unknown element", "element");
1131  type = 0;
1132  }
1133  break;
1134  }
1135  }
1136  type->SetSourceLine(node.GetSourceLine());
1137  type->SetNamespaceName( node.GetNamespaceName());
1138  type->SetNsQualified( node.IsQualified());
1139  type->SetGlobalType( node.IsGlobalType() ? CDataType::eType : (node.IsGlobalGroup() ? CDataType::eGroup : CDataType::eElement));
1140  if (node.IsNillable()) {
1141  type->SetNillable();
1142  }
1143  if (uniseq) {
1145  uniType->SetSourceLine(type->GetSourceLine());
1146  uniType->SetNonEmpty( occ == DTDElement::eOneOrMore);
1147  uniType->SetNoPrefix(true);
1148  type = uniType;
1149  }
1150  else if (!fromInside && cont && occ == DTDElement::eZeroOrOne) {
1151  string refname(node.GetName());
1152  refname.insert(0,"E");
1154  AutoPtr<CDataMember> member(new CDataMember(refname, type));
1155  container->SetSourceLine(type->GetSourceLine());
1156  member->SetOptional();
1157  member->SetNotag();
1158  member->SetNoPrefix();
1159  container->AddMember(member);
1160  type = container.release();
1161  }
1162  if (!fromInside) {
1163  type->SetRestrictions(node.GetRestrictions());
1164  }
1165  if (!embtype.empty()) {
1166  m_ElementEmbTypes.pop_back();
1167  }
1168  return type;
1169 }
1170 
1172 {
1173  try {
1175  value->SetSourceLine(node.GetSourceLine());
1176  return value;
1177  }
1178  catch (CException& e) {
1180  string("Element: ") + node.GetName() +
1181  ", type: " + node.GetTypeName() +
1182  ", namespace: " + node.GetNamespaceName() +
1183  ", on line: " + NStr::NumericToString(node.GetSourceLine()) +
1184  ": failed to define default value");
1185  }
1186  return AutoPtr<CDataValue>();
1187 }
1188 
1190 {
1191  switch (node.GetType()) {
1192  default:
1193  break;;
1194  case DTDElement::eEnum:
1195  return AutoPtr<CDataValue>(new CIdDataValue(node.GetDefault()));
1196  case DTDElement::eString:
1197  return AutoPtr<CDataValue>(new CStringDataValue(node.GetDefault()));
1200  case DTDElement::eEmpty:
1201  return AutoPtr<CDataValue>(new CNullDataValue());
1202  case DTDElement::eBoolean:
1203  {
1204  bool b;
1205  if (node.GetDefault() == "0") {
1206  b = false;
1207  } else if (node.GetDefault() == "1") {
1208  b = true;
1209  } else {
1210  b = NStr::StringToBool(node.GetDefault());
1211  }
1212  return AutoPtr<CDataValue>(new CBoolDataValue(b));
1213  }
1214  case DTDElement::eIntEnum:
1215  case DTDElement::eInteger:
1216  case DTDElement::eBigInt:
1218  NStr::StringToInt8(node.GetDefault())));
1219  case DTDElement::eDouble:
1222  }
1223  ParseError("value");
1224  return AutoPtr<CDataValue>(0);
1225 }
1226 
1227 CDataType* DTDParser::NillableBlock(const DTDElement& node, bool ignoreAttrib)
1228 {
1229  DTDElement tmp(node);
1230  tmp.SetNillable(false);
1232  if (!ignoreAttrib) {
1233  AddAttributes(container, tmp);
1234  }
1236  AutoPtr<CDataMember> member(new CDataMember( tmp.GetName(), type));
1237  type->SetNillable();
1238  member->SetNotag();
1239  member->SetNillable();
1240  member->SetNoPrefix();
1241  container->AddMember(member);
1242  return container.release();
1243 }
1244 
1246  CDataMemberContainerType* containerType,const DTDElement& node,
1247  bool ignoreAttrib)
1248 {
1249  AutoPtr<CDataMemberContainerType> container(containerType);
1250 
1251  if (!ignoreAttrib) {
1252  AddAttributes(container, node);
1253  }
1254  const list<string>& refs = node.GetContent();
1255  for (list<string>::const_iterator i= refs.begin(); i != refs.end(); ++i) {
1256  if (*i == s_SpecialName) {
1257  AutoPtr<CDataType> stype(new CStringDataType());
1258  AutoPtr<CDataMember> smember(new CDataMember("-CharData", stype));
1259  smember->SetNotag();
1260  smember->SetNoPrefix();
1261  container->AddMember(smember);
1262  continue;
1263  }
1264  DTDElement& refNode = m_MapElement[*i];
1265  if (refNode.GetName().empty()) {
1266  if (refNode.GetType() == DTDElement::eAny) {
1267  refNode.SetName("-Any");
1268  } else {
1269  ERR_POST_X(7, Warning << GetLocation() << "Element with no name: " << *i);
1270  refNode.SetName(*i);
1271  }
1272  }
1274  if (refNode.IsEmbedded()) {
1275  occ = refNode.GetOccurrence();
1276  }
1277  AutoPtr<CDataType> type(Type(refNode, occ, true));
1278  bool stdtype = type->IsStdType();
1279  bool setnil = refNode.IsNillable() && stdtype && !refNode.HasAttributes();
1280  if (refNode.IsEmbedded() && refNode.IsNamed()) {
1281  bool optional = false, uniseq = false, uniseq2 = false, refseq = false;
1282  uniseq = (occ == DTDElement::eOneOrMore || occ == DTDElement::eZeroOrMore);
1283  optional = (occ == DTDElement::eZeroOrOne || occ == DTDElement::eZeroOrMore);
1284  refseq = refNode.GetType() == DTDElement::eSequence ||
1285  refNode.GetType() == DTDElement::eChoice ||
1286  refNode.GetType() == DTDElement::eSet;
1287  occ = node.GetOccurrence(*i);
1288  uniseq2 = (occ == DTDElement::eOneOrMore || occ == DTDElement::eZeroOrMore);
1289 
1290  if (uniseq || (optional && refseq)) {
1291 
1292  string refname(refNode.GetName());
1293  if (uniseq2 || (optional && refseq)) {
1294  refname.insert(0,"E");
1295  }
1297  AutoPtr<CDataMember> member(new CDataMember(refname, type));
1298  type_container->SetSourceLine(type->GetSourceLine());
1299  if (optional) {
1300  member->SetOptional();
1301  }
1302  member->SetNotag();
1303  member->SetNoPrefix();
1304  type_container->AddMember(member);
1305  type.reset(type_container.release());
1306  }
1307  else if (uniseq2 && setnil) {
1308 // the idea is to make it implicit
1309  DTDElement tmp(refNode);
1310  tmp.SetName("");
1312  setnil = false;
1313  }
1314  if (uniseq2) {
1316  uniType->SetSourceLine( type->GetSourceLine());
1317  uniType->SetNonEmpty( occ == DTDElement::eOneOrMore);
1318  type.reset(uniType);
1319 
1320  }
1321  }
1322  AutoPtr<CDataMember> member(new CDataMember(refNode.GetName(), type));
1323  if ((occ == DTDElement::eZeroOrOne) ||
1324  (occ == DTDElement::eZeroOrMore)) {
1325  member->SetOptional();
1326  }
1327  if (!refNode.IsNamed()) {
1328  member->SetNotag();
1329  }
1330  if (!refNode.GetDefault().empty() && !refNode.HasAttributes()) {
1331  member->SetDefault(Value(refNode));
1332  }
1333  if (setnil) {
1334  member->SetNillable();
1335  }
1336  member->SetNoPrefix();
1337  if (m_SrcType == eDTD || refNode.IsEmbedded()) {
1338  member->Comments() = refNode.GetComments();
1339  }
1340  if (refNode.IsEmbedded()) {
1341  member->SetRestrictions( refNode.GetRestrictions());
1342  }
1343  container->AddMember(member);
1344  }
1345  if (m_SrcType == eDTD || node.IsEmbedded()) {
1346  container->Comments() = node.GetComments();
1347  }
1348  return container.release();
1349 }
1350 
1352  const DTDElement& node, DTDElement::EOccurrence occ)
1353 {
1355 
1356  AddAttributes(container, node);
1357  bool uniseq =
1359 
1360  AutoPtr<CDataType> type(Type(node, DTDElement::eOne, false, true));
1361  if (uniseq) {
1362  int line = type->GetSourceLine();
1363  type.reset(new CUniSequenceDataType(type));
1364  type->SetSourceLine( line );
1365  }
1366  AutoPtr<CDataMember> member(new CDataMember(node.GetName(), type));
1367 
1368  if ((occ == DTDElement::eZeroOrOne) ||
1369  (occ == DTDElement::eZeroOrMore)) {
1370  member->SetOptional();
1371  }
1372  member->SetNotag();
1373  if (!node.GetDefault().empty()) {
1374  member->SetDefault(Value(node));
1375  }
1376  if (node.IsNillable() &&
1377  (occ == DTDElement::eZeroOrOne || occ == DTDElement::eOne)) {
1378  member->SetNillable();
1379  }
1380  member->SetNoPrefix();
1381  if (!uniseq) {
1382  member->SetSimpleType();
1383  }
1384  container->AddMember(member);
1385  if (m_SrcType == eDTD || node.IsEmbedded()) {
1386  container->Comments() = node.GetComments();
1387  }
1388  return container.release();
1389 }
1390 
1392  AutoPtr<CDataMemberContainerType>& container, const DTDElement& node)
1393 {
1394  if (node.HasAttributes()) {
1395  AutoPtr<CDataMember> member(
1396  new CDataMember("Attlist", AttribBlock(node)));
1397  member->SetNoPrefix();
1398  member->SetAttlist();
1399  member->Comments() = node.GetAttribComments();
1400  container->AddMember(member);
1401  }
1402 }
1403 
1405 {
1407  const list<DTDAttribute>& att = node.GetAttributes();
1408  bool has_nsq = false;
1409  for (list<DTDAttribute>::const_iterator i= att.begin();
1410  i != att.end(); ++i) {
1412  AutoPtr<CDataMember> member(new CDataMember(i->GetName(), type));
1413  string defValue( i->GetValue());
1414  if (!defValue.empty()) {
1415  member->SetDefault(x_AttribValue(*i,defValue));
1416  }
1417  if (i->GetValueType() == DTDAttribute::eImplied) {
1418  member->SetOptional();
1419  }
1420  member->SetNoPrefix();
1421  member->Comments() = i->GetComments();
1422  if (type->IsNsQualified() == eNSQualified) {
1423  has_nsq = true;
1424  }
1425  container->AddMember(member);
1426  }
1427  if (has_nsq) {
1428  container->SetNamespaceName(node.GetNamespaceName());
1429  container->SetNsQualified(true);
1430  }
1431  return container.release();
1432 }
1433 
1434 
1435 
1437 {
1438  CDataType* type=0;
1439  switch (att.GetType()) {
1441  ParseError("Unknown attribute", "attribute");
1442  break;
1444  ParseError("Unknown attribute", "attribute");
1445  break;
1446  default:
1447  case DTDAttribute::eId:
1448  case DTDAttribute::eIdRef:
1449  case DTDAttribute::eIdRefs:
1452  case DTDAttribute::eEntity:
1455  case DTDAttribute::eString:
1456  type = new CStringDataType();
1457  break;
1458  case DTDAttribute::eEnum:
1459  type = EnumeratedBlock(att, new CEnumDataType());
1460  break;
1462  type = EnumeratedBlock(att, new CIntEnumDataType());
1463  break;
1464 
1466  type = new CBoolDataType();
1467  break;
1469  type = new CIntDataType();
1470  break;
1471  case DTDAttribute::eBigInt:
1472  type = new CBigIntDataType();
1473  break;
1474  case DTDAttribute::eDouble:
1475  type = new CRealDataType();
1476  break;
1478  type = new CBase64BinaryDataType();
1479  break;
1480  }
1481  type->SetSourceLine(att.GetSourceLine());
1482  type->SetNsQualified(att.IsQualified());
1483  return type;
1484 }
1485 
1487  const string& defvalue)
1488 {
1489  CDataValue* value=0;
1490  switch (att.GetType()) {
1492  ParseError("Unknown attribute", "attribute");
1493  break;
1495  ParseError("Unknown attribute", "attribute");
1496  break;
1497  default:
1498  case DTDAttribute::eId:
1499  case DTDAttribute::eIdRef:
1500  case DTDAttribute::eIdRefs:
1503  case DTDAttribute::eEntity:
1506  case DTDAttribute::eString:
1507  value = new CStringDataValue(defvalue);
1508  break;
1509  case DTDAttribute::eEnum:
1510  value = new CIdDataValue(defvalue);
1511  break;
1512 
1514  value = new CBoolDataValue(NStr::StringToBool(defvalue));
1515  break;
1517  value = new CIntDataValue(att.GetEnumValueId(defvalue));
1518  break;
1520  case DTDAttribute::eBigInt:
1521  value = new CIntDataValue(NStr::StringToInt8(defvalue));
1522  break;
1523  case DTDAttribute::eDouble:
1524  value = new CDoubleDataValue(
1526  break;
1527  }
1528  return value;
1529 }
1530 
1531 
1533  CEnumDataType* enumType)
1534 {
1535  int v=1;
1536  const list<string>& attEnums = att.GetEnumValues();
1537  list<string>::const_iterator i;
1538  for (i = attEnums.begin(); i != attEnums.end(); ++i, ++v) {
1539  if (enumType->IsInteger()) {
1540  v = att.GetEnumValueId(*i);
1541  }
1542  enumType->AddValue( *i, v).SetSourceLine(
1543  att.GetEnumValueSourceLine(*i));
1544  }
1545  return enumType;
1546 }
1547 
1549  CEnumDataType* enumType)
1550 {
1551  int v=1;
1552  const list<string>& enums = node.GetContent();
1553  list<string>::const_iterator i;
1554  for (i = enums.begin(); i != enums.end(); ++i, ++v) {
1555  if (enumType->IsInteger()) {
1556  v = NStr::StringToInt(*i);
1557  }
1558  enumType->AddValue( *i, v).SetSourceLine( node.GetSourceLine());
1559  }
1560  return enumType;
1561 }
1562 
1564 {
1565  if (comments->Empty()) {
1566  m_Comments = comments;
1567  } else {
1568  m_Comments = 0;
1569  }
1570 }
1571 
1572 /////////////////////////////////////////////////////////////////////////////
1573 // debug printing
1574 
1575 #if defined(NCBI_DTDPARSER_TRACE)
1576 void DTDParser::PrintDocumentTree(void)
1577 {
1578  PrintEntities();
1579 
1580  cout << " === Elements ===" << endl;
1582  for (i = m_MapElement.begin(); i != m_MapElement.end(); ++i) {
1583  DTDElement& node = i->second;
1584  DTDElement::EType type = node.GetType();
1585  if ((type == DTDElement::eSequence ||
1587  type == DTDElement::eSet ||
1589  node.HasAttributes()) && !node.IsEmbedded()) {
1590  PrintDocumentNode(i->first,i->second);
1591  }
1592  }
1593  bool started = false;
1594  for (i = m_MapElement.begin(); i != m_MapElement.end(); ++i) {
1595  DTDElement& node = i->second;
1596  if (node.IsEmbedded()) {
1597  if (!started) {
1598  cout << " === Embedded elements ===" << endl;
1599  started = true;
1600  }
1601  PrintDocumentNode(i->first,i->second);
1602  }
1603  }
1604  started = false;
1605  for (i = m_MapElement.begin(); i != m_MapElement.end(); ++i) {
1606  DTDElement& node = i->second;
1607  DTDElement::EType type = node.GetType();
1608  if ((type != DTDElement::eSequence &&
1610  type != DTDElement::eSet &&
1611  !node.HasAttributes()) && node.IsReferenced()) {
1612  if (!started) {
1613  cout << " === REFERENCED simpletype elements ===" << endl;
1614  started = true;
1615  }
1616  PrintDocumentNode(i->first,i->second);
1617  }
1618  }
1619  started = false;
1620  for (i = m_MapElement.begin(); i != m_MapElement.end(); ++i) {
1621  DTDElement& node = i->second;
1622  DTDElement::EType type = node.GetType();
1623  if ((type != DTDElement::eSequence &&
1625  type != DTDElement::eSet &&
1627  !node.IsReferenced()) {
1628  if (!started) {
1629  cout << " === UNREFERENCED simpletype elements ===" << endl;
1630  started = true;
1631  }
1632  PrintDocumentNode(i->first,i->second);
1633  }
1634  }
1635  cout << endl;
1636 }
1637 
1638 void DTDParser::PrintEntities(void)
1639 {
1640  if (!m_MapEntity.empty()) {
1641  cout << " === Entities ===" << endl;
1643  for (i = m_MapEntity.begin(); i != m_MapEntity.end(); ++i) {
1644  cout << i->first << " = \"" << i->second.GetData() << "\"" << endl << endl;
1645  }
1646  }
1647 }
1648 
1649 void DTDParser::PrintDocumentNode(const string& name, const DTDElement& node)
1650 {
1651  cout << name << ": ";
1652  switch (node.GetType()) {
1653  default:
1654  case DTDElement::eUnknown: cout << "UNKNOWN"; break;
1655  case DTDElement::eUnknownGroup: cout << "UNKNOWN"; break;
1656 
1657  case DTDElement::eString: cout << "string"; break;
1658  case DTDElement::eAny: cout << "any"; break;
1659  case DTDElement::eEmpty: cout << "empty"; break;
1660  case DTDElement::eSequence: cout << "sequence";break;
1661  case DTDElement::eChoice: cout << "choice"; break;
1662  case DTDElement::eSet: cout << "set"; break;
1663 
1664  case DTDElement::eAlias: cout << "Alias"; break;
1665  case DTDElement::eEnum: cout << "Enum"; break;
1666  case DTDElement::eIntEnum: cout << "IntEnum"; break;
1667 
1668  case DTDElement::eBoolean: cout << "boolean"; break;
1669  case DTDElement::eInteger: cout << "integer"; break;
1670  case DTDElement::eBigInt: cout << "BigInt"; break;
1671  case DTDElement::eDouble: cout << "double"; break;
1672  case DTDElement::eOctetString: cout << "OctetString"; break;
1673  case DTDElement::eBase64Binary: cout << "Base64Binary"; break;
1674 
1675  case DTDElement::eWsdlService: cout << "WsdlService"; break;
1676  case DTDElement::eWsdlEndpoint: cout << "WsdlEndpoint"; break;
1677  case DTDElement::eWsdlUnsupportedEndpoint: cout << "WsdlUnsupportedEndpoint"; break;
1678  case DTDElement::eWsdlOperation: cout << "WsdlOperation"; break;
1679  case DTDElement::eWsdlHeaderInput: cout << "WsdlHeaderInput"; break;
1680  case DTDElement::eWsdlInput: cout << "WsdlInput"; break;
1681  case DTDElement::eWsdlHeaderOutput: cout << "WsdlHeaderOutput"; break;
1682  case DTDElement::eWsdlOutput: cout << "WsdlOutput"; break;
1683  case DTDElement::eWsdlMessage: cout << "WsdlMessage"; break;
1684  }
1685  switch (node.GetOccurrence()) {
1686  default:
1687  case DTDElement::eOne: cout << "(1)"; break;
1688  case DTDElement::eOneOrMore: cout << "(1..*)"; break;
1689  case DTDElement::eZeroOrMore: cout << "(0..*)"; break;
1690  case DTDElement::eZeroOrOne: cout << "(0..1)"; break;
1691  }
1692  if (!node.GetDefault().empty()) {
1693  cout << ", default=";
1694  cout << "\"" << node.GetDefault() << "\"";
1695  }
1696  if (!node.GetNamespaceName().empty()) {
1697  cout << endl;
1698  cout << "Namespace: " << node.GetNamespaceName() << endl;
1699  cout << "form: " << (node.IsQualified() ? "qualified" : "unqualified") << endl;
1700  }
1701  cout << endl;
1702  if (!node.GetComments().Empty()) {
1703  cout << " === Comments ===" << endl;
1705  }
1706  if (!node.GetAttribComments().Empty()) {
1707  cout << " === AttribComments ===" << endl;
1709  }
1710  if (node.HasAttributes()) {
1711  PrintNodeAttributes(node);
1712  }
1713  const list<string>& refs = node.GetContent();
1714  if (!refs.empty()) {
1715  cout << " === Contents ===" << endl;
1716  for (list<string>::const_iterator ir= refs.begin();
1717  ir != refs.end(); ++ir) {
1718  cout << " " << *ir;
1719  switch (node.GetOccurrence(*ir)) {
1720  default:
1721  case DTDElement::eOne: cout << "(1)"; break;
1722  case DTDElement::eOneOrMore: cout << "(1..*)"; break;
1723  case DTDElement::eZeroOrMore: cout << "(0..*)"; break;
1724  case DTDElement::eZeroOrOne: cout << "(0..1)"; break;
1725  }
1726  if (m_MapElement.find(*ir) != m_MapElement.end() &&
1727  m_MapElement[*ir].IsEmbedded()) {
1728  cout << " [" << m_MapElement[*ir].GetName() << "]";
1729  }
1730  cout << endl;
1731  }
1732  }
1733  cout << endl;
1734 }
1735 
1736 void DTDParser::PrintNodeAttributes(const DTDElement& node)
1737 {
1738  const list<DTDAttribute>& att = node.GetAttributes();
1739  cout << " === Attributes ===" << endl;
1740  for (list<DTDAttribute>::const_iterator i= att.begin();
1741  i != att.end(); ++i) {
1742  PrintAttribute( *i);
1743  }
1744 }
1745 
1746 void DTDParser::PrintAttribute(const DTDAttribute& attrib, bool indent/*=true*/)
1747 {
1748  if (indent) {
1749  cout << " ";
1750  }
1751  cout << attrib.GetName();
1752  cout << ": ";
1753  switch (attrib.GetType()) {
1754  case DTDAttribute::eUnknown: cout << "UNKNOWN"; break;
1755  case DTDAttribute::eUnknownGroup: cout << "UNKNOWN"; break;
1756  case DTDAttribute::eString: cout << "eString"; break;
1757  case DTDAttribute::eEnum: cout << "eEnum"; break;
1758  case DTDAttribute::eId: cout << "eId"; break;
1759  case DTDAttribute::eIdRef: cout << "eIdRef"; break;
1760  case DTDAttribute::eIdRefs: cout << "eIdRefs"; break;
1761  case DTDAttribute::eNmtoken: cout << "eNmtoken"; break;
1762  case DTDAttribute::eNmtokens: cout << "eNmtokens"; break;
1763  case DTDAttribute::eEntity: cout << "eEntity"; break;
1764  case DTDAttribute::eEntities: cout << "eEntities"; break;
1765  case DTDAttribute::eNotation: cout << "eNotation"; break;
1766 
1767  case DTDAttribute::eBoolean: cout << "boolean"; break;
1768  case DTDAttribute::eInteger: cout << "integer"; break;
1769  case DTDAttribute::eBigInt: cout << "BigInt"; break;
1770  case DTDAttribute::eDouble: cout << "double"; break;
1771  }
1772  {
1773  const list<string>& enumV = attrib.GetEnumValues();
1774  if (!enumV.empty()) {
1775  cout << " (";
1776  for (list<string>::const_iterator ie= enumV.begin();
1777  ie != enumV.end(); ++ie) {
1778  if (ie != enumV.begin()) {
1779  cout << ",";
1780  }
1781  cout << *ie << "(" << attrib.GetEnumValueId(*ie) << ")";
1782  }
1783  cout << ")";
1784  }
1785  }
1786  cout << ", ";
1787  switch (attrib.GetValueType()) {
1788  case DTDAttribute::eDefault: cout << "eDefault"; break;
1789  case DTDAttribute::eRequired: cout << "eRequired"; break;
1790  case DTDAttribute::eImplied: cout << "eImplied"; break;
1791  case DTDAttribute::eFixed: cout << "eFixed"; break;
1792  }
1793  cout << ", ";
1794  cout << "\"" << attrib.GetValue() << "\"";
1795 
1796  cout << endl;
1797  cout << "form:" << (attrib.IsQualified() ? "qualified" : "unqualified") << endl;
1798  if (!attrib.GetNamespaceName().empty()) {
1799  cout << "Namespace: " << attrib.GetNamespaceName() << endl;
1800  }
1801  cout << endl;
1802  if (!attrib.GetComments().Empty()) {
1803  cout << " === Comments ===" << endl;
1805  }
1806 }
1807 
1808 #endif
1809 
void SetParser(AbstractParser *parser)
Definition: alexer.hpp:51
void FlushCommentsTo(CComments &comments)
Definition: alexer.cpp:218
void BeginFile(void)
Definition: alexer.cpp:239
void FlushComments(void)
Definition: alexer.cpp:213
const AbstractToken & NextToken(void) const
Definition: aparser.hpp:76
void ConsumeSymbol(char symbol)
Definition: aparser.hpp:149
TToken Next(void) const
Definition: aparser.hpp:80
AbstractLexer & Lexer(void)
Definition: aparser.hpp:67
void SetLexer(AbstractLexer *lexer)
Definition: aparser.hpp:176
virtual void ParseError(const char *error, const char *expected, const AbstractToken &token)
Definition: aparser.cpp:54
void CopyComments(CComments &comments)
Definition: aparser.hpp:165
virtual string GetLocation(void)
Definition: aparser.cpp:49
void Consume(void)
Definition: aparser.hpp:93
string GetText(void) const
Definition: atoken.hpp:49
AutoPtr –.
Definition: ncbimisc.hpp:401
bool Empty(void) const
Definition: comments.hpp:89
CNcbiOstream & PrintDTD(CNcbiOstream &out, int flags=0) const
Definition: comments.cpp:121
@ eDoNotWriteBlankLine
Definition: comments.hpp:54
void AddDefinition(const string &name, const AutoPtr< CDataType > &type)
Definition: module.cpp:67
@ eGroup
Definition: type.hpp:426
@ eElement
Definition: type.hpp:424
@ eType
Definition: type.hpp:425
void SetSourceLine(int line)
Definition: type.cpp:112
CDirEntry –.
Definition: ncbifile.hpp:262
void SetSourceLine(int line)
Definition: enumtype.hpp:66
TValue & AddValue(const string &name, TEnumValueType value)
Definition: enumtype.cpp:78
virtual bool IsInteger(void) const
Definition: enumtype.cpp:73
CFile –.
Definition: ncbifile.hpp:1604
void SetNoPrefix(bool noprefix)
Definition: unitype.hpp:88
void SetNonEmpty(bool nonEmpty)
Definition: unitype.hpp:80
void SetWsdlType(EType type)
Definition: blocktype.hpp:223
int GetEnumValueId(const string &value) const
Definition: dtdaux.cpp:262
const string & GetNamespaceName(void) const
Definition: dtdaux.cpp:274
const string & GetValue(void) const
Definition: dtdaux.cpp:238
EType GetType(void) const
Definition: dtdaux.cpp:210
const CComments & GetComments(void) const
Definition: dtdaux.hpp:190
void AddEnumValue(const string &value, int line, int id=0)
Definition: dtdaux.cpp:243
bool IsQualified(void) const
Definition: dtdaux.hpp:181
void SetValueType(EValueType valueType)
Definition: dtdaux.cpp:225
int GetEnumValueSourceLine(const string &value) const
Definition: dtdaux.cpp:254
const list< string > & GetEnumValues(void) const
Definition: dtdaux.cpp:249
void SetValue(const string &value)
Definition: dtdaux.cpp:234
void SetType(EType type)
Definition: dtdaux.cpp:198
const string & GetName(void) const
Definition: dtdaux.cpp:193
int GetSourceLine(void) const
Definition: dtdaux.cpp:184
void SetSourceLine(int line)
Definition: dtdaux.cpp:179
CComments & Comments(void)
Definition: dtdaux.hpp:186
EValueType GetValueType(void) const
Definition: dtdaux.cpp:229
void SetName(const string &name)
Definition: dtdaux.cpp:339
const string & GetTypeName(void) const
Definition: dtdaux.cpp:392
void AddContent(const string &ref_name)
Definition: dtdaux.cpp:428
bool IsGlobalGroup(void) const
Definition: dtdaux.hpp:334
void SetTypeIfUnknown(EType type)
Definition: dtdaux.cpp:376
bool IsEmbedded(void) const
Definition: dtdaux.cpp:466
const CComments & GetAttribComments(void) const
Definition: dtdaux.hpp:350
const list< CMemberFacet > & GetRestrictions(void) const
Definition: dtdaux.hpp:358
void SetSourceLine(int line)
Definition: dtdaux.cpp:330
void SetType(EType type)
Definition: dtdaux.cpp:359
void SetOccurrence(const string &ref_name, EOccurrence occ)
Definition: dtdaux.cpp:406
list< DTDAttribute > & GetNonconstAttributes(void)
Definition: dtdaux.cpp:497
bool IsNamed(void) const
Definition: dtdaux.cpp:354
const string & GetDefault(void) const
Definition: dtdaux.cpp:549
@ eWsdlHeaderInput
Definition: dtdaux.hpp:245
@ eWsdlService
Definition: dtdaux.hpp:241
@ eWsdlInput
Definition: dtdaux.hpp:246
@ eBase64Binary
Definition: dtdaux.hpp:239
@ eWsdlHeaderOutput
Definition: dtdaux.hpp:247
@ eWsdlUnsupportedEndpoint
Definition: dtdaux.hpp:243
@ eWsdlOutput
Definition: dtdaux.hpp:248
@ eWsdlEndpoint
Definition: dtdaux.hpp:242
@ eWsdlOperation
Definition: dtdaux.hpp:244
@ eWsdlMessage
Definition: dtdaux.hpp:249
@ eOctetString
Definition: dtdaux.hpp:238
@ eUnknownGroup
Definition: dtdaux.hpp:222
bool IsNillable(void) const
Definition: dtdaux.hpp:321
bool IsGlobalType(void) const
Definition: dtdaux.hpp:328
EOccurrence GetOccurrence(const string &ref_name) const
Definition: dtdaux.cpp:410
@ eZeroOrOne
Definition: dtdaux.hpp:258
@ eZeroOrMore
Definition: dtdaux.hpp:257
@ eOneOrMore
Definition: dtdaux.hpp:256
CComments & AttribComments(void)
Definition: dtdaux.hpp:346
bool IsQualified(void) const
Definition: dtdaux.hpp:310
CComments & Comments(void)
Definition: dtdaux.hpp:338
void SetNamed(bool named=true)
Definition: dtdaux.cpp:350
bool HasAttributes(void) const
Definition: dtdaux.cpp:489
const CComments & GetComments(void) const
Definition: dtdaux.hpp:342
const list< DTDAttribute > & GetAttributes(void) const
Definition: dtdaux.cpp:493
const string & GetName(void) const
Definition: dtdaux.cpp:346
const string & GetNamespaceName(void) const
Definition: dtdaux.cpp:539
int GetSourceLine(void) const
Definition: dtdaux.cpp:334
const list< string > & GetContent(void) const
Definition: dtdaux.cpp:446
bool RemoveContent(const string &ref_name)
Definition: dtdaux.cpp:433
void AddAttribute(DTDAttribute &attrib)
Definition: dtdaux.cpp:485
bool IsReferenced(void) const
Definition: dtdaux.cpp:456
string CreateEmbeddedName(int depth) const
Definition: dtdaux.cpp:470
void SetEmbedded(bool set=true)
Definition: dtdaux.cpp:462
EType GetType(void) const
Definition: dtdaux.cpp:383
void SetExternal(void)
Definition: dtdaux.cpp:81
void SetData(const string &data)
Definition: dtdaux.cpp:72
void SetName(const string &name)
Definition: dtdaux.cpp:63
void ParseAttributesContent(DTDElement &node)
Definition: dtdparser.cpp:757
CDataValue * x_AttribValue(const DTDAttribute &att, const string &value)
Definition: dtdparser.cpp:1486
CDataType * TypesBlock(CDataMemberContainerType *containerType, const DTDElement &node, bool ignoreAttrib=false)
Definition: dtdparser.cpp:1245
void GenerateDataTree(CDataTypeModule &module, const string &name_space)
Definition: dtdparser.cpp:891
void ConsumeAttributeContent(DTDElement &node, const string &id_name)
Definition: dtdparser.cpp:774
AutoPtr< CDataValue > x_Value(const DTDElement &node)
Definition: dtdparser.cpp:1189
CDataType * CompositeNode(const DTDElement &node, DTDElement::EOccurrence occ)
Definition: dtdparser.cpp:1351
void BeginElementContent(void)
Definition: dtdparser.cpp:312
CDataType * NillableBlock(const DTDElement &node, bool ignoreAttrib=false)
Definition: dtdparser.cpp:1227
void AddAttributes(AutoPtr< CDataMemberContainerType > &container, const DTDElement &node)
Definition: dtdparser.cpp:1391
string CreateEmbeddedName(const DTDElement &node, int depth) const
Definition: dtdparser.cpp:540
virtual void EndCommentBlock(void) override
Definition: dtdparser.cpp:93
void BeginEntityContent(void)
Definition: dtdparser.cpp:618
map< string, DTDEntity > m_MapEntity
Definition: dtdparser.hpp:149
string m_IdentifierText
Definition: dtdparser.hpp:153
void BeginAttributesContent(void)
Definition: dtdparser.cpp:747
void FixEmbeddedNames(DTDElement &node)
Definition: dtdparser.cpp:581
CDataType * AttribBlock(const DTDElement &node)
Definition: dtdparser.cpp:1404
AutoPtr< CFileModules > Modules(const string &fileName)
Definition: dtdparser.cpp:77
string GetNextTokenText(void)
Definition: dtdparser.cpp:288
AutoPtr< CDataValue > Value(const DTDElement &node)
Definition: dtdparser.cpp:1171
virtual ~DTDParser(void)
Definition: dtdparser.cpp:72
bool m_ExpectLastComment
Definition: dtdparser.hpp:158
virtual void BeginDocumentTree(void)
Definition: dtdparser.cpp:143
map< string, DTDElement > m_MapElement
Definition: dtdparser.hpp:148
CDataType * x_AttribType(const DTDAttribute &att)
Definition: dtdparser.cpp:1436
ESrcType m_SrcType
Definition: dtdparser.hpp:156
void SkipConditionalSection(void)
Definition: dtdparser.cpp:202
void ParseEnumeratedList(DTDAttribute &attrib)
Definition: dtdparser.cpp:862
AutoPtr< CDataType > Type(const DTDElement &node, DTDElement::EOccurrence occ, bool fromInside, bool ignoreAttrib=false)
Definition: dtdparser.cpp:939
virtual bool PopEntityLexer(void)
Definition: dtdparser.cpp:725
list< string > m_StackLexerName
Definition: dtdparser.hpp:152
CDataType * x_Type(const DTDElement &node, DTDElement::EOccurrence occ, bool fromInside, bool ignoreAttrib=false)
Definition: dtdparser.cpp:952
virtual void BuildDataTree(AutoPtr< CFileModules > &modules, AutoPtr< CDataTypeModule > &module)
Definition: dtdparser.cpp:136
virtual void BuildDocumentTree(CDataTypeModule &module)
Definition: dtdparser.cpp:147
void EndElementContent(DTDElement &node)
Definition: dtdparser.cpp:510
virtual AbstractLexer * CreateEntityLexer(CNcbiIstream &in, const string &name, bool autoDelete=true)
Definition: dtdparser.cpp:738
stack< AbstractLexer * > m_StackLexer
Definition: dtdparser.hpp:150
void ModuleType(CDataTypeModule &module, const DTDElement &node)
Definition: dtdparser.cpp:932
virtual string GetLocation(void) override
Definition: dtdparser.cpp:231
CDataType * EnumeratedBlock(const DTDAttribute &att, CEnumDataType *enumType)
Definition: dtdparser.cpp:1532
void ConsumeToken(void)
Definition: dtdparser.cpp:300
CComments * m_Comments
Definition: dtdparser.hpp:157
void SetCommentsIfEmpty(CComments *comments)
Definition: dtdparser.cpp:1563
void Module(AutoPtr< CFileModules > &modules, const string &name)
Definition: dtdparser.cpp:109
void ParseEntityContent(const string &name)
Definition: dtdparser.cpp:655
virtual DTDEntity * PushEntityLexer(const string &name)
Definition: dtdparser.cpp:684
void ParseElementContent(const string &name, bool embedded)
Definition: dtdparser.cpp:320
DTDParser(DTDLexer &lexer)
Definition: dtdparser.cpp:62
stack< string > m_StackPath
Definition: dtdparser.hpp:151
static const string & s_SpecialName
Definition: dtdparser.hpp:159
void ConsumeElementContent(DTDElement &node)
Definition: dtdparser.cpp:354
TToken GetNextToken(void)
Definition: dtdparser.cpp:247
list< string > m_ElementEmbTypes
Definition: dtdparser.hpp:155
set< string > m_GeneratedTypes
Definition: dtdparser.hpp:154
void AddElementContent(DTDElement &node, string &id_name, char separator=0)
Definition: dtdparser.cpp:434
void erase(iterator pos)
Definition: map.hpp:167
const_iterator begin() const
Definition: map.hpp:151
const_iterator end() const
Definition: map.hpp:152
bool empty() const
Definition: map.hpp:149
const_iterator find(const key_type &key) const
Definition: map.hpp:153
Definition: map.hpp:338
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
void clear()
Definition: set.hpp:153
const_iterator find(const key_type &key) const
Definition: set.hpp:137
const_iterator end() const
Definition: set.hpp:136
char value[7]
Definition: config.c:431
static unsigned char depth[2 *(256+1+29)+1]
static int type
Definition: getdata.c:31
element_type * release(void)
Release will release ownership of pointer to caller.
Definition: ncbimisc.hpp:472
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
Definition: ncbidiag.hpp:550
#define NCBI_RETHROW_SAME(prev_exception, message)
Generic macro to re-throw the same exception.
Definition: ncbiexpt.hpp:749
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
Definition: ncbiexpt.cpp:342
string GetDir(EIfEmptyPath mode=eIfEmptyPath_Current) const
Get the directory component for this directory entry.
Definition: ncbifile.cpp:475
string GetBase(void) const
Get the base entry name without extension.
Definition: ncbifile.hpp:3924
static string MakePath(const string &dir=kEmptyStr, const string &base=kEmptyStr, const string &ext=kEmptyStr)
Assemble a path from basic components.
Definition: ncbifile.cpp:413
@ eNSQualified
Definition: serialdef.hpp:201
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
Definition: ncbistre.hpp:146
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
Definition: ncbistre.hpp:439
static bool StringToBool(const CTempString str)
Convert string to bool.
Definition: ncbistr.cpp:2819
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
Definition: ncbistr.cpp:630
static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to Int8.
Definition: ncbistr.cpp:793
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
Definition: ncbistr.cpp:1387
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5083
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.
Definition: ncbistr.cpp:3310
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.
Definition: ncbistr.hpp:673
@ fDecimalPosix
StringToDouble*(): For decimal point, use C locale.
Definition: ncbistr.hpp:300
Definition of all error codes used in serial libraries (xser.lib, xcser.lib).
FILE * file
int i
int len
unsigned int a
Definition: ncbi_localip.c:102
EIPRangeType t
Definition: ncbi_localip.c:101
int toupper(Uchar c)
Definition: ncbictype.hpp:73
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 char tmp[2048]
Definition: utf8.c:42
string indent(" ")
Definition: type.c:6
done
Definition: token1.c:1
TToken
Definition: tokens.hpp:38
@ T_NMTOKEN
Definition: tokens.hpp:95
@ K_EMPTY
Definition: tokens.hpp:102
@ K_ENTITY
Definition: tokens.hpp:99
@ T_IDENTIFIER
Definition: tokens.hpp:42
@ T_ENTITY
Definition: tokens.hpp:91
@ T_STRING
Definition: tokens.hpp:44
@ K_IDREFS
Definition: tokens.hpp:109
@ K_ENTITIES
Definition: tokens.hpp:112
@ K_IDREF
Definition: tokens.hpp:108
@ K_PUBLIC
Definition: tokens.hpp:104
@ K_FIXED
Definition: tokens.hpp:117
@ K_NMTOKENS
Definition: tokens.hpp:111
@ K_CDATA
Definition: tokens.hpp:106
@ K_NMTOKEN
Definition: tokens.hpp:110
@ K_SYSTEM
Definition: tokens.hpp:103
@ K_NOTATION
Definition: tokens.hpp:113
@ K_ANY
Definition: tokens.hpp:101
@ T_IDENTIFIER_END
Definition: tokens.hpp:92
@ K_IMPLIED
Definition: tokens.hpp:116
@ K_DEFAULT
Definition: tokens.hpp:75
@ K_REQUIRED
Definition: tokens.hpp:115
@ T_EOF
Definition: tokens.hpp:39
@ K_ID
Definition: tokens.hpp:107
@ K_PCDATA
Definition: tokens.hpp:100
@ T_CONDITIONAL_END
Definition: tokens.hpp:94
@ T_CONDITIONAL_BEGIN
Definition: tokens.hpp:93
@ K_ELEMENT
Definition: tokens.hpp:97
@ K_IGNORE
Definition: tokens.hpp:120
@ T_SYMBOL
Definition: tokens.hpp:40
@ K_INCLUDE
Definition: tokens.hpp:119
@ K_ATTLIST
Definition: tokens.hpp:98
CDataValueTmpl< bool > CBoolDataValue
Definition: value.hpp:107
CDataValueTmpl< string > CStringDataValue
Definition: value.hpp:110
CDataValueTmpl< Int8 > CIntDataValue
Definition: value.hpp:108
CDataValueTmpl< double > CDoubleDataValue
Definition: value.hpp:109
Modified on Fri Dec 01 04:46:00 2023 by modify_doxy.py rev. 669887