dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
scanner.h
1
12#pragma once
13
14#ifndef __DLINEAR_VNNLIB_SCANNER_H__
15#define yyFlexLexer VnnlibFlexLexer
16#include <FlexLexer.h>
17#undef yyFlexLexer
18#endif
19
20#ifdef DLINEAR_PYDLINEAR
21#include "pydlinear/interrupt.h"
22#endif
23
24#include "dlinear/parser/vnnlib/Sort.h"
25#include "dlinear/parser/vnnlib/Term.h"
26#include "dlinear/symbolic/symbolic.h"
27#include "dlinear/util/Box.h"
28// The following include should come after all the previous ones.
29// Do not alpha-sort them.
30#include "dlinear/parser/vnnlib/parser.yy.hpp"
31
32namespace dlinear::vnnlib {
33
41class VnnlibScanner : public VnnlibFlexLexer {
42 public:
48 explicit VnnlibScanner(std::istream *arg_yyin = nullptr, std::ostream *arg_yyout = nullptr);
49
50 VnnlibScanner(const VnnlibScanner &) = delete;
51 VnnlibScanner(VnnlibScanner &&) = delete;
52 VnnlibScanner &operator=(const VnnlibScanner &) = delete;
53 VnnlibScanner &operator=(VnnlibScanner &&) = delete;
54
56 ~VnnlibScanner() override;
57
66 virtual VnnlibParser::token_type lex(VnnlibParser::semantic_type *yylval, VnnlibParser::location_type *yylloc);
67
69 void set_debug(bool b);
70};
71
72} // namespace dlinear::vnnlib
VnnlibScanner is a derived class to add some extra function to the scanner class.
Definition scanner.h:41
virtual VnnlibParser::token_type lex(VnnlibParser::semantic_type *yylval, VnnlibParser::location_type *yylloc)
This is the main lexing function.
VnnlibScanner(std::istream *arg_yyin=nullptr, std::ostream *arg_yyout=nullptr)
Create a new scanner object.
~VnnlibScanner() override
Required for virtual functions.
void set_debug(bool b)
Enable debug output (via arg_yyout) if compiled into the scanner.
Namespace for the VNNLIB parser of the dlinear library.
Definition Driver.cpp:17