### Unicode NamesList File Format

Last updated: 1999-07-06

### 1.0 Introduction

The Unicode name list file NamesList.txt (also NamesList.lst) is a plain text file used to drive the layout of the character code charts in the Unicode Standard. The information in this file is a combination of several fields from the UnicodeData.txt and Blocks.txt files, together with additional annotations for many characters. This document describes the syntax rules for the file format, but also gives brief information on how each construct is rendered when laid out for the book. Some of the syntax elements were used in preparation of the drafts of the book and may not be present in the final, released form of the NamesList.txt file.

The same input file can be used to do the draft preparation for ISO/IEC 10646 (referred below as ISO-style). This necessitates the presence of some information in the name list file that is not needed (and in fact removed during parsing) for the Unicode book.

With access to the layout program (unibook.exe) it is a simple matter of creating name lists for the purpose of formatting working drafts containing proposed characters.

### 1.1 NamesList File Overview

The *.lst files are plain text files which in their most simple form look like this

@@<tab>0020<tab>BASIC LATIN<tab>007F
; this is a file comment (ignored)
0020<tab>SPACE
0021<tab>EXCLAMATION MARK
0022<tab>QUOTATION MARK
. . .
007F<tab>DELETE

The semicolon (as first character), @ and <tab> characters are used by the file syntax and must be provided as shown. Hexadecimal digits must be in UPPER CASE). A double @@ introduces a block header, with the title, and start and ending code of the block provided as shown.

For an ISO-style, minimal name list, only the NAME_LINE and BLOCKHEADER and their constituent syntax elements are needed.

The full syntax with all the options is provided in the following sections.

### 1.2 NamesList File Structure

This section gives defines the overall file structure

    NAMELIST:     TITLE_PAGE* BLOCK*

    TITLE_PAGE:   TITLE
    		| TITLE_PAGE SUBTITLE
    		| TITLE_PAGE SUBHEADER
    		| TITLE_PAGE IGNORED_LINE
    		| TITLE_PAGE EMPTY_LINE
    		| TITLE_PAGE COMMENTLINE
    		| TITLE_PAGE NOTICE
    		| TITLE_PAGE PAGEBREAK

    BLOCK:	      BLOCKHEADER
    		| BLOCK CHAR_ENTRY
    		| BLOCK SUBHEADER
    		| BLOCK NOTICE
    		| BLOCK EMPTY_LINE
    		| BLOCK IGNORED_LINE
    		| BLOCK PAGEBREAK

    CHAR_ENTRY:   NAME_LINE | RESERVED_LINE
    		| CHAR_ENTRY ALIAS_LINE
    		| CHAR_ENTRY COMMENT_LINE
    		| CHAR_ENTRY CROSS_REF
    		| CHAR_ENTRY DECOMPOSITION
    		| CHAR_ENTRY COMPAT_MAPPING
    		| CHAR_ENTRY IGNORED_LINE
    		| CHAR_ENTRY EMPTY_LINE
    		| CHAR_ENTRY NOTICE

In other words:
Neither TITLE nor SUBTITLE may occur after the first BLOCKHEADER.

Only TITLE, SUBTITLE, SUBHEADER, PAGEBREAK, COMMENT_LINE, and IGNORED_LINE may occur before the first BLOCKHEADER.

Directly following either a NAME_LINE or a RESERVED_LINE an uninterrupted sequence of the following lines may occur (in any order and repeated as often as needed): ALIAS_LINE, CROSS_REF, DECOMPOSITION, COMPAT_MAPPING, NOTICE, EMPTY_LINE and IGNORED_LINE.

Except for EMPTY_LINE, NOTICE and IGNORED_LINE, none of these lines may occur in any other place.

Note: A NOTICE displays differently depending on whether it follows a header or title or is part of a CHAR_ENTRY.

### 1.3 NamesList File Elements

