HPCToolkit
PGMDocHandler.cpp
Go to the documentation of this file.
1 // -*-Mode: C++;-*-
2 
3 // * BeginRiceCopyright *****************************************************
4 //
5 // $HeadURL$
6 // $Id$
7 //
8 // --------------------------------------------------------------------------
9 // Part of HPCToolkit (hpctoolkit.org)
10 //
11 // Information about sources of support for research and development of
12 // HPCToolkit is at 'hpctoolkit.org' and in 'README.Acknowledgments'.
13 // --------------------------------------------------------------------------
14 //
15 // Copyright ((c)) 2002-2019, Rice University
16 // All rights reserved.
17 //
18 // Redistribution and use in source and binary forms, with or without
19 // modification, are permitted provided that the following conditions are
20 // met:
21 //
22 // * Redistributions of source code must retain the above copyright
23 // notice, this list of conditions and the following disclaimer.
24 //
25 // * Redistributions in binary form must reproduce the above copyright
26 // notice, this list of conditions and the following disclaimer in the
27 // documentation and/or other materials provided with the distribution.
28 //
29 // * Neither the name of Rice University (RICE) nor the names of its
30 // contributors may be used to endorse or promote products derived from
31 // this software without specific prior written permission.
32 //
33 // This software is provided by RICE and contributors "as is" and any
34 // express or implied warranties, including, but not limited to, the
35 // implied warranties of merchantability and fitness for a particular
36 // purpose are disclaimed. In no event shall RICE or contributors be
37 // liable for any direct, indirect, incidental, special, exemplary, or
38 // consequential damages (including, but not limited to, procurement of
39 // substitute goods or services; loss of use, data, or profits; or
40 // business interruption) however caused and on any theory of liability,
41 // whether in contract, strict liability, or tort (including negligence
42 // or otherwise) arising in any way out of the use of this software, even
43 // if advised of the possibility of such damage.
44 //
45 // ******************************************************* EndRiceCopyright *
46 
47 //***************************************************************************
48 //
49 // File:
50 // $HeadURL$
51 //
52 // Purpose:
53 // XML adaptor for the program structure file (PGM)
54 //
55 // Description:
56 // [The set of functions, macros, etc. defined in the file]
57 //
58 //***************************************************************************
59 
60 //************************ System Include Files ******************************
61 
62 #include <stdlib.h>
63 
64 #include <iostream>
65 using std::cerr;
66 using std::endl;
67 
68 #include <string>
69 using std::string;
70 
71 #include <typeinfo>
72 
73 //************************ Xerces Include Files ******************************
74 
75 #include <xercesc/sax/ErrorHandler.hpp>
76 
77 #include <xercesc/util/XMLString.hpp>
78 using XERCES_CPP_NAMESPACE::XMLString;
79 
80 //************************* User Include Files *******************************
81 
82 #include "PGMDocHandler.hpp"
83 #include "XercesSAX2.hpp"
84 #include "XercesUtil.hpp"
85 #include "XercesErrorHandler.hpp"
86 
87 #include <lib/prof/Struct-Tree.hpp>
88 using namespace Prof;
89 
91 #include <lib/support/SrcFile.hpp>
92 using SrcFile::ln_NULL;
93 #include <lib/support/StrUtil.hpp>
94 #include <lib/support/Trace.hpp>
95 
96 //************************ Forward Declarations ******************************
97 
98 #define DBG 0
99 
100 //****************************************************************************
101 
102 // General parsing notes:
103 // - We assume a more restricted input than the PGM specification
104 // allows. For example, a Proc must always have a File parent.
105 //
106 //
107 // Group Implementation notes.
108 //
109 // The goal is to obtain a structure tree, including groups, that can be
110 // traversed by the PROFILE handler, which finds the appropriate location
111 // in the scope tree by examining load module, file, procedure and line
112 // maps. Thus, given a LM, F, P and S/LINE, we must be able to locate
113 // and annotate the statements in partitioning defined by the groups.
114 //
115 // While processing the group file, we maintain/build the standard scope
116 // tree in addition to creating leaf Group nodes (even if the it will not
117 // eventually be a leaf) in appropriate places. When a Group scope is
118 // closed, we fill in Group subtrees by creating shadow copies of the
119 // corresponding non-leaf children of the Group. The leaf children are
120 // transported to become children of the shadow nodes.
121 //
122 // This scheme allows the shadow and transported nodes to be found using
123 // the standard maps when processing the PROFILE file. The grouped
124 // shadow copies will recive aggregate metric data and the original
125 // versions of these nodes will be eliminated when the tree is pruned.
126 //
127 // Algorithm:
128 //
129 // - Maintain a stack of [scope, shadow-scope] pairs
130 // - Maintain a counter of group nesting
131 //
132 // 1. Move down the tree and process it as we process PGM nodes, creating
133 // a stack of nodes.
134 //
135 // - if tree is empty it will be populated as if it were a structure
136 // file (mostly). IOW, a LM, F or P that is a child of a group will
137 // be added to the tree as if it were _not_ (shadow nodes will be
138 // created when the group scope is closed). We get this behavior
139 // by default because Struct::TreeInterface maintains LM/F/P cursors and
140 // igores the group.
141 //
142 // The exception is that unlike LM, F and P, L and S will be added
143 // as children of G; neither have names that the node retriever can
144 // use. However, they will be correctly annotated with profile info
145 // because of the line map in a P.
146 //
147 // - When a G node is seen, add it to the current enclosing scope
148 // and increment group nesting counter
149 //
150 // 2. When a non-group-leaf or leaf node is closed within a group context:
151 // a. Find enclosing GROUP node g (excluding the top of the stack)
152 // b. For each node between g (excluding g) to the node before
153 // top-of-stack, create a shadow node
154 // c. Make the top node a child of the most recent shadow node
155 //
156 // Example:
157 //
158 // structure file:
159 // PGM
160 // LM
161 // V1
162 // F1
163 // P1
164 // P2
165 // F2
166 //
167 // group file:
168 // PGM
169 // G1
170 // LM
171 // G2
172 // F1
173 // P1
174 //
175 // A. Structure file has been processed. After processing Group file
176 // down to P1 (completion of step 1)
177 //
178 // scope tree: stack:
179 // PGM PGM
180 // G1 <- new G1
181 // LM LM
182 // G2 <- new G2 <=
183 // F1 F1
184 // P1 P1 <- top
185 // P2
186 // F2
187 //
188 // B. After processing from G2 to P1 on stack (completion of step 2)
189 //
190 // scope tree:
191 // PGM
192 // G1
193 // LM
194 // G2
195 // F1' <- shadow
196 // P1 <- moved
197 // F1 <- retains map pointer to P1
198 // P2
199 // F2
200 //
201 
202 //****************************************************************************
203 
204 
206  Struct::Tree* structure,
208  : m_docty(ty),
209  m_args(args),
210  m_structure(structure),
211 
212  // element names
213  elemStructure(XMLString::transcode("HPCToolkitStructure")),
214  elemLM(XMLString::transcode("LM")),
215  elemVariable(XMLString::transcode("V")),
216  elemFile(XMLString::transcode("F")),
217  elemProc(XMLString::transcode("P")),
218  elemAlien(XMLString::transcode("A")),
219  elemLoop(XMLString::transcode("L")),
220  elemStmt(XMLString::transcode("S")),
221  elemGroup(XMLString::transcode("G")),
222 
223  // attribute names
224  attrVer(XMLString::transcode("version")),
225  attrId(XMLString::transcode("i")),
226  attrName(XMLString::transcode("n")),
227  attrFile(XMLString::transcode("f")),
228  attrLnName(XMLString::transcode("ln")),
229  attrLine(XMLString::transcode("l")),
230  attrVMA(XMLString::transcode("v"))
231 {
232  m_version = -1;
233 
234  m_curRoot = NULL;
235  m_curLM = NULL;
236  m_curFile = NULL;
237  m_curProc = NULL;
238 
239  groupNestingLvl = 0;
240 }
241 
242 
244 {
245  // element names
246  XMLString::release((XMLCh**)&elemStructure);
247  XMLString::release((XMLCh**)&elemLM);
248  XMLString::release((XMLCh**)&elemVariable);
249  XMLString::release((XMLCh**)&elemFile);
250  XMLString::release((XMLCh**)&elemProc);
251  XMLString::release((XMLCh**)&elemAlien);
252  XMLString::release((XMLCh**)&elemLoop);
253  XMLString::release((XMLCh**)&elemStmt);
254  XMLString::release((XMLCh**)&elemGroup);
255 
256  // attribute names
257  XMLString::release((XMLCh**)&attrVer);
258  XMLString::release((XMLCh**)&attrId);
259  XMLString::release((XMLCh**)&attrName);
260  XMLString::release((XMLCh**)&attrFile);
261  XMLString::release((XMLCh**)&attrLnName);
262  XMLString::release((XMLCh**)&attrLine);
263  XMLString::release((XMLCh**)&attrVMA);
264 
265  DIAG_AssertWarn(scopeStack.Depth() == 0, "Invalid state reading HPCStructure.");
266 }
267 
268 
269 void
271  const XMLCh* const name,
272  const XMLCh* const GCC_ATTR_UNUSED qname,
273  const XERCES_CPP_NAMESPACE::Attributes& attributes)
274 {
275  Struct::ANode* curStrct = NULL;
276 
277  // Structure
278  if (XMLString::equals(name, elemStructure)) {
279  string verStr = getAttr(attributes, attrVer);
280  double ver = StrUtil::toDbl(verStr);
281 
282  m_version = ver;
283  if (m_version < 4.5) {
284  PGM_Throw("Found file format version " << m_version << ": This format is outdated; please regenerate the file.");
285  }
286 
288  DIAG_DevMsgIf(DBG, "PGMDocHandler: " << m_curRoot->toStringMe());
289 
290  curStrct = m_curRoot;
291  }
292 
293  // Load Module
294  else if (XMLString::equals(name, elemLM)) {
295  string nm = getAttr(attributes, attrName); // must exist
296  DIAG_Assert(m_curRoot && !m_curLM, "Parse error!");
297 
298  nm = m_args.realpath(nm);
300  DIAG_DevMsgIf(DBG, "PGMDocHandler: " << m_curLM->toStringMe());
301 
302  m_curFile = NULL;
303  m_curProc = NULL;
304 
305  curStrct = m_curLM;
306  }
307 
308  // File
309  else if (XMLString::equals(name, elemFile)) {
310  string nm = getAttr(attributes, attrName);
311  DIAG_Assert(m_curLM && !m_curFile, "Parse error!");
312 
313  nm = m_args.realpath(nm);
314  m_curFile = Struct::File::demand(m_curLM, nm);
315  DIAG_DevMsgIf(DBG, "PGMDocHandler: " << m_curFile->toStringMe());
316 
317  m_curProc = NULL;
318 
319  curStrct = m_curFile;
320  }
321 
322  // Variable
323  else if (XMLString::equals(name, elemVariable)) {
324  string nm = getAttr(attributes, attrName);
325  string id = getAttr(attributes, attrId); // ID: must exist
326  string vma = getAttr(attributes, attrVMA);
327  string lnm = getAttr(attributes, attrLnName); // optional
328 
329  SrcFile::ln begLn, endLn;
330  getLineAttr(begLn, endLn, attributes);
331 
332  Prof::Struct::Proc* variable = new Struct::Proc(nm, m_curFile, lnm, false, begLn, endLn);
333  variable->m_origId = atoi(id.c_str());
334 
335  if (!vma.empty()) {
336  variable->vmaSet().fromString(vma.c_str());
337  }
339 
340  curStrct = variable;
341  }
342 
343  // Proc
344  else if (XMLString::equals(name, elemProc)) {
345  string nm = getAttr(attributes, attrName); // must exist
346  string lnm = getAttr(attributes, attrLnName); // optional
347  string id = getAttr(attributes, attrId); // ID: must exist
348 
349  SrcFile::ln begLn, endLn;
350  getLineAttr(begLn, endLn, attributes);
351 
352  string vma = getAttr(attributes, attrVMA);
353  string node_id = getAttr(attributes, attrId);
354 
355  DIAG_Assert(m_curLM && m_curFile && !m_curProc, "Parse error: Support for nested procedures is disabled (cf. buildLMSkeleton())!");
356 
357  // -----------------------------------------------------
358  // Find/Create the procedure.
359  // -----------------------------------------------------
360 
361  //m_curProc = Struct::Proc::demand(m_curFile, procnm, line);
362 
364  if (m_curProc) {
365  // STRUCTURE files usually have qualifying VMA information.
366  // Assume that VMA information fully qualifies procedures.
367  if (m_docty == Doc_STRUCT
368  && !m_curProc->vmaSet().empty() && !vma.empty()) {
369  m_curProc = NULL;
370  }
371  }
372 
373  if (!m_curProc) {
374  m_curProc = new Struct::Proc(nm, m_curFile, lnm, false, begLn, endLn);
375  if (!vma.empty()) {
376  m_curProc->vmaSet().fromString(vma.c_str());
377  }
378  m_curProc->m_origId = atoi(node_id.c_str());
379  }
380  else {
381  if (m_docty == Doc_STRUCT) {
382  // If a proc with the same name already exists, print a warning.
383  DIAG_Msg(0, "Warning: Found procedure '" << nm << "' multiple times within file '" << m_curFile->name() << "'; information for this procedure will be aggregated. If you do not want this, edit the STRUCTURE file and adjust the names by hand.");
384  }
385  }
386 
387  DIAG_DevMsgIf(DBG, "PGMDocHandler: " << m_curProc->toStringMe());
388 
389  curStrct = m_curProc;
391  }
392 
393  // Alien
394  else if (XMLString::equals(name, elemAlien)) {
395  int numAttr = attributes.getLength();
396  DIAG_Assert(0 <= numAttr && numAttr <= 6, DIAG_UnexpectedInput);
397 
398  string nm = getAttr(attributes, attrName);
399  string ln = getAttr(attributes, attrLnName);
400  string fnm = getAttr(attributes, attrFile);
401  fnm = m_args.realpath(fnm);
402 
403  SrcFile::ln begLn, endLn;
404  getLineAttr(begLn, endLn, attributes);
405 
406  Struct::ACodeNode* parent = dynamic_cast<Struct::ACodeNode*>(getCurrentScope());
407  Struct::Alien* alien = new Struct::Alien(parent, fnm, nm, nm, begLn, endLn);
408  alien->proc( idToProcMap[ln] );
409 
410  string node_id = getAttr(attributes, attrId);
411  alien->m_origId = atoi(node_id.c_str());
412 
413  DIAG_DevMsgIf(DBG, "PGMDocHandler: " << alien->toStringMe());
414 
415  curStrct = alien;
416  }
417 
418  // Loop
419  else if (XMLString::equals(name, elemLoop)) {
420  DIAG_Assert(scopeStack.Depth() >= 3, ""); // at least has Proc, File, LM
421 
422  // both 'begin' and 'end' are implied (and can be in any order)
423  int numAttr = attributes.getLength();
424  DIAG_Assert(0 <= numAttr && numAttr <= 5, DIAG_UnexpectedInput);
425 
426  SrcFile::ln begLn, endLn;
427  getLineAttr(begLn, endLn, attributes);
428 
429  string fnm = getAttr(attributes, attrFile);
430  fnm = m_args.realpath(fnm);
431 
432  // by now the file and function names should have been found
433  Struct::ACodeNode* parent = dynamic_cast<Struct::ACodeNode*>(getCurrentScope());
434  Struct::ACodeNode* loopNode = new Struct::Loop(parent, fnm, begLn, endLn);
435 
436  string node_id = getAttr(attributes, attrId);
437  loopNode->m_origId = atoi(node_id.c_str());
438 
439  DIAG_DevMsgIf(DBG, "PGMDocHandler: " << loopNode->toStringMe());
440 
441  curStrct = loopNode;
442  }
443 
444  // Stmt
445  else if (XMLString::equals(name, elemStmt)) {
446  int numAttr = attributes.getLength();
447 
448  // 'begin' is required but 'end' is implied (and can be in any order)
449  DIAG_Assert(1 <= numAttr && numAttr <= 4, DIAG_UnexpectedInput);
450 
451  SrcFile::ln begLn, endLn;
452  getLineAttr(begLn, endLn, attributes);
453 
454  // for now insist that line range include one line (since we don't nest S)
455  DIAG_Assert(begLn == endLn, "S line range [" << begLn << ", " << endLn << "]");
456 
457  string vma = getAttr(attributes, attrVMA);
458 
459  // by now the file and function names should have been found
460  Struct::ACodeNode* parent = dynamic_cast<Struct::ACodeNode*>(getCurrentScope());
461  DIAG_Assert(m_curProc != NULL, "");
462 
463  Struct::Stmt* stmtNode = new Struct::Stmt(parent, begLn, endLn);
464  if (!vma.empty()) {
465  stmtNode->vmaSet().fromString(vma.c_str());
466  }
467  string node_id = getAttr(attributes, attrId);
468  stmtNode->m_origId = atoi(node_id.c_str());
469 
470  DIAG_DevMsgIf(DBG, "PGMDocHandler: " << stmtNode->toStringMe());
471 
472  curStrct = stmtNode;
473  }
474 
475  // Group
476  else if (XMLString::equals(name, elemGroup)) {
477  string grpnm = getAttr(attributes, attrName); // must exist
478  DIAG_Assert(!grpnm.empty(), "");
479 
480  Struct::ANode* parent = getCurrentScope(); // enclosing scope
481  Struct::Group* grpStrct
482  = Prof::Struct::Group::demand(m_curRoot, grpnm, parent);
483  DIAG_DevMsgIf(DBG, "PGMDocHandler: " << grpStrct->toStringMe());
484 
485  groupNestingLvl++;
486  curStrct = grpStrct;
487  }
488 
489 
490  // -----------------------------------------------------------------
491  //
492  // -----------------------------------------------------------------
493 
494  // The current top of the stack must be a non-leaf. Since we are
495  // using SAX parsing, we don't know this until now.
496  StackEntry_t* entry = getStackEntry(0);
497  if (entry) {
498  entry->SetLeaf(false);
499  }
500 
501  pushCurrentScope(curStrct);
502 }
503 
504 
505 void
507  const XMLCh* const name,
508  const XMLCh* const GCC_ATTR_UNUSED qname)
509 {
510 
511  // Structure
512  if (XMLString::equals(name, elemStructure)) {
513  m_curRoot = NULL;
514  }
515 
516  // Load Module
517  else if (XMLString::equals(name, elemLM)) {
518  DIAG_Assert(scopeStack.Depth() >= 1, "");
520  m_curLM = NULL;
521  }
522 
523  // File
524  else if (XMLString::equals(name, elemFile)) {
525  DIAG_Assert(scopeStack.Depth() >= 2, ""); // at least has LM
527  m_curFile = NULL;
528  }
529 
530  // Proc
531  else if (XMLString::equals(name, elemProc)) {
532  DIAG_Assert(scopeStack.Depth() >= 3, ""); // at least has File, LM
534  m_curProc = NULL;
535  }
536 
537  // Alien
538  else if (XMLString::equals(name, elemAlien)) {
539  // stack depth should be at least 4
540  DIAG_Assert(scopeStack.Depth() >= 4, "");
542  }
543 
544  // Loop
545  else if (XMLString::equals(name, elemLoop)) {
546  // stack depth should be at least 4
547  DIAG_Assert(scopeStack.Depth() >= 4, "");
549  }
550 
551  // Stmt
552  else if (XMLString::equals(name, elemStmt)) {
554  }
555 
556  // Group
557  else if (XMLString::equals(name, elemGroup)) {
558  DIAG_Assert(scopeStack.Depth() >= 1, "");
559  DIAG_Assert(groupNestingLvl >= 1, "");
561  groupNestingLvl--;
562  }
563 
564  popCurrentScope();
565 }
566 
567 
568 void
570  const XERCES_CPP_NAMESPACE::Attributes& attributes)
571 {
572  begLn = ln_NULL;
573  endLn = ln_NULL;
574 
575  string begStr, endStr;
576 
577  // 1. Obtain string representation of begin and end line
578  string lineStr = getAttr(attributes, attrLine);
579  if (!lineStr.empty()) {
580  size_t dashpos = lineStr.find_first_of('-');
581  if (dashpos == std::string::npos) {
582  begStr = lineStr;
583  }
584  else {
585  begStr = lineStr.substr(0, dashpos);
586  endStr = lineStr.substr(dashpos+1);
587  }
588  }
589 
590  // 2. Parse begin and end line strings
591  if (!begStr.empty()) {
592  begLn = (SrcFile::ln)StrUtil::toLong(begStr);
593  }
594  if (!endStr.empty()) {
595  endLn = (SrcFile::ln)StrUtil::toLong(endStr);
596  }
597 
598  // 3. Sanity check
599  if (endLn == ln_NULL) {
600  endLn = begLn;
601  }
602 }
603 
604 
605 // ---------------------------------------------------------------------------
606 //
607 // ---------------------------------------------------------------------------
608 
609 const char*
611 {
612  switch (m_docty) {
613  case Doc_NULL: return "Document:NULL";
614  case Doc_STRUCT: return "Document:STRUCTURE";
615  case Doc_GROUP: return "Document:GROUP";
616  default: DIAG_Die("Invalid Doc_t!");
617  }
618 }
619 
620 
621 // ---------------------------------------------------------------------------
622 // SAX2 ErrorHandler interface
623 // ---------------------------------------------------------------------------
624 
625 void
626 PGMDocHandler::error(const SAXParseException& e)
627 {
628  XercesErrorHandler::report(cerr, "HPCStructure non-fatal error", ToString(m_docty), e);
629 }
630 
631 
632 void
633 PGMDocHandler::fatalError(const SAXParseException& e)
634 {
635  XercesErrorHandler::report(cerr, "HPCStructure fatal error", ToString(m_docty), e);
636  exit(1);
637 }
638 
639 
640 void
641 PGMDocHandler::warning(const SAXParseException& e)
642 {
643  XercesErrorHandler::report(cerr, "HPCStructure warning", ToString(m_docty), e);
644 }
645 
646 
647 // ---------------------------------------------------------------------------
648 //
649 // ---------------------------------------------------------------------------
650 
653 {
654  for (unsigned int i = 0; i < scopeStack.Depth(); ++i) {
655  Struct::ANode* s = getScope(i);
656  if (typeid(*s) == typeid(Struct::File)) {
657  return dynamic_cast<Struct::File*>(s);
658  }
659  }
660  return NULL;
661 }
662 
663 
664 uint
666 {
667  for (uint i = 1; i < scopeStack.Depth(); ++i) {
668  Struct::ANode* x = getScope(i);
669  if (typeid(*x) == typeid(Struct::Group)) {
670  return i + 1; // depth is index + 1
671  }
672  }
673  return 0;
674 }
675 
676 
677 // For processing the GROUP file
678 void
680 {
681  StackEntry_t* top = getStackEntry(0);
682 
683  // If the top of the stack is a non-group leaf node or a nested
684  // group node... (Note 'groupNestingLvl' has not been decremented yet)
685  if ( (groupNestingLvl >= 1 && top->IsNonGroupLeaf()) ||
686  (groupNestingLvl >= 2 && top->IsGroupScope()) ) {
687 
688  // 1. Find enclosing GROUP node g (excluding the top of the stack)
689  unsigned int enclGrpDepth = findEnclosingGroupScopeDepth();
690  DIAG_Assert(enclGrpDepth >= 2, ""); // must be found && not at top
691  unsigned int enclGrpIdx = enclGrpDepth - 1;
692 
693  // 2. For each node between g (excluding g) to the node before
694  // top-of-stack, create a shadow node
695  Struct::ANode* parentNode = getScope(enclGrpIdx);
696  for (unsigned int i = enclGrpIdx - 1; i >= 1; --i) {
697  StackEntry_t* entry = getStackEntry(i);
698  Struct::ANode* curNode = entry->getScope();
699  Struct::ANode* shadowNode = entry->GetShadow();
700  if (!shadowNode) {
701  shadowNode = curNode->clone();
702  shadowNode->link(parentNode);
703  entry->SetShadow(shadowNode);
704  }
705  parentNode = shadowNode;
706  }
707 
708  // 3. Make the top node a child of the most recent shadow node
709  Struct::ANode* topNode = getScope(0);
710  topNode->unlink();
711  topNode->link(parentNode);
712  }
713 }
714 
void getLineAttr(SrcFile::ln &begLn, SrcFile::ln &endLn, const XERCES_CPP_NAMESPACE::Attributes &attributes)
virtual ANode * clone()
void fatalError(const SAXParseException &e)
static void report(std::ostream &estream, const char *prefix, const char *fileType, const XERCES_CPP_NAMESPACE::SAXParseException &e, const char *alternateFile=0, int numPrefixLines=0)
virtual std::string realpath(const std::string &oldpath) const
unsigned int ln
Definition: SrcFile.hpp:66
double toDbl(const char *str, unsigned *endidx)
Definition: StrUtil.cpp:213
#define DBG
Prof::Struct::Proc * m_curProc
const XMLCh *const elemAlien
static const char * ToString(Doc_t docty)
unsigned groupNestingLvl
#define PGM_Throw(streamArgs)
long toLong(const char *str, unsigned *endidx)
Definition: StrUtil.cpp:165
const XMLCh *const elemFile
Prof::Struct::ANode * getScope(unsigned int idx)
void pushCurrentScope(Prof::Struct::ANode *scope)
void startElement(const XMLCh *const uri, const XMLCh *const name, const XMLCh *const qname, const XERCES_CPP_NAMESPACE::Attributes &attributes)
const XMLCh *const attrName
virtual const std::string & name() const
const XMLCh *const elemLoop
void endElement(const XMLCh *const uri, const XMLCh *const name, const XMLCh *const qname)
Prof::Struct::Root * m_curRoot
Root * root() const
void fromString(const char *formattedstr)
Prof::Struct::ANode * GetShadow() const
Proc * findProc(const char *name, const char *linkname=NULL) const
exit
Definition: names.cpp:1
PGMDocHandler(Doc_t ty, Prof::Struct::Tree *structure, DocHandlerArgs &args)
unsigned int uint
Definition: uint.h:124
void popCurrentScope()
void link(NonUniformDegreeTreeNode *parent)
void SetShadow(Prof::Struct::ANode *x)
Prof::Struct::Tree * m_structure
const XMLCh *const attrVMA
DocHandlerArgs & m_args
string getAttr(const Attributes &attributes, int i)
Definition: XercesUtil.cpp:102
void processGroupDocEndTag()
const XMLCh *const attrFile
const XMLCh *const elemVariable
const XMLCh *const elemProc
Prof::Struct::File * m_curFile
const VMAIntervalSet & vmaSet() const
unsigned int Depth()
void error(const SAXParseException &e)
const char * DIAG_UnexpectedInput
std::string toStringMe(uint oFlags=0, const char *pre="") const
#define DIAG_Msg(level,...)
Definition: diagnostics.h:241
const XMLCh *const elemStructure
StackEntry_t * getStackEntry(unsigned int idx)
static LM * demand(Root *pgm, const std::string &lm_fnm)
const XMLCh *const attrId
Prof::Struct::ANode * getScope() const
#define NULL
Definition: ElfHelper.cpp:85
const XMLCh *const elemStmt
std::map< std::string, Prof::Struct::Proc * > idToProcMap
const XMLCh *const elemGroup
#define DIAG_Die(...)
Definition: diagnostics.h:267
const XMLCh *const elemLM
#define GCC_ATTR_UNUSED
Definition: gcc-attr.h:80
static Group * demand(Root *pgm, const std::string &nm, ANode *parent)
void proc(Prof::Struct::Proc *proc)
unsigned int findEnclosingGroupScopeDepth()
const XMLCh *const attrVer
Prof::Struct::ANode * getCurrentScope()
void warning(const SAXParseException &e)
Prof::Struct::File * findCurrentFile()
Prof::Struct::LM * m_curLM
const ln ln_NULL
Definition: SrcFile.hpp:67
const XMLCh *const attrLnName
PointerStack scopeStack
const XMLCh *const attrLine