Skip to content

Instantly share code, notes, and snippets.

View mvanga's full-sized avatar

Manohar Vanga mvanga

View GitHub Profile
@mvanga
mvanga / 00_readme.md
Created July 17, 2022 13:39 — forked from p4bl0-/00_readme.md
A complete compiler for a simple language (in less than 150 LoC)

This project is a tiny compiler for a very simple language consisting of boolean expression.

The language has two constants: 1 for true and 0 for false, and 4 logic gates: ! (not), & (and), | (or), and ^ (xor).

It can also use parentheses to manage priorities.

Here is its grammar in BNF format:

expr ::= "0" | "1"