Restructure bison generation to allow multiple forntends

This commit is contained in:
2024-01-22 21:20:10 +01:00
parent b83f057e49
commit 0e5ef46512
7 changed files with 68 additions and 72 deletions

View File

@@ -6,8 +6,8 @@
#include <FlexLexer.h>
#endif
#include "tpr-parser.hpp"
#include "location.hh"
#include <tpr-parser/tpr-parser.hpp>
#include <tpr-parser/location.hh>
namespace tpr {

View File

@@ -19,26 +19,17 @@ enum class CommandType {
digio_wait,
};
struct CommandSpec {
CommandType type;
std::vector<bool> param_is_whole_num;
};
class TprCommand {
private:
static const CommandSpec m_specs[11];
CommandType m_type;
std::vector<float> m_parameters;
bool is_whole_number(float num) const;
public:
TprCommand(CommandType type);
TprCommand(CommandType type, const std::vector<float> &params);
TprCommand(CommandType type, const std::vector<float> &&params);
bool check_command(bool print_status) const;
};