gencpp/project
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
..
components Progress towards bootstrap/singleheader generation 2023-07-24 22:19:21 -04:00
dependencies Formatting fixes 2023-07-24 20:59:20 -04:00
filesystem Progress towards bootstrap/singleheader generation 2023-07-24 22:19:21 -04:00
helpers Support for interfaces in class/struct. 2023-07-24 13:44:19 -04:00
gen.bootstrap.cpp Progress towards bootstrap/singleheader generation 2023-07-24 22:19:21 -04:00
gen.cpp Progress towards bootstrap/singleheader generation 2023-07-24 22:19:21 -04:00
gen.hpp Progress towards bootstrap/singleheader generation 2023-07-24 22:19:21 -04:00
meson.build Fixes + more setup, added more directories to clean script. 2023-07-24 18:56:15 -04:00
Readme.md Progress towards bootstrap/singleheader generation 2023-07-24 22:19:21 -04:00

Documentation

The core library is contained within gen.hpp and gen.cpp. Things related to the editor and scanner are in their own respective files. (Ex: gen.scanner.<hpp/cpp> )

Dependencies are within gen.dep.<hpp/cpp>

The library is fragmented into a series of headers and sources files meant to be scanned in and then generated to a tailored format for the target gen files.

Both libraries use pre-generated (self-hosting I guess) version of the library to then generate the latest version of itself. (sort of a verification that the generated version is equivalent)

The default gen.bootstrap.cpp located in the project folder is meant to be produce a standard segmeneted library, where the components of the library have relatively dedicated header and source files. With dependencies included at the top of the file and each header starting with a pragma once.

Use those to get a general idea of how to make your own tailored version.

If the naming convention is undesired, the gencpp.refactor script can be used with the refactor

Feature Macros:

  • GEN_DONT_USE_NAMESPACE : By default, the library is wrapped in a gen namespace, this will disable that expose it to the global scope.
  • GEN_DONT_ENFORCE_GEN_TIME_GUARD : By default, the library ( gen.hpp/ gen.cpp ) expects the macro GEN_TIME to be defined, this disables that.
  • GEN_ROLL_OWN_DEPENDENCIES : Optional override so that user may define the dependencies themselves.
  • GEN_DEFINE_LIBRARY_CORE_CONSTANTS : Optional typename codes as they are non-standard to C/C++ and not necessary to library usage
  • GEN_ENFORCE_STRONG_CODE_TYPES : Enforces casts to filtered code types.
  • GEN_EXPOSE_BACKEND : Will expose symbols meant for internal use only.
  • GEN_Define_Attribute_Tokens : Allows user to define their own attribute macros for use in parsing.

GEN_USE_RECURSIVE_AST_DUPLICATION is available but its not well tested and should not need to be used.
If constructing ASTs properly. There should be no modification of ASTs, and thus this would never become an issue.
(I will probably remove down the line...)