Parameters can be used to pass information
from one part of a gloss parser to another, or
to indicate finer information on the state
of the parser. This page describes usage of
parameters in the gloss system, especially when
writing modular vocabulary (MV) files.
Parameters are contained in a parameter container
class which contains a number of name="value" data.
The name here is a non-null key or parameter name and
value is a non-null string of unicode characters.
The ParameterContainer class has a clone
method which
is used extensively for saving current values during recursion.
A parameter must have a non-null string as a name. It may have a name built from a-z A-Z 0-9 - _ . according to the usual rules (under review - TO DO) or else may have name "{URI}name" where "URI" may be any URI with balanced (or no) braces and name agrees with the above. The URI is used as a "namespace" for the name, and may be abbreviated by a "prefix" according to the interpolation rules following.
Almost everywhere in text or attribute values in the MV file, parameter values will be interpolated. For details of exactly when interpolation takes place see the documentation for the modularvocab DTD.
The interpolation rules follow.
The rationale behind these rules are that parameter values themselves
might be thought of as tainted
and should not themselves be interpolated
unless they are used (at a higher level
) to build a parameter name.
In other words, only prefixes that are explicitly given in the MV file
should be resolved and parameter expressions in the input text file should
never be interpolated.
The MV file tokentypes.mv reads a list of tokens and dumps the tokens to the screen, showing the effects of $d, $n, $p, $q, $t, $v on the different token types. The following summary may be found helpful.
Token types: elt pelt attr fp hex int uri pdef pref cref eref b64 char str pi ns uc eos punc
safecharacters; value="URI", data="URI", prefix="", localname="", fullname=""
accept; value="STRING", prefix="", localname="", data="STRING", fullname=""
MV files may use a number of commands and features that enable you to use parameters effectively. Only a few manipulate parameters directly. Many more use parameters via the interpolation mechanism. The main commands that use parameters include
<mv:init-parameter name="..." value="..." /> <mv:set-parameter name="..." value="..." /> <mv:append-parameter name="..." value="..." /> <mv:incr-parameter name="..." value="..." /> <mv:declare-prefix prefix="..." uri="..."> ... </mv:declare-prefix> <mv:... parameters="[no]share" > ... <mv:if [test="..."] [value="..."] > ... </mv:if> <mv:if-not [test="..."] [value="..."] > ... </mv:if-not> <mv:else> ... </mv:else>
Parameters are local to their current mode unless they explicitly share space with their parent mode or a parameter is exported to an ancestor mode. See the documentation for the modularvocab DTD.
This page is copyright. Web page design and creation by GLOSS.