We’ve built a complete compiler frontend. Source code becomes tokens, tokens become an abstract syntax tree. Before we jump into code generation, let’s take a moment to understand what we actually have.

What We Built

Look at the pipeline we’ve constructed:

  1. Lexer (lexer.py) - Turns source code into tokens
  2. AST Nodes (abstract.py) - Defines the tree structure
  3. Parser (parser.py) - Turns tokens into an AST

A complete frontend. We can take YFC source code and produce a structured representation of what it means.

The language itself:

  • Functions - named chunks of code with parameters
  • Conditionals - if/else expressions for branching
  • Recursion - functions that call themselves
  • Arithmetic - +, -, *, /
  • Comparison - <,…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help