Commit Graph

109 Commits

Author SHA1 Message Date
ed 7d1c499e7b Build script improvements
Made sure devshell only loads up the msvc env once.
2023-08-20 22:39:46 -04:00
ed 52ae431ad6 Made clean script remove the gen dir now from test dir. 2023-08-20 15:51:51 -04:00
ed 05fa62eced Test building & generation fixed with altest scripts 2023-08-20 15:45:06 -04:00
ed 2f7836b191 Fixes to buildscript 2023-08-20 13:18:09 -04:00
ed f574a9ba9a Further improvements to build script
test is failing to complete properly, need to debug...
2023-08-20 13:02:50 -04:00
ed a6bf60a51e Simpilication of build script, added initial support for tests 2023-08-20 12:31:28 -04:00
ed 37d9782cf2 Singleheader now compiles with new build script on both clang & msvc 2023-08-20 10:17:55 -04:00
ed 11679ba8b4 New build script works for clang and msvc!
Need to update singleheader and test to use it.
2023-08-19 21:33:01 -04:00
ed 8985f0a4d9 MSVC in latest script works
Clang is having issues.
2023-08-19 17:08:13 -04:00
ed 32a910515e More refactoring, getting rid of meson in favor of just powershell scripts 2023-08-19 12:18:48 -04:00
ed aa928ff446 Scripting updates, some refactors..
Made a package release script.

Did refactors based on some design considerations
Still need to make some major decisions...
2023-08-09 18:47:59 -04:00
ed b5fa864318 Fixes and improvements to serialization.
There were multiple issues with comment and newline lexing.

Extended printing functions to support Strings with %S flag (captial 'S').
Allows for length detection. Also made it so that precision for strings is the string length.
2023-08-08 22:14:58 -04:00
ed a4f9596d3b Fixes to serialization, reduced Define_CodeType macro
Now the execution code is generated in bootstrap/singleheader gen.
2023-08-06 17:19:57 -04:00
ed 97750388ad No longer using components/temp/ast_inlines (switched to helper function to avoid macro usage)
Increased the arg count support of num_args to 100.
2023-08-06 14:58:43 -04:00
ed 34f286d218 Library can now construct into AST and serialization itself (singleheader).
Still need to validate if they match.
2023-08-04 16:12:13 -04:00
ed d36c3fa847 Single header generates again, some more cleanup.
Looking into properly dealing with empty lines...

I want to preserve the text's empty lines in the AST for serialization purposes (perserve formatting for gapes between definitions).
Don't want to introduce the possibility of it breaking though, so will have to ignore empty_lines in a general way (if they are in a bad spot).
Attempted to cover that by having TokArray::current() auto-skip empty lines and eat as well if the type doesn't match.
2023-08-03 23:18:33 -04:00
ed 5d7dfaf666 Heavy refactor..
Isolating large macros to their own directory (components/temp).
- Plan is to remove them soon with proper generation.

Added additional component files, separating the old data_structures header for a set of ast headers.
Header_end also had its inlines extracted out.
Necessary to complete the macro isolation.

ZPL parser dependencies were removed from the core library along with builder, its now generated in bootstrap as pare of making a gen_builder set of files.

Singleheader will be changed in next few commits to reflect this as well (By making builder deps and components a conditional option).

