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:
Bruno BELANYI 2021-08-20 02:05:53 +02:00
parent 42100fe98d
commit ff35faa705
6 changed files with 270 additions and 0 deletions

View 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