- the "Л" is pronounced like the "L" sound in "love" but with a slightly palatalized or softened quality
- the "ё" sounds like the "yo" in "yoga"
- the "х" is a voiceless velar fricative, similar to the "ch" in the german "Bach"
- the "а" is pronounced as the "a" in "sofa," a schwa sound
a custom programming language with a unique syntax, implemented to run inside roblox this language includes a lexer, parser, and an interpreter
follow these steps to add Lexa to ur game:
-
create folders
- create a folder called
ЛёхаinServerScriptService - create a folder called
examplesinReplicatedStorage
- create a folder called
-
create core modules
- inside
ServerScriptService/Лёха, create these modulescripts:lexer: tokenizes the codeparser: converts tokens to an ASTinterpreter: executes the ASTmain: main entry point for the language
- inside
-
add example programs
- inside
ReplicatedStorage/LexaExamples, add these modulescripts:hello_world.lexafibonnaci.lexamultiplication_table.lexa
- inside
every Lexa program begins with the keyword здарова followed by the filename (which has a .lexa extension) and ends with the phrase давай бб
здарова helloworld.lexa
//// code here
давай бб
each statement in Lexa ends with the keyword стоять (similar to a semicolon in other languages)
ебаника "zdarova Lexa" стоять
//// lua equivalent: print("zdarova Lexa");
| keyword | meaning | example |
|---|---|---|
здарова |
program start | здарова myprogram.lexa |
давай бб |
program end | давай бб |
стоять |
statement terminator | ебаника "Hello" стоять |
ебаника |
print statement | ебаника "Hello, World!" стоять |
хуйняебаная |
function definition | хуйняебаная square(x) |
если |
if statement | если x > 0 тогда |
тогда |
then (follows if) | если x > 0 тогда |
уёбывай |
return statement | уёбывай x * x стоять |
похуй |
end block | если x > 0 тогда ... похуй стоять |
для_каждого |
for loop | для_каждого i = 1, 10 ебашьследующее |
ебашьследующее |
loop iteration | для_каждого i = 1, 10 ебашьследующее |
нарик |
variable declaration | нарик x = 10 стоять |
- single-line comments begin with
//// - multi-line comments start with
////!!!and end with!!!////
//// this is a single-line comment
////!!! this is a
multi-line
comment !!!////
здарова helloworld.lexa
ебаника "Hello, World!" стоять
давай бб
здарова fibonacci.lexa
хуйняебаная фиб(н)
если н <= 0 тогда уёбывай 0 похуй стоять
если н == 1 тогда уёбывай 1 похуй стоять
уёбывай фиб(н-1) + фиб(н-2) стоять
похуй стоять
для_каждого и = 0, 10 ебашьследующее
ебаника "Fib(" .. и .. ") = " .. фиб(и) стоять
похуй стоять
давай бб
здарова multiplicationtable.lexa
для_каждого и = 1, 5 ебашьследующее
нарик линия = "" стоять
для_каждого д = 1, 5 ебашьследующее
линия = линия .. (и * д) .. "\t" стоять
похуй стоять
ебаника линия стоять
похуй стоять
давай бб
local LexaMain = require(game.ServerScriptService["Лёха"].main)
local lexaCode = [[
здарова myprogram.lexa
ебаника "Hello from Lexa!" стоять
давай бб
]]
local output = LexaMain.run(lexaCode)
print(output)there's an example .rbxl place in this folder
download it and check it out urself
the Lexa language implementation consists of:
- lexer: breaks down source code into tokens, handling keywords, identifiers, strings, numbers, operators, and comments
- parser: builds an Abstract Syntax Tree (AST) representing the program structure
- interpreter: executes the AST with a bytecode-based VM, including a stack for values, constants pool, and call frames for functions
- the implementation is designed to work within roblox
- all printing is done through Roblox's
print()function and captured for UI display - the UI allows u to experiment with the language without modifying scripts
- u can extend the language by modifying the modules in
ServerScriptService/Лёха