torc-master
|
#include <Scanner.hpp>
Public Member Functions | |
Scanner (std::istream *arg_yyin=0, std::ostream *arg_yyout=0) | |
virtual | ~Scanner () |
virtual Parser::token_type | lex (Parser::semantic_type *yylval, Parser::location_type *yylloc) |
void | set_debug (bool b) |
bool | getIsIdContext () const |
void | setIsIdContext (bool inIsIdContext) |
void | skipThisRule (char *yytext) |
bool | getAppendToBuffer () |
void | setAppendToBuffer (bool inAppendToBuffer) |
void | resetBuffer () |
void | addToBuffer (const char *str) |
std::string | getBuffer () |
bool | getAppendToUserDataBuffer () |
void | setAppendToUserDataBuffer (bool inAppendToBuffer) |
void | addToUserDataBuffer (const char *str) |
void | resetUserDataBuffer () |
std::string | getUserDataBuffer () |
Private Attributes | |
bool | mIsIdContext |
bool | mAppendToBuffer |
bool | mAppendToUserDataBuffer |
std::string | mBuffer |
std::string | mUserDataBuffer |
bool | mIsIdAlreadyAdded |
Scanner is a derived class to add some extra function to the scanner class. Flex itself creates a class named FlexLexer, which is renamed using macros to EdifFlexLexer. However we change the context of the generated yylex() function to be contained within the Scanner class. This is required because the yylex() defined in EdifFlexLexer has no parameters.
Definition at line 55 of file Scanner.hpp.
torc::generic::Scanner::Scanner | ( | std::istream * | arg_yyin = 0 , |
std::ostream * | arg_yyout = 0 |
||
) |
Create a new scanner object. The streams arg_yyin and arg_yyout default to cin and cout, but that assignment is only made when initializing in yylex().
Definition at line 7042 of file Scanner.cc.
|
virtual |
void torc::generic::Scanner::addToBuffer | ( | const char * | str | ) |
void torc::generic::Scanner::addToUserDataBuffer | ( | const char * | str | ) |
Definition at line 7116 of file Scanner.cc.
|
inline |
|
inline |
Definition at line 124 of file Scanner.hpp.
|
inline |
|
inline |
Definition at line 108 of file Scanner.hpp.
|
inline |
|
virtual |
This is the main lexing function. It is generated by flex according to the macro declaration YY_DECL above. The generated bison parser then calls this virtual function to fetch new tokens.
void torc::generic::Scanner::resetBuffer | ( | ) |
void torc::generic::Scanner::resetUserDataBuffer | ( | ) |
void torc::generic::Scanner::set_debug | ( | bool | b | ) |
Enable debug output (via arg_yyout) if compiled into the scanner.
Definition at line 7125 of file Scanner.cc.
void torc::generic::Scanner::setAppendToBuffer | ( | bool | inAppendToBuffer | ) |
void torc::generic::Scanner::setAppendToUserDataBuffer | ( | bool | inAppendToBuffer | ) |
Definition at line 7098 of file Scanner.cc.
|
inline |
void torc::generic::Scanner::skipThisRule | ( | char * | yytext | ) |
Definition at line 7057 of file Scanner.cc.
|
private |
Definition at line 101 of file Scanner.hpp.
|
private |
Definition at line 102 of file Scanner.hpp.
|
private |
Definition at line 103 of file Scanner.hpp.
|
private |
Definition at line 105 of file Scanner.hpp.
|
private |
Definition at line 100 of file Scanner.hpp.
|
private |
Definition at line 104 of file Scanner.hpp.