My computer programming language made with LEX/YACC written in C. (interpreted)
My computer programming language made with LEX/YACC written in C. (interpreted)
V0.9.2 Update notes:
* major cleaning of the project
* issues found and documented
V0.9.1 Update notes:
* Prep for doubly linked lists
* Prep for VOID data type
* Prep for merge/clean
V0.8
* Prep for TCP/IP implementation
* Prep for VOID data type
# Hello World.
# Hello World.
```
```
def Main : {
def Main : {
printf[ "hello world" ];
printf[ "hello world" ];
@ -26,12 +9,9 @@ def Main : {
call Main;
call Main;
```
```
Requirements to making a program:
Requirements to making a program:
1.) a struct/function.
1.) a struct/function.
2.) a call statement.
2.) a call statement.
# Variables
# Variables
Variables are stored in a hashmap for quick and easy access. Variables also support type juggling. When you define a variable its type will be assumed when parsed.
Variables are stored in a hashmap for quick and easy access. Variables also support type juggling. When you define a variable its type will be assumed when parsed.
Variables are scoped to the struct that they are defined in. This is so everything is not global. An example of this would look:
```
def MyDog : {
age = -153000;
name = "i dont have a name";
printfMyName = {
printf[ name ];
};
};
def Main : {
someOtherAge = 2;
myRealDogsName = "cat"; // because variable naming is the hardest thing in computer science.
printfMyName = {
printf[ someOtherAge ];
};
call MyDog::printfMyName;
/*
When you do not use the scope resolution modifier then it will only check local functions.
The local function hashmap is stored in the head of your functions linked list.
/*
call printfMyName;
};
call Main;
```
# Logic
# Logic
Logic is first evaluated and if deemed valid then a list of statements will be executed.
Logic is first evaluated and if deemed valid then a list of statements will be executed.
```
```
@ -82,18 +34,14 @@ if [ {int} newInt > 99 ]: {
printf [ "newInt is bigger than 99" ];
printf [ "newInt is bigger than 99" ];
};
};
```
```
# Functions
# Functions
Functions can be declared inside of a struct and accessed by anyone who uses the scope resolution operator. Do not mistake structs as functions just because you can interact with them in the same way. Functions do not have "scope" like structs do. Functions can interact with all elements in the parenting struct including other functions, and those functions local variables.
Functions can be declared inside of a struct and accessed by anyone who uses the scope resolution operator. Do not mistake structs as functions just because you can interact with them in the same way. Functions do not have "scope" like structs do. Functions can interact with all elements in the parenting struct including other functions, and those functions local variables.