2. 專有名詞, 標記法, 和參考資料(Terms, notation, and references)
在這個標準中到處使用的詞組 參閱: 是用來指引讀者到標準中與目前這一區
有關連的其他章節.
The phrase See: is used throughout this Standard to direct the reader to
other sections of the Standard that have a direct bearing on the current
section.
在標準中 必須(shall) 聲明了一個系統或程式的需求; 相反地, 必須不(shall not)
是禁止某事; 不必要(need not) 表示 不一定須要 做某事; 應該(should)
描述標準的建議; 而 可以(may) 依照情況, 表示 允許 或 可以發生.
In this Standard, shall states a requirement on a system or
program; conversely, shall not is a prohibition; need not
means is not required to; should describes a
recommendation of the Standard; and may, depending on context,
means is allowed to or might happen.
在整個標準中, 鉛字字體是以下列的方式使用的:
Throughout the Standard,
typefaces are used in the following manner:
- 成比例的襯線鉛字字體是用來顯示文字, 而斜字體是用來代表符號及
第一次出現的專有名詞;
- 粗體的沒有襯線的鉛字體是用來表示標題;
- 粗體的 monospaced 襯線鉛字字體是用來表示 Forth 語言的文字.
- This proportional
serif typeface is used for text, with italic used
for symbols and the first appearance of new terms;
- A bold
proportional sans-serif typeface is used for headings;
- A bold
monospaced serif typeface is used for Forth-language text.
2.1 專有名詞的定義(Definitions of terms)
在這個標準中這一節中定義的專有名詞是普遍地到處使用. 對於獨立詞集的額外的
特定專有名詞是定義在那個詞集中. 其他的專有名詞是在它們第一次出現時定義,
以斜體字的型式表示. 未曾定義於這個標準中的專有名詞可以依照資訊系統字典
ANSI X3.172-1990 來翻譯.
Terms defined in this section are used generally throughout this Standard.
Additional terms specific to individual word sets are defined in those word
sets. Other terms are defined at their first appearance, indicated by italic
type. Terms not defined in this Standard are to be construed according to the
Dictionary for Information Systems, ANSI X3.172-1990.
- 位址單位:
- 依照前後關聯的上下文, 可能是:
1) Forth 位址空間分割的單位, 為了尋找資料物件的位置, 像是字元和變數.
2) 對應到這些單元的實體記憶體儲存元素;
3) 這樣的記憶體儲存元素的內容;
4) 一個記憶體區域的長度表現的單位.
- address unit:
- Depending on context, either 1) the units
into which a Forth
address space is divided for the purposes of locating data objects such as
characters and variables; 2) the physical memory storage elements
corresponding to those units; 3) the contents of such a memory storage
element; or 4) the units in which the length of a region of memory is
expressed.
- 對齊的位址:
- 在一個字元、單元、單元對、或是雙單元整數的
記憶體位置的位址是可以被存取的.
- aligned address:
- The address of a memory location at which a
character, cell,
cell pair, or double-cell integer can be accessed.
- 模稜兩可的情況:
- 一個標準並未預先描述 Forth 系統和應用程式
應該如何反應的特殊情況.
- ambiguous condition:
- A circumstance for which this Standard
does not
prescribe a specific behavior for Forth systems and programs.
模稜兩可的情況包含在分析、嘗試存取一個不存在的檔案或嘗試使用一個不存在的
詞時缺乏定義符號. 當一個標準詞被傳進不適合的或是超過範圍的數值時, 也會產生
模稜兩可的情況.
Ambiguous conditions include such things as the absence of a needed delimiter
while parsing, attempted access to a nonexistent file, or attempted use of a
nonexistent word. An ambiguous condition also exists when a Standard word is
passed values that are improper or out of range.
- 單元:
- 一個 Forth 系統架構中的主要資訊單位.
- cell:
- The primary unit of information in the architecture of a Forth system.
- 單元對:
- 兩個單元被當成一個單一的單位.
- cell pair:
- Two cells that are treated as a single unit.
- 字元:
- 依照前後關聯的上下文, 可能是:
1) 一個存放一個一個字元的儲存單位能力;
2) 一個字元集的成員.
- character:
- Depending on context, either 1) a storage unit capable of holding
a character; or 2) a member of a character set.
- 對齊的字元位址:
- 在一個字元的記憶體位置的位址是可以被存取的.
- character-aligned address:
- The address of a memory location at which a
character can be accessed.
- 字元字串:
- 資料空間結合了一串連續的相鄰對齊的字元位址. 字元字串通常包含文字.
除非特別提示, 專有名詞 字串 的意思是 字元字串.
- character string:
- Data space that is associated with a sequence of
consecutive character-aligned addresses. Character strings usually
contain text. Unless otherwise indicated, the term string means
character string.
- 程式碼空間:
- 詞典中實作詞語義的邏輯的區域.
- code space:
- The logical area of the dictionary in which word semantics are
implemented.
- 編譯:
- 將原始碼改變成詞典的定義.
- compile:
- To transform
source code into dictionary definitions.
- 編譯語意:
- 文字解譯器在編譯狀態時遇見一個 Forth 定義名字時的行為.
- compilation semantics:
- The behavior of a Forth definition when its name is
encountered by the text interpreter in compilation state.
- 計數字串:
- 一個資料結構, 由一個包含跟隨長度的字元及零或多個連續的字元組成.
一般情形下, 計數字串包含文字.
- counted string:
- A data structure consisting of one character containing a
length followed by zero or more contiguous data characters. Normally, counted
strings contain text.
- 交錯的編譯器:
- 可編譯一個程式為了稍後在實際或邏輯上不同於編譯程式環境執行的一個系統.
在一個交錯的編譯器中, 專有名詞 主機 是指編譯環境, 而專有名詞
目標主機 是指執行環境.
- cross compiler:
- A system that compiles a program for later execution in
an environment that may be physically and logically different from the
compiling environment. In a cross compiler, the term host
applies to the compiling environment, and the term target applies
to the run-time environment.
- 目前的定義:
- 已經開始編譯, 但是尚未結束的定義.
- current definition:
- The definition whose compilation has been started but not
yet ended.
- 資料欄:
- 透過 CREATE 定義的詞中相關的資料空間.
- data field:
- The data space
associated with a word defined via
CREATE.
- 資料空間:
- 詞典中可被存取的邏輯區域.
- data space:
- The logical
area of the dictionary that can be accessed.
- 資料空間指標:
- 下一個可用的資料空間位置的位址, 例如: 這個值可由
HERE 傳回.
- data-space pointer:
- The address of the next available data space location,
i.e., the value returned by
HERE.
- 資料堆疊:
- 可以用來定義之間傳參數的堆疊. 在沒有可能混亂的情形下, 資料堆疊可以
簡稱為 堆疊. 相對於返回堆疊.
- data stack:
- A stack that may be used for passing parameters between
definitions. When there is no possibility of confusion, the data stack is
referred to as the stack. Contrast with return stack.
- 資料型別:
- 一個資料物件可以有的值集合.
- data type:
- An identifier
for the set of values that a data object may have.
- 定義詞:
- 一個 Forth 詞, 在執行時會創造一個新的定義.
- defining word:
- A Forth word
that creates a new definition when executed.
- 定義:
- 將一個 Forth 執行程序編譯進入詞典中.
- definition:
- A Forth execution
procedure compiled into the dictionary.
- 詞典:
- 一個可延伸的結構包含了定義及相關的資料空間.
- dictionary:
- An extensible structure that contains definitions and associated
data space.
- 顯示:
- 將一個或多個字元輸出到使用者輸出裝置.
- display:
- To send one or more
characters to the user output device.
- 環境的依賴:
- 一個程式隱含地假定一個 Forth 系統的實作選項或是底層的硬體.
例如, 一個程式假定單元的大小大於 16 位元就是一個對環境的依賴.
- environmental dependencies:
- A program's implicit assumptions about a Forth
system's implementation options or underlying hardware. For example, a
program that assumes a cell size greater than 16 bits is said to have an
environmental dependency.
- 執行語義:
- 一個 Forth 定義執行時的行為.
- execution semantics:
- The behavior
of a Forth definition when it is executed.
- 執行代號:
- 一個識別執行語義的數值.
- execution token:
- A value that identifies the execution semantics of a
definition.
- 尋找:
- 在詞典中找出一個給定的字串的定義名字.
- find:
- To search the
dictionary for a definition name matching a given string.
- 直譯詞:
- 一個 Forth 詞, 它的編譯語義是執行它的執行語義.
- immediate word:
- A Forth word whose compilation semantics are to perform its
execution semantics.
- 實作時指定:
- 表示系統的行為或特性必須在一個系統中供應並提供文件, 但是進一步
的細節並未預先在標準中描述.
- implementation defined:
- Denotes system behaviors or features that must be
provided and documented by a system but whose further details are not
prescribed by this Standard.
- 依實作而定:
- 表示系統的行為或特性必須在一個系統中供應, 但是進一步的細節
並未預先在標準中描述.
- implementation dependent:
- Denotes system behaviors or features that must be
provided by a system but whose further details are not prescribed by this
Standard.
- 輸入緩衝區:
- 一塊記憶體的區域, 包含了輸入來源讀入的字元, 目前正被一個程式使用中.
- input buffer:
- A region of memory containing the sequence of characters from
the input source that is currently accessible to a program.
- 輸入來源:
- 裝置、檔案、區塊或是其他提供字元來重新填滿輸入緩衝區的實體.
- input source:
- The device, file, block, or other entity that supplies
characters to refill the input buffer.
- 輸入來源明細表:
- 一個描述輸入來源、輸入緩衝區、分析區的資訊的集合. 如果能適當地
儲存及回存, 這個資訊足以允許巢狀地操作分析同樣或不同的輸入來源.
- input source specification:
- A set of information describing a particular
state of the input source, input buffer, and parse area. This information is
sufficient, when saved and restored properly, to enable the nesting of parsing
operations on the same or different input sources.
- 解譯語義:
- 一個 Forth 定義的名字被文字解譯器在解譯模式使用時的行為.
- interpretation semantics:
- The behavior of a Forth definition when its name is
encountered by the text interpreter in interpretation state.
- 初始語義:
- 一個 Forth 定義或是一個跟隨著 DOES> 部分後的
Forth 定義, 開始執行時的行為.
- initiation semantics:
- The behavior of a Forth definition, or of the portion of a Forth definition
following DOES>, when it begins execution.
- 鍵盤事件:
- 系統指示使用者在使用者輸入裝置輸入一個數值. 在這份文件中專有名詞
鍵盤 並不排除其他型式的使用者輸入裝置.
- keyboard event:
- A value received by the system denoting a user action at the
user input device. The term keyboard in this document does not exclude
other types of user input devices.
- 行:
- 跟隨著一個實際的或是暗示的行結束符號的一串連續的字元.
- line:
- A sequence of characters followed by an actual or implied line
terminator.
- 名稱空間:
- 詞典存放定義名稱的邏輯區域.
- name space:
- The logical area of the dictionary in which definition names are
stored.
- 數字:
- 在這個標準中, 沒有其他條件的 數字 就是 整數.
相同地, 雙數字 表示 雙單元整數.
- number:
- In this Standard, number used without other qualification
means integer. Similarly, double number means
double-cell integer.
- 分析:
- 用指定的界定符號集合來從分析區選擇及除去一個字元字串.
- parse:
- To select and exclude a character string from the parse area using a
specified set of delimiting characters, called delimiters.
- 分析區:
- 輸入緩衝區中尚未被分析的部分, 因此提供給系統的文字解譯器或是其他
的分析操作來作接著的處理.
- parse area:
- The portion of the input buffer that has not yet been parsed, and
is thus available to the system for subsequent processing by the text
interpreter and other parsing operations.
- 圖表數字輸出:
- 一種數字顯示格式, 而它的數字是以 Forth 詞來轉換的, 用像是符號式的
圖表 產生需求輸出.
- pictured-numeric output:
- A number display format in which the number is
converted using Forth words that resemble a symbolic picture of
the desired output.
- 程式:
- 一個完全的執行設計清單, 可以達成一個特定的功能 (應用程式的工作),
以 Forth 原始碼格式表示.
- program:
- A complete specification of execution to achieve a specific function
(application task) expressed in Forth source code form.
- 接收:
- 從使用者輸入裝置中取得字元.
- receive:
- To obtain characters
from the user input device.
- 返回堆疊:
- 一個可以用來做程式巢狀執行、DO-LOOP 執行、暫存空間及其他用途的堆疊.
- return stack:
- A stack that may be used for program execution nesting, do-loop
execution, temporary storage, and other purposes.
- 標準詞:
- 一個正式地定義在這個標準中的有名字的 Forth 程序.
- standard word:
- A named Forth
procedure, formally specified in this Standard.
- 使用者輸入裝置:
- 目前選擇作為接收資料來源的輸入裝置, 通常是鍵盤.
- user input device:
- The input device currently selected as the source of
received data, typically a keyboard.
- 使用者輸出裝置:
- 目前選擇作為輸出資料的目的地顯示裝置.
- user output device:
- The output device currently selected as the destination
of display data.
- 變數:
- 一個有名字的資料空間區域, 可由它的記憶體位置定位及存取.
- variable:
- A named region of data space located and accessed by its memory
address.
- 詞:
- 依照上下文, 可能是 1) 一個 Forth 定義的名字; 或是 2) 分析過的非空白字元,
它可以是一個 Forth 定義的名字.
- word:
- Depending on context, either 1) the name of a Forth definition; or 2) a
parsed sequence of non-space characters, which could be the name of a Forth
definition.
- 詞列表:
- 一串相關聯的 Forth 定義名字, 它們可以在一個詞典搜尋中被檢視.
- word list:
- A list of associated Forth definition names that may be examined
during a dictionary search.
- 詞集:
- 一個 Forth 定義的集合, 在標準中分類在一起是以一個名字顯示的相同觀點,
通常是它們的共同功能範圍.
- word set:
- A set of Forth definitions grouped together in this Standard under
a name indicating some shared aspect, typically their common functional
area.
See:
A.2.1 專有名詞的定義(Definition of terms),
RFI 0005 初始化的語義(Initiation semantics),
RFI 0007 在 "即時性" 和 "特別編譯語義" 之間的差別(Distinction between immediacy and special compilation semantics).
2.2 標記法(Notation)
2.2.1 數字標記法(Numeric notation)
除非特別提示, 所有提到數字的部分都是以有號的單一單元整數為單位.
有界限的數值是以 {從...到} 的方式顯示的. 一個位置的內容所允許的範圍
是以雙大括弧顯示的, 特別是為了變數的內容, 例如:
BASE {{2...36}}.
Unless otherwise stated, all references to numbers apply to signed single-cell
integers. The inclusive range of values is shown as {from...to}. The
allowable range for the contents of an address is shown in double braces,
particularly for the contents of variables, e.g.,
BASE {{2...36}}.
2.2.2 堆疊標記法(Stack notation)
一個定義的堆疊的參數輸入和輸出是用下列的標記法描述.
Stack parameters input to and output from a definition are described using the
notation:
( stack-id before -- after )
這裡的 stack-id 是指定要描述哪一個堆疊, before 是表示在執行定義之前的
堆疊參數資料型別, after 表示執行後的堆疊參數資料型別. 用於 before 與
after 之間的符號顯示於 表格 3.1.
where stack-id specifies which stack is being described, before represents the
stack-parameter data types before execution of the definition and after
represents them after execution. The symbols used in before and after are
shown in
table 3.1.
流程控制 stack-id 是 C:, 資料堆疊的 stack-id 是 S:,
而返回堆疊的 stack-id R:. 在不會混亂的情形下, 資料堆疊的 stack-id
可以省略.
The control-flow-stack stack-id is C:, the data-stack stack-id is
S:, and the return-stack stack-id is R:. When there is no
confusion, the data-stack stack-id may be omitted.
在有替代的 after 代表時, 它們以 after1 | after2 的方式來描述.
堆疊的最上層在右邊. 只有在執行時需要及提供的堆疊項目才會被顯示.
When there are alternate after representations, they are described by
after1 | after2. The top of the stack is to the right. Only
those stack items required for or provided by execution of the
definition are shown.
See:
A.2.2.2 堆疊標記法(Stack notation)
2.2.3 分析文字的標記(Parsed-text notation)
除了使用堆疊參數之外, 如果一個定義分析文字, 文字應該使用表格 2.1 的方式簡寫,
用雙引號環繞住, 並且放置在第一個堆疊描述的 before 參數和 --
分隔符號之間. 例如:
( S: before "待分析文字的縮寫" -- after ).
If, in addition to using stack parameters, a definition parses text,
that text is specified by an abbreviation from table 2.1, shown
surrounded by double-quotes and placed between the before parameters and
the -- separator in the first stack described, e.g.,
( S: before "parsed-text-abbreviation" -- after ).
Table 2.1 - 待分析文字的縮寫(Parsed text abbreviations)
縮寫 描述
------------ -----------
<char> 標示被分析的字串結束的分界符號
<chars> 零或多個連續不斷的字元
<space> 一個空白分界符號
<spaces> 零或多個連續不斷的空白字元
<quote> 一個雙引號分界符號
<paren> 一個右括弧分界符號
<eol> 一個隱含地分界符號標明一行的結束
ccc 一個分析過的任意的字元序列, 去除了分界符號字元
name 一個由空白結尾的標記, 相等於ccc<space> 或 ccc<eol>
Abbreviation Description
------------ -----------
<char> the delimiting character marking the end of the
string being parsed
<chars> zero or more consecutive occurrences of the
character char
<space> a delimiting space character
<spaces> zero or more consecutive occurrences of the
character space
<quote> a delimiting double quote
<paren> a delimiting right parenthesis
<eol> an implied delimiter marking the end of a line
ccc a parsed sequence of arbitrary characters,
excluding the delimiter character
name a token delimited by space, equivalent to
ccc<space> or ccc<eol>
2.2.4 詞彙標記法(Glossary notation)
每一個詞集的詞彙記錄是以標準 ASCII 對照表的順序列出的. 每一個詞彙記錄
指定了一個 ANS Forth 詞, 並由兩部分組成: 一個索引行及這個定義的語義描述.
The glossary entries for each word set are listed in the standard ASCII
collating sequence. Each glossary entry specifies an ANS Forth word and
consists of two parts: an index line and the semantic description of the
definition.
2.2.4.1 詞彙索引行(Glossary index line)
索引行是一個單行記錄, 從左到右包含了:
The index line is a single-line entry containing, from left to right:
- 區號, 最後四個數字是在標準中所有的詞最後都被指定的一個連續性的
唯一的數字;
- 定義名, 是大寫格式、單空鉛、粗體字元;
- 如果發音不同於英文的話, 用引號圍住的自然語言發音;
- 列於表格 2.2 的詞集稱呼. 延伸詞集包含了 EXT 字樣.
- Section number,
the last four digits of which assign a unique
sequential number to all words included in this Standard;
- DEFINITION-NAME
in upper-case, mono-spaced, bold-face letters;
- Natural-language
pronunciation in quotes if it differs from English;
- Word-set
designator from table 2.2. The designation for extensions
word sets includes EXT.
Table 2.2 - 詞集稱呼(Word set designators)
詞集 稱呼
-------- ----------
核心詞集 CORE
區塊詞集 BLOCK
雙數值詞集 DOUBLE
例外詞集 EXCEPTION
設備詞集 FACILITY
檔案存取詞集 FILE
浮點詞集 FLOATING
區域變數詞集 LOCALS
記憶體配置詞集 MEMORY
程式設計工具詞集 TOOLS
搜尋順序詞集 SEARCH
字串詞集 STRING
Word set Designator
-------- ----------
Core word set CORE
Block word set BLOCK
Double-Number word set DOUBLE
Exception word set EXCEPTION
Facility word set FACILITY
File-Access word set FILE
Floating-Point word set FLOATING
Locals word set LOCALS
Memory-Allocation word set MEMORY
Programming-Tools word set TOOLS
Search-Order word set SEARCH
String-Handling word set STRING
2.2.4.2 詞彙語義描述(Glossary semantic description)
語義描述的第一段包含了一個執行這個詞時影響每一個堆疊的堆疊標記.
其他段包含這個語義的文字描述. 參閱
3.4.3 語義.
The first paragraph of the semantic description contains a stack notation for
each stack affected by execution of the word. The remaining paragraphs
contain a text description of the semantics. See
3.4.3 Semantics.
2.3 參考資料(References)
這個標準參考了下列的國家及國際的標準:
The following national and international standards are referenced in this
Standard:
ANSI X3.172-1990, 資訊系統字典
(2.1 專有名詞的定義(Definition of terms));
ANSI X3.172-1990, Dictionary for information systems
(2.1 Definition of terms);
ANSI X3.4-1974, 資訊交換美國標準字元
(ASCII)
(3.1.2.1 圖形字元(Graphic characters));
ANSI X3.4-1974, American Standard Code for Information Interchange
(ASCII)
(3.1.2.1 Graphic characters);
ISO 646-1983, ISO 資訊交換 7 位元字集, 國際參考版(IRV)
(3.1.2.1 圖形字元(Graphic characters));
ISO 646-1983, ISO 7-bit coded characterset for information
interchange, International Reference Version (IRV)
(3.1.2.1 Graphic characters);
ANSI/IEEE 754-1985, 浮點運算標準
(12.2.1 專有名詞的定義(Definition of terms)).
ANSI/IEEE 754-1985, Floating-point standard
(12.2.1 Definition of terms).
內容列表(Table of Contents)
下一章(Next Section)