This section provides the details of the syntax for the individual elements.

    ELEMENT		SYNTAX	// How rendered

    NAME_LINE:	CHAR <tab> LINE
    			// the CHAR and the corresponding image are echoed,
    			// followed by the name as given in LINE

    		CHAR TAB NAME COMMENT LF
    			// Names may have a comment, which is stripped off
    			// unless the file is parsed for an ISO style list

    RESERVED_LINE:	CHAR TAB <reserved>
    			// the CHAR is echoed followed by an icon for the
    			// reserved character and a fixed string e.g. <reserved>

    COMMMENT_LINE:	<tab> "*" SP EXPAND_LINE
    			// * is replaced by BULLET, output line as comment
    		<tab> EXPAND_LINE
    			// output line as comment

    ALIAS_LINE:	<tab> "=" SP LINE
    			// replace = by itself, output line as alias

    CROSS_REF:	<tab> "X" SP EXPAND_LINE
    			// X is replaced by a right arrow
    		<tab> "X" SP "(" STRING SP "-" SP CHAR ")"
    			// X is replaced by a right arrow
    			// the "(", "-", ")" are removed, the
    			// order of CHAR and STRING is reversed
    			// i.e. both inputs result in the same output

    IGNORED_LINE:	<tab> ";" EXPAND_LINE
    EMPTY_LINE:	LF
    			// empty lines and file comments are ignored

    DECOMPOSITION:	<tab> ":" EXPAND_LINE
    			// replace ':' by EQUIV, expand line into
    			// decomposition

    COMPAT_MAPPING:	<tab> "#" SP EXPAND_LINE
    			// replace '#' by APPROX, output line as mapping

    NOTICE:		"@+" <tab> LINE
    			// skip '@+', output text as notice
    		"@+" TAB * SP LINE
    			// skip '@', output text as notice
    			// "*" expands to a bullet character
    			// Notices following a character code apply to the
    			// character and are indented. Notices not following
    			// a character code apply to the page/block/column
    			// and are italicized, but not indented

    SUBTITLE:	"@@@+" <tab> LINE
    			// skip "@@@+", output text as subtitle

    SUBHEADER:	"@" <tab> LINE
    			// skip '@', output line as text as column header

    BLOCKHEADER:	"@@" <tab> BLOCKSTART <tab> BLOCKNAME <tab> BLOCKEND
    			// skip "@@", cause a page break and optional
    			// blank page, then output one or more charts
    			// followed by the list of character names.
    			// use BLOCKSTART and BLOCKEND to define the
    			// what characters belong to a block
    			// use blockname in page and table headers
    		"@@" <tab> BLOCKSTART <tab> BLOCKNAME COMMENT <tab> BLOCKEND
    			// if a comment is present it replaces the blockname
    			// when an ISO-style namelist is laid out

    BLOCKSTART:	CHAR	// first character position in block
    BLOCKEND:	CHAR	// last character position in block
    PAGE_BREAK:	"@@"	// insert a (column) break

    TITLE:		"@@@" <tab> LINE
    			// skip "@@@", output line as text
    			// Title is used in page headers

    EXPAND_LINE:	{CHAR | STRING}+ LF
    			// all instances of CHAR *) are replaced by
    			// CHAR NBSP x NBSP where x is the single Unicode
    			// character corresponding to char
    			// If character is combining, it is replaced with
    			// CHAR NBSP <circ> x NBSP where <circ> is the
    			// dotted circle

### 1.4 NamesList File Primitives

The following are the primitives and terminals for the NamesList syntax.

    LINE:		STRING LF
    COMMENT:	"(" NAME ")"
    		"(" NAME ")" "*"

    NAME:	  	<sequence of ASCII characters, except "(" or ")" >
    STRING:	  	<sequence of Latin-1 characters>
    CHAR:		X X X X
    		| X X X X X X X X X
    X:	  	"0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"A"|"B"|"C"|"D"|"E"|"F"
    <tab>:	  	<sequence of one or more ASCII tab characters 0x09>
    SP:	  	<ASCII 0x20>
    LF:	  	<any sequence of ASCII 0x0A and 0x0D>

Notes:

- Special lookahead logic prevents a mention of a 4 digit standard, such as ISO 9999 from being misinterpreted as ISO CHAR.
- Use of Latin-1 is supported in unibook.exe, but not portably, unless the file is encoded as UTF-16LE.
- The final LF in the file must be present
- A CHAR inside ' or " is expanded, but only its glyph image is printed, the code value is not echoed
- Straight quotes in an EXPAND_LINE are replaced by curly quotes using English rules. Apostrophes are supported, but nested quotes are not.