Skip to content

🇧🇷 Brazilian Portuguese Language based on Julia syntax and compiled in Python

Notifications You must be signed in to change notification settings

arthurolga/SambaLang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SambaLang

EBNF

types = vazio|
        booleano|
        inteiro|
        decimal|
        caracter|
        corda|
        ;

if_se = "se ",condition,
"{", execute, "}",
{"senao ", is_se },
{"senao ","{",execute,"}"};

while_enquanto = "enquanto", condition, 
"{", execute, "}";

condition = exp | exp { ("==",">","<","!=","and","or"), exp };


factor = ("+"|"-"|"!") factor | num | "(", exp, ")" ;
term = factor, {("*"|"/"), factor};
exp = term, {("+"|"-"), term};
num = [0-9],{[0-9]};


id = char, {char} ;
char = ([a-z] | [A-Z] | "_");
typing = (types, id) | (types, set_var) ;
set_var = id, "=", exp;

execute = typing | set_var | if_se | while_enquanto | "return", (execute,"\n") ;

COMPILLING BISON AND FLEX

yacc -d samba_syntax.y ; lex samba_semantics.l ; cc lex.yy.c y.tab.c -o output;
./output

About

🇧🇷 Brazilian Portuguese Language based on Julia syntax and compiled in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages