当前位置: 首页>>代码示例>>C++>>正文


C++ SgLocatedNode::get_startOfConstruct方法代码示例

本文整理汇总了C++中SgLocatedNode::get_startOfConstruct方法的典型用法代码示例。如果您正苦于以下问题:C++ SgLocatedNode::get_startOfConstruct方法的具体用法?C++ SgLocatedNode::get_startOfConstruct怎么用?C++ SgLocatedNode::get_startOfConstruct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SgLocatedNode的用法示例。


在下文中一共展示了SgLocatedNode::get_startOfConstruct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: isSgLocatedNode

// This function is not requied since the base class function is available and is preferred (for conformity).
std::string
CompassAnalyses::FunctionDefinitionPrototype::CheckerOutput::getString() const
{
     ROSE_ASSERT(getNodeArray().size() <= 1);

  // Default implementation for getString
     SgLocatedNode* locatedNode = isSgLocatedNode(getNode());
     std::string sourceCodeLocation;
     if (locatedNode != NULL)
        {
          Sg_File_Info* start = locatedNode->get_startOfConstruct();
          Sg_File_Info* end   = locatedNode->get_endOfConstruct();
          sourceCodeLocation = (end ? Compass::formatStandardSourcePosition(start, end) 
                                    : Compass::formatStandardSourcePosition(start));
       }
      else
       {
      // Else this could be a SgInitializedName or SgTemplateArgument (not yet moved to be a SgLocatedNode)
         Sg_File_Info* start = getNode()->get_file_info();
         ROSE_ASSERT(start != NULL);
         sourceCodeLocation = Compass::formatStandardSourcePosition(start);
       }

     std::string nodeName = getNode()->class_name();

  // The short description used here needs to be put into a separate function (can this be part of what is filled in by the script?)
  // return loc + ": " + nodeName + ": variable requiring static constructor initialization";

     return m_checkerName + ": " + sourceCodeLocation + ": " + nodeName + ": " + m_shortDescription + ".\n\"" + what + "\" does not have a prototype";
} //CompassAnalyses::FunctionDefinitionPrototype::CheckerOutput::getString()
开发者ID:8l,项目名称:rose,代码行数:31,代码来源:functionDefinitionPrototype.C

示例2: preOrderVisit

 // Start marking nodes as frontend-specific once we enter an AST that's frontend-specific.
 void preOrderVisit(SgNode *node) {
     SgLocatedNode *located = isSgLocatedNode(node);
     if (located) {
         bool in_fes_ast = fes_ast!=NULL ||
                           is_frontend_specific(located->get_file_info()) ||
                           is_frontend_specific(located->generateMatchingFileInfo()) ||
                           is_frontend_specific(located->get_startOfConstruct()) ||
                           is_frontend_specific(located->get_endOfConstruct());
         if (in_fes_ast) {
             if (!fes_ast)
                 fes_ast = node;
             fix(located, located->get_file_info());
             fix(located, located->generateMatchingFileInfo());
             fix(located, located->get_startOfConstruct());
             fix(located, located->get_endOfConstruct());
         }
     }
 }
开发者ID:faizur,项目名称:edg4x-rose,代码行数:19,代码来源:checkIsFrontendSpecificFlag.C

示例3: visit

 void visit(SgNode *node) {
     SgLocatedNode *located = isSgLocatedNode(node);
     if (located) {
         fix(located, located->get_file_info());
         fix(located, located->generateMatchingFileInfo());
         fix(located, located->get_startOfConstruct());
         fix(located, located->get_endOfConstruct());
     }
 }
开发者ID:peihunglin,项目名称:CFD-ROSE,代码行数:9,代码来源:checkIsCompilerGeneratedFlag.C

示例4: isSgLocatedNode

