Class containing some basic functions for simple tokenising of C++ code. More...
#include <juce_CPlusPlusCodeTokeniserFunctions.h>
Classes | |
struct | StringIterator |
A class that can be passed to the CppTokeniserFunctions functions in order to parse a String. More... | |
Static Public Member Functions | |
static String | addEscapeChars (const String &s) |
Takes a string and returns a version of it where standard C++ escape sequences have been used to replace any non-ascii bytes. More... | |
static bool | isDecimalDigit (const juce_wchar c) noexcept |
static bool | isHexDigit (const juce_wchar c) noexcept |
static bool | isIdentifierBody (const juce_wchar c) noexcept |
static bool | isIdentifierStart (const juce_wchar c) noexcept |
static bool | isOctalDigit (const juce_wchar c) noexcept |
static bool | isReservedKeyword (String::CharPointerType token, const int tokenLength) noexcept |
template<typename Iterator > | |
static bool | parseDecimalLiteral (Iterator &source) noexcept |
template<typename Iterator > | |
static bool | parseFloatLiteral (Iterator &source) noexcept |
template<typename Iterator > | |
static bool | parseHexLiteral (Iterator &source) noexcept |
template<typename Iterator > | |
static int | parseIdentifier (Iterator &source) noexcept |
template<typename Iterator > | |
static int | parseNumber (Iterator &source) |
template<typename Iterator > | |
static bool | parseOctalLiteral (Iterator &source) noexcept |
template<typename Iterator > | |
static int | readNextToken (Iterator &source) |
template<typename Iterator > | |
static void | skipComment (Iterator &source) noexcept |
template<typename Iterator > | |
static void | skipIfNextCharMatches (Iterator &source, const juce_wchar c) noexcept |
template<typename Iterator > | |
static void | skipIfNextCharMatches (Iterator &source, const juce_wchar c1, const juce_wchar c2) noexcept |
template<typename Iterator > | |
static bool | skipNumberSuffix (Iterator &source) |
template<typename Iterator > | |
static void | skipPreprocessorLine (Iterator &source) noexcept |
template<typename Iterator > | |
static void | skipQuotedString (Iterator &source) noexcept |
static void | writeEscapeChars (OutputStream &out, const char *utf8, const int numBytesToRead, const int maxCharsOnLine, const bool breakAtNewLines, const bool replaceSingleQuotes, const bool allowStringBreaks) |
Takes a UTF8 string and writes it to a stream using standard C++ escape sequences for any non-ascii bytes. More... | |
Class containing some basic functions for simple tokenising of C++ code.
Takes a string and returns a version of it where standard C++ escape sequences have been used to replace any non-ascii bytes.
Although not strictly a tokenising function, this is still a function that often comes in handy when working with C++ code!
References String::toRawUTF8(), MemoryOutputStream::toString(), and writeEscapeChars().
|
inlinestaticnoexcept |
Referenced by parseDecimalLiteral(), and parseFloatLiteral().
|
inlinestaticnoexcept |
Referenced by parseHexLiteral().
|
inlinestaticnoexcept |
References CharacterFunctions::isLetterOrDigit().
Referenced by parseIdentifier().
|
inlinestaticnoexcept |
References CharacterFunctions::isLetter().
Referenced by readNextToken().
|
inlinestaticnoexcept |
Referenced by parseOctalLiteral().
|
inlinestaticnoexcept |
Referenced by parseIdentifier().
|
inlinestaticnoexcept |
References isDecimalDigit(), and skipNumberSuffix().
Referenced by parseNumber().
|
inlinestaticnoexcept |
References isDecimalDigit().
Referenced by parseNumber().
|
inlinestaticnoexcept |
References isHexDigit(), and skipNumberSuffix().
Referenced by parseNumber().
|
inlinestaticnoexcept |
|
inlinestatic |
|
inlinestaticnoexcept |
References isOctalDigit(), and skipNumberSuffix().
Referenced by parseNumber().
|
inlinestatic |
References isIdentifierStart(), parseIdentifier(), parseNumber(), skipComment(), skipIfNextCharMatches(), skipPreprocessorLine(), skipQuotedString(), CPlusPlusCodeTokeniser::tokenType_bracket, CPlusPlusCodeTokeniser::tokenType_comment, CPlusPlusCodeTokeniser::tokenType_error, CPlusPlusCodeTokeniser::tokenType_operator, CPlusPlusCodeTokeniser::tokenType_preprocessor, CPlusPlusCodeTokeniser::tokenType_punctuation, and CPlusPlusCodeTokeniser::tokenType_string.
|
inlinestaticnoexcept |
Referenced by readNextToken().
|
inlinestaticnoexcept |
Referenced by readNextToken().
|
inlinestaticnoexcept |
|
inlinestatic |
References CharacterFunctions::isLetterOrDigit().
Referenced by parseDecimalLiteral(), parseHexLiteral(), and parseOctalLiteral().
|
inlinestaticnoexcept |
References skipQuotedString().
Referenced by readNextToken().
|
inlinestaticnoexcept |
Referenced by readNextToken(), and skipPreprocessorLine().
|
inlinestatic |
Takes a UTF8 string and writes it to a stream using standard C++ escape sequences for any non-ascii bytes.
Although not strictly a tokenising function, this is still a function that often comes in handy when working with C++ code!
Note that addEscapeChars() is easier to use than this function if you're working with Strings.
References CharacterFunctions::getHexDigitValue(), newLine, and String::toHexString().
Referenced by addEscapeChars().