This document is a summary of the language specification of the programming language TL/1. Based on the explanation in magazines and the web etc., it is what I reorganized into the format of the specification with the addition of my interpretation and the indication of ambiguous parts.
We may use terms that are not in the original document for the purpose of explanation.
The places in this text that are referred to as "undefined" are explicit indications that the original source material can not be judged.
Although syntax diagrams are prepared, it is better to read the sentences first and then refer to the syntax diagrams because there is a unique part in the interpretation of identifiers.
The percent sign (%) to the next newline is ignored, and it is treated as whitespace. Use it to describe the program description etc.
It consists of zero or more alphanumeric characters, beginning with an alphabetic character. The word continues up to just before a character (space or symbol) that does not form an identifier. Uppercase and lowercase letters are not distinguished. There is no upper limit on the identifier length.
Reserved words, procedure names, function names, global single variable names, global array names, small area single variables, and small area array names may have the same spelling. It is not checked at the time of declaration if it is identical to the existing name. Except where in the declaration, the implementation tries the name search in the following order and interprets it as the identifier of the first attribute found.
There are 4 types of expressions.
The numbers that can be handled directly with TL/1 are byte sizes, so the numeric representations that appear in a program are always in the range of 0-255.
In places where a boolean value is required in the syntax, 255 is interpreted as true, and other values are interpreted as false. A function that returns a boolean value returns 255 as true and 0 as false.
One or more of the characters 0-9 can be numbers in the range 0-255. p>
Behavior is not defined if you add an extra 0 at the beginning (such as 02). p>
Symbols beginning '$' which follows 0 to 9 or a to f represent 0 to 255 in hexadecimal notation. The letters a to f have the same meaning even if they use uppercase letters (A to F).
Do not put a space character after the symbol $.
It is permissible to add an extra 0 (for example $0A) to make two digits in hexadecimal, but if you add more 0 (for example $002) The behavior of) is undefined.
Expressed by a single character between quotes. It is considered that the same numerical value as the one-letter ASCII code is written. p>
'A' has the same meaning as 65. pre>Logical constant
represented by TRUE span> or FALSE span>. TRUE span> is equivalent to $FF and FALSE span> is equal to 0. p>
symbol
Others, symbols are used for operators and syntax, but they will be covered in the syntax description below.
Space character
It can be inserted between words. One word is sufficient for word separation, but the meaning does not change even if it continues several times. Please use it to adjust the appearance. The following characters are interpreted as whitespace characters.
- Character code less than $1F (control character)
- Blank
- Period (.)
- Semicolon (;)
There are also habitual meanings to how to use, which will be described later.
Program configuration
Programs are organized in the following order. p>
- Procedure name declaration
- Function name declaration
- Global single variable name declaration
- Global array name / array size declaration
- Main program definition
- Procedure or function definition group
The contents of each are as follows.
Procedure Name Declaration
Comma separated list of the procedure names to be used in the program following the reserved word PROC .
PROC span>