W3C home > Mailing lists > Public > www-voice@w3.org > April to June 2003

SISR: Comments on April 2003 WD

From: Serge LE HUITOUZE <slehuitouze@telisma.com>
Date: Tue, 10 Jun 2003 18:42:23 +0200
Message-ID: <3AB3C7F30279254494C258DE38FE7CB969F4DF@cedre>
To: <www-voice@w3.org>


I have a few comments concerning last SISR Working Draft.

QUESTION/REMARK 1: Unique evaluation for global tags

Section 4.3 : "The header of an SRGS grammar may contain one or more SI
Tags that are executed before any of the SI Tags in the matching grammar
rules are evaluated. [...] The SI Tags are evaluated once, in a global
scope that will be shared by all evaluations (see 6.3).[...] This is
the primary function of these [global] tags: to initialize the global
scope for use in the SI Tags."

Variable scoping during execution is well described, but nothing is
mentionned as to grammars refering to external rules.

Consider the following (top-level) grammar: 
{ /* global tags for initializing the top-level grammar */ ...}
public $root =
   from $<somewhere/aux_file.abnf#city> {$.departure = $$}
   to $<somewhere/aux_file.abnf#city> {$.arrival = $$};
refering to the following external grammar 'aux_file.abnf':
{ /* global tags for initializing this grammar */ ... }
public $city = ...; /* some expansions need this grammar's global tags */ 

It seems obvious (or is it not?) that "global" tags for grammar
'aux_file.abnf' should be executed "locally" to allow for proper
evaluation of semantic interpretation of the '$city' sub-rule.

However, I don't know how to interpret the above-mentionned phrase
"... The SI Tags are evaluated once, in a global scope that will be
shared by all evaluations".
Does this mean that 'aux_file.abnf' global tags must be evaluated only
once, even if rule 'aux_file.abnf#city' is used twice in the top-level

In any case, the terms "global tags" and "global scope" become a little
bit ambiguous when grammars containing external references are involved
in a particular semantic evaluation...

QUESTION/REMARK 2 : Global scope being read-only

[NOTE: This question has more to do with personal curiosity rather
than a real problem/misunderstanding in the Draft, but I don't know
where to ask the question otherwise...]

The choice of having the global scope read-only essentially means that
tag language has some kind of functional semantics rather than an
imperative one.
Whereas I'm favorable to this choice, I would like to know why the WG
has ruled out a more imperative style of semantics, which is probably
more familiar to most developers. In particular, this choice implies
that some side effect programming is impossible.

I understand that reverting to a more imperative-like semantics would
necessitate the standard to define the order of execution more precisely
(i.e. the last paragraph before the example in section 6.4 should be

QUESTION/REMARK 3 : Section 6.3
Example "$a = $b [$b] { $.x = $b.x };".
A comment should be added to stress that such code is possibly
(probably?) flawed...

QUESTION/REMARK 4 : Section 6.3
Example "$a = $b [$c] { $.x = $c; $.y=$d; $.z=$e } $e;"
Comments say that some objects are undefined, whereas comments
for other examples (e.g. example 2 in section 6.5) mention run-time
Comments on 'undefinedness' and errorneous/exceptional behavior
should be harmonized in the whole document.

QUESTION/REMARK 5 : Section 6.5, proposed alternative for example 4
The proposed alternative supposes that first evaluation of "$.x"
in "{$.x = $.x + $b.x}" should yield "0" or empty string.
This is not consistent with example 11 (section 6.5), whose
comment states that first execution of "{$.ds = $.ds + $digit;}"
would cause a run-time error if 'ds' was not initialized with
tag "{$.ds = ""}".
A tag should be added at the beginning of the proposed alternative
for $a and comment changed accordingly. Possible tags are
"{$.x = 0}" and "{$.x = ""}".

QUESTION/REMARK 6 : Section 6.5, example 4b
Similar inconsistency as the one described in question/remark #6.

QUESTION/REMARK 7 : Section 6.5, examples 12 through 17
I (think I) understand how '$$' is resolved (or not) in these
examples, but I don't understand why the tags used in these
exmaples are reduced to a single '$$'.
See, for example, the following (sub-)grammar:
$x = $a [$b] {$$};
$a = foo;
$b = bar;
Since the only explicit SI tag in this (sub-)grammar doesn't
contain any reference to '$' or to '$.xxx', the value for
"$x" will not be defined (or did I miss something?).

It seems to me that the use of these particular tag values makes
the examples more obscure than they ought to be. Maybe, for greater
clarity, tags in these examples should be changed to, e.g., "{$ = $$}"?

-- Serge Le Huitouze
Received on Tuesday, 10 June 2003 12:43:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:07:36 UTC