Lexer

produces tokens

Take the input and pass tokens to the parser.

Excellent talk rob pike - Lexical Scanning in Go

Parser

parsing Parse the tokens into an AST parsing algorithms

golang ast package

https://astexplorer.net/

Emitter

Wouter van Oortmerssen - Bring your language to Wasm

llvm ir in golang

https://blog.gopheracademy.com/advent-2018/llvm-ir-and-go/

https://www.aosabook.org/en/llvm.html