Previous Table of Contents Next

Syntax

Symbols

  1. ASC syntax is composed of individual symbols which consist of contiguous series of characters.

  2. Symbols are delimited by any blank or non-printable characters including...

  3. Symbols are divided into two classes, names and terminals. Symbols are used to name entities. Terminals are used to compose and delimit expressions.

Names

  1. Names consist of a contiguous series of alphanumeric characters and the ASCII dash character.

  2. Alphanumeric characters are defined as the ASCII code point ranges 30-39, 41-5A, 61-7A, and any Unicode points that fall under the Unicode standard definition of Writing Systems.

  3. The ASCII dash character is allowed in a name at any point where it is not the first or last character in that name.

  4. Names are case insensitive. The ASCII code points 41-5A and 61-7A are considered lexically equivalent for the purposes of the ASC language. The equivalence is not general across all points, rather each individual point from the first range is equivalent to the point from the corresponding position in the second range. For example, the names symb, SYMB, and sYmB are considered the same name.

  5. In the Unicode Latin-1 Supplement block, the code point pairs are considered lexically equivalent in the following ranges...

    00C0-00D600E0-00F6
    00D8-00DD00F8-00FD

    For example, the characters Æ and æ, and the characters Ý and ý are each considered lexically equivalent.

  6. In the Unicode Latin Extended-A block, in the code point range U+0100-U+017E, each even-numbered code point is considered lexically equivalent with the immediately following odd-numbered code point. For example, the characters Ă and ă are equivalent.

Terminals

  1. Terminals consist of a contiguous series of non-alphanumeric characters including the ASCII dash character.

  2. Non-alphanumeric characters are defined as the ASCII code points 21-2F, 3A-40, 5B-60, 7B-7E, and any Unicode points which fall under the Unicode standard definition of General Punctuation.

  3. Unlike symbols, the ASCII dash character is accepted at any point within a terminal.

Numbers

  1. Symbols which consist of all numeric characters (in the range 30-39) are interpreted as decimal numeric constants.

  2. Symbols which consist of all numeric characters and the uppercase letters A-F, and are prefixed with the character sequence 0x are interpreted as hexadecimal numeric constants.

  3. In both decimal and hexadecimal constants, the leftmost digit is always the most significant digit, followed by digits of decreasing significance.

Number Terminals

  1. The negation terminal - may prefix a decimal or hexadecimal constant which will cause that constant to be interpreted as the corresponding negative value of the constant.

  2. The radix terminal . may infix two decimal constants and shall produce a rational value using the left constant as the integer component and the right constant as the fractional component of the resulting rational value. The left and right decimal constants and the radix terminal cannot be separated by any token delimiting characters.

  3. It is possible for the left constant of the radix terminal to be prefixed with the negation terminal which will result in the corresponding negative value of the rational value produced by the radix terminal.

  4. Neither the negation or the radix terminal are associative.

Character Values

  1. A character value is the whole numerical value associated with an ASCII or Unicode character.

  2. A character value is declared by writing a single ASCII or Unicode character surrounded by ASCII double quotations such as the character value 65 as "A". This method requires UTF-8, UTF-16, or UTF-32 text encoding in order to express a Unicode character value.

  3. The character values for the double quotation and the backward slash are expressed as "\"" and "\\" respectively, using the backward slash as an escape prefix.

  4. Non-printable values as well as printable values can be declared by writing a two to eight digit hexadecimal numeric constant, prefixed with a backward slash and suffixed by a period dot, such as "\20." to declare the value used to encode the ASCII Space character. This method does not require a Unicode text encoding to express a Unicode character value.

  5. Character values cannot include token delimiters and do not conform to tokenization rules.

String Data

  1. String data consists of a contiguous series of character values surrounded by ASCII double quotation characters.

  2. String data is declared using the same declarative syntax for character values, but including more than one value declaration within a surrounding pair of double quotations.

  3. Each character in the string data declaration may use one of the declarative syntaxes described in (Character Values).

Comments

  1. Comments are delimited by a pair of comment terminals, ``.

  2. Comments may include any series of characters excluding the comment terminal.

  3. Pairs of comment terminal symbols may not be nested within each other.

  4. Comments may be discarded without further processing.

Quoting

  1. A symbol may be quoted so that the symbol itself may be handled by the program as a unique entity rather than representing the entity which it refers to.

  2. The quotation terminal, ' prefixes any symbol which produces that symbol as an entity.

Creating Syntax

  1. New ASC syntax can be defined using a pattern signature