2 * Copyright 2014, Rene Gollent, rene@gollent.com.
3 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Distributed under the terms of the MIT License.
6 #ifndef SYNTAX_HIGHLIGHTER_H
7 #define SYNTAX_HIGHLIGHTER_H
12 #include <Referenceable.h>
16 class TeamTypeInformation
;
19 enum syntax_highlight_type
{
20 SYNTAX_HIGHLIGHT_NONE
= 0,
21 SYNTAX_HIGHLIGHT_KEYWORD
,
22 SYNTAX_HIGHLIGHT_PREPROCESSOR_KEYWORD
,
23 SYNTAX_HIGHLIGHT_IDENTIFIER
,
24 SYNTAX_HIGHLIGHT_OPERATOR
,
25 SYNTAX_HIGHLIGHT_TYPE
,
26 SYNTAX_HIGHLIGHT_NUMERIC_LITERAL
,
27 SYNTAX_HIGHLIGHT_STRING_LITERAL
,
28 SYNTAX_HIGHLIGHT_COMMENT
32 class SyntaxHighlightInfo
{
34 virtual ~SyntaxHighlightInfo();
36 virtual int32
GetLineHighlightRanges(int32 line
,
38 syntax_highlight_type
* _types
,
40 // Returns number of filled in
41 // (column, type) pairs.
42 // Default is (0, SYNTAX_HIGHLIGHT_NONE)
43 // and can be omitted.
47 class SyntaxHighlighter
: public BReferenceable
{
49 virtual ~SyntaxHighlighter();
51 virtual status_t
ParseText(LineDataSource
* source
,
52 TeamTypeInformation
* typeInfo
,
53 SyntaxHighlightInfo
*& _info
) = 0;
54 // caller owns the returned info
58 #endif // SYNTAX_HIGHLIGHTER_H