abacus: add parse library
Would need some improvements, such as by using the C++ Flex scanner interface. It will also need to start using the BigNum once it has been implemented.
This commit is contained in:
parent
42100fe98d
commit
ff35faa705
6 changed files with 270 additions and 0 deletions
30
src/parse/parser-driver.hh
Normal file
30
src/parse/parser-driver.hh
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "parser.hh"
|
||||
|
||||
namespace abacus::parser {
|
||||
|
||||
class ParserDriver {
|
||||
public:
|
||||
ParserDriver();
|
||||
|
||||
int parse(std::string filename);
|
||||
|
||||
void scan_open();
|
||||
void scan_close();
|
||||
|
||||
yy::location& location();
|
||||
yy::location const& location() const;
|
||||
|
||||
private:
|
||||
// FIXME: will become BigNum
|
||||
int result_ = 0;
|
||||
std::string filename_{};
|
||||
yy::location current_location_{};
|
||||
bool parse_trace_p_ = false;
|
||||
bool scan_trace_p_ = false;
|
||||
};
|
||||
|
||||
} // namespace abacus::parser
|
||||
Loading…
Add table
Add a link
Reference in a new issue