本文整理汇总了C++中SourceLocation::setEndOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceLocation::setEndOffset方法的具体用法?C++ SourceLocation::setEndOffset怎么用?C++ SourceLocation::setEndOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceLocation
的用法示例。
在下文中一共展示了SourceLocation::setEndOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new_array
RexxArray *RexxCode::getSource()
/******************************************************************************/
/* Function: Extract the source from a method from the source object as an */
/* array of strings. */
/******************************************************************************/
{
SourceLocation location; /* location information */
SourceLocation end_location; /* ending location */
RexxInstruction *current; /* current instruction */
if (this->start == OREF_NULL) /* empty method? */
return new_array((size_t)0); /* just return an empty array */
location = start->getLocation(); /* get its location info */
current = this->start; /* point to the beginning */
/* while not at the last one */
while (current->nextInstruction != OREF_NULL) {
current = current->nextInstruction;/* step to the next one */
}
end_location = current->getLocation(); /* get the end location */
/* copy over the ending position */
location.setEndLine(end_location.getEndLine());
location.setEndOffset(end_location.getEndOffset());
/* go extract the source array */
return this->source->extractSource(location);
}