#pragma once #include "parser/ast_node.hpp" #include "parser/parser.hpp" #include "parser/lexer.hpp" #include "views/view.hpp" #include #include #include "views/highlight.hpp" namespace hex { class ViewPattern : public View { public: ViewPattern(std::vector &highlights); virtual ~ViewPattern(); virtual void createMenu() override; virtual void createView() override; private: char *m_buffer; std::vector &m_highlights; bool m_windowOpen = true; void setHighlight(u64 offset, size_t size, std::string name, u32 color = 0); void parsePattern(char *buffer); s32 highlightUsingDecls(std::vector &ast, lang::ASTNodeTypeDecl* currTypeDeclNode, lang::ASTNodeVariableDecl* currVarDec, u64 offset); s32 highlightStruct(std::vector &ast, lang::ASTNodeStruct* currStructNode, u64 offset); }; }