Commit Graph

32 Commits

Author SHA1 Message Date
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
Ed_
b360cf3024 Setup testing and library for getting the parse api done. 2023-07-08 14:11:41 -04:00
Ed_
352da126ca Nativs support for gen::AST, fixes & update to library, getting gen_array working...
token_fmt returns StrC now. Did some fixes so it can properly function now!

Lots of changes to the Array non-parsed implementation.
It shows no errors in the edtitor static analysis, however I haven't tried it yet.
Unfortunately have some friction with how I would like to set it up like with everything in C++...
Can't inherit from ArrayBase to provide the common members to all Array defs, without introducing constructor complexity.

I may be open to using constructors in the future, depends on how I feel when trying out the context pattern used in jai and odin...
2023-06-30 03:13:41 -04:00
Ed_
257e9ebf11 Removed incremental API, fixes for operator__validation, added formatting pass on generated files
Decided not to support the incremental API, its not necessary as the ergonomics are not that big a deal.

Got operators to pass the sanity base cases, which means now all upfront constructors pass the base cases!

Next up is getting it to pass the array container generation.
2023-06-29 22:48:47 -04:00
Ed_
d00de42969 Started to fix some runtime bugs. 2023-05-08 20:54:24 -04:00
Ed_
00b4220333 Got it to compile (without Incremental, parsing, editor, scanner) 2023-05-07 15:03:24 -04:00
Ed_
340f466f24 Test now runs generated code, swtiched math test to use polyorphism from cpp.
Now need to make that array test...
2023-04-02 12:25:08 -04:00
Ed_
5e26d53a12 First test works. 2023-04-02 11:53:15 -04:00
Ed_
d66c1e4eb4 test.cpp gen_time compiles (has memory issues though) 2023-04-02 01:07:44 -04:00
Ed_
f09fe6aa15 Iniital commit 2023-04-01 22:21:46 -04:00