- From: Serge LE HUITOUZE <slehuitouze@telisma.com>
- Date: Thu, 31 Jul 2003 10:36:18 +0200
- To: "Wyss, Felix" <FelixW@inin.com>, <www-voice@w3.org>
Wyss, Felix wrote: > Why do you assign it to a temporary variable instead of directly > assigning the GRR to the 'o' property of the GRN? > > $command2 = (set | turn) > $<http://www.example.com/object> {$.o=$$} > $state {$.s=$$}; You're right. I might have done so for this very example, but I preferred using a more generally aplicable framework: You don't always know where to put the result of the sub-grammar just after returning from it. For example (I must admit it's quite artificial): $command3 = (set | turn) $<http://www.example.com/object> {var obj = $$} ( $state {$.a=obj; $.b=$state} | $location {$.x=obj; $.y=$location} ); Wyss, Felix also wrote: > An alternate workaround would be the following: > > $command1 = (set | turn) > $object > $state > {$.o=$object; $.s=$state}; > > private $object = $<http://www.example.com/object>; This would not work as is: The semantics would be lost (see paragraph 5, Default Assignment, in SISR 2003 WD). The private rule should be written: private $object = $<http://www.example.com/object> {$=$$}; Which brings us back to my original comment on the impossibility to refer to the result of an external rule... --Serge Le Huitouze
Received on Thursday, 31 July 2003 04:51:55 UTC