KDevelop API Documentation

Lexer Class Reference

#include <lexer.h>

List of all members.

Public Member Functions

 Lexer (Driver *driver)
 ~Lexer ()
bool recordComments () const
void setRecordComments (bool record)
bool recordWhiteSpaces () const
void setRecordWhiteSpaces (bool record)
bool reportWarnings () const
void setReportWarnings (bool enable)
bool reportMessages () const
void setReportMessages (bool enable)
bool skipWordsEnabled () const
void setSkipWordsEnabled (bool enabled)
bool preprocessorEnabled () const
void setPreprocessorEnabled (bool enabled)
void resetSkipWords ()
void addSkipWord (const QString &word, SkipType skipType=SkipWord, const QString &str=QString::null)
QString source () const
void setSource (const QString &source)
int index () const
void setIndex (int index)
void reset ()
const TokentokenAt (int position) const
const TokennextToken ()
const TokenlookAhead (int n) const
int tokenPosition (const Token &token) const
void getTokenPosition (const Token &token, int *line, int *col)
int currentLine () const
int currentColumn () const

Static Public Member Functions

int toInt (const Token &token)

Private Member Functions

QChar currentChar () const
QChar peekChar (int n=1) const
int currentPosition () const
void tokenize ()
void nextToken (Token &token, bool stopOnNewline=false)
void nextChar ()
void nextChar (int n)
void skip (int l, int r)
void readIdentifier ()
void readWhiteSpaces (bool skipNewLine=true)
void readLineComment ()
void readMultiLineComment ()
void readCharLiteral ()
void readStringLiteral ()
void readNumberLiteral ()
int findOperator3 () const
int findOperator2 () const
bool eof () const
int testIfLevel ()
int macroDefined ()
QString readArgument ()
int macroPrimary ()
int macroMultiplyDivide ()
int macroAddSubtract ()
int macroRelational ()
int macroEquality ()
int macroBoolAnd ()
int macroBoolXor ()
int macroBoolOr ()
int macroLogicalAnd ()
int macroLogicalOr ()
int macroExpression ()
void handleDirective (const QString &directive)
void processDefine (Macro &macro)
void processElse ()
void processElif ()
void processEndif ()
void processIf ()
void processIfdef ()
void processIfndef ()
void processInclude ()
void processUndef ()
 Lexer (const Lexer &source)
void operator= (const Lexer &source)

Private Attributes

LexerDatad
Driverm_driver
QPtrVector< Tokenm_tokens
int m_size
int m_index
QString m_source
int m_ptr
int m_endPtr
bool m_recordComments
bool m_recordWhiteSpaces
bool m_startLine
QMap< QString, QPair< SkipType,
QString > > 
m_words
int m_currentLine
int m_currentColumn
bool m_skipWordsEnabled
QMemArray< boolm_skipping
QMemArray< boolm_trueTest
int m_ifLevel
bool m_preprocessorEnabled
bool m_inPreproc
bool m_reportWarnings
bool m_reportMessages


Constructor & Destructor Documentation

Lexer::Lexer Driver driver  ) 
 

Definition at line 109 of file lexer.cpp.

References LexerData::beginScope(), d, Lexer(), m_tokens, and reset().

Referenced by Lexer().

Lexer::~Lexer  ) 
 

Definition at line 124 of file lexer.cpp.

References d, and LexerData::endScope().

Lexer::Lexer const Lexer source  )  [private]
 


Member Function Documentation

void Lexer::addSkipWord const QString word,
SkipType  skipType = SkipWord,
const QString str = QString::null
 

Definition at line 505 of file lexer.cpp.

References addSkipWord(), and m_words.

Referenced by addSkipWord(), and Driver::setupLexer().

QChar Lexer::currentChar  )  const [inline, private]
 

Definition at line 755 of file lexer.h.

References m_endPtr, m_ptr, and m_source.

Referenced by findOperator2(), findOperator3(), handleDirective(), macroAddSubtract(), macroBoolAnd(), macroBoolOr(), macroBoolXor(), macroEquality(), macroLogicalAnd(), macroLogicalOr(), macroMultiplyDivide(), macroPrimary(), macroRelational(), nextToken(), processDefine(), processInclude(), readArgument(), readCharLiteral(), readIdentifier(), readLineComment(), readMultiLineComment(), readNumberLiteral(), readStringLiteral(), readWhiteSpaces(), and tokenize().

int Lexer::currentColumn  )  const [inline]
 

Definition at line 235 of file lexer.h.

Referenced by Driver::addDependence(), and nextToken().

int Lexer::currentLine  )  const [inline]
 

