Language
lsFusion is a programming language that describes lsFusion modules.
Each module consists of a sequence of statements divided into module header and body. The header may include four special statements: MODULE, REQUIRE, PRIORITY and NAMESPACE, which define module parameters. The header is followed by the module body which consists of the remaining statements and describes the logic of this module.
Besides the statements, this section describes the interfaces that client code written in JavaScript works with: the React views — what a React component that draws a container, a component or a window of the client receives from the form and calls — the render functions and edit functions of the classic custom views, the form and navigator controllers that any view written in JavaScript is given, and the client JavaScript modules that hold such code.
Example
// Module header
MODULE LanguageExample;
REQUIRE System;
NAMESPACE Example;
// Module body
// Classes declaration
CLASS Employee;
CLASS Company;
// Properties declaration
name(employee) = DATA BPSTRING[100](Employee);
age(employee) = DATA INTEGER(Employee);
company(employee) = DATA Company(Employee);
name(company) = DATA BPSTRING[100](Company);
// Form declaration
FORM employeeForm
OBJECTS e = Employee
PROPERTIES(e) name, age, company
;
// Adding a form to the navigator
NAVIGATOR {
NEW employeeForm;
}