Making A Compiler: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Created page with "=Introduction= This page is how someone went about build a compiler and is here for reference =Steps= *Write example file *Read contents of file *Parse Lines *Parse Tokens in *Decide on Node Types *Decide what AST should look like *Create Nodes =Things I learnt= ==Abstract Syntax Tree== ==Continuation vs Recursion== ==Typical Flow Control=== *Jump goto, while, functions *Conditional (if/then/else) *Early Exit (break, continue, skip) *Exception handling (try/throw/catch)..."
 
Line 12: Line 12:
==Abstract Syntax Tree==
==Abstract Syntax Tree==
==Continuation vs Recursion==
==Continuation vs Recursion==
==Typical Flow Control===
==Typical Flow Control==
*Jump goto, while, functions
*Jump goto, while, functions
*Conditional (if/then/else)
*Conditional (if/then/else)

Revision as of 07:33, 6 September 2024

Introduction

This page is how someone went about build a compiler and is here for reference

Steps

  • Write example file
  • Read contents of file
  • Parse Lines
  • Parse Tokens in
  • Decide on Node Types
  • Decide what AST should look like
  • Create Nodes

Things I learnt

Abstract Syntax Tree

Continuation vs Recursion

Typical Flow Control

  • Jump goto, while, functions
  • Conditional (if/then/else)
  • Early Exit (break, continue, skip)
  • Exception handling (try/throw/catch)
  • Lazy evaluation (delay/force)
  • Threading (thread create,stop, yield)
  • Generator (yield)