Definition at line 234 of file lexer.h.

Referenced by Driver::addDependence(), and nextToken().

int Lexer::currentPosition  )  const [inline, private]
 

Definition at line 750 of file lexer.h.

References m_ptr.

Referenced by macroDefined(), macroLogicalAnd(), nextToken(), processDefine(), processInclude(), processUndef(), readCharLiteral(), readLineComment(), readMultiLineComment(), and tokenize().

bool Lexer::eof  )  const [inline, private]
 

Definition at line 765 of file lexer.h.

References m_endPtr, and m_ptr.

Referenced by skip().

int Lexer::findOperator2  )  const [inline, private]
 

Definition at line 696 of file lexer.h.

References currentChar(), m_endPtr, m_ptr, peekChar(), Token_and, Token_arrow, Token_assign, Token_concat, Token_decr, Token_eq, Token_geq, Token_incr, Token_leq, Token_or, Token_ptrmem, Token_scope, and Token_shift.

Referenced by nextToken().

int Lexer::findOperator3  )  const [inline, private]
 

Definition at line 680 of file lexer.h.

References currentChar(), m_endPtr, m_ptr, peekChar(), Token_assign, Token_ellipsis, and Token_ptrmem.

Referenced by nextToken().

void Lexer::getTokenPosition const Token token,
int *  line,
int *  col
 

Definition at line 196 of file lexer.cpp.

References Token::getStartPosition(), and getTokenPosition().

Referenced by getTokenPosition(), and Parser::reportError().

void Lexer::handleDirective const QString directive  )  [private]
 

Definition at line 565 of file lexer.cpp.

References currentChar(), handleDirective(), m_ifLevel, m_inPreproc, m_skipping, nextToken(), preprocessorEnabled(), processDefine(), processElif(), processElse(), processEndif(), processIf(), processIfdef(), processIfndef(), processInclude(), processUndef(), setPreprocessorEnabled(), setSkipWordsEnabled(), skip(), and skipWordsEnabled().

Referenced by handleDirective(), and nextToken().

int Lexer::index  )  const [inline]
 

Definition at line 468 of file lexer.h.

References m_index.

Referenced by Parser::parseAbstractDeclarator(), Parser::parseAccessSpecifier(), Parser::parseAssignmentExpression(), Parser::parseBaseClause(), Parser::parseBaseSpecifier(), Parser::parseBlockDeclaration(), Parser::parseCastExpression(), Parser::parseClassSpecifier(), Parser::parseCommaExpression(), Parser::parseCompoundStatement(), Parser::parseCondition(), Parser::parseConstantExpression(), Parser::parseCvQualify(), Parser::parseDeclaration(), Parser::parseDeclarationInternal(), Parser::parseDeclarationStatement(), Parser::parseDeclarator(), Parser::parseDoStatement(), Parser::parseElaboratedTypeSpecifier(), Parser::parseEnumerator(), Parser::parseEnumSpecifier(), Parser::parseExceptionSpecification(), Parser::parseExpression(), Parser::parseForStatement(), Parser::parseFunctionBody(), Parser::parseFunctionSpecifier(), Parser::parseIdentifierList(), Parser::parseIfStatement(), Parser::parseInitDeclarator(), Parser::parseInitDeclaratorList(), Parser::parseLinkageBody(), Parser::parseLinkageSpecification(), Parser::parseLogicalOrExpression(), Parser::parseMemberSpecification(), Parser::parseName(), Parser::parseNamespace(), Parser::parseOperatorFunctionId(), Parser::parseParameterDeclaration(), Parser::parseParameterDeclarationClause(), Parser::parseParameterDeclarationList(), Parser::parsePrimaryExpression(), Parser::parsePtrOperator(), Parser::parseSimpleTypeSpecifier(), Parser::parseStorageClassSpecifier(), Parser::parseSwitchStatement(), Parser::parseTemplateArgument(), Parser::parseTemplateArgumentList(), Parser::parseTemplateDeclaration(), Parser::parseTemplateParameter(), Parser::parseTemplateParameterList(), Parser::parseTypedef(), Parser::parseTypeId(), Parser::parseTypeIdList(), Parser::parseTypeParameter(), Parser::parseUnaryExpression(), Parser::parseUnqualifiedName(), Parser::parseUsing(), Parser::parseUsingDirective(), Parser::parseWhileStatement(), Parser::parseWinDeclSpec(), Parser::skipCommaExpression(), Parser::skipExpression(), and Parser::skipExpressionStatement().

const Token & Lexer::lookAhead int  n  )  const [inline]
 

