eRPC Generator (erpcgen)
Rev. 1.12.0
NXP Semiconductors
|
Lexical scanner class for erpcgen interface files. More...
#include <ErpcLexer.hpp>
Public Member Functions | |
ErpcLexer (const char *inputFile) | |
This function is constructor of ErpcLexer class. More... | |
~ErpcLexer () | |
This function is destructor of ErpcLexer class. | |
virtual Token * | getNextToken () |
This function returns next Token from flex lexer. More... | |
token_loc_t & | getLocation () |
returns the current token's location in loc. More... | |
void | pushFile (const std::string &fileName) |
Suspend actual and give new file to flex. More... | |
void | popFile () |
Give suspended file to flex. | |
std::string & | getFileName () |
return current file name More... | |
uint16_t | getIdlCrc16 () |
This function returns crc16 of all used IDL files. More... | |
Protected Member Functions | |
virtual void | LexerError (const char *msg) |
This function thrown lexical_error with given message. More... | |
int | processStringEscapes (const char *in, char *out) |
Reads the in string and writes to the out string. More... | |
virtual int | yylex () |
Internal lexer interface. More... | |
CurrentFileInfo * | openFile (const std::string &fileName) |
This function open file. More... | |
Protected Attributes | |
Value * | m_value |
token_loc_t | m_location |
uint32_t | m_indents |
CurrentFileInfo * | m_currentFileInfo |
uint16_t | m_idlCrc16 |
Lexical scanner class for erpcgen interface files.
This class is a subclass of the standard C++ lexer class produced by Flex. It's primary purpose is to provide a clean way to report values for symbols, without using the yylval global. This is necessary because the parser produced by Bison is a "pure" parser.
ErpcLexer::ErpcLexer | ( | const char * | inputFile | ) |
This function is constructor of ErpcLexer class.
This function set given file for flex lexer.
[in] | inputFile | This variable contains file name and can contains also path to file. File is given to flex lexical analysis. |
|
inline |
return current file name
|
inline |
This function returns crc16 of all used IDL files.
|
inline |
returns the current token's location in loc.
|
virtual |
|
protectedvirtual |
This function thrown lexical_error with given message.
[in] | msg | Message, which is showed, when this functions is called. |
lexical_error | Thrown always, when function is called. |
|
protected |
This function open file.
This function will try find and open file, which is given be file name variable. When file is found and opened new current file info object is created.
[in] | fileName | File name, which can contains also path to file, which is given to flex lexical analysis. |
std::runtime_error | Thrown if file is not found. |
std::runtime_error | Thrown if file can not open. |
std::runtime_error | Thrown if can not create ifstream object from file. |
|
protected |
Reads the in string and writes to the out string.
These strings can be the same string since the read head is always in front of the write head.
[in] | in | Input string containing C-style escape sequences. |
[out] | out | Output string. All escape sequences in the input string have been converted to the actual characters. May point to the same string as in. |
void ErpcLexer::pushFile | ( | const std::string & | fileName | ) |
Suspend actual and give new file to flex.
This function set to flex lexer new file, when import file request is inside parsed file.
[in] | fileName | File name, which can contains also path to file, which is given to flex lexical analysis. |
|
protectedvirtual |
Internal lexer interface.
|
protected |
Pointer to current file info.
|
protected |
Crc16 of IDL files.
|
protected |
How much indents can be removed from newlines in doxygen comments.
|
protected |
Location for the current token.