ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PdmsLexer Class Referenceabstract

PDMS Lexer. More...

#include <PdmsParser.h>

Inheritance diagram for PdmsLexer:
Collaboration diagram for PdmsLexer:

Public Member Functions

 PdmsLexer ()
 
virtual ~PdmsLexer ()
 
virtual bool initializeSession ()
 
bool gotoNextToken ()
 
void finish ()
 
virtual void closeSession (bool destroyLoadedObject=false)
 
PointCoordinateType valueFromBuffer ()
 
const char * nameFromBuffer () const
 
virtual void printWarning (const char *str)=0
 
Token getCurrentToken () const
 
PdmsObjects::GenericItemgetLoadedObject () const
 
const char * getBufferContent () const
 
void setLoadedObject (PdmsObjects::GenericItem *o)
 

Protected Member Functions

void pushIntoDictionary (const char *str, Token token, int minSize=0)
 
virtual void parseCurrentToken ()
 
virtual void skipComment ()=0
 
virtual void skipHandleCommand ()=0
 
virtual bool moveForward ()
 

Protected Attributes

PdmsObjects::GenericItemloadedObject
 
Token currentToken
 
char tokenBuffer [c_max_buff_size]
 
char nextBuffer [c_max_buff_size]
 
std::map< std::string, Tokendictionary
 
bool stop
 
char metaGroupMask
 

Static Protected Attributes

static const int c_max_buff_size = 2048
 

Detailed Description

PDMS Lexer.

PDMS sessions are made to provide an input stream to the parser (file, keyboard, pipe, ...)

Definition at line 22 of file PdmsParser.h.

Constructor & Destructor Documentation

◆ PdmsLexer()

PdmsLexer::PdmsLexer ( )

Definition at line 29 of file PdmsParser.cpp.

References nextBuffer, and tokenBuffer.

◆ ~PdmsLexer()

virtual PdmsLexer::~PdmsLexer ( )
inlinevirtual

Definition at line 25 of file PdmsParser.h.

Member Function Documentation

◆ closeSession()

void PdmsLexer::closeSession ( bool  destroyLoadedObject = false)
virtual

Reimplemented in PdmsFileSession.

Definition at line 117 of file PdmsParser.cpp.

References dictionary, and loadedObject.

Referenced by PdmsFileSession::closeSession(), and PdmsParser::parseSessionContent().

◆ finish()

void PdmsLexer::finish ( )
inline

Definition at line 29 of file PdmsParser.h.

Referenced by PdmsParser::processCurrentToken().

◆ getBufferContent()

const char* PdmsLexer::getBufferContent ( ) const
inline

Definition at line 39 of file PdmsParser.h.

◆ getCurrentToken()

Token PdmsLexer::getCurrentToken ( ) const
inline

Definition at line 37 of file PdmsParser.h.

Referenced by PdmsParser::processCurrentToken().

◆ getLoadedObject()

PdmsObjects::GenericItem* PdmsLexer::getLoadedObject ( ) const
inline

Definition at line 38 of file PdmsParser.h.

Referenced by PdmsParser::getLoadedObject().

◆ gotoNextToken()

◆ initializeSession()

bool PdmsLexer::initializeSession ( )
virtual

Reimplemented in PdmsFileSession.

Definition at line 38 of file PdmsParser.cpp.