Definition at line 491 of file lexer.h.

References lookAhead(), m_index, m_size, and m_tokens.

Referenced by lookAhead(), Parser::parseAbstractDeclarator(), Parser::parseAccessSpecifier(), Parser::parseAdditiveExpression(), Parser::parseAndExpression(), Parser::parseAssignmentExpression(), Parser::parseBaseClause(), Parser::parseBaseSpecifier(), Parser::parseBlockDeclaration(), Parser::parseCastExpression(), Parser::parseClassSpecifier(), Parser::parseCommaExpression(), Parser::parseCompoundStatement(), Parser::parseCondition(), Parser::parseConditionalExpression(), Parser::parseCtorInitializer(), Parser::parseCvQualify(), Parser::parseDeclaration(), Parser::parseDeclarationInternal(), Parser::parseDeclarator(), Parser::parseDeleteExpression(), Parser::parseElaboratedTypeSpecifier(), Parser::parseEnumerator(), Parser::parseEnumSpecifier(), Parser::parseEqualityExpression(), Parser::parseExceptionSpecification(), Parser::parseExclusiveOrExpression(), Parser::parseFunctionBody(), Parser::parseFunctionSpecifier(), Parser::parseIdentifierColon(), Parser::parseIdentifierList(), Parser::parseIfStatement(), Parser::parseInclusiveOrExpression(), Parser::parseInitDeclaratorList(), Parser::parseInitializer(), Parser::parseInitializerClause(), Parser::parseLabeledStatement(), Parser::parseLinkageBody(), Parser::parseLinkageSpecification(), Parser::parseLogicalAndExpression(), Parser::parseLogicalOrExpression(), Parser::parseMemberSpecification(), Parser::parseMemInitializerList(), Parser::parseMultiplicativeExpression(), Parser::parseName(), Parser::parseNamespace(), Parser::parseNamespaceAliasDefinition(), Parser::parseNewDeclarator(), Parser::parseNewExpression(), Parser::parseNewInitializer(), Parser::parseOperator(), Parser::parseOperatorFunctionId(), Parser::parseParameterDeclaration(), Parser::parseParameterDeclarationClause(), Parser::parseParameterDeclarationList(), Parser::parsePmExpression(), Parser::parsePostfixExpression(), Parser::parsePrimaryExpression(), Parser::parsePtrOperator(), Parser::parsePtrToMember(), Parser::parseRelationalExpression(), Parser::parseShiftExpression(), Parser::parseSimpleTypeSpecifier(), Parser::parseStatement(), Parser::parseStorageClassSpecifier(), Parser::parseStringLiteral(), Parser::parseTemplateArgument(), Parser::parseTemplateArgumentList(), Parser::parseTemplateDeclaration(), Parser::parseTemplateParameter(), Parser::parseTemplateParameterList(), Parser::parseThrowExpression(), Parser::parseTryBlockStatement(), Parser::parseTypedef(), Parser::parseTypeIdList(), Parser::parseTypeParameter(), Parser::parseUnaryExpression(), Parser::parseUnqualifiedName(), Parser::parseUsing(), Parser::parseUsingDirective(), Parser::parseWinDeclSpec(), Parser::reportError(), Parser::skip(), Parser::skipCommaExpression(), Parser::skipExpression(), Parser::skipUntil(), Parser::skipUntilDeclaration(), and Parser::skipUntilStatement().

int Lexer::macroAddSubtract  )  [private]
 

Definition at line 884 of file lexer.cpp.

References currentChar(), macroMultiplyDivide(), nextChar(), and readWhiteSpaces().

Referenced by macroRelational().

int Lexer::macroBoolAnd  )  [private]
 

Definition at line 935 of file lexer.cpp.

References currentChar(), macroEquality(), nextChar(), peekChar(), and readWhiteSpaces().

Referenced by macroBoolXor().

int Lexer::macroBoolOr  )  [private]
 

Definition at line 957 of file lexer.cpp.

References currentChar(), macroBoolXor(), nextChar(), peekChar(), and readWhiteSpaces().

Referenced by macroLogicalAnd().

int Lexer::macroBoolXor  )  [private]
 

Definition at line 946 of file lexer.cpp.

References currentChar(), macroBoolAnd(), nextChar(), and readWhiteSpaces().

Referenced by macroBoolOr().

int Lexer::macroDefined  )  [private]
 

Definition at line 621 of file lexer.cpp.

References currentPosition(), Driver::hasMacro(), m_driver, m_source, readIdentifier(), and readWhiteSpaces().

Referenced by processIf(), processIfdef(), and processIfndef().