std::string
Compass::OutputViolationBase::getString() const
{
  ROSE_ASSERT(getNodeArray().size() <= 1);

  // Default implementation for getString
  SgLocatedNode* locatedNode = isSgLocatedNode(getNode());
  std::string sourceCodeLocation;
  if (locatedNode != NULL)
    {
      Sg_File_Info* start = locatedNode->get_startOfConstruct();
      Sg_File_Info* end   = locatedNode->get_endOfConstruct();
      sourceCodeLocation = (end ? Compass::formatStandardSourcePosition(start, end) 
			    : Compass::formatStandardSourcePosition(start));
    }
  else
    {
      // Else this could be a SgInitializedName or SgTemplateArgument (not yet moved to be a SgLocatedNode)
      if (getNode()) {
  //      std::cerr << "Node : " << getNode()->class_name() << std::endl;
        Sg_File_Info* start = getNode()->get_file_info();
      // tps : 22Jan 2009 - commented the following out because it does not work with binaries
      //ROSE_ASSERT(start != NULL);
        if (start)
	  sourceCodeLocation = Compass::formatStandardSourcePosition(start);
      }
    }

  // tps Jan 23 2009: getNode() can be NULL because it could be a binary node
  // added a test for this
  std::string nodeName = "unknown";
	if (getNode())
            getNode()->class_name();

  // The short description used here needs to be put into a separate function (can this be part of what is filled in by the script?)
  // return loc + ": " + nodeName + ": variable requiring static constructor initialization";

  // return m_checkerName + ": " + sourceCodeLocation + ": " + nodeName + ": " + m_shortDescription;
  return m_checkerName + ": " + sourceCodeLocation + ": " + m_shortDescription;
}
开发者ID:OpenFortranProject,项目名称:ftt-research,代码行数:40,代码来源:compass.C

示例5: isSgLocatedNode

static std::string
sourcePositionInformation (SgNode* node)
   {
  // DQ (8/31/2013): Adding source position information for DOT output.
     string ss;

     SgLocatedNode* locatedNode = isSgLocatedNode(node);
     if (locatedNode != NULL)
        {
          Sg_File_Info* fileInfo = locatedNode->get_file_info();
          if (fileInfo != NULL)
             {
               bool hasSpecialMode = false;
               if (fileInfo->isCompilerGenerated() == true)
                  {
                    ss += "compiler generated\\n";
                    hasSpecialMode = true;
                  }
                 else
                  {
                    if (fileInfo->isFrontendSpecific() == true)
                       {
                         ss += "front-end specific\\n";
                         hasSpecialMode = true;
                       }
                      else
                       {
                         if (fileInfo->isTransformation() == true)
                            {
                              ss += "is part of transformation\\n";
                              hasSpecialMode = true;
                            }
                           else
                            {
                           // ss += "???\\n";
                            }
                       }
                  }

               if (hasSpecialMode == true)
                  {
                    if (fileInfo->isOutputInCodeGeneration() == true)
                       {
                         ss += "IS output in generated code\\n";
                       }
                      else
                       {
                         ss += "is NOT output in generated code\\n";
                       }
                  }
                 else
                  {
                 // DQ (9/1/2013): Name a few cases were we want to output the end of the IR node construct's source position range.
                 // bool outputEndOfConstruct = (isSgAggregateInitializer(node) != NULL || isSgScopeStatement(node) != NULL);
                    bool outputEndOfConstruct = true; // (isSgAggregateInitializer(node) != NULL || isSgStatement(node) != NULL);

                    if (outputEndOfConstruct == true)
                       {
                      // Output the end of the range represented by the IR node's source position.
                         ss += generateFileLineColumnString(locatedNode->get_startOfConstruct());
                         ss += generateFileLineColumnString(locatedNode->get_endOfConstruct());
                       }
                      else
                       {
                      // For an SgStatement this is the startOfConstruct, but for an SgExpression this is the operator position (or sometimes equal to the startOfConstruct).
                         ss += generateFileLineColumnString(fileInfo);
                       }
                  }
             }
            else
             {
               ss += "no source position available\\n";
             }
        }
       else
        {
       // DQ (9/1/2013): We could handle the source position of some other IR nodes (e.g. output name of the file for SgFile).
          SgFile* file = isSgFile(node);
          if (file != NULL)
             {
               ROSE_ASSERT(file->get_file_info() != NULL);
               ss += generateFileLineColumnString(file->get_file_info());
             }
        }

     return ss;
   }
开发者ID:lvpw,项目名称:edg4x-rose,代码行数:87,代码来源:AstDOTGeneration.C


注:本文中的SgLocatedNode::get_startOfConstruct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。