Small progress. Have to continue here..

This commit is contained in:
2024-01-20 20:17:36 +01:00
parent 223de7f190
commit fc2744d7fa
4 changed files with 120 additions and 3 deletions

View File

@@ -22,7 +22,7 @@ public:
m_source_file = source_file;
}
int analyze();
virtual int analyze() = 0;
const std::string &get_src_file()
{

View File

@@ -11,8 +11,7 @@ class TprFrontend : public TempLangFrontend {
private:
public:
TprFrontend(const std::string &source_file);
int analyze();
int analyze() override;
};

View File

@@ -0,0 +1,47 @@
#ifndef _TPR_TYPES_HPP_
#define _TPR_TYPES_HPP_
#include <vector>
namespace tpr {
enum class CommandType {
pid_conf,
temp_set,
wait_temp,
wait_time,
temp_ramp,
beep,
temp_off,
clear_flags,
digio_conf,
digio_set,
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;
}
}
#endif /* _TPR_TYPES_HPP_ */