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 "helpers/utils.hpp"
|
2020-11-10 14:26:38 +00:00
|
|
|
#include "window.hpp"
|
|
|
|
|
2020-11-19 10:36:52 +00:00
|
|
|
#include "lang/pattern_data.hpp"
|
2020-11-10 14:26:38 +00:00
|
|
|
#include "views/view_hexeditor.hpp"
|
|
|
|
#include "views/view_pattern.hpp"
|
2020-11-10 20:31:04 +00:00
|
|
|
#include "views/view_pattern_data.hpp"
|
2020-11-10 23:13:09 +00:00
|
|
|
#include "views/view_hashes.hpp"
|
2020-11-12 08:38:52 +00:00
|
|
|
#include "views/view_information.hpp"
|
2020-11-14 20:16:03 +00:00
|
|
|
#include "views/view_help.hpp"
|
2020-11-14 23:46:38 +00:00
|
|
|
#include "views/view_tools.hpp"
|
2020-11-15 00:42:43 +00:00
|
|
|
#include "views/view_strings.hpp"
|
2020-11-20 23:12:58 +00:00
|
|
|
#include "views/view_data_inspector.hpp"
|
2020-11-22 22:07:50 +00:00
|
|
|
#include "views/view_disassembler.hpp"
|
2020-11-27 23:33:26 +00:00
|
|
|
#include "views/view_bookmarks.hpp"
|
2020-11-29 01:06:41 +00:00
|
|
|
#include "views/view_patches.hpp"
|
2020-12-16 21:43:07 +00:00
|
|
|
#include "views/view_command_palette.hpp"
|
2020-11-10 20:31:04 +00:00
|
|
|
|
2020-11-11 08:18:35 +00:00
|
|
|
#include "providers/provider.hpp"
|
|
|
|
|
2020-11-10 20:31:04 +00:00
|
|
|
#include <vector>
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-12-01 17:19:49 +00:00
|
|
|
int mainArgc;
|
|
|
|
char **mainArgv;
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
mainArgc = argc;
|
|
|
|
mainArgv = argv;
|
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
hex::Window window;
|
|
|
|
|
2020-11-10 20:31:04 +00:00
|
|
|
// Shared Data
|
2020-11-19 10:36:52 +00:00
|
|
|
std::vector<hex::lang::PatternData*> patternData;
|
2020-11-27 23:33:26 +00:00
|
|
|
|
2020-11-10 20:31:04 +00:00
|
|
|
// Create views
|
2020-12-27 14:39:06 +00:00
|
|
|
window.addView<hex::ViewHexEditor>(patternData);
|
|
|
|
window.addView<hex::ViewPattern>(patternData);
|
|
|
|
window.addView<hex::ViewPatternData>(patternData);
|
|
|
|
window.addView<hex::ViewDataInspector>();
|
|
|
|
window.addView<hex::ViewHashes>();
|
|
|
|
window.addView<hex::ViewInformation>();
|
|
|
|
window.addView<hex::ViewStrings>();
|
|
|
|
window.addView<hex::ViewDisassembler>();
|
|
|
|
window.addView<hex::ViewBookmarks>();
|
|
|
|
window.addView<hex::ViewPatches>();
|
|
|
|
window.addView<hex::ViewTools>();
|
2020-12-16 21:43:07 +00:00
|
|
|
window.addView<hex::ViewCommandPalette>();
|
2020-11-22 22:07:50 +00:00
|
|
|
window.addView<hex::ViewHelp>();
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-12-05 21:10:03 +00:00
|
|
|
if (argc > 1)
|
|
|
|
hex::View::postEvent(hex::Events::FileDropped, argv[1]);
|
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
window.loop();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|