Extending Qt Creator Manual | Lexer

Extending Qt Creator Manual 4.7.1

# Lexer Class

(QmlJS::Lexer)

Inherits: | QmlJSGrammar

- List of all members, including inherited members

## Public Types

enum | Error { NoError, IllegalCharacter, IllegalHexNumber, UnclosedStringLiteral, ..., IllegalHexadecimalEscapeSequence }
enum | ParenthesesState { IgnoreParentheses, CountParentheses, BalancedParentheses }
enum | RegExpBodyPrefix { NoPrefix, EqualPrefix }
enum | RegExpFlag { RegExp_Global, RegExp_IgnoreCase, RegExp_Multiline }
enum | anonymous { T_ABSTRACT, T_BOOLEAN, T_BYTE, T_CHAR, ..., T_VOLATILE }

## Public Functions

| Lexer(QmlJS::Engine *engine)
bool | canInsertAutomaticSemicolon(int token) const
QString | code() const
QmlJS::Lexer::Error | errorCode() const
QString | errorMessage() const
bool | followsClosingBrace() const
int | lex()
bool | prevTerminator() const
bool | qmlMode() const
int | regExpFlags() const
QString | regExpPattern() const
bool | scanDirectives(QmlJS::Directives *directives, QmlJS::DiagnosticMessage *error)
bool | scanRegExp(QmlJS::Lexer::RegExpBodyPrefix prefix = NoPrefix)
void | setCode(const QString &code, int lineno, bool qmlMode = true)
int | tokenEndColumn() const
int | tokenEndLine() const
int | tokenKind() const
int | tokenLength() const
int | tokenOffset() const
QStringRef | tokenSpell() const
int | tokenStartColumn() const
int | tokenStartLine() const
QString | tokenText() const
double | tokenValue() const

## Protected Functions

int | classify(const QChar *s, int n, bool qmlMode)

## Member Type Documentation

### enum Lexer::Error

### enum Lexer::ParenthesesState

### enum Lexer::RegExpBodyPrefix

### enum Lexer::RegExpFlag

### enum Lexer::anonymous

## Member Function Documentation

### Lexer::Lexer(QmlJS::Engine *engine)

Default constructs an instance of Lexer.

### bool Lexer::canInsertAutomaticSemicolon(int token) const

### `[protected]` int Lexer::classify(const QChar *s, int n, bool qmlMode)

### QString Lexer::code() const

See also setCode().

### QmlJS::Lexer::Error Lexer::errorCode() const

### QString Lexer::errorMessage() const

### bool Lexer::followsClosingBrace() const

### int Lexer::lex()

### bool Lexer::prevTerminator() const

### bool Lexer::qmlMode() const

### int Lexer::regExpFlags() const

### QString Lexer::regExpPattern() const

### bool Lexer::scanDirectives(QmlJS::Directives *directives, QmlJS::DiagnosticMessage *error)

### bool Lexer::scanRegExp(QmlJS::Lexer::RegExpBodyPrefix prefix = NoPrefix)

### void Lexer::setCode(const QString &code, int lineno, bool qmlMode = true)

See also code().

### int Lexer::tokenEndColumn() const

### int Lexer::tokenEndLine() const

### int Lexer::tokenKind() const

### int Lexer::tokenLength() const

### int Lexer::tokenOffset() const

### QStringRef Lexer::tokenSpell() const

### int Lexer::tokenStartColumn() const

### int Lexer::tokenStartLine() const

### QString Lexer::tokenText() const

### double Lexer::tokenValue() const