A simple lexical analyser for syntax colouring of C++ code. More...
Inherits CodeTokeniser.
Public Types | |
| enum | TokenType { tokenType_error = 0, tokenType_comment, tokenType_builtInKeyword, tokenType_identifier, tokenType_integerLiteral, tokenType_floatLiteral, tokenType_stringLiteral, tokenType_operator, tokenType_bracket, tokenType_punctuation, tokenType_preprocessor } |
Public Member Functions | |
| CPlusPlusCodeTokeniser () | |
| ~CPlusPlusCodeTokeniser () | |
| int | readNextToken (CodeDocument::Iterator &source) |
| Reads the next token from the source and returns its token type. | |
| StringArray | getTokenTypes () |
| Returns a list of the names of the token types this analyser uses. | |
| Colour | getDefaultColour (int tokenType) |
| Returns a suggested syntax highlighting colour for a specified token type. | |
Static Public Member Functions | |
| static bool | isReservedKeyword (const String &token) noexcept |
| This is a handy method for checking whether a string is a c++ reserved keyword. | |
A simple lexical analyser for syntax colouring of C++ code.
| int CPlusPlusCodeTokeniser::readNextToken | ( | CodeDocument::Iterator & | source | ) | [virtual] |
Reads the next token from the source and returns its token type.
This must leave the source pointing to the first character in the next token.
Implements CodeTokeniser.
| StringArray CPlusPlusCodeTokeniser::getTokenTypes | ( | ) | [virtual] |
Returns a list of the names of the token types this analyser uses.
The index in this list must match the token type numbers that are returned by readNextToken().
Implements CodeTokeniser.
| Colour CPlusPlusCodeTokeniser::getDefaultColour | ( | int | tokenType | ) | [virtual] |
Returns a suggested syntax highlighting colour for a specified token type.
Implements CodeTokeniser.
| static bool CPlusPlusCodeTokeniser::isReservedKeyword | ( | const String & | token | ) | [static] |
This is a handy method for checking whether a string is a c++ reserved keyword.