int Lexer::macroEquality  )  [private]
 

Definition at line 921 of file lexer.cpp.

References currentChar(), eq, macroRelational(), nextChar(), peekChar(), and readWhiteSpaces().

Referenced by macroBoolAnd().

int Lexer::macroExpression  )  [private]
 

Definition at line 992 of file lexer.cpp.

References macroLogicalOr(), and readWhiteSpaces().

Referenced by macroPrimary(), processElif(), and processIf().

int Lexer::macroLogicalAnd  )  [private]
 

Definition at line 968 of file lexer.cpp.

References currentChar(), currentPosition(), m_source, macroBoolOr(), nextChar(), peekChar(), and readWhiteSpaces().

Referenced by macroLogicalOr().

int Lexer::macroLogicalOr  )  [private]
 

Definition at line 981 of file lexer.cpp.

References currentChar(), macroLogicalAnd(), nextChar(), peekChar(), and readWhiteSpaces().

Referenced by macroExpression().

int Lexer::macroMultiplyDivide  )  [private]
 

Definition at line 861 of file lexer.cpp.

References currentChar(), macroPrimary(), nextChar(), peekChar(), and readWhiteSpaces().

Referenced by macroAddSubtract().

int Lexer::macroPrimary  )  [private]
 

Todo:
report error

implement

Definition at line 807 of file lexer.cpp.

References currentChar(), Driver::hasMacro(), m_driver, macroExpression(), nextChar(), nextToken(), readWhiteSpaces(), Token::text(), toInt(), Token_char_literal, Token_identifier, Token_number_literal, and Token::type.

Referenced by macroMultiplyDivide().

int Lexer::macroRelational  )  [private]
 

Definition at line 898 of file lexer.cpp.

References currentChar(), macroAddSubtract(), nextChar(), and readWhiteSpaces().

Referenced by macroEquality().

void Lexer::nextChar int  n  )  [inline, private]
 

Definition at line 512 of file lexer.h.

References m_currentColumn, and m_ptr.

void Lexer::nextChar  )  [inline, private]
 

Definition at line 501 of file lexer.h.

References m_currentColumn, m_currentLine, m_ptr, and m_source.

Referenced by macroAddSubtract(), macroBoolAnd(), macroBoolOr(), macroBoolXor(), macroEquality(), macroLogicalAnd(), macroLogicalOr(), macroMultiplyDivide(), macroPrimary(), macroRelational(), nextToken(), processDefine(), processInclude(), readCharLiteral(), readIdentifier(), readLineComment(), readMultiLineComment(), readNumberLiteral(), readStringLiteral(), and readWhiteSpaces().

void Lexer::nextToken Token token,
bool  stopOnNewline = false
[private]
 

Definition at line 201 of file lexer.cpp.

References LexerData::apply(), Macro::argumentList(), LexerData::beginScope(), LexerData::bind(), Macro::body(), CREATE_TOKEN, currentChar(), currentColumn(), currentLine(), currentPosition(), d, LexerData::endScope(), findOperator2(), findOperator3(), handleDirective(), Macro::hasArguments(), LexerData::hasBind(), Driver::hasMacro(), m_currentColumn, m_currentLine, m_driver, m_endPtr, m_ifLevel, m_inPreproc, m_preprocessorEnabled, m_size, m_skipping, m_skipWordsEnabled, m_source, m_startLine, m_tokens, m_words, Driver::macro(), nextChar(), nextToken(), peekChar(), preprocessorEnabled(), readArgument(), readCharLiteral(), readIdentifier(), readLineComment(), readMultiLineComment(), readNumberLiteral(), readStringLiteral(), readWhiteSpaces(), recordComments(), Driver::removeMacro(), Token::setEndPosition(), setPreprocessorEnabled(), Token::setStartPosition(), skip(), SkipWordAndArguments, Token_char_literal, Token_comment, Token_concat, Token_ellipsis, Token_eof, Token_identifier, Token_number_literal, and Token_string_literal.

const Token & Lexer::nextToken  )  [inline]
 

Definition at line 478 of file lexer.h.

References m_index, m_size, and m_tokens.

Referenced by handleDirective(), macroPrimary(), nextToken(), Parser::parseAbstractDeclarator(), Parser::parseAccessSpecifier(), Parser::parseAdditiveExpression(), Parser::parseAndExpression(), Parser::parseAssignmentExpression(), Parser::parseBaseClause(), Parser::parseBaseSpecifier(), Parser::parseBlockDeclaration(), Parser::parseCastExpression(), Parser::parseClassSpecifier(), Parser::parseCommaExpression(), Parser::parseCompoundStatement(), Parser::parseCondition(), Parser::parseConditionalExpression(), Parser::parseCtorInitializer(), Parser::parseCvQualify(), Parser::parseDeclaration(), Parser::parseDeclarationInternal(), Parser::parseDeclarator(), Parser::parseDeleteExpression(), Parser::parseElaboratedTypeSpecifier(), Parser::parseEnumerator(), Parser::parseEnumSpecifier(), Parser::parseEqualityExpression(), Parser::parseExceptionSpecification(), Parser::parseExclusiveOrExpression(), Parser::parseFunctionBody(), Parser::parseFunctionSpecifier(), Parser::parseIdentifierColon(), Parser::parseIdentifierList(), Parser::parseIfStatement(), Parser::parseInclusiveOrExpression(), Parser::parseInitDeclaratorList(), Parser::parseInitializer(), Parser::parseInitializerClause(), Parser::parseLabeledStatement(), Parser::parseLinkageBody(), Parser::parseLinkageSpecification(), Parser::parseLogicalAndExpression(), Parser::parseLogicalOrExpression(), Parser::parseMemberSpecification(), Parser::parseMemInitializerList(), Parser::parseMultiplicativeExpression(), Parser::parseName(), Parser::parseNamespace(), Parser::parseNamespaceAliasDefinition(), Parser::parseNewDeclarator(), Parser::parseNewExpression(), Parser::parseNewInitializer(), Parser::parseOperator(), Parser::parseOperatorFunctionId(), Parser::parseParameterDeclaration(), Parser::parseParameterDeclarationClause(), Parser::parseParameterDeclarationList(), Parser::parsePmExpression(), Parser::parsePostfixExpression(), Parser::parsePrimaryExpression(), Parser::parsePtrOperator(), Parser::parsePtrToMember(), Parser::parseRelationalExpression(), Parser::parseShiftExpression(), Parser::parseSimpleTypeSpecifier(), Parser::parseStatement(), Parser::parseStorageClassSpecifier(), Parser::parseStringLiteral(), Parser::parseTemplateArgumentList(), Parser::parseTemplateDeclaration(), Parser::parseTemplateParameterList(), Parser::parseTryBlockStatement(), Parser::parseTypedef(), Parser::parseTypeIdList(), Parser::parseTypeParameter(), Parser::parseUnaryExpression(), Parser::parseUnqualifiedName(), Parser::parseUsing(), Parser::parseUsingDirective(), Parser::parseWinDeclSpec(), processDefine(), readArgument(), Parser::skip(), skip(), Parser::skipCommaExpression(), Parser::skipExpression(), Parser::skipUntil(), Parser::skipUntilDeclaration(), Parser::skipUntilStatement(), and tokenize().

void Lexer::operator= const Lexer source  )  [private]
 

QChar Lexer::peekChar int  n = 1  )  const [inline, private]
 

Definition at line 760 of file lexer.h.

References m_endPtr, m_ptr, m_source, and peekChar().

Referenced by findOperator2(), findOperator3(), macroBoolAnd(), macroBoolOr(), macroEquality(), macroLogicalAnd(), macroLogicalOr(), macroMultiplyDivide(), nextToken(), peekChar(), processDefine(), readCharLiteral(), readLineComment(), readMultiLineComment(), and readStringLiteral().

bool Lexer::preprocessorEnabled  )  const [inline]
 

Definition at line 740 of file lexer.h.

References m_preprocessorEnabled.

Referenced by handleDirective(), and nextToken().

void Lexer::processDefine Macro macro  )  [private]
 

Definition at line 632 of file lexer.cpp.

References Macro::addArgument(), Driver::addMacro(), Macro::Argument, currentChar(), Driver::currentFileName(), currentPosition(), m_driver, m_source, nextChar(), nextToken(), peekChar(), processDefine(), readIdentifier(), readWhiteSpaces(), Driver::removeMacro(), Macro::setBody(), Macro::setFileName(), Macro::setHasArguments(), Macro::setName(), setPreprocessorEnabled(), Token::text(), and Token::type.

Referenced by handleDirective(), and processDefine().

void Lexer::processElif  )  [private]
 

Todo:
report error

implement the correct semantic for elif!!

Definition at line 710 of file lexer.cpp.

References m_ifLevel, m_skipping, m_trueTest, and macroExpression().

Referenced by handleDirective().

void Lexer::processElse  )  [private]
 

Definition at line 698 of file lexer.cpp.

References m_ifLevel, m_skipping, and m_trueTest.

Referenced by handleDirective().

void Lexer::processEndif  )  [private]
 

