explain that GF_LIB_PATH can now be a colon-separated list

This commit is contained in:
Meng Weng Wong
2018-07-22 00:14:29 -07:00
parent 8a14912ee3
commit 7f86bee8e7
2 changed files with 23 additions and 8 deletions

View File

@@ -412,21 +412,33 @@ use on-line ``h -FLAG``.
===File paths=== ===File import search paths===
Colon-separated lists of directories searched in the Colon-separated list of directories searched in the
given order: given order:
``` ```
--# -path=.:../abstract:../common:prelude --# -path=.:../abstract:../common:prelude
``` ```
This can be (in order of growing preference), as This can be (in order of increasing priority), as
first line in the top file, as flag to ``gf`` first line in the file, as flag to ``gf``
when invoked, or as flag to the ``i`` command. when invoked, or as flag to the ``i`` command.
The prefix ``--#`` is used only in files. The prefix ``--#`` is used only in files.
If the environment variabls ``GF_LIB_PATH`` is defined, its GF attempts to satisfy an ``import`` command by searching for the
value is automatically prefixed to each directory to import filename in the above search paths, initially qualified
extend the original search path. relative to the current working directory. If the file is not found in
that initial expansion, the search paths are re-qualified relative to
the directories given in the ``GF_LIB_PATH`` environment variable. If
``GF_LIB_PATH`` is not defined, its default value is
``/usr/local/share/gf-3.9/lib`` (assuming you have GF version 3.9).
If your GF resource grammar libraries are installed somewhere else,
you will want to set ``GF_LIB_PATH`` to point there instead. In a
pinch, you can point to the ``GF/lib/src/`` folder in your clone of
the GF source code repository.
Developers of resource grammars may find it useful to define multiple
directories, colon-separated, in ``GF_LIB_PATH``.
===Alternative grammar formats=== ===Alternative grammar formats===

View File

@@ -3204,7 +3204,10 @@ in the top of <CODE>FILE.gf</CODE> causes the GF compiler, when invoked on <CODE
to search through the current directory (<CODE>.</CODE>) and the directories to search through the current directory (<CODE>.</CODE>) and the directories
<CODE>present</CODE>, <CODE>prelude</CODE>, and <CODE>/home/aarne/GF/tmp</CODE>, in this order. <CODE>present</CODE>, <CODE>prelude</CODE>, and <CODE>/home/aarne/GF/tmp</CODE>, in this order.
If a directory <CODE>DIR</CODE> is not found relative to the working directory, If a directory <CODE>DIR</CODE> is not found relative to the working directory,
also <CODE>$(GF_LIB_PATH)/DIR</CODE> is searched. <CODE>$(GF_LIB_PATH)/DIR</CODE> is searched. <CODE>$GF_LIB_PATH</CODE>
can be a colon-separated list of directories, in which case each directory
in the list contributes to the search path expansion.
</P> </P>
<A NAME="toc53"></A> <A NAME="toc53"></A>
<H2>Alternative grammar input formats</H2> <H2>Alternative grammar input formats</H2>