Commit Graph

159 Commits

Author SHA1 Message Date
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_
3d7cb85e71
Merge pull request #8 from Ed94/parser_context_stack
Parser context stack
2023-07-29 17:16: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_
b9064fba9d renamed parsed and upfront dirs to lowercase 2023-07-29 16:27:36 -04:00
Ed_
4e8d6456cb Merge branch 'parser_context_stack' of https://github.com/Ed94/gencpp into parser_context_stack 2023-07-29 16:25:50 -04:00
Ed_
d704f11c81 renamed Docs to lowercase 2023-07-29 16:25:38 -04:00
Ed_
50a10c901f renamed Docs to lowercase 2023-07-29 16:24:07 -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_
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_
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_
1d3050f157 Update readme todo (remove trailing specifiers task) 2023-07-24 00:28:23 -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_
1488aeb188 update todo 2023-07-19 00:24:00 -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