Skip to content

JuanMBriones/Obiecti

Repository files navigation

Obiecti

Obiecti is a brand new OOP programming language 👾👾👾

Requirements:

pip install ply

To run your file:

python3 compile.py YOUR_FILE_NAME.txt YOUR_OBJECT_FILE_NAME.txt

To run the tests: 🧪🧪🧪🧪

python3 -m unittest discover -s tests/ -v

Information about the v1: A lexical analyzer has been build to recognize the tokens of the language taking in consideration the sytax proposals that were delivered to M.C. Elda Quiroga

Semantical Proposal: The following is a semantical proposal for the Obiecti language. We will be using the following terms: Data Type Operation

This will be used for the semantic cube of the language.

Data Type:
    Integer
    Float
    String
    Char

Operation:
    sum
    sub
    div
    mult

The semantic cube is the following:
    int + int = int
    int + float = float
    int + char = char
    float + int = float
    float + float = float
    char + int = char
    char + char = char
    char + string = string
    string + char = string

    int - int = int
    int - float = float
    int - char = char
    float - int = float
    float - float = float
    char - int = char
    char - char = char

    int * int = int
    int * float = float
    float * float = float

    int / int = int
    int / float = float
    float / float = float

Is not possible to do:
    int OP string
    int OP char
    float OP string
    float OP char

The structure of a program look like this:

program x2
private class x3 : x4 {
    print("Hello world")
}

To declare variables you can use something like this:

var x2, x3 : int
x2 = 10

You can't declare variables inside a while

To define a function you can use something like this:

int def x3() {
    return 3
}

For conditionals, you can only use if and elif. Else doesn't exist here

if (x2 < 3) {
    print("Hi")
}
elif (x2 < 5) {
    print("Goodbye")
}

The only loop that exists here is while

while (x2 < 3) {
    print("Hi")
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages