Commit Graph

138 Commits

Author SHA1 Message Date
ed a8a9b681f0 test completes singleheader ast construction and serailizes with corruption 2023-08-02 14:01:56 -04:00
ed b96b0821c1 Fixes towards parsing (getting to line 12575 now of the singleheader. 2023-08-02 12:39:35 -04:00
ed 4c8a0f0005 Iterations on serialization improvements. 2023-08-01 20:56:00 -04:00
ed 684569750d first serialization of singlehearder without asserts. (Still failing after around 4k lines. 2023-08-01 16:07:47 -04:00
ed 0f16d1131e Got past parsing, fixing serialization 2023-08-01 14:02:54 -04:00
ed 528ef72a51 More progress on parsing
Made it to line 2597 of self parsing its singleheader

Complex global or member defintions are now supported.
2023-08-01 05:17:24 -04:00
ed 21a8f3bb39 WIP: It can parse to around ~2k lines. Need to improve its ability to detect when a forward declare of a class/enum/struct/union..
This language truly is a mess.
2023-08-01 00:42:08 -04:00
ed 2b63fc27cd Progress toward preprocessor parsing, lexing works, parsing does not. 2023-07-30 18:55:57 -04:00
ed bfbfae466f Naive preprocessor support initial implementation (compiles and runs, not heavily tested) 2023-07-30 01:21:04 -04:00
ed 03df940085 Improved parser scope errors.
Added the caret for indicating where the error is.
2023-07-29 17:14:02 -04:00
ed 0a5885495f got old tests working (test.parsing.cpp and test.upfront.cpp) 2023-07-29 16:00:06 -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 689646c393 Finished iniital refactor pass. Comples, but has runtime issues. 2023-07-29 06:32:16 -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 31e1c38c18 Started to implement context stack for parser. 2023-07-28 21:44:31 -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 8232e79aac Adding pragma regions to all dependency components 2023-07-25 23:00:57 -04:00
ed a11117c97c Fixes to the parsing constructors 2023-07-25 19:23:21 -04:00
ed cd9b393790 Fixes to bootstrap and singleheader generation 2023-07-25 17:46:00 -04:00
ed 62b0ed2112 Finished initial implmentation bootstrap generation and singleheader implementation. 2023-07-25 15:12:51 -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 387787b88d Formatting fixes 2023-07-24 20:59:20 -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 49ef1a2e87 gen.deps.cpp "componentized" 2023-07-24 18:35:16 -04:00
ed 5aa334237a gen.dep.hpp "componentization" 2023-07-24 18:19:37 -04:00
ed 74ea502de5 "compentiazation" of gen.hpp and gen.cpp 2023-07-24 17:45:27 -04:00
ed fcca15b4b9 Making new files, preparing to offload code to them. 2023-07-24 14:30:57 -04:00
ed 88a43cb11f namespace macro unused in gen.dep.cpp, updates to readme. 2023-07-24 14:30:35 -04:00
ed 39390535ce Support for interfaces in class/struct.
Interfaces are assumed to have the public access specifier for their content (if its a class definition)

Started to prepare to segement library code into more files (Less scrolling, need for bootstrapping a tailored version + single header support anyway).
2023-07-24 13:44:19 -04:00
ed d4c2cdf30e Added varadic parameter support (upfront and parsing) 2023-07-24 11:20:13 -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 5df21998ef Should support parsing full definitions within typedef... (need to make tests) 2023-07-23 23:28:21 -04:00
ed 80b5c9768d Adding tuning macros for memory usage of the library, fixes.
Reduced the sanity test case to half its original iterations.
2023-07-23 23:11:53 -04:00
ed 5ce8bfa259 Added macros to make the gen namespace optional. 2023-07-23 22:25:19 -04:00
ed e7374ec328 Support for module and attribute parsing ( untested ) 2023-07-23 22:14:48 -04:00
ed b1de5b1ac7 Fixed swap fn 2023-07-21 01:40:45 -04:00
ed a37c3f63c2 Update to readme, update CodePool_NumBlocks to 64k 2023-07-21 01:12:38 -04:00
ed efd7af9f96 Added ability for a CodeBody to append another 2023-07-20 23:51:56 -04:00
ed 8bb0db8145 Moved the indentation for the library over
The entire project uses the namespace and it felt redundant.

There is a fix for array append_at. Finally got csv parsing working with it.
2023-07-19 23:42:28 -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 231ae5f5d6 Some refactors (see description)
- Renamed macro gen_time to GEN_TIME
- Moved scanner and editor to their own headers, I'm going to consider them extensions.
- I'm preparing to setup the library to build on multiple compiler platforms: clang, gcc, msvc.
2023-07-18 23:33:00 -04:00
ed e501941c5c Fix for sanity test... 2023-07-17 23:40:28 -04:00
ed 9a784fe92f Preparing to implement ADT for csv functions.
I'm rewritting it the way I'd like to learn it.
- I want to use csv parsing heavily with the library so I'm just going to add it to the scanner.

- Globaly memory allocator moved to regular gen header/source as its something really just made for the library.
- Some small refactors to macros
- The parser was updated to support tokenizing preprocessor directives.
  - The purpose is based off intuition that it will be required for the scanner.
2023-07-17 20:17:19 -04:00