dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
dlinear::vnnlib::VnnlibScanner Class Reference

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

#include <scanner.h>

Inheritance diagram for dlinear::vnnlib::VnnlibScanner:

Public Member Functions

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

Detailed Description

VnnlibScanner 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 VnnlibScanner class. This is required because the yylex() defined in ExampleFlexLexer has no parameters.

Definition at line 41 of file scanner.h.

Constructor & Destructor Documentation

◆ VnnlibScanner()

dlinear::vnnlib::VnnlibScanner::VnnlibScanner ( 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 VnnlibParser::token_type dlinear::vnnlib::VnnlibScanner::lex ( VnnlibParser::semantic_type * yylval,
VnnlibParser::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.

Parameters
yylvala union for storing the token value
yylloca location object for storing the token location
Returns
the next token

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