Skip to content

kabukki/brainfuck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤯 Brainfuck

A Brainfuck interpreter, written as an opportunity to practice TDD.

How it works

  1. The source code goes through a lexer that produces a series of tokens
  2. These tokens are parsed into an abstract syntax tree (AST)
  3. The AST is visited (depth-first) and interpreted by the runtime

While this seems overkill, the goal of this project is to familiarize with compiler concepts, hence the apprent complexity for such a simple problem.

Todo

BNF

Brainfuck's Backus-Naur form could be:

  • <prg> ::= <expr> | <expr> <prg>
  • <expr> ::= + | - | < | > | . | , | <loop>
  • <loop> ::= [ + <expr> + ]

About

🤯 Brainfuck interpreter

Resources

Stars

Watchers

Forks

Contributors

Languages