Skip to content
/ meego Public

A miniature bootstrapped Golang to vanilla C++ transpiler

Notifications You must be signed in to change notification settings

aniketp/meego

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meego

A miniature bootstrapped Golang to 'Vanilla' C++ transpiler.

Lexer/Parser generated using gocc, following the stand-alone DFA which recognizes grammer for a regular language in BNF (Backus Naur Form).

  • Install meego and gocc
$ go get github.com/aniketp/meego
$ go get github.com/goccmack/gocc	(make deps)
  • Generate Lexer and Parser
$ cd src; gocc lang.bnf			(make run)
  • Run tests
$ cd test; go test -v			(make test)
  • Compile a simple program
$ go run main.go input/example.meego
5
Requiescat in pace, Ezio!

This project is my attempt to learn about Compiler Design, and was done in a short duration following this medium article, including my own variations on the top. As a result, the grammer is a tiny subset of Golang (with a mix of Typescript syntax).

To avoid the complexity of Intermediate Language generation and optimization, I switched the Target Language to a simple subset of C++11.

References

About

A miniature bootstrapped Golang to vanilla C++ transpiler

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published