Definition at line 726 of file lexer.cpp.

References m_ifLevel, m_skipping, and m_trueTest.

Referenced by handleDirective().

void Lexer::processIf  )  [private]
 

Definition at line 736 of file lexer.cpp.

References m_ifLevel, m_skipping, m_trueTest, macroDefined(), macroExpression(), and testIfLevel().

Referenced by handleDirective().

void Lexer::processIfdef  )  [private]
 

Definition at line 753 of file lexer.cpp.

References m_ifLevel, m_skipping, m_trueTest, macroDefined(), and testIfLevel().

Referenced by handleDirective().

void Lexer::processIfndef  )  [private]
 

Definition at line 763 of file lexer.cpp.

References m_ifLevel, m_skipping, m_trueTest, macroDefined(), and testIfLevel().

Referenced by handleDirective().

void Lexer::processInclude  )  [private]
 

Definition at line 773 of file lexer.cpp.

References Driver::addDependence(), currentChar(), Driver::currentFileName(), currentPosition(), Dep_Global, Dep_Local, Dependence, m_driver, m_ifLevel, m_skipping, m_source, nextChar(), and readWhiteSpaces().

Referenced by handleDirective().

void Lexer::processUndef  )  [private]
 

Definition at line 798 of file lexer.cpp.

References currentPosition(), m_driver, m_source, readIdentifier(), readWhiteSpaces(), and Driver::removeMacro().

Referenced by handleDirective().

QString Lexer::readArgument  )  [private]
 

Definition at line 534 of file lexer.cpp.

References currentChar(), nextToken(), readWhiteSpaces(), and Token::text().

Referenced by nextToken().

void Lexer::readCharLiteral  )  [inline, private]
 

Definition at line 626 of file lexer.h.

References currentChar(), currentPosition(), len, m_endPtr, nextChar(), and peekChar().

Referenced by nextToken().

void Lexer::readIdentifier  )  [inline, private]
 

Definition at line 518 of file lexer.h.

References currentChar(), and nextChar().

Referenced by macroDefined(), nextToken(), processDefine(), and processUndef().

void Lexer::readLineComment  )  [inline, private]
 

Definition at line 542 of file lexer.h.

References Driver::addProblem(), currentChar(), Driver::currentFileName(), currentPosition(), m_currentColumn, m_currentLine, m_driver, m_reportMessages, m_source, nextChar(), and peekChar().

Referenced by nextToken().

void Lexer::readMultiLineComment  )  [inline, private]
 

Definition at line 583 of file lexer.h.

References Driver::addProblem(), currentChar(), Driver::currentFileName(), currentPosition(), m_currentColumn, m_currentLine, m_driver, m_reportMessages, m_source, nextChar(), and peekChar().

Referenced by nextToken().

void Lexer::readNumberLiteral  )  [inline, private]
 

Definition at line 674 of file lexer.h.

References currentChar(), and nextChar().

Referenced by nextToken().

void Lexer::readStringLiteral  )  [inline, private]
 

Definition at line 651 of file lexer.h.

References currentChar(), len, m_endPtr, m_ptr, nextChar(), and peekChar().

Referenced by nextToken().

void Lexer::readWhiteSpaces bool  skipNewLine = true  )  [inline, private]
 

Definition at line 524 of file lexer.h.

References currentChar(), m_inPreproc, nextChar(), and readWhiteSpaces().

Referenced by macroAddSubtract(), macroBoolAnd(), macroBoolOr(), macroBoolXor(), macroDefined(), macroEquality(), macroExpression(), macroLogicalAnd(), macroLogicalOr(), macroMultiplyDivide(), macroPrimary(), macroRelational(), nextToken(), processDefine(), processInclude(), processUndef(), readArgument(), and readWhiteSpaces().

bool Lexer::recordComments  )  const [inline]
 

Definition at line 443 of file lexer.h.

References m_recordComments.

Referenced by nextToken().

bool Lexer::recordWhiteSpaces  )  const [inline]
 

Definition at line 453 of file lexer.h.

References m_recordWhiteSpaces.

bool Lexer::reportMessages  )  const [inline]
 

Definition at line 780 of file lexer.h.

References m_reportMessages.

bool Lexer::reportWarnings  )  const [inline]
 

Definition at line 770 of file lexer.h.

References m_reportWarnings.

void Lexer::reset  ) 
 

Definition at line 141 of file lexer.cpp.

References m_currentColumn, m_currentLine, m_endPtr, m_ifLevel, m_index, m_ptr, m_size, m_skipping, m_source, m_startLine, m_tokens, and m_trueTest.

