2020-11-10 14:26:38 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "views/view.hpp"
|
2020-11-19 10:36:52 +00:00
|
|
|
#include "lang/pattern_data.hpp"
|
2021-01-09 22:48:42 +00:00
|
|
|
#include "lang/evaluator.hpp"
|
2020-11-13 12:06:22 +00:00
|
|
|
|
|
|
|
#include "providers/provider.hpp"
|
2020-11-10 14:26:38 +00:00
|
|
|
|
|
|
|
#include <cstring>
|
2020-11-21 13:39:16 +00:00
|
|
|
#include <filesystem>
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 19:27:11 +00:00
|
|
|
#include <thread>
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-17 14:38:24 +00:00
|
|
|
#include "ImGuiFileBrowser.h"
|
2020-11-20 17:24:59 +00:00
|
|
|
#include "TextEditor.h"
|
2020-11-12 20:20:51 +00:00
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class ViewPattern : public View {
|
|
|
|
public:
|
2020-12-27 14:39:06 +00:00
|
|
|
explicit ViewPattern(std::vector<lang::PatternData*> &patternData);
|
2020-11-11 08:28:44 +00:00
|
|
|
~ViewPattern() override;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-12-22 17:10:01 +00:00
|
|
|
void drawMenu() override;
|
|
|
|
void drawContent() override;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
|
|
|
private:
|
2020-11-19 10:36:52 +00:00
|
|
|
std::vector<lang::PatternData*> &m_patternData;
|
2020-11-21 13:39:16 +00:00
|
|
|
std::filesystem::path m_possiblePatternFile;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-20 17:24:59 +00:00
|
|
|
TextEditor m_textEditor;
|
2021-01-09 22:48:42 +00:00
|
|
|
std::vector<std::pair<lang::Evaluator::ConsoleLogLevel, std::string>> m_console;
|
2020-11-17 14:38:24 +00:00
|
|
|
imgui_addons::ImGuiFileBrowser m_fileBrowser;
|
2020-11-12 20:20:51 +00:00
|
|
|
|
2020-11-21 13:39:16 +00:00
|
|
|
void loadPatternFile(std::string path);
|
2020-11-14 13:42:21 +00:00
|
|
|
void clearPatternData();
|
2020-11-10 20:31:04 +00:00
|
|
|
void parsePattern(char *buffer);
|
2020-11-10 14:26:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|