Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes

LexAn Class Reference

Lexical analyzer used for splitting lexical symbols from input 'stream'. More...

#include <parser.h>

List of all members.

Public Types

typedef QMap< QString,
VaucansonKeywords::Token
TKeywordMap

Public Member Functions

 LexAn ()
 ~LexAn ()
int getLineNumber ()
 returns current line number
VaucansonKeywords::Token getToken ()
 returns last readed token
QString getTokenData ()
 returns token data
bool openFile (const QString &fn)
 opens input file, returns false if opening fails
QString readStringBetween (const QChar &opening, const QChar &closing, bool allowMatching=true)
VaucansonKeywords::Token readToken ()
 reads single new token

Static Public Member Functions

static void initialize ()

Static Public Attributes

static TKeywordMap keywordMap

Private Member Functions

bool isAllowed (char character)
VaucansonKeywords::Token keyWordTest (const QString &tokenData)
char readChar ()

Private Attributes

unsigned char character
bool fileOpened
QFile * inFile
char input
char line [1024]
int lineIndex
int lineLength
int lineNumber
VaucansonKeywords::Token token
QString tokenData

Detailed Description

Lexical analyzer used for splitting lexical symbols from input 'stream'.

Definition at line 63 of file parser.h.


Member Typedef Documentation

Definition at line 66 of file parser.h.


Constructor & Destructor Documentation

LexAn::LexAn (  ) 

Definition at line 143 of file parser.cpp.

References initialize().

Here is the call graph for this function:

LexAn::~LexAn (  ) 

Definition at line 148 of file parser.cpp.

References inFile.


Member Function Documentation

int LexAn::getLineNumber (  ) 
Token LexAn::getToken (  ) 
QString LexAn::getTokenData (  ) 
void LexAn::initialize (  )  [static]

Definition at line 40 of file parser.cpp.

References ADD_KEYWORD, VaucansonKeywords::chgEdgeLabelColor, VaucansonKeywords::chgEdgeLabelScale, VaucansonKeywords::chgEdgeLineColor, VaucansonKeywords::chgEdgeLineStyle, VaucansonKeywords::chgEdgeLineWidth, VaucansonKeywords::chgStateFillColor, VaucansonKeywords::chgStateFillStatus, VaucansonKeywords::chgStateLabelColor, VaucansonKeywords::chgStateLabelScale, VaucansonKeywords::chgStateLineColor, VaucansonKeywords::chgStateLineStyle, VaucansonKeywords::chgStateLineWidth, VaucansonKeywords::fixDimEdge, VaucansonKeywords::fixDimState, VaucansonKeywords::fixEdgeBorder, VaucansonKeywords::fixEdgeLineDouble, VaucansonKeywords::fixStateLineDouble, keywordMap, VaucansonKeywords::kwArcL, VaucansonKeywords::kwArcR, VaucansonKeywords::kwBegin, VaucansonKeywords::kwCLoopE, VaucansonKeywords::kwCLoopN, VaucansonKeywords::kwCLoopNE, VaucansonKeywords::kwCLoopNW, VaucansonKeywords::kwCLoopS, VaucansonKeywords::kwCLoopSE, VaucansonKeywords::kwCLoopSW, VaucansonKeywords::kwCLoopW, VaucansonKeywords::kwDimEdge, VaucansonKeywords::kwDimState, VaucansonKeywords::kwEdgeBorder, VaucansonKeywords::kwEdgeBorderOff, VaucansonKeywords::kwEdgeL, VaucansonKeywords::kwEdgeLineDouble, VaucansonKeywords::kwEdgeLineSimple, VaucansonKeywords::kwEdgeR, VaucansonKeywords::kwEnd, VaucansonKeywords::kwFinal, VaucansonKeywords::kwFinalState, VaucansonKeywords::kwFinalStateVar, VaucansonKeywords::kwHideFrame, VaucansonKeywords::kwHideGrid, VaucansonKeywords::kwInitial, VaucansonKeywords::kwLabelL, VaucansonKeywords::kwLabelR, VaucansonKeywords::kwLArcL, VaucansonKeywords::kwLArcR, VaucansonKeywords::kwLoopE, VaucansonKeywords::kwLoopN, VaucansonKeywords::kwLoopNE, VaucansonKeywords::kwLoopNW, VaucansonKeywords::kwLoopS, VaucansonKeywords::kwLoopSE, VaucansonKeywords::kwLoopSW, VaucansonKeywords::kwLoopVarN, VaucansonKeywords::kwLoopVarS, VaucansonKeywords::kwLoopW, VaucansonKeywords::kwRstEdge, VaucansonKeywords::kwRstState, VaucansonKeywords::kwShowFrame, VaucansonKeywords::kwShowGrid, VaucansonKeywords::kwState, VaucansonKeywords::kwStateLineDouble, VaucansonKeywords::kwStateLineSimple, VaucansonKeywords::kwStateVar, VaucansonKeywords::kwVArcL, VaucansonKeywords::kwVArcR, VaucansonKeywords::kwVarLoopOff, VaucansonKeywords::kwVarLoopOn, VaucansonKeywords::kwVCPut, VaucansonKeywords::kwVCurveL, VaucansonKeywords::kwVCurveR, VaucansonKeywords::rstEdgeLabelColor, VaucansonKeywords::rstEdgeLabelScale, VaucansonKeywords::rstEdgeLineColor, VaucansonKeywords::rstEdgeLineStyle, VaucansonKeywords::rstEdgeLineWidth, VaucansonKeywords::rstStateFillColor, VaucansonKeywords::rstStateFillStatus, VaucansonKeywords::rstStateLabelColor, VaucansonKeywords::rstStateLabelScale, VaucansonKeywords::rstStateLineColor, VaucansonKeywords::rstStateLineStyle, VaucansonKeywords::rstStateLineWidth, VaucansonKeywords::setEdgeLabelColor, VaucansonKeywords::setEdgeLabelScale, VaucansonKeywords::setEdgeLineColor, VaucansonKeywords::setEdgeLineStyle, VaucansonKeywords::setEdgeLineWidth, VaucansonKeywords::setStateFillColor, VaucansonKeywords::setStateFillStatus, VaucansonKeywords::setStateLabelColor, VaucansonKeywords::setStateLabelScale, VaucansonKeywords::setStateLineColor, VaucansonKeywords::setStateLineStyle, and VaucansonKeywords::setStateLineWidth.

Referenced by LexAn().

Here is the caller graph for this function:

bool LexAn::isAllowed ( char  character  )  [private]
Token LexAn::keyWordTest ( const QString &  tokenData  )  [private]

Definition at line 412 of file parser.cpp.

References DBGLOG_LEX, and keywordMap.

Referenced by readToken().

Here is the caller graph for this function:

bool LexAn::openFile ( const QString &  fn  ) 

opens input file, returns false if opening fails

Definition at line 157 of file parser.cpp.

References DBGLOG_LEX, fileOpened, and inFile.

Referenced by Parser::run().

Here is the caller graph for this function:

char LexAn::readChar (  )  [private]

Definition at line 171 of file parser.cpp.

References character, inFile, input, line, lineIndex, lineLength, and lineNumber.

Referenced by readStringBetween(), and readToken().

Here is the caller graph for this function:

QString LexAn::readStringBetween ( const QChar &  opening,
const QChar &  closing,
bool  allowMatching = true 
)

reads string between characters pair, if allowMatching is false, first closing character stops reading, otherwise balances matching is used never call matching on opening character, but ever call matching to closing character!

Definition at line 208 of file parser.cpp.

References character, input, readChar(), RELLOG, token, and tokenData.

Referenced by Parser::StateLabel(), Parser::TransitionLabel(), and Parser::VCPut().

Here is the call graph for this function:

Here is the caller graph for this function:

Token LexAn::readToken (  ) 

reads single new token

Definition at line 249 of file parser.cpp.

References character, DBGLOG_LEX, VaucansonKeywords::ERR, fileOpened, input, keyWordTest(), VaucansonKeywords::kwBegin, readChar(), token, and tokenData.

Referenced by Parser::Element(), Parser::matching(), Parser::Numb(), Parser::Predeclaration(), and Parser::run().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

unsigned char LexAn::character [private]

Definition at line 94 of file parser.h.

Referenced by readChar(), readStringBetween(), and readToken().

bool LexAn::fileOpened [private]

Definition at line 91 of file parser.h.

Referenced by openFile(), and readToken().

QFile* LexAn::inFile [private]

Definition at line 90 of file parser.h.

Referenced by openFile(), readChar(), and ~LexAn().

char LexAn::input [private]

Definition at line 93 of file parser.h.

Referenced by readChar(), readStringBetween(), and readToken().

Definition at line 67 of file parser.h.

Referenced by initialize(), and keyWordTest().

char LexAn::line[1024] [private]

Definition at line 96 of file parser.h.

Referenced by readChar().

int LexAn::lineIndex [private]

Definition at line 97 of file parser.h.

Referenced by readChar().

int LexAn::lineLength [private]

Definition at line 98 of file parser.h.

Referenced by readChar().

int LexAn::lineNumber [private]

Definition at line 95 of file parser.h.

Referenced by getLineNumber(), and readChar().

Definition at line 99 of file parser.h.

Referenced by getToken(), readStringBetween(), and readToken().

QString LexAn::tokenData [private]

Definition at line 100 of file parser.h.

Referenced by getTokenData(), readStringBetween(), and readToken().


The documentation for this class was generated from the following files: