Question about semantic/1.0

I have question on example 17 in the draft.

$x = $a<1-> {$$};
$$ resolves to the last occurrence of $a.
The effect is equivalent to $x = ($a {$$})<1->.

I think there is one difference between the two rules. In the first one,
{$$} only gets evaluated once when $x was matched. But in the second case,
($$) gets evaluated every time $a was matched. 

If we parse "111" using following grammars:
1.
root $x;
$a = '1';
$x = {$=""} $a<1-> {$+=$$};

2.
root $x;
$a = '1';
$x = {$=""} ($a{$+=$$})<1-> ; 

I think the first one gives us $x="1", and the second one $x="111".

Am I right?


Jia (Jay) Pu
Software Engineer
LumenVox LLC
-------------------------------------------
Anytime a linguist leaves the group 
the recognition rate goes up.
--Fred Jelinek 
  (then of the IBM speech group) (1988)

Received on Thursday, 8 April 2004 16:44:20 UTC