29XmlTokeniser::XmlTokeniser() {}
30XmlTokeniser::~XmlTokeniser() {}
42 {
"Error", 0xffcc0000 },
43 {
"Comment", 0xff00aa00 },
44 {
"Keyword", 0xff0000cc },
45 {
"Operator", 0xff225500 },
46 {
"Identifier", 0xff000000 },
47 {
"String", 0xff990099 },
48 {
"Bracket", 0xff000055 },
49 {
"Punctuation", 0xff004400 },
50 {
"Preprocessor Text", 0xff660000 }
61template <
typename Iterator>
62static void skipToEndOfXmlDTD (Iterator& source)
noexcept
68 auto c = source.nextChar();
77template <
typename Iterator>
78static void skipToEndOfXmlComment (Iterator& source)
noexcept
84 auto c = source.nextChar();
86 if (c == 0 || (c ==
'>' && last[0] ==
'-' && last[1] ==
'-'))
105 CppTokeniserFunctions::skipQuotedString (source);
106 return tokenType_string;
117 skipToEndOfXmlDTD (source);
118 return tokenType_preprocessor;
131 skipToEndOfXmlComment (source);
132 return tokenType_comment;
137 CppTokeniserFunctions::skipIfNextCharMatches (source,
'/');
138 CppTokeniserFunctions::parseIdentifier (source);
140 CppTokeniserFunctions::skipIfNextCharMatches (source,
'/');
142 CppTokeniserFunctions::skipIfNextCharMatches (source,
'>');
143 return tokenType_keyword;
148 return tokenType_keyword;
153 CppTokeniserFunctions::skipIfNextCharMatches (source,
'>');
154 return tokenType_keyword;
159 return tokenType_operator;
162 if (CppTokeniserFunctions::isIdentifierStart (
firstChar))
163 CppTokeniserFunctions::parseIdentifier (source);
169 return tokenType_identifier;
Iterates the text in a CodeDocument.
void skip() noexcept
Advances the position by one character.
juce_wchar peekNextChar() const noexcept
Reads the next character without moving the current position.
void skipWhitespace() noexcept
Skips over any whitespace characters until the next character is non-whitespace.
Represents a colour, also including a transparency value.
CodeEditorComponent::ColourScheme getDefaultColourScheme() override
Returns a suggested syntax highlighting colour scheme.
int readNextToken(CodeDocument::Iterator &) override
Reads the next token from the source and returns its token type.
wchar_t juce_wchar
A platform-independent 32-bit unicode character type.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
Defines a syntax highlighting colour scheme.