dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
scanner.h
1
11#pragma once
12
13#include <iosfwd>
14
15#ifndef __DLINEAR_MPS_SCANNER_H__
16#define yyFlexLexer MpsFlexLexer
17#include <FlexLexer.h>
18#undef yyFlexLexer
19#endif
20
21#ifdef DLINEAR_PYDLINEAR
22#include "pydlinear/interrupt.h"
23#endif
24
25#include "dlinear/parser/mps/BoundType.h"
26#include "dlinear/parser/mps/Sense.h"
27// All the types needed for the scanner to work must be imported before parser.yy.hh.
28// Needs to be included after the above headers.
29#include "dlinear/parser/mps/parser.yy.hpp"
30
31namespace dlinear::mps {
32
40class MpsScanner : public MpsFlexLexer {
41 public:
47 explicit MpsScanner(std::istream *arg_yyin = nullptr, std::ostream *arg_yyout = nullptr);
48
49 MpsScanner(const MpsScanner &) = delete;
50 MpsScanner(MpsScanner &&) = delete;
51 MpsScanner &operator=(const MpsScanner &) = delete;
52 MpsScanner &operator=(MpsScanner &&) = delete;
53
55 ~MpsScanner() override;
56
62 virtual MpsParser::token_type lex(MpsParser::semantic_type *yylval, MpsParser::location_type *yylloc);
63
65 void set_debug(bool b);
66};
67
68} // namespace dlinear::mps
MpsScanner is a derived class to add some extra function to the scanner class.
Definition scanner.h:40
~MpsScanner() override
Required for virtual functions.
virtual MpsParser::token_type lex(MpsParser::semantic_type *yylval, MpsParser::location_type *yylloc)
This is the main lexing function.
MpsScanner(std::istream *arg_yyin=nullptr, std::ostream *arg_yyout=nullptr)
Create a new scanner object.
void set_debug(bool b)
Enable debug output (via arg_yyout) if compiled into the scanner.
Namespace for the MPS parser of the dlinear library.
Definition BoundType.cpp:13