clang
7.0.0
|
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo correction. More...
#include "clang/Sema/TypoCorrection.h"
Public Member Functions | |
CorrectionCandidateCallback (IdentifierInfo *Typo=nullptr, NestedNameSpecifier *TypoNNS=nullptr) | |
virtual | ~CorrectionCandidateCallback ()=default |
virtual bool | ValidateCandidate (const TypoCorrection &candidate) |
Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance. More... | |
virtual unsigned | RankCandidate (const TypoCorrection &candidate) |
Method used by Sema::CorrectTypo to assign an "edit distance" rank to a candidate (where a lower value represents a better candidate), or returning InvalidDistance if the candidate is not at all viable. More... | |
void | setTypoName (IdentifierInfo *II) |
void | setTypoNNS (NestedNameSpecifier *NNS) |
Public Attributes | |
bool | WantTypeSpecifiers = true |
bool | WantExpressionKeywords = true |
bool | WantCXXNamedCasts = true |
bool | WantFunctionLikeCasts = true |
bool | WantRemainingKeywords = true |
bool | WantObjCSuper = false |
bool | IsObjCIvarLookup = false |
bool | IsAddressOfOperand = false |
Static Public Attributes | |
static const unsigned | InvalidDistance = TypoCorrection::InvalidDistance |
Protected Member Functions | |
bool | MatchesTypo (const TypoCorrection &candidate) |
Protected Attributes | |
IdentifierInfo * | Typo |
NestedNameSpecifier * | TypoNNS |
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo correction.
Definition at line 282 of file TypoCorrection.h.
|
inlineexplicit |
Definition at line 286 of file TypoCorrection.h.
|
virtualdefault |
|
inlineprotected |
Definition at line 334 of file TypoCorrection.h.
|
inlinevirtual |
Method used by Sema::CorrectTypo to assign an "edit distance" rank to a candidate (where a lower value represents a better candidate), or returning InvalidDistance if the candidate is not at all viable.
For validation callbacks that only need to determine if a candidate is viable, the default RankCandidate returns either 0 or InvalidDistance depending whether ValidateCandidate returns true or false.
Definition at line 310 of file TypoCorrection.h.
References clang::TypoCorrection::InvalidDistance.
Referenced by isCandidateViable().
|
inline |
Definition at line 316 of file TypoCorrection.h.
|
inline |
Definition at line 317 of file TypoCorrection.h.
|
virtual |
Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance.
This can be overridden by validators that only need to determine if a candidate is viable, without ranking potentially viable candidates. Only ValidateCandidate or RankCandidate need to be overridden by a callback wishing to check the viability of correction candidates. The default predicate always returns true if the candidate is not a type name or keyword, true for types if WantTypeSpecifiers is true, and true for keywords if WantTypeSpecifiers, WantExpressionKeywords, WantCXXNamedCasts, WantRemainingKeywords, or WantObjCSuper is true.
Reimplemented in clang::NoTypoCorrectionCCC, clang::FunctionCallFilterCCC, and clang::DeclFilterCCC< C >.
Definition at line 4936 of file SemaLookup.cpp.
References clang::TypoCorrection::isKeyword(), and clang::TypoCorrection::isResolved().
|
static |
Definition at line 284 of file TypoCorrection.h.
Definition at line 331 of file TypoCorrection.h.
Definition at line 330 of file TypoCorrection.h.
|
protected |
Definition at line 342 of file TypoCorrection.h.
|
protected |
Definition at line 343 of file TypoCorrection.h.
Definition at line 324 of file TypoCorrection.h.
Definition at line 323 of file TypoCorrection.h.
Referenced by AddKeywordsToConsumer().
Definition at line 325 of file TypoCorrection.h.
Referenced by clang::FunctionCallFilterCCC::FunctionCallFilterCCC().
Definition at line 327 of file TypoCorrection.h.
Referenced by AddKeywordsToConsumer().
Definition at line 326 of file TypoCorrection.h.
Referenced by clang::FunctionCallFilterCCC::FunctionCallFilterCCC().
Definition at line 322 of file TypoCorrection.h.
Referenced by AddKeywordsToConsumer(), and clang::FunctionCallFilterCCC::FunctionCallFilterCCC().