Fore Specification

Language is an infinite set of correctly composed sentences, which meet the language syntax. The language dictionary consists of lexemes.

Lexemes are keywords, operator signs, identifiers, numbers, character constants, strings, special characters and comments. Lexemes consist of separate letters. Separate language sentences consist of lexemes.

The Fore language used in Foresight Analytics Platform is a fully object-oriented program language. Any program written using this language is a set of interrelated logical units (some of them are the standard ones). Each unit contains some program code that is used to solve some kind of problems (perhaps, as a part of some other, more common problem). Splitting program code into units provides language component orientation and program code reuse.

The extended Backus–Naur form (BNF) is used to describe the language. The BNF form can be used to describe programming language syntax.

The following BNF characters are used to describe structures.

Character Character description
= An element to the left of the character is defined by the structure to the right.
* Prior structure can be repeated 0 or more times.
{...} Structures, enclosed in figured brackets, can be repeated 0 or more times.
(...) Structures, enclosed in parentheses, are used to describe language rules as logical expressions.
[...] Structures, enclosed in brackets, are optional.
| Excluding OR.
CAPITAL LETTERS Keyword.
'Space' A space, horizontal tabulation or carriage line feed can be used as a space character.

Non-terminal characters are denoted by English words describing the meaning of the character.

Terminal characters (language dictionary characters) are denoted by strings, marked by quotations or words, written in upper case. These are so called reserved words.

Syntax rules are marked by the $ sign on the left of the string.

Example

Expression

$ ident = letter {letter | digit | "_"}.

It may be read as "Identifier is a set of letters, digits, and '_' characters, starting with a letter".