Referenced by Lexer(), and setSource().

void Lexer::resetSkipWords  ) 
 

Definition at line 500 of file lexer.cpp.

References m_words.

void Lexer::setIndex int  index  )  [inline]
 

Definition at line 473 of file lexer.h.

References m_index, and setIndex().

Referenced by Parser::parseAbstractDeclarator(), Parser::parseBlockDeclaration(), Parser::parseCastExpression(), Parser::parseClassSpecifier(), Parser::parseCondition(), Parser::parseDeclaration(), Parser::parseDeclarationInternal(), Parser::parseDeclarator(), Parser::parseElaboratedTypeSpecifier(), Parser::parseEnumSpecifier(), Parser::parseMemberSpecification(), Parser::parseParameterDeclaration(), Parser::parseParameterDeclarationList(), Parser::parsePrimaryExpression(), Parser::parsePtrOperator(), Parser::parseSimpleTypeSpecifier(), Parser::parseTemplateArgument(), Parser::parseUnaryExpression(), Parser::parseUnqualifiedName(), and setIndex().

void Lexer::setPreprocessorEnabled bool  enabled  )  [inline]
 

Definition at line 745 of file lexer.h.

References m_preprocessorEnabled, and setPreprocessorEnabled().

Referenced by handleDirective(), nextToken(), processDefine(), and setPreprocessorEnabled().

void Lexer::setRecordComments bool  record  )  [inline]
 

Definition at line 448 of file lexer.h.

References m_recordComments, and setRecordComments().

Referenced by setRecordComments().

void Lexer::setRecordWhiteSpaces bool  record  )  [inline]
 

Definition at line 458 of file lexer.h.

References m_recordWhiteSpaces, and setRecordWhiteSpaces().

Referenced by setRecordWhiteSpaces().

void Lexer::setReportMessages bool  enable  )  [inline]
 

Definition at line 785 of file lexer.h.

References m_reportMessages, and setReportMessages().

Referenced by setReportMessages(), and KDevDriver::setupLexer().

void Lexer::setReportWarnings bool  enable  )  [inline]
 

Definition at line 775 of file lexer.h.

References m_reportWarnings, and setReportWarnings().

Referenced by setReportWarnings(), and KDevDriver::setupLexer().

void Lexer::setSkipWordsEnabled bool  enabled  )  [inline]
 

Definition at line 735 of file lexer.h.

References m_skipWordsEnabled, and setSkipWordsEnabled().

Referenced by handleDirective(), and setSkipWordsEnabled().

void Lexer::setSource const QString source  ) 
 

Definition at line 130 of file lexer.cpp.

References m_endPtr, m_inPreproc, m_ptr, m_source, reset(), setSource(), and tokenize().

Referenced by CppCodeCompletion::completeText(), setSource(), and CppCodeCompletion::typeName().

void Lexer::skip int  l,
int  r
[private]
 

Definition at line 510 of file lexer.cpp.

References eof(), m_currentColumn, m_currentLine, nextToken(), and skip().

Referenced by handleDirective(), nextToken(), and skip().

bool Lexer::skipWordsEnabled  )  const [inline]
 

Definition at line 730 of file lexer.h.

References m_skipWordsEnabled.

Referenced by handleDirective().

QString Lexer::source  )  const [inline]
 

Definition at line 463 of file lexer.h.

References m_source.

int Lexer::testIfLevel  )  [private]
 

Definition at line 614 of file lexer.cpp.

References m_ifLevel, and m_skipping.

Referenced by processIf(), processIfdef(), and processIfndef().

int Lexer::toInt const Token token  )  [static]
 

Definition at line 161 of file lexer.cpp.

References Token::text(), toInt(), Token_char_literal, Token_number_literal, and Token::type.

Referenced by macroPrimary(), and toInt().

const Token & Lexer::tokenAt int  position  )  const [inline]
 

Definition at line 486 of file lexer.h.

References m_size, m_tokens, and tokenAt().

Referenced by tokenAt(), and Parser::toString().

void Lexer::tokenize  )  [private]
 

Definition at line 478 of file lexer.cpp.

References ADD_TOKEN, CREATE_TOKEN, currentChar(), currentPosition(), m_currentColumn, m_currentLine, m_size, m_startLine, nextToken(), Token::setEndPosition(), Token::setStartPosition(), Token_eof, and Token::type.

Referenced by setSource().

int Lexer::tokenPosition const Token token  )  const [inline]
 

Definition at line 496 of file lexer.h.

References Token::position(), and tokenPosition().

Referenced by tokenPosition().


