DogWaterDev / DurianCompiler

compiler for some random programming language i'll invent ig
GNU General Public License v3.0
0 stars 0 forks source link

No visualization method for abstract syntax trees / Expressions / Statements/ Declarations #3

Open DogWaterDev opened 5 months ago

DogWaterDev commented 5 months ago

Abstract Syntax Trees are hard to visualize without a pretty printer for them.

It will be difficult to debug the compiler without any method for this, as you'd have no idea why the compiler fails.

Declarations, Expressions, and Statement could also be difficult to visualize without this feature

Pretty print function for ASTs could look something like this:

image

Or more like this:

image

The first method is easier to read, but likely much harder to implement (guesstimating)

The second method is harder to read, but seems easier to implement (guesstimating)

If you want to try this, just fork the repo and send a PR. The most recent version of the code is all in the 'master' branch.

DogWaterDev commented 5 months ago

so maybe nobody wants to do this (or nobody saw this) so i'm gonna start working on this now, as i finished the lexer

DogWaterDev commented 4 months ago

im so lazy it's crazy... i have like 2 hours to maybe do this (i suck at programming) so i will work on this but im a bit lost rn pray for me y'all

DogWaterDev commented 2 months ago

mb mb im two tired