UFL

Still in development, documentation not final.

Index

  1. The Syntax
  2. Defining Variables
  3. Defining Functions
  4. Calling Functions
  5. Logic
  6. Core Calls

The Syntax

When UFI parses a file, the file is separated into tokens which are then put into lines. Lines end with the ";" character. print "Hello World\n";
pause;

Defining Variables

To define a variable use the def token followed by the name of the variable and its value.

Example

def x 12;
def f 5.0;
def s "a string";

Defining Functions

To define a function use the func token followed by the name of the function you want to define.

Example

func test;
   print "Hello World\n";
   ret 0;
end;

Calling Functions

To call a function simply put the name of the function followed by its arguments.

Example

test;
You can send any data type or constant through an argument.

Example

def x 5;
test x "test";
Sends the value of x and the string "test".

You can also call a function in an argument.

Example

print (test);

print (test x "test");

Logic

The logic is the same as in any other language.

Example

def x 2;
def y x;
if x = y;
   print "equal\n";
end;

Core Calls

There are various core calls which are integrated into the interpreter.