2020-11-10 14:26:38 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "parser/ast_node.hpp"
|
|
|
|
#include "parser/parser.hpp"
|
|
|
|
#include "parser/lexer.hpp"
|
|
|
|
#include "views/view.hpp"
|
|
|
|
|
|
|
|
#include <concepts>
|
|
|
|
#include <cstring>
|
|
|
|
|
2020-11-10 20:31:04 +00:00
|
|
|
#include "views/highlight.hpp"
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-12 20:20:51 +00:00
|
|
|
#include "imfilebrowser.h"
|
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class ViewPattern : public View {
|
|
|
|
public:
|
2020-11-11 08:28:44 +00:00
|
|
|
explicit ViewPattern(std::vector<Highlight> &highlights);
|
|
|
|
~ViewPattern() override;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-11 08:28:44 +00:00
|
|
|
void createMenu() override;
|
|
|
|
void createView() override;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
char *m_buffer;
|
|
|
|
|
2020-11-10 20:31:04 +00:00
|
|
|
std::vector<Highlight> &m_highlights;
|
2020-11-10 16:34:11 +00:00
|
|
|
bool m_windowOpen = true;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-12 20:20:51 +00:00
|
|
|
ImGui::FileBrowser m_fileBrowser;
|
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-13 11:07:05 +00:00
|
|
|
void setHighlight(u64 offset, std::string name, lang::Token::TypeToken::Type type, size_t size = 0, u32 color = 0);
|
2020-11-10 20:31:04 +00:00
|
|
|
void parsePattern(char *buffer);
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-13 10:37:43 +00:00
|
|
|
s32 highlightUsingDecls(std::vector<lang::ASTNode*> &ast, lang::ASTNodeTypeDecl* currTypeDeclNode, lang::ASTNodeVariableDecl* currVarDec, u64 offset, std::string name);
|
|
|
|
s32 highlightStruct(std::vector<lang::ASTNode*> &ast, lang::ASTNodeStruct* currStructNode, u64 offset, std::string name);
|
2020-11-10 14:26:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|