clang API Documentation
Common components of both fprintf and fscanf format strings. More...
Classes | |
class | OptionalFlag |
class | LengthModifier |
Represents the length modifier in a format string in scanf/printf. More... | |
class | ConversionSpecifier |
class | ArgType |
class | OptionalAmount |
class | FormatSpecifier |
class | FormatStringHandler |
class | SpecifierResult |
Enumerations | |
enum | PositionContext { FieldWidthPos = 0, PrecisionPos = 1 } |
Functions | |
bool | ParsePrintfString (FormatStringHandler &H, const char *beg, const char *end, const LangOptions &LO, const TargetInfo &Target) |
bool | ParseFormatStringHasSArg (const char *beg, const char *end, const LangOptions &LO, const TargetInfo &Target) |
bool | ParseScanfString (FormatStringHandler &H, const char *beg, const char *end, const LangOptions &LO, const TargetInfo &Target) |
OptionalAmount | ParseAmount (const char *&Beg, const char *E) |
OptionalAmount | ParseNonPositionAmount (const char *&Beg, const char *E, unsigned &argIndex) |
OptionalAmount | ParsePositionAmount (FormatStringHandler &H, const char *Start, const char *&Beg, const char *E, PositionContext p) |
bool | ParseFieldWidth (FormatStringHandler &H, FormatSpecifier &CS, const char *Start, const char *&Beg, const char *E, unsigned *argIndex) |
bool | ParseArgPosition (FormatStringHandler &H, FormatSpecifier &CS, const char *Start, const char *&Beg, const char *E) |
bool | ParseLengthModifier (FormatSpecifier &FS, const char *&Beg, const char *E, const LangOptions &LO, bool IsScanf=false) |
Common components of both fprintf and fscanf format strings.
Definition at line 595 of file FormatString.h.
OptionalAmount clang::analyze_format_string::ParseAmount | ( | const char *& | Beg, |
const char * | E | ||
) |
Definition at line 37 of file FormatString.cpp.
Referenced by ParseArgPosition(), ParseNonPositionAmount(), ParsePositionAmount(), and ParseScanfSpecifier().
bool clang::analyze_format_string::ParseArgPosition | ( | FormatStringHandler & | H, |
FormatSpecifier & | CS, | ||
const char * | Start, | ||
const char *& | Beg, | ||
const char * | E | ||
) |
Definition at line 144 of file FormatString.cpp.
References clang::analyze_format_string::OptionalAmount::getConstantAmount(), clang::analyze_format_string::OptionalAmount::getHowSpecified(), clang::analyze_format_string::FormatStringHandler::HandleIncompleteSpecifier(), clang::analyze_format_string::FormatStringHandler::HandlePosition(), clang::analyze_format_string::FormatStringHandler::HandleZeroPosition(), ParseAmount(), clang::analyze_format_string::FormatSpecifier::setArgIndex(), and clang::analyze_format_string::FormatSpecifier::setUsesPositionalArg().
Referenced by ParsePrintfSpecifier(), and ParseScanfSpecifier().
bool clang::analyze_format_string::ParseFieldWidth | ( | FormatStringHandler & | H, |
FormatSpecifier & | CS, | ||
const char * | Start, | ||
const char *& | Beg, | ||
const char * | E, | ||
unsigned * | argIndex | ||
) |
Definition at line 122 of file FormatString.cpp.
References FieldWidthPos, clang::analyze_format_string::OptionalAmount::isInvalid(), ParseNonPositionAmount(), ParsePositionAmount(), and clang::analyze_format_string::FormatSpecifier::setFieldWidth().
Referenced by ParsePrintfSpecifier().
bool clang::analyze_format_string::ParseFormatStringHasSArg | ( | const char * | beg, |
const char * | end, | ||
const LangOptions & | LO, | ||
const TargetInfo & | Target | ||
) |
Definition at line 268 of file PrintfFormatString.cpp.
References clang::analyze_printf::PrintfSpecifier::getConversionSpecifier(), clang::analyze_format_string::ConversionSpecifier::getKind(), clang::analyze_format_string::SpecifierResult< T >::getValue(), clang::analyze_format_string::SpecifierResult< T >::hasValue(), ParsePrintfSpecifier(), and clang::analyze_format_string::SpecifierResult< T >::shouldStop().
Referenced by clang::Sema::FormatStringHasSArg().
bool clang::analyze_format_string::ParseLengthModifier | ( | FormatSpecifier & | FS, |
const char *& | Beg, | ||
const char * | E, | ||
const LangOptions & | LO, | ||
bool | IsScanf = false |
||
) |
Returns true if a LengthModifier was parsed and installed in the FormatSpecifier& argument, and false otherwise.
Definition at line 181 of file FormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::setLengthModifier().
Referenced by ParsePrintfSpecifier(), and ParseScanfSpecifier().
OptionalAmount clang::analyze_format_string::ParseNonPositionAmount | ( | const char *& | Beg, |
const char * | E, | ||
unsigned & | argIndex | ||
) |
Definition at line 63 of file FormatString.cpp.
References ParseAmount().
Referenced by ParseFieldWidth(), and ParsePrecision().
OptionalAmount clang::analyze_format_string::ParsePositionAmount | ( | FormatStringHandler & | H, |
const char * | Start, | ||
const char *& | Beg, | ||
const char * | E, | ||
PositionContext | p | ||
) |
Definition at line 75 of file FormatString.cpp.
References clang::analyze_format_string::OptionalAmount::getConstantAmount(), clang::analyze_format_string::OptionalAmount::getHowSpecified(), clang::analyze_format_string::FormatStringHandler::HandleIncompleteSpecifier(), clang::analyze_format_string::FormatStringHandler::HandleInvalidPosition(), clang::analyze_format_string::FormatStringHandler::HandleZeroPosition(), and ParseAmount().
Referenced by ParseFieldWidth(), and ParsePrecision().
bool clang::analyze_format_string::ParsePrintfString | ( | FormatStringHandler & | H, |
const char * | beg, | ||
const char * | end, | ||
const LangOptions & | LO, | ||
const TargetInfo & | Target | ||
) |
Definition at line 239 of file PrintfFormatString.cpp.
References clang::analyze_format_string::SpecifierResult< T >::getStart(), clang::analyze_format_string::SpecifierResult< T >::getValue(), clang::analyze_format_string::FormatStringHandler::HandlePrintfSpecifier(), clang::analyze_format_string::SpecifierResult< T >::hasValue(), ParsePrintfSpecifier(), and clang::analyze_format_string::SpecifierResult< T >::shouldStop().
Referenced by clang::Sema::CheckFormatString().
bool clang::analyze_format_string::ParseScanfString | ( | FormatStringHandler & | H, |
const char * | beg, | ||
const char * | end, | ||
const LangOptions & | LO, | ||
const TargetInfo & | Target | ||
) |
Definition at line 525 of file ScanfFormatString.cpp.
References clang::analyze_format_string::SpecifierResult< T >::getStart(), clang::analyze_format_string::SpecifierResult< T >::getValue(), clang::analyze_format_string::FormatStringHandler::HandleScanfSpecifier(), clang::analyze_format_string::SpecifierResult< T >::hasValue(), ParseScanfSpecifier(), and clang::analyze_format_string::SpecifierResult< T >::shouldStop().
Referenced by clang::Sema::CheckFormatString().