References c_max_buff_size, currentToken, dictionary, loadedObject, metaGroupMask, nextBuffer, PdmsTools::PDMS_AND, PdmsTools::PDMS_ANGLE, PdmsTools::PDMS_BOTTOM_DIAMETER, PdmsTools::PDMS_BOX, PdmsTools::PDMS_CONE, PdmsTools::PDMS_CREATE, PdmsTools::PDMS_CTORUS, PdmsTools::PDMS_DIAMETER, PdmsTools::PDMS_DISH, PdmsTools::PDMS_DOWN, PdmsTools::PDMS_END, PdmsTools::PDMS_EQUIPMENT, PdmsTools::PDMS_EST, PdmsTools::PDMS_EXTRU, PdmsTools::PDMS_GROUP, PdmsTools::PDMS_HEIGHT, PdmsTools::PDMS_INSIDE_RADIUS, PdmsTools::PDMS_INVALID_TOKEN, PdmsTools::PDMS_IS, PdmsTools::PDMS_LAST, PdmsTools::PDMS_LOOP, PdmsTools::PDMS_METRE, PdmsTools::PDMS_MILLIMETRE, PdmsTools::PDMS_NAME, PdmsTools::PDMS_NBOX, PdmsTools::PDMS_NEXTRU, PdmsTools::PDMS_NORTH, PdmsTools::PDMS_ORIENTATION, PdmsTools::PDMS_OUTSIDE_RADIUS, PdmsTools::PDMS_OWNER, PdmsTools::PDMS_POSITION, PdmsTools::PDMS_PYRAMID, PdmsTools::PDMS_RADIUS, PdmsTools::PDMS_RETURN, PdmsTools::PDMS_RTORUS, PdmsTools::PDMS_SCYLINDER, PdmsTools::PDMS_SITE, PdmsTools::PDMS_SNOUT, PdmsTools::PDMS_SOUTH, PdmsTools::PDMS_STRUCTURE, PdmsTools::PDMS_SUBSTRUCTURE, PdmsTools::PDMS_TOP_DIAMETER, PdmsTools::PDMS_UP, PdmsTools::PDMS_VERTEX, PdmsTools::PDMS_WEST, PdmsTools::PDMS_WORLD, PdmsTools::PDMS_WRT, PdmsTools::PDMS_X, PdmsTools::PDMS_X_BOTTOM, PdmsTools::PDMS_X_BOTTOM_SHEAR, PdmsTools::PDMS_X_OFF, PdmsTools::PDMS_X_TOP, PdmsTools::PDMS_X_TOP_SHEAR, PdmsTools::PDMS_XLENGTH, PdmsTools::PDMS_Y, PdmsTools::PDMS_Y_BOTTOM, PdmsTools::PDMS_Y_BOTTOM_SHEAR, PdmsTools::PDMS_Y_OFF, PdmsTools::PDMS_Y_TOP, PdmsTools::PDMS_Y_TOP_SHEAR, PdmsTools::PDMS_YLENGTH, PdmsTools::PDMS_Z, PdmsTools::PDMS_ZLENGTH, PdmsTools::PDMS_ZONE, pushIntoDictionary(), stop, and tokenBuffer.

Referenced by PdmsFileSession::initializeSession(), and PdmsParser::parseSessionContent().

◆ moveForward()

bool PdmsLexer::moveForward ( )
protectedvirtual

Reimplemented in PdmsFileSession.

Definition at line 245 of file PdmsParser.cpp.

References PdmsTools::c_max_str_length, nextBuffer, and tokenBuffer.

Referenced by gotoNextToken(), and PdmsFileSession::moveForward().

◆ nameFromBuffer()

const char * PdmsLexer::nameFromBuffer ( ) const

Definition at line 243 of file PdmsParser.cpp.

References tokenBuffer.

Referenced by PdmsParser::processCurrentToken().

◆ parseCurrentToken()

◆ printWarning()

virtual void PdmsLexer::printWarning ( const char *  str)
pure virtual

◆ pushIntoDictionary()

void PdmsLexer::pushIntoDictionary ( const char *  str,
Token  token,
int  minSize = 0 
)
protected

Definition at line 254 of file PdmsParser.cpp.

References dictionary.

Referenced by initializeSession().

◆ setLoadedObject()

void PdmsLexer::setLoadedObject ( PdmsObjects::GenericItem o)
inline

Definition at line 40 of file PdmsParser.h.

Referenced by PdmsParser::parseSessionContent().

◆ skipComment()

virtual void PdmsLexer::skipComment ( )
protectedpure virtual

Implemented in PdmsFileSession.

Referenced by gotoNextToken().

◆ skipHandleCommand()

virtual void PdmsLexer::skipHandleCommand ( )
protectedpure virtual

Implemented in PdmsFileSession.

Referenced by parseCurrentToken().

◆ valueFromBuffer()

PointCoordinateType PdmsLexer::valueFromBuffer ( )

Definition at line 213 of file PdmsParser.cpp.

References length(), nextBuffer, and tokenBuffer.

Referenced by PdmsParser::processCurrentToken().

Member Data Documentation

◆ c_max_buff_size

const int PdmsLexer::c_max_buff_size = 2048
staticprotected
Warning
Never pass a 'constant initializer' by reference

Definition at line 45 of file PdmsParser.h.

Referenced by initializeSession(), PdmsFileSession::moveForward(), and PdmsFileSession::skipComment().

◆ currentToken

◆ dictionary

std::map<std::string, Token> PdmsLexer::dictionary
protected

◆ loadedObject

PdmsObjects::GenericItem* PdmsLexer::loadedObject
protected

Definition at line 47 of file PdmsParser.h.

Referenced by closeSession(), and initializeSession().

◆ metaGroupMask

char PdmsLexer::metaGroupMask
protected

Definition at line 53 of file PdmsParser.h.

Referenced by gotoNextToken(), initializeSession(), and PdmsFileSession::skipComment().

◆ nextBuffer

char PdmsLexer::nextBuffer[c_max_buff_size]
protected

Definition at line 50 of file PdmsParser.h.

Referenced by initializeSession(), moveForward(), PdmsLexer(), and valueFromBuffer().

◆ stop

bool PdmsLexer::stop
protected

Definition at line 52 of file PdmsParser.h.

Referenced by gotoNextToken(), and initializeSession().

◆ tokenBuffer


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