Skip to content

Thoughts on cfront's potential improvements #84

Open
@ChAoSUnItY

Description

@ChAoSUnItY

Currently cfront is using scanless parser with IR emitter binds into it, and it contains ~3000 LOC. But based on my contributions experience to industrial grade programming languages (V Lang in this case), shecc's frontend parser is lack of ease to either debug or for others to contribute (Even though shecc is meant to be educational).

Here's a list of my thoughts on improving the frontend of shecc:

  1. Discard scanerless parser, rewrite it into both lexer and parser.
  2. Introducing Abstract Syntax Tree for better IR emission and backend generation.
  3. Separation on the compilation phases into multiple files would be a better idea for potential contributors to learn shecc's architecture.

And by accepting the suggestion described above, the possible major changes would be:

  1. Having more than 3 phases compilation in shecc.
  2. The code generation logic must rewrite based on the introduced AST.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions