Skip to content

Releases: fedejinich/fcc

chapter_8

04 Jan 21:56
f2ab131

Choose a tag to compare

In this chapter:

  • Added support for loops: while, do-while and for statements, along with break and continue.
  • Introduced a new semantic pass for loop labeling that tags each loop with a unique identifier to correctly resolve control flow jumps. - Extended variable resolution to support loops and generates the corresponding TACKY code.
chapter_8

chapter_7

04 Jan 21:52
f2ab131

Choose a tag to compare

In this chapter:

  • Introduced compound statements (blocks { ... }) to the compiler.
  • Added Block and Compound to the AST,
  • Implemented block parsing,
  • Extended variable resolution to support block scoping,
  • Converting blocks to TACKY IR.
chapter_7

chapter_6

21 Dec 23:08
7711b53

Choose a tag to compare

Now fcc supports if (cond) exp_1 else exp_2 statements and conditional ternary operator cond ? v1 : v2.

  • if else statement.
  • if statment (without else clause).
  • if and else are now a keywords.
  • Ternary operator cond ? v1 : v2.
image

chapter_5

24 Sep 03:14
db0cb47

Choose a tag to compare

Now fcc supports local variables and semnatic checks.

  • Local variables: declarations with and without initializers.
  • Variable resolution: unique renaming of identifiers.
  • Initializers: evaluate and store into the declared variable.
  • Short-circuit: correct evaluation order for &&/||.
  • Semantic checks: duplicates, undeclared uses, invalid lvalues.
Screenshot 2025-09-24 at 12 14 41 AM

chapter_4

03 Sep 14:26
a4cd835

Choose a tag to compare

now fcc supports logical and relational operators (for precedence and associativity)

  • Relational: <, <=, >, >=, ==, !=
  • Logical: &&, ||
Screenshot 2025-09-03 at 11 25 07 AM

chapter_3_bitwise

29 Aug 04:08
fee2271

Choose a tag to compare

This is an extension of chapter 3 that adds support for bitwise operators ^ & | << >>

chapter_3

27 Aug 04:21
f84522a

Choose a tag to compare

fcc now supports Binary Operators (+, -, *, /, %):

  • Added parsing and code generation for binary operators
  • Implemented precedence climbing for expression parsing
  • Extended TACKY generation and assembly output
Screenshot 2025-08-27 at 1 23 01 AM

chapter_2

18 Aug 20:58
f1d79af

Choose a tag to compare

Second fcc snapshot, supporting unary operators:

  • Support for - and ~ unary operators
  • New tacky intermediate representation
  • Parsing recursive expressions
  • Replacing pseudoregisters with stack address
  • Fixing mov insutrctions to support registers on both operands
  • Emiting assembly
Screenshot 2025-08-18 at 5 56 25 PM

chapter_1

13 Aug 14:17

Choose a tag to compare

First functional snapshot of the compiler, implementing the four basic passes:

  • Lexer: Converts the source code into a list of tokens (delimiters, symbols, keywords, identifiers).
  • Parser: Transforms the token list into an abstract syntax tree (AST) for easier analysis.
  • Assembly generation: Converts the AST into assembly instructions, stored in an internal data structure.
  • Code emission: Writes the assembly code to a file for later assembling and linking.
Screenshot 2025-08-18 at 6 05 19 PM

old master

13 Aug 14:08
f138e79

Choose a tag to compare

this is an old and archived version of fcc