Skip to content

sergioaugrod/uai_lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UaiLang

Build Status

UaiLang is an initial structure of a language created with Ruby for study purposes. Structure based on the examples of the great book "How to Create Your Own Programming Language". Lexer was created using regex and used racc as parser generator.

Installation

Install deps:

$ bundle install

For changes in grammar.y it is necessary to have the racc installed:

$ gem install racc

Update Grammar

Modify grammar.y and execute racc:

$ racc -o generator.rb grammar.y

Running Code

Running codes in REPL:

$ bin/repl

Executing file code:

$ bin/repl code.uai

Usage

Example of function creation:

functrem soma(a, b) faiz
  a + b
popara

soma(1, 2)

Example of if:

if true faiz
  print("true")
  print(1)
popara

About

Cheese bread prog lang.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages