clang
3.7.0
|
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo correction. More...
#include <TypoCorrection.h>
Public Member Functions | |
CorrectionCandidateCallback (IdentifierInfo *Typo=nullptr, NestedNameSpecifier *TypoNNS=nullptr) | |
virtual | ~CorrectionCandidateCallback () |
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. This can be overrided by validators that only need to determine if a candidate is viable, without ranking potentially viable candidates. Only ValidateCandidate or RankCandidate need to be overriden 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. 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. 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. More... | |
void | setTypoName (IdentifierInfo *II) |
void | setTypoNNS (NestedNameSpecifier *NNS) |
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 246 of file TypoCorrection.h.
|
inlineexplicit |
Definition at line 250 of file TypoCorrection.h.
|
inlinevirtual |
Definition at line 258 of file TypoCorrection.h.
|
inlineprotected |
Definition at line 302 of file TypoCorrection.h.
References clang::TypoCorrection::getCorrectionAsIdentifierInfo(), clang::TypoCorrection::getCorrectionSpecifier(), clang::TypoCorrection::isResolved(), clang::TypoCorrection::requiresImport(), Typo, and TypoNNS.
Referenced by RankCandidate().
|
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 278 of file TypoCorrection.h.
References InvalidDistance, MatchesTypo(), and ValidateCandidate().
Referenced by isCandidateViable().
|
inline |
Definition at line 284 of file TypoCorrection.h.
References Typo.
|
inline |
Definition at line 285 of file TypoCorrection.h.
References TypoNNS.
|
virtual |
Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance. This can be overrided by validators that only need to determine if a candidate is viable, without ranking potentially viable candidates. Only ValidateCandidate or RankCandidate need to be overriden 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 4561 of file SemaLookup.cpp.
References IsAddressOfOperand, clang::TypoCorrection::isKeyword(), clang::TypoCorrection::isResolved(), WantCXXNamedCasts, WantExpressionKeywords, WantObjCSuper, WantRemainingKeywords, and WantTypeSpecifiers.
Referenced by RankCandidate().
|
static |
Definition at line 248 of file TypoCorrection.h.
Referenced by RankCandidate().
bool clang::CorrectionCandidateCallback::IsAddressOfOperand |
Definition at line 299 of file TypoCorrection.h.
Referenced by ValidateCandidate().
bool clang::CorrectionCandidateCallback::IsObjCIvarLookup |
Definition at line 298 of file TypoCorrection.h.
|
protected |
Definition at line 310 of file TypoCorrection.h.
Referenced by MatchesTypo(), and setTypoName().
|
protected |
Definition at line 311 of file TypoCorrection.h.
Referenced by MatchesTypo(), and setTypoNNS().
bool clang::CorrectionCandidateCallback::WantCXXNamedCasts |
Definition at line 292 of file TypoCorrection.h.
Referenced by AddKeywordsToConsumer(), clang::NoTypoCorrectionCCC::NoTypoCorrectionCCC(), and ValidateCandidate().
bool clang::CorrectionCandidateCallback::WantExpressionKeywords |
Definition at line 291 of file TypoCorrection.h.
Referenced by AddKeywordsToConsumer(), clang::NoTypoCorrectionCCC::NoTypoCorrectionCCC(), and ValidateCandidate().
bool clang::CorrectionCandidateCallback::WantFunctionLikeCasts |
Definition at line 293 of file TypoCorrection.h.
Referenced by AddKeywordsToConsumer(), clang::FunctionCallFilterCCC::FunctionCallFilterCCC(), and clang::NoTypoCorrectionCCC::NoTypoCorrectionCCC().
bool clang::CorrectionCandidateCallback::WantObjCSuper |
Definition at line 295 of file TypoCorrection.h.
Referenced by AddKeywordsToConsumer(), and ValidateCandidate().
bool clang::CorrectionCandidateCallback::WantRemainingKeywords |
Definition at line 294 of file TypoCorrection.h.
Referenced by AddKeywordsToConsumer(), clang::FunctionCallFilterCCC::FunctionCallFilterCCC(), clang::NoTypoCorrectionCCC::NoTypoCorrectionCCC(), and ValidateCandidate().
bool clang::CorrectionCandidateCallback::WantTypeSpecifiers |
Definition at line 290 of file TypoCorrection.h.
Referenced by AddKeywordsToConsumer(), clang::FunctionCallFilterCCC::FunctionCallFilterCCC(), clang::NoTypoCorrectionCCC::NoTypoCorrectionCCC(), and ValidateCandidate().