uniclient executes programs written in aime, a C like programming language.
All the aime language and library features are available for executed programs.
The connection to the server is available for the programs as one read file (incoming, also aliased as is) and one write file (outgoing, also aliased as os).
Due to output buffering calling f_flush on the output connection may be required.
The C if, else, while, do while and break statements are supported, their syntax and semantics being pretty much the same as in C. An extra elif statement is borrowed from the C preprocessor, yet its syntax is C inspired. The opening and closing block braces are mandatory. The declarations must precede statements within a block. The variable initialization is disallowed.
A more formal syntax definition is:
Functions and variables do not share the same name space, thus using a function name for a variable is allowed. The break, do, elif, if, else and while keywords and the cardinal, integer, real and text type names are however restricted for variable naming.
The expression syntax is much resembling the C expression syntax.
Most of prefix unary and common syntax binary C operators are supported (including unary !, +, - and ~ and binary *, /, %, +, -, <<, >>, <, >, !=, ==, &, ^, |, &&, ||, =, +=, -=, *=, /=, %=, &=, ^=, |=, <<= and >>=), the semantics and precedence being the same or at least very close to those of their C counterparts.
A secondary syntax allows for functions. Function definition syntax is much the C syntax. One main function, returning integer and having a void argument list, is expected.
The formal syntax definition is:
Functions may return no value, integer and real only (i.e. the return type of functions may only be one of cardinal, integer, real and void).