Member Data Documentation

LexerData* Lexer::d [private]
 

Definition at line 288 of file lexer.h.

Referenced by Lexer(), nextToken(), and ~Lexer().

int Lexer::m_currentColumn [private]
 

Definition at line 302 of file lexer.h.

Referenced by nextChar(), nextToken(), readLineComment(), readMultiLineComment(), reset(), skip(), and tokenize().

int Lexer::m_currentLine [private]
 

Definition at line 301 of file lexer.h.

Referenced by nextChar(), nextToken(), readLineComment(), readMultiLineComment(), reset(), skip(), and tokenize().

Driver* Lexer::m_driver [private]
 

Definition at line 289 of file lexer.h.

Referenced by macroDefined(), macroPrimary(), nextToken(), processDefine(), processInclude(), processUndef(), readLineComment(), and readMultiLineComment().

int Lexer::m_endPtr [private]
 

Definition at line 295 of file lexer.h.

Referenced by currentChar(), eof(), findOperator2(), findOperator3(), nextToken(), peekChar(), readCharLiteral(), readStringLiteral(), reset(), and setSource().

int Lexer::m_ifLevel [private]
 

Definition at line 308 of file lexer.h.

Referenced by handleDirective(), nextToken(), processElif(), processElse(), processEndif(), processIf(), processIfdef(), processIfndef(), processInclude(), reset(), and testIfLevel().

int Lexer::m_index [private]
 

Definition at line 292 of file lexer.h.

Referenced by index(), lookAhead(), nextToken(), reset(), and setIndex().

bool Lexer::m_inPreproc [private]
 

Definition at line 310 of file lexer.h.

Referenced by handleDirective(), nextToken(), readWhiteSpaces(), and setSource().

bool Lexer::m_preprocessorEnabled [private]
 

Definition at line 309 of file lexer.h.

Referenced by nextToken(), preprocessorEnabled(), and setPreprocessorEnabled().

int Lexer::m_ptr [private]
 

Definition at line 294 of file lexer.h.

Referenced by currentChar(), currentPosition(), eof(), findOperator2(), findOperator3(), nextChar(), peekChar(), readStringLiteral(), reset(), and setSource().

bool Lexer::m_recordComments [private]
 

Definition at line 296 of file lexer.h.

Referenced by recordComments(), and setRecordComments().

bool Lexer::m_recordWhiteSpaces [private]
 

Definition at line 297 of file lexer.h.

Referenced by recordWhiteSpaces(), and setRecordWhiteSpaces().

bool Lexer::m_reportMessages [private]
 

Definition at line 313 of file lexer.h.

Referenced by readLineComment(), readMultiLineComment(), reportMessages(), and setReportMessages().

bool Lexer::m_reportWarnings [private]
 

Definition at line 312 of file lexer.h.

Referenced by reportWarnings(), and setReportWarnings().

int Lexer::m_size [private]
 

Definition at line 291 of file lexer.h.

Referenced by lookAhead(), nextToken(), reset(), tokenAt(), and tokenize().

QMemArray<bool> Lexer::m_skipping [private]
 

Definition at line 306 of file lexer.h.

Referenced by handleDirective(), nextToken(), processElif(), processElse(), processEndif(), processIf(), processIfdef(), processIfndef(), processInclude(), reset(), and testIfLevel().

bool Lexer::m_skipWordsEnabled [private]
 

Definition at line 303 of file lexer.h.

Referenced by nextToken(), setSkipWordsEnabled(), and skipWordsEnabled().

QString Lexer::m_source [private]
 

Definition at line 293 of file lexer.h.

Referenced by currentChar(), macroDefined(), macroLogicalAnd(), nextChar(), nextToken(), peekChar(), processDefine(), processInclude(), processUndef(), readLineComment(), readMultiLineComment(), reset(), setSource(), and source().

bool Lexer::m_startLine [private]
 

Definition at line 298 of file lexer.h.

Referenced by nextToken(), reset(), and tokenize().

QPtrVector< Token > Lexer::m_tokens [private]
 

Definition at line 290 of file lexer.h.

Referenced by Lexer(), lookAhead(), nextToken(), reset(), and tokenAt().

QMemArray<bool> Lexer::m_trueTest [private]
 

Definition at line 307 of file lexer.h.

Referenced by processElif(), processElse(), processEndif(), processIf(), processIfdef(), processIfndef(), and reset().

QMap< QString, QPair<SkipType, QString> > Lexer::m_words [private]
 

Definition at line 299 of file lexer.h.

Referenced by addSkipWord(), nextToken(), and resetSkipWords().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:26 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003