Skip to content

Latest commit

 

History

History
131 lines (93 loc) · 5.37 KB

File metadata and controls

131 lines (93 loc) · 5.37 KB

CLite

#import

The import directive accepts 2 or 3 arguments: A file without the specified format (you can use the path, or it will be searched in the directory where the executable file is located, or in the directory where the compiler is located), syntax without quotes in its name and an optional argument namespace name

#import(file, syntax, namespace = file)

Example:

#import(MyLibrary, CLite, lib)
lib.func(lib.variable)

#include

The include directive accepts 1 or 2 arguments: A file without the specified format (the path can be used, or it will be searched in the directory where the executable file is located, or in the directory where the compiler is located), and an optional argument the name of the namespace

#include(file, namespace = file)

Example:

#include(MyLibrary, lib)
lib.func(lib.constant)

#init

The init directive takes 1 or 2 arguments: the name of the variable, and if you want to create a constant, you specify its value

Initialize variable:

#init(var)

Constant initialization:

#init(var, value)

Example:

#init(myVar)
myVar = 1
#init(myConst, 1)

#define/#end/return

The define directive takes the required argument-name of the function and any number of argument names of this function. The end directive takes only one argument, the name of the function to end. The return function may not accept any values or may accept the value of a variable whose value will be placed in the Stack to position 0, 0 (temp variable)

#define(func, arg1 .. argn)
#end(func)

Examples:

#define(myFoo, arg)
WriteLine(console, arg)
#end(myFoo)
#define(myFoo, arg)
arg = +(arg, 1)
return(arg)
#end(myFoo)
#init(var)
var = 43
myFoo(var)
var = temp

Clarification

If you use your own program for compilation, make sure that there is a variable in the lowest level stack and use its name instead of temp

UA

#import

Директива import приймає 2 або 3 аргументи: Файл без вказаного формату (можна повиний шлях, або його будуть шукати в каталозі де знаходиться виконуваний файл, або в каталозі де знаходиться компілятор), синтаксис без лапок в його назві і необов'язковий аргумент назва простору імен

#import(file, syntax, namespace = file)

Приклад:

#import(MyLibrary, CLite, lib)
lib.func(lib.variable)

#include

Директива include приймає 1 або 2 аргументи: Файл без вказаного формату (можна повиний шлях, або його будуть шукати в каталозі де знаходиться виконуваний файл, або в каталозі де знаходиться компілятор), і необов'язковий аргумент назва простору імен

#include(file, namespace = file)

Приклад:

#include(MyLibrary, lib)
lib.func(lib.constant)

#init

Директива init приймає 1 або 2 аргументи: назва змінної, і якщо потрібно створити констану то вказуєте її значення

Ініціалізація змінної:

#init(var)

Ініціалізація константи:

#init(var, value)

Приклад:

#init(myVar)
myVar = 1
#init(myConst, 1)

#define/#end/return

Директива define приймає обов'язковий аргумнт-назву функції та будь-яку кількість назв аргументів цієї функції. Директива end приймає лише один аргумент, назву функціїї яку слід завершити. Функція return можне не приймати ніяких значень або приймати значення змінної значння якої буде покладено в Стек до позиціїї 0, 0 (змінна temp)

#define(func, arg1 .. argn)
#end(func)

Приклади:

#define(myFoo, arg)
WriteLine(console, arg)
#end(myFoo)
#define(myFoo, arg)
arg = +(arg, 1)
return(arg)
#end(myFoo)
#init(var)
var = 43
myFoo(var)
var = temp

Уточнення

Якщо ви використовуєте власну програму для компіляції то запевніться, що в стеку найнижчого рівня є змінна і використовуйте замість temp її назву