Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.3 KB

README.md

File metadata and controls

47 lines (30 loc) · 1.3 KB

PeachLang 🍑 (Programming Language)

PeachLang™ is a simple interpreted programming language done with Ruby using Racc for the parser (Racc is the Ruby version of Yacc/Bison). The language has been made thanks to MACournoyer's book.

Although my favorite book (my bedside book TBH! 👌) is by far the Dragon Book, Marc-André's book is also a really good one! 😊

📓 Usage

From your terminal, you can execute the example peach file:

ruby src/PeachLang examples/PeachLang/say-hello.peach

Or... use the interactive shell, like

PeachLang Interpreter
CTRL+R to quit
>> say("Hi")
Hi
=> nil

⚙️ Modify "grammar.y"

If you change grammar.y parsing rules, you will need to regenerate parser.rb file by using the following command:

racc -o parser.rb grammar.y

P.S. You will need to install Racc before doing it:

gem install racc

🚀 Other Programming Languages I've Done

✉️ Contact

Any questions, please ask me at hi {{ AT }} ph7 {{ D0T }} me or visit my personal website.