> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lexical conventions

> Lexical conventions of the FlexiLayout language: identifier syntax, punctuation, operator precedence and associativity, assignment, constants, comments.

The FlexiLayout language follows these lexical conventions for identifiers, punctuation, operators, assignment, constants, and comments.

## Identifiers

An **identifier** is a sequence of characters used to denote one of the following:

* Block name
* Element name
* Constant name
* Variable name
* Keyword

Identifiers are case-insensitive.

Identifier syntax:

```text theme={null}
identifier:
   nondigit
   identifier nondigit
   identifier digit

nondigit: one of
   _ a b c d e f g h i j k l m n o p q r s t u v w x y z
   A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

digit: one of
   0 1 2 3 4 5 6 7 8 9
```

## Punctuation characters

The following punctuation characters can be used:

`. , ( ) * / + - = < > { } : ; ! & |`

The punctuation characters `( )` and `{ }` must appear in pairs.

## Operator precedence and associativity

The highest precedence level is at the top of the table.

| Operator | Meaning                        | Associativity |
| -------- | ------------------------------ | ------------- |
| `( )`    | Function call                  |               |
| `:`      | Function call                  |               |
| `.`      | Member selection               | Left to right |
| `+`, `-` | Unary positive, unary negative |               |
| `*`, `/` | Multiplication, division       | Left to right |
| `+`, `-` | Addition, subtraction          | Left to right |
| `NOT`    | Logical NOT (unary)            |               |
| `<`      | Less than                      | Left to right |
| `>`      | Greater than                   | Left to right |
| `<=`     | Less than or equal to          | Left to right |
| `>=`     | Greater than or equal to       | Left to right |
| `==`     | Equality                       | Left to right |
| `!=`     | Inequality                     | Left to right |
| `AND`    | Logical AND                    | Left to right |
| `OR`     | Logical OR                     | Left to right |

<Note>
  The comparison operations (`<`, `>`, `<=`, `>=`, `==`, `!=`) have equal priority.
</Note>

## Assignment operator

The `=` operator assigns a value to a variable.

For example:

```text theme={null}
Distance a;
a = Page( 1 ).RectGlobal.Width;
```

The data type of the expression must be compatible with the data type of the variable.

## Constants

The FlexiLayout language uses only global constants. Global constants are set in the **FlexiLayout Properties** dialog box and can be accessed from any section of any block or element description.

For more information, see [Global constants](/flexi-capture/fls/code/global-constant).

## Comments

You can add comments to the code. Comments have the same format as in the C language and can be written in one of the following ways:

* The `/*` (slash, asterisk) characters, followed by any sequence of characters (including new lines), followed by the `*/` characters.
* The `//` (two slashes) characters, followed by any sequence of characters. A new line not immediately preceded by a backslash terminates this form of comment.
