Definition
- A vocabulary is defined as a directory containing files
with the extension *.leo.
- These
*.leo files are LeoScripts that, when "sourced in"
(loaded and executed), create nothing but dictionaries.
- The dictionaries created from
*.leo files are pushed onto the
dictionary stack.
- Each dictionary gets an entry in the Leonardus dictionary.
- Following subdirectories are used to store vocabularies:
vocabularies/
../lib/leonardus/vocabularies/
Command Line Supprt
- The
lb and lc scripts provide a command line option -V to source the
specified vocabulary.
- This option can be repeated, allowing multiple vocabularies to be sourced in.
lb provides a lbcommand lsvoc to list all available vocabularies
Operator vocabulary
There is an operator vocabulary to source in the given literal name
of a vocabulary.
Translations
The vocabulary mechanism is used to implement multi-lingual operator names.
See LANGUAGE.
Test Suites
- Test suites can source vocabularies using the variable
SUITE_VOCABULARY.
- This variable is a comma-separated list of vocabulary names, allowing
multiple vocabularies to be specified for testing purposes.
Initial Phase
- In the initial phase, only one
*.leo file per vocabulary is used, and
this file is named after the vocabulary.
- The system does not enforce these actions or properties.
Syntax for Documentation within Vocabularies
The vocabularies should contain a standardized documentation for each operator.
man pages are extracted from these text blocks by the command:
lb -C manpage
This documentation example enables man nip after the extraction:
%%!doc nip
%%!st X_1 X_2 -- X_2
%%!de Drop the first item below the top of stack.
%%!or Procedure from vocabulary Forth.
Supported sections are:
- doc .. the operator name
- st ... STACK
- de ... DESCRIPTION
- or ... ORIGIN
- co ... CONVERSION
- se ... SEE ALSO
Multiple %%!de lines are allowed. They will be concatenated.