Skip to content

Very rough first draft at codegen module - #652

Draft
ratmice wants to merge 2 commits into
softdevteam:masterfrom
ratmice:codegen_cleanup
Draft

Very rough first draft at codegen module#652
ratmice wants to merge 2 commits into
softdevteam:masterfrom
ratmice:codegen_cleanup

Conversation

@ratmice

@ratmice ratmice commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Here is a (not very pretty) first draft which is mostly just pulling code as-is out of CTLexerBuilder::build() into smaller, more manageable functions. I don't think anything here is really properly named, codegen at times seems like it's doing more parsing/validation than actual code generation (where it never uses it's self type!)

I thought that the splitting of the CTTokenMapBuilder turned out okay, however it is quite a bit simpler with less moving parts.

My thoughts are to try and rename the LexCodegen structure to something like LexCodegenBuilder,
and then try see if we can manage to come up with a good Self type for the codegen parts.

Edit:
I haven't tried to make anything public here yet, aiming for close to verbatim code movement.
I do have an idea of what a second draft might look like, we'll see if it works soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant