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 29 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 34 of file SimpleLexer.cpp.

◆ getPositionInfo()

LexerInfo getPositionInfo ( int  pos)

Definition at line 132 of file SimpleLexer.cpp.

+ Here is the call graph for this function:

◆ nextToken()

int nextToken ( )

Definition at line 39 of file SimpleLexer.cpp.

◆ positionToLineAndColumn()

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

Definition at line 100 of file SimpleLexer.cpp.

+ Here is the caller graph for this function:

◆ reset()

void reset ( )

Definition at line 69 of file SimpleLexer.cpp.

◆ tokenIdToName()

std::string tokenIdToName ( int  id)

Definition at line 77 of file SimpleLexer.cpp.

Member Data Documentation

◆ currentTokenId

int currentTokenId

Definition at line 59 of file SimpleLexer.h.

◆ currentTokenValue

std::string currentTokenValue

Definition at line 60 of file SimpleLexer.h.

◆ lastPos

int lastPos

Definition at line 56 of file SimpleLexer.h.

◆ pos

int pos

Definition at line 55 of file SimpleLexer.h.

◆ rules

std::vector<Rule> rules

Definition at line 63 of file SimpleLexer.h.

◆ src

std::string src

Definition at line 57 of file SimpleLexer.h.

◆ tokenError

int tokenError

Definition at line 62 of file SimpleLexer.h.

◆ tokenFin

int tokenFin

Definition at line 62 of file SimpleLexer.h.


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