Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.
/ gfy-cpp Public archive

Interpreter written in C++ for the bizarre and unconventional GFY language.

Notifications You must be signed in to change notification settings

LanaMirko04/gfy-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GFY-CPP

An interpreter for the GFY language written in C++.

⚠️ This project is discontinued beacuse the original GFY language is no longer maintained.

Building

To build the interpreter, run the following commands:

$ git clone https://github.com/LanaMirko04/gfy-cpp.git
$ cd gfy-cpp
$ make

Usage

To run the interpreter, use the following command:

$ ./bin/gfy-cpp <file>

Where <file> is the path to the file containing the GFY code.

Implemented features

The following is a list of the features that have been implemented in the interpreter.

Legend:

  • ✅ - Implemented
  • ⚠️ - Partially implemented
  • ❌ - Not implemented

I/O

Keyword Description Status
input Reads a value from the given input stream.
output Prints a value to the given output stream.

Variables

Keyword Description Status
print Prints a string to the console. ⚠️
set Sets a variable to a value. ⚠️

Variable types

Type Description Status
int Integer number.
float Floating-point number.
string String.
bool Boolean value.
list List of values.

Arithmetic operations

Keyword Description Status
add Adds two numbers.
sub Subtracts two numbers.
mul Multiplies two numbers.
div Divides two numbers.
mod Calculates the remainder of the division of two numbers.

Logical operations

Keyword Description Status
equals Checks if two values are equal.
greater Checks if the first value is greater than the second.
less Checks if the first value is less than the second.
define Defines a function.

Operators

Operator Description Status
-> Set explicit type. ⚠️
@ Get the value of a list at a specific index.

Documentation

TODO

Notes

  • input, output, list and @ are not implemented in the lexer yet.
  • The interpreter is still in development and some features may not work as expected.

Aknowledgements

Special thanks to: