JUCE
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Types | Public Member Functions | Static Public Member Functions
CPlusPlusCodeTokeniser Class Reference

A simple lexical analyser for syntax colouring of C++ code. More...

Inherits CodeTokeniser.

List of all members.

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.

Detailed Description

A simple lexical analyser for syntax colouring of C++ code.

See also:
SyntaxAnalyser, CodeEditorComponent, CodeDocument

Member Enumeration Documentation

Enumerator:
tokenType_error 
tokenType_comment 
tokenType_builtInKeyword 
tokenType_identifier 
tokenType_integerLiteral 
tokenType_floatLiteral 
tokenType_stringLiteral 
tokenType_operator 
tokenType_bracket 
tokenType_punctuation 
tokenType_preprocessor 

Constructor & Destructor Documentation


Member Function Documentation

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.

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.


The documentation for this class was generated from the following file: