SimpleLexer Class Reference

#include <ArmarXGui/libraries/StructuralJson/SimpleLexer.h>

Classes

struct  Rule
 

Public Member Functions

void addRule (int id, const std::string &name, const std::string &regex)
 
LexerInfo getPositionInfo (int pos)
 
int nextToken ()
 
void positionToLineAndColumn (int pos, int &line, int &column)
 
void reset ()
 
 SimpleLexer (std::string src, int tokenFin=-1, int tokenError=-2)
 
std::string tokenIdToName (int id)
 

Public Attributes

int currentTokenId
 
std::string currentTokenValue
 
int lastPos
 
int pos
 
std::vector< Rulerules
 
std::string src
 
int tokenError
 
int tokenFin
 

Detailed Description

Definition at line 31 of file SimpleLexer.h.

Constructor & Destructor Documentation

◆ SimpleLexer()

SimpleLexer ( std::string src,
int tokenFin = -1,
int tokenError = -2 )

Definition at line 25 of file SimpleLexer.cpp.

Member Function Documentation

◆ addRule()

void addRule ( int id,
const std::string & name,
const std::string & regex )

Definition at line 35 of file SimpleLexer.cpp.

◆ getPositionInfo()

LexerInfo getPositionInfo ( int pos)

Definition at line 138 of file SimpleLexer.cpp.

+ Here is the call graph for this function:

◆ nextToken()

int nextToken ( )

Definition at line 41 of file SimpleLexer.cpp.

◆ positionToLineAndColumn()

void positionToLineAndColumn ( int pos,
int & line,
int & column )

Definition at line 106 of file SimpleLexer.cpp.

+ Here is the caller graph for this function:

◆ reset()

void reset ( )

Definition at line 73 of file SimpleLexer.cpp.

◆ tokenIdToName()

std::string tokenIdToName ( int id)

Definition at line 82 of file SimpleLexer.cpp.

Member Data Documentation

◆ currentTokenId

int currentTokenId

Definition at line 63 of file SimpleLexer.h.

◆ currentTokenValue

std::string currentTokenValue

Definition at line 64 of file SimpleLexer.h.

◆ lastPos

int lastPos

Definition at line 60 of file SimpleLexer.h.

◆ pos

int pos

Definition at line 59 of file SimpleLexer.h.

◆ rules

std::vector<Rule> rules

Definition at line 67 of file SimpleLexer.h.

◆ src

std::string src

Definition at line 61 of file SimpleLexer.h.

◆ tokenError

int tokenError

Definition at line 66 of file SimpleLexer.h.

◆ tokenFin

int tokenFin

Definition at line 66 of file SimpleLexer.h.


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