JUCE: CPlusPlusCodeTokeniser Class Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
CPlusPlusCodeTokeniser Class Reference
juce_gui_extra » code_editor

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

`#include <juce_CPlusPlusCodeTokeniser.h>`

Inheritance diagram for CPlusPlusCodeTokeniser:

## Public Types
enum | TokenType { tokenType_error = 0 , tokenType_comment , tokenType_keyword , tokenType_operator , tokenType_identifier , tokenType_integer , tokenType_float , tokenType_string , tokenType_bracket , tokenType_punctuation , tokenType_preprocessor }
| The token values returned by this tokeniser. More...

## Public Member Functions
| CPlusPlusCodeTokeniser ()
| ~CPlusPlusCodeTokeniser () override
int | readNextToken (CodeDocument::Iterator &) override
| Reads the next token from the source and returns its token type.
CodeEditorComponent::ColourScheme | getDefaultColourScheme () override
| Returns a suggested syntax highlighting colour scheme.
Public Member Functions inherited from CodeTokeniser
| CodeTokeniser ()=default
virtual | ~CodeTokeniser ()=default

## 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
  CodeEditorComponent, CodeDocument

## Member Enumeration Documentation

## ◆ TokenType

enum CPlusPlusCodeTokeniser::TokenType

The token values returned by this tokeniser.

Enumerator
tokenType_error |
tokenType_comment |
tokenType_keyword |
tokenType_operator |
tokenType_identifier |
tokenType_integer |
tokenType_float |
tokenType_string |
tokenType_bracket |
tokenType_punctuation |
tokenType_preprocessor |

## Constructor & Destructor Documentation

## ◆ CPlusPlusCodeTokeniser()

CPlusPlusCodeTokeniser::CPlusPlusCodeTokeniser | ( |  | ) |

## ◆ ~CPlusPlusCodeTokeniser()

CPlusPlusCodeTokeniser::~CPlusPlusCodeTokeniser | ( |  | ) |
| override

## Member Function Documentation

## ◆ readNextToken()

int CPlusPlusCodeTokeniser::readNextToken | ( | CodeDocument::Iterator & | source | ) |
| overridevirtual

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.

## ◆ getDefaultColourScheme()

CodeEditorComponent::ColourScheme CPlusPlusCodeTokeniser::getDefaultColourScheme | ( |  | ) |
| overridevirtual

Returns a suggested syntax highlighting colour scheme.

Implements CodeTokeniser.

## ◆ isReservedKeyword()

static bool CPlusPlusCodeTokeniser::isReservedKeyword | ( | const String & | token | ) |
| staticnoexcept

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:

- juce_CPlusPlusCodeTokeniser.h