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_SMT2_SCANNER_H__
15#define yyFlexLexer Smt2FlexLexer
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/smt2/Sort.h"
25#include "dlinear/parser/smt2/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/smt2/parser.yy.hpp"
31
32namespace dlinear::smt2 {
33
41class Smt2Scanner : public Smt2FlexLexer {
42 public:
48 explicit Smt2Scanner(std::istream *arg_yyin = nullptr, std::ostream *arg_yyout = nullptr);
49
50 Smt2Scanner(const Smt2Scanner &) = delete;
51 Smt2Scanner(Smt2Scanner &&) = delete;
52 Smt2Scanner &operator=(const Smt2Scanner &) = delete;
53 Smt2Scanner &operator=(Smt2Scanner &&) = delete;
54
56 ~Smt2Scanner() override;
57
63 virtual Smt2Parser::token_type lex(Smt2Parser::semantic_type *yylval, Smt2Parser::location_type *yylloc);
64
66 void set_debug(bool b);
67};
68
69} // namespace dlinear::smt2
Smt2Scanner is a derived class to add some extra function to the scanner class.
Definition scanner.h:41
void set_debug(bool b)
Enable debug output (via arg_yyout) if compiled into the scanner.
Smt2Scanner(std::istream *arg_yyin=nullptr, std::ostream *arg_yyout=nullptr)
Create a new scanner object.
virtual Smt2Parser::token_type lex(Smt2Parser::semantic_type *yylval, Smt2Parser::location_type *yylloc)
This is the main lexing function.
~Smt2Scanner() override
Required for virtual functions.
Namespace for the SMT2 parser of the dlinear library.
Definition Driver.cpp:17