# class toSyntaxAnalyzer

This class implements a syntax parser to provide information to a syntax highlighted editor. More...

Definition | `#include <tohighlightedtext.h>`
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- enum infoType { Normal=0, /** This is a keyword }
- struct highlightInfo

#### Public Methods

- toSyntaxAnalyzer (const char **keywords)
- virtual ~toSyntaxAnalyzer ()
- virtual std::list<highlightInfo> analyzeLine (const QString &str,infoType in,infoType &out)
- QColor getColor (infoType typ)

#### Public Static Methods

- static toSyntaxAnalyzer & defaultAnalyzer ()

#### Public Members

- friend class toSyntaxSetup

#### Protected Methods

- bool isSymbol (QChar c)

## Detailed Description

This class implements a syntax parser to provide information to a syntax highlighted editor.

enum infoType { Normal=0, /** This is a keyword }

### infoType

Normal text

highlightInfo (struct)

### highlightInfo

Information about a change in highlighting.

bool isSymbol (QChar c)

### isSymbol

[protected]

Check if this is part of a symbol or not.

toSyntaxAnalyzer (const char **keywords)

### toSyntaxAnalyzer

Create a syntax analysed

Parameters:

keywords | A list of keywords.

~toSyntaxAnalyzer ()

### ~toSyntaxAnalyzer

[virtual]

std::list<highlightInfo> analyzeLine (const QString &str,infoType in,infoType &out)

### analyzeLine

[virtual]

Analyze a line. There is no guarantee that lines will be called in any kind of order.

Parameters:

str | Line to analyze.
in | Type at start of line.
out | Type at start of next line.

Returns: A list of where highlighting should change. Start as normal.

QColor getColor (infoType typ)

### getColor

Get a colordefinition for a infoType value.

Parameters:

typ | infoType to get color for.

Returns: Color of that type.

friend class toSyntaxSetup

### toSyntaxSetup

toSyntaxAnalyzer & defaultAnalyzer ()

### defaultAnalyzer

[static]

Get the default syntax analyzer.

Returns: Reference to the default analyzer.