Description - Description of the NedoLang programming language

Description of the NedoLang programming language
                     by Alone Coder

The language in the current version does not provide analogues of the following
C constructs:

- multidimensional arrays (you can use calculations instead
index or pointer arrays);
- switch...case (it is supposed to be implemented, because on this
designs are built by an assembler);
- floating point numbers (it is supposed to be implemented,
they already understand the syntax);
- constants const;
- constant arrays const;
- sizeof();
- #include (supposed to be implemented if this construction
the project will be built);
- #define constants;
- #define macros (not recommended behavior);
- conditional compilation (#if, #ifdef, #ifndef );
- for (you should use while or repeat instead);
- structures;
- associations (not recommended behavior);
- exit from the middle of the function using return (not recommended
behavior);
- exit from the middle of the program using exit (not recommended
behavior);
- calling a function by pointer (not recommended behavior);

Commands are collected in blocks surrounded by curly braces
              {...}
Such a block is equivalent to a single command and is valid wherever
Single command is allowed.
After each command for C compatibility it is recommended (but not
required) use a semicolon.

One line can contain any number of commands. Translationlines
between any words does not affect anything.
Line numbers are not written in the source text. Therefore, in case of errors
displays the line number of the source text file (first line
has number 00001).

Standard comments are formatted as /**comment*/ . If
there is only one star ahead, then this is not a comment (needed for
design of calls to procedures and functions, see below).
Standard comments cannot be nested.
There are also standard one-line comments from // to the end
lines.
There are also non-standard comments that may be
nested, but they are incompatible with C:
{comment{nested comment}comment continuation}
Comments can be placed between any words except between
variable name and array index square bracket, that is
this is not possible:
                    a/**comment*/[10]
All comments during compilation are transferred to the assembly text
also in the form of comments.

Full variable name (as used in assembler)
is constructed from the name of the current scope, the name of the
variable and postfix.

- Full name "petya.pet." means: scope "petya",
variable "pet" defined in the source text (marked with a dot
".").
-Full name "_boolarr." means: global variable
"_boolarr" specified in the source text (marked with a dot ".").
- Full name "vasya.nemain.l00003" means: scope
"vasya.nemain",variable "l00003" created automatically (not
contains dots at the end).

Therefore, automatically created variables are not
intersect in names with the variables specified in the source
text.
The full names of function headers and labels are also constructed for
transition.

Variables and other names are accessible from the language as follows:

- _boolarr to access the global variable _boolarr from
anywhere in the program (you can also access
global procedure or function).
- i to access variable i defined in the current scope
visibility.
- .func2 to access the func2 function defined externally
current scope (through such names they are called
procedures and functions from other procedures and functions).
- ..anothermodule.funcS to access the funcS function,
defined in the neighboring module anothermodule (that is, in the area
visibility adjacent to the scope where the current one is defined
function).
- submodule.v to access the variable v defined in
child scope of the submodule (in practice this may
be only when declaring nested functions using
goto).

Automatically created variables are not available from the language.

Identifiers (names of variables, procedures, functions, labels)
must begin with a letter (or an underscore for
global variables and global procedures/functions) and consist
of letters, numbers and underscores. The full variable name is notmust be longer than 254 characters. Allowed to use Russian
letters in identifiers. Russian letters remain in the same form
how they are encoded in the source text (cp866 encoding,
cp1251 or utf8).

All commands begin with the word:

* var - define a variable:
                     var
* var with square brackets - define a fixed array
size:
            var<[><]>
array cells are numbered starting from 0, that is, in the array a[10] is not
There are cells with index 10.
* recursivevar - define a variable inside a recursive one
procedures/functions. Formatted in the same way as var. If inside
recursive procedure/function to define a regular variable, then
its value will be corrupted during recursion. You can't announce it like that
arrays.
* let - calculate and write to a variable:
                    let=
the type of the expression must match the type of the variable, except
one exception: you can write to a variable of type pointer
array address, that is, let poi=arr (actually into a variable like
pointer can be written to anything, but when using byte or
char result is undefined, and using long will result in
execution error).
* let with square brackets - calculate and write to cell
array:let<[><]>=
* let* - calculate and write to memory with the desired type:
       let*(*)()=
type (*) and brackets around () skip
it is impossible.
* module - define a module (scope):
                    module

Share your thoughts about the article