本文整理汇总了C++中SourceLocation::getLineNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceLocation::getLineNumber方法的具体用法?C++ SourceLocation::getLineNumber怎么用?C++ SourceLocation::getLineNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceLocation
的用法示例。
在下文中一共展示了SourceLocation::getLineNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool SourceLocation::operator< (const SourceLocation& other) const {
if (fileName < other.fileName)
return true;
if (fileName > other.fileName)
return false;
return (getLineNumber() < other.getLineNumber());
}
示例2: setEnd
/**
* Construct an IF instructon instance.
*
* @param _condition The condition expression to evaluate.
* @param thenToken The token for the terminating THEN keyword.
* This is where we mark the end of the
* instruction.
*/
RexxInstructionIf::RexxInstructionIf(RexxInternalObject *_condition, RexxToken *thenToken)
{
condition = _condition;
//get the location from the THEN token and use its location to set
// the end of the instruction. Note that the THEN is traced on its
// own, but using the start of the THEN gives a fuller picture of things.
SourceLocation location = thenToken->getLocation();
setEnd(location.getLineNumber(), location.getOffset());
}