dReal4
DrScanner Class Reference

DrScanner is a derived class to add some extra function to the scanner class. More...

#include </home/soonhokong/work/dreal4/dreal/dr/scanner.h>

Inheritance diagram for DrScanner:

Public Member Functions

 DrScanner (std::istream *arg_yyin=nullptr, std::ostream *arg_yyout=nullptr)
 Create a new scanner object. More...
 
 DrScanner (const DrScanner &)=delete
 
 DrScanner (DrScanner &&)=delete
 
DrScanneroperator= (const DrScanner &)=delete
 
DrScanneroperator= (DrScanner &&)=delete
 
 ~DrScanner () override
 Required for virtual functions.
 
virtual DrParser::token_type lex (DrParser::semantic_type *yylval, DrParser::location_type *yylloc)
 This is the main lexing function. More...
 
void set_debug (bool b)
 Enable debug output (via arg_yyout) if compiled into the scanner. More...
 

Detailed Description

DrScanner is a derived class to add some extra function to the scanner class.

Flex itself creates a class named yyFlexLexer, which is renamed using macros to ExampleFlexLexer. However we change the context of the generated yylex() function to be contained within the DrScanner class. This is required because the yylex() defined in ExampleFlexLexer has no parameters.

Constructor & Destructor Documentation

◆ DrScanner()

DrScanner ( std::istream *  arg_yyin = nullptr,
std::ostream *  arg_yyout = nullptr 
)
explicit

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().

Member Function Documentation

◆ lex()

virtual DrParser::token_type lex ( DrParser::semantic_type *  yylval,
DrParser::location_type *  yylloc 
)
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.

◆ set_debug()

void set_debug ( bool  b)

Enable debug output (via arg_yyout) if compiled into the scanner.


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