Tests are most likely all broken for now.
2023-08-03 11:01:43 -04:00
ed b96b0821c1 Fixes towards parsing (getting to line 12575 now of the singleheader. 2023-08-02 12:39:35 -04:00
ed 2b63fc27cd Progress toward preprocessor parsing, lexing works, parsing does not. 2023-07-30 18:55:57 -04:00
ed f09bb99fdf Fixes for test generation (sanity, soa). 2023-07-29 13:15:53 -04:00
ed 108b16739f bootstrap and singleheader compile and generate. 2023-07-29 12:25:38 -04:00
ed c5afede7b5 Reorganization of files, refactors, doc updates (WIP)
Removing the gen. namespace from the files for components, dependencies, and file_processors.
They are only necessary if the include directory is transparent, and in my case those are not.

Made a docs directory. I'm offloading information from the main readme to there along with additional informationn I end up elaborating on down the line.
Enum tables were moved to their own directory (project/enums).

Library will not compile for now. Major refactor occuring with parsing related components.
2023-07-29 05:52:06 -04:00
ed 3f0b7e7fc6 Update to scripts, readme
Offloaded todo to the issues on github.
2023-07-28 03:15:50 -04:00
ed d977c82f37 Fixes from latest refactor of toktype enum. 2023-07-27 17:12:58 -04:00
ed b00c1ae522 ECode, ESpecifier, and ETokType are now all generated.
There is a redundant pattern for generating all three (as expected).

I'll use it to define a general way of doing this sort of behavior.
2023-07-27 02:51:36 -04:00
ed cf65638979 Started to generate the enums from csv (ECode, EOperator, ESpecifier).
- Changed the zpl csv parser to only accept hex values with 0x perfix. it was messing with the add term.
- Small changes to the clang format config.
2023-07-26 14:21:20 -04:00
ed 62b0ed2112 Finished initial implmentation bootstrap generation and singleheader implementation. 2023-07-25 15:12:51 -04:00
ed ebe049d3a0 Added refactor.ps1 script, fixed the gencpp.refactor script (missing commas) 2023-07-24 23:47:04 -04:00
ed 88d36f5d06 Update readme and scripts
Both bootstrap and singleheader now name the files the same as the library's default.
Output now directed toward gen directory for the corresponding dir (project, singleheader, or test)
2023-07-24 23:10:10 -04:00
ed 9c81504178 Progress towards bootstrap/singleheader generation
I will most likely need to refactor some of the components & dependencies files to get the desired gneration implementation the way I want.

Specficially I want to be able to eliminate macros I'm using for enums and common patterns for implmeentation of the data structures.

When it comes to the cpp files, I may leave those alone as the macros largely help ith readability.
Replacing those macros is expensive and most likely not worth it.

The macros under consideration with replacing using the library bootstrap are:

* Define_Types
* Define_Operators
* Define_Specifiers
* GEN_Define_Attribute_Tokens
* Define_CodeType
* Using_Code
* Define_TokType
* def_constant_spec ?
* Helper Macros for def_**_body functions ?
  * AST unallowed types case macros?
(The last three I'm unsure about as they work fine, and neeeding the debugger steps there is a rare scenario...)

The enums could be manually generated and have its fields derived from a CSV (which is what genc is currently doing).
This would allow the user to specify custom attribute macros as well with greater ease.

I may maually inline ProcessModuleFlags, as its not even necessary as any specific symbol with a module flag will only use the export value. Import is only used on modules themselves (from what I can tell).

The Parser::lex function could be offloaded to its own file in case the user wants to swap the entire thing out.
(Most likely may want to for various purposes)

The problem with extracting any definitions out of a component file currently is that will lead to splintering that componnet to multiple other components.
This is necessary as the proper scanner is not implemented yet (only a reduimentary scan_file proc is made so far).
2023-07-24 22:19:21 -04:00
ed 4a87a42db0 Fixes + more setup, added more directories to clean script. 2023-07-24 18:56:15 -04:00
ed b5cad6e8a1 some cleanup of unused macros in test files, preparing bootstrap and single header code + scripts 2023-07-24 18:51:49 -04:00
ed cee55ad080 Suppeort for trailing specifiers for member functions, operators, and operator type casts (Untested) 2023-07-24 00:27:13 -04:00
ed e7374ec328 Support for module and attribute parsing ( untested ) 2023-07-23 22:14:48 -04:00
ed d1c061769c GlobalAllocator fixes
- Made a gen script (does full build and test) build just builds gencpp now.
2023-07-19 00:49:54 -04:00
ed db584d8fe6 Removed GEN_FEATURE_PARSING macro, fixes to readme
Parsing constructors are too ergonomic to be a "optional" feature.
2023-07-19 00:14:15 -04:00
ed 7634aeb34c Fixes to memory mangment, library is much faster now. 2023-07-16 18:00:07 -04:00
ed 1f77e39694 Minor refactor, added optional recursive dups for ast, ...
- Added support for anonymous structs.
- Gave Token_Fmt::token_map its own static memory.
- Minor natvis fix for CodeBody
- Renamed ESpecifier::Static_Member to just Static (acts as a general use case) specifier option
- Setup the lex token array with a configurable arena allocator.

Two major things left before V0.3-4:
- Attribute and Module parisng support with base case test
- AST serializtaion strings get a dedicated slag allocator.
2023-07-16 03:19:59 -04:00
ed 79c3459f08 Updated readmes 2023-07-15 23:38:53 -04:00
ed 1e79c9190e Upfront constructors work again (test case wise)
Doing parsing set next
2023-07-15 22:27:38 -04:00
ed 0241979085 WIP, updates to vs solution, got natvis working again. serializations still bugged 2023-07-15 20:56:27 -04:00
ed 8f4a94545c Finished refactoring library, still working on cleaning up tests. 2023-07-15 15:20:55 -04:00
ed 9ce859ec64 WIP Ended up using new layout, made major changes to how asts are interacted with an iterated.
- Got rid of dynamic arrays for body entries, were using links only.
- Halfed the size of the ast from 256 to 128 bytes.
- Fields for different ast types are not accessed directly. Each type has a unique filtered AST for ease of use.
2023-07-15 00:03:14 -04:00
ed 7a2e20bcdb WIP Change to code types [ Broken ] 2023-07-13 23:01:20 -04:00
ed a86d6fa0ee Some general refactors to dependency side of the library
Also upated the gencpp.refactor script with almost all relevant symbols.
gen.undef.macros.hpp also filled out

Ready to complete gencpp related todos left in implementation...
2023-07-13 19:28:52 -04:00
ed 7828e6d2ea More dependency movement from zpl, incremental design improvements.
Made token_fmt more ergonomic, going to have to use a similar behavior with the upfront body constructors.
2023-07-12 01:33:11 -04:00
ed f9085d4b6f Parser constructor passes all current tests...
Pretty much have a working library now... Albiet with problably quite a few hidden bugs in parsing.

Next steps are to start converting library to use its own Arena, Pool, Array, HashTable types. And either work on zpl dependency gutting or making a more robust set of tests.
2023-07-11 03:10:20 -04:00
ed ddb3244467 array.Parsed.hpp passed test! 2023-07-11 01:09:50 -04:00
ed 1fb3db379c Fixed regression with non-parsed code due to new global allocator setup 2023-07-10 22:56:59 -04:00
ed 14568d512e Parsing constructors passed the sanity test! 2023-07-10 22:14:51 -04:00