Skip to content

RaxoCoding/guacamole_lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guacamole Lang README

Guacamole Logo

Introduction

Name : Guacamole, File Extension : .g, Author : Raxo, Grammar : PEG (lang.peg)

Syntax Highlighting

if you would like a syntax highlighter for Guacamole, I have included a .vsix file which can easily be installed on VSCode for syntax highlighting.

Usage

Compile Compiler:

> make clean && make && make compiler

Interpret Code:

> ./compiler code.g

Definitions

Primitive Operators

+       // ADD
-       // SUBTRACT
*       // MULTIPLY
/       // DIVIDE
^       // RAISE TO POWER
%       // MODULO

Unary Operators

+       // STAY
-       // FLIP
!       // 0 IF BIGGER THAN 0 ELSE 1

Comparisons

==      // EQUAL TO
!=      // NOT EQUAL TO
<=      // LESS THAN OR EQUAL TO
<       // LESS THAN
>=      // MORE THAN OR EQUAL TO
>       // MORE THAN

Logical Operators

||      // OR
&&      // AND

Variables

a = 1;

b = a + 5;

c = (b ^ 4) * 4;

Control Operators

break    // BREAK LOOP
return   // RETURN FROM FUNK
continue // SKIP TO NEXT LOOP ITERATION

Keywords

if      // IF CONDITION
elif    // ELSE IF CONDITION
else    // ELSE CONDITION
while   // WHILE LOOP

Conditionals

// IF BLOCK
if (a == 1 || a == 2) {
    a = 4;
} 
// ELIF BLOCK
elif (a < 1 && a < 2) {
    a = 1;
}
// ELSE BLOCK
else {
    a = 2;
}

// WHILE BLOCK
while (a < 5) {
    a = a + 1;
}

Functions

funk add(a, b) {
    return a + b;
}

Builtins

print(a);   // PRINTS WITH 1 SPACE AFTER
println(a); // PRINTS WITH NEWLINE AFTER
donut();    // DONUT!!!!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published