2020-11-10 15:26:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
2021-01-13 17:28:27 +01:00
|
|
|
#include <hex/views/view.hpp>
|
|
|
|
#include <hex/lang/evaluator.hpp>
|
2021-01-22 18:01:39 +01:00
|
|
|
#include <hex/lang/pattern_language.hpp>
|
2020-11-13 13:06:22 +01:00
|
|
|
|
2021-01-13 17:28:27 +01:00
|
|
|
#include <hex/providers/provider.hpp>
|
2020-11-10 15:26:38 +01:00
|
|
|
|
|
|
|
#include <cstring>
|
2020-11-21 14:39:16 +01: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 20:27:11 +01:00
|
|
|
#include <thread>
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2021-01-13 17:28:27 +01:00
|
|
|
#include <ImGuiFileBrowser.h>
|
|
|
|
#include <TextEditor.h>
|
2020-11-12 21:20:51 +01:00
|
|
|
|
2020-11-10 15:26:38 +01:00
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class ViewPattern : public View {
|
|
|
|
public:
|
2020-12-27 15:39:06 +01:00
|
|
|
explicit ViewPattern(std::vector<lang::PatternData*> &patternData);
|
2020-11-11 09:28:44 +01:00
|
|
|
~ViewPattern() override;
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2020-12-22 18:10:01 +01:00
|
|
|
void drawMenu() override;
|
|
|
|
void drawContent() override;
|
2020-11-10 15:26:38 +01:00
|
|
|
|
|
|
|
private:
|
2021-01-22 18:01:39 +01:00
|
|
|
lang::PatternLanguage *m_patternLanguageRuntime;
|
2020-11-19 11:36:52 +01:00
|
|
|
std::vector<lang::PatternData*> &m_patternData;
|
2020-11-21 14:39:16 +01:00
|
|
|
std::filesystem::path m_possiblePatternFile;
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2020-11-20 18:24:59 +01:00
|
|
|
TextEditor m_textEditor;
|
2021-01-21 11:36:58 +01:00
|
|
|
std::vector<std::pair<lang::LogConsole::Level, std::string>> m_console;
|
2020-11-17 15:38:24 +01:00
|
|
|
imgui_addons::ImGuiFileBrowser m_fileBrowser;
|
2020-11-12 21:20:51 +01:00
|
|
|
|
2020-11-21 14:39:16 +01:00
|
|
|
void loadPatternFile(std::string path);
|
2020-11-14 14:42:21 +01:00
|
|
|
void clearPatternData();
|
2020-11-10 21:31:04 +01:00
|
|
|
void parsePattern(char *buffer);
|
2020-11-10 15:26:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|