<start> = <select> <all> . <select> = select . <all> = all:"&keys:[alt e]a" .
With this grammar enabled, Voice Manager will send the keystrokes [alt e]a upon recognizing select all.
&X:i:s
where i is an integer greater than zero and s is a string. This has the effect of assigning the value s to variable i. For example,
<blue> = blue:"&X:1:[down]" .assigns down to be the value of X1. Referencing variables is done with the @X(i) operator (where i is a positive integer). For example:
<change-color> = <set> <color> <to> <colors> . <set> = set . <color> = color:"&keys:[alt o]c[home]@X(1)[enter]" . <colors> = <blue> . <blue> = blue .When Voice Manager recognizes the phrase set color to blue the annotation on blue sets the value of X(1) to [down]. The annotation on color is &keys:[alt o]c[home]@X(1)[enter]. The variable @X(1) is replaced by its value [down] and voice manager sends the following keystrokes:
[alt o]c[home][down][enter]
EXTERN <Extern_counts> .
This enables you to use the <Extern_counts> nonterminal and the @count(i) annotation. The nonterminal <Extern_counts> has the following rewrite rule:
<Extern_counts> = one | two | three | four | five | six | seven | eight | nine | ten | eleven | twelve | thirteen | fourteen | fifteen | sixteen | seventeen | eighteen | nineteen | twenty | thirty | forty | fifty .
The annotation @count(i) specifies the value of the i-th count nonterminal. For example, if you have the grammar rule:
<sample> = <print> <Extern_counts> <copies> <of> <pages> <Extern_counts> <through> <Extern_counts> .
and the user utters: print five copies of pages one through three. Then:
Here's an example that will work with IBM Works:
<font-size> = <change> <font> <size> <to> <Extern_counts> . <change> = change . <font> = font . <size> = size:"&keys:[ctrl f][alt s]@count(1)[enter]" . <to> = to . EXTERN <Extern_counts> .Consider the case where the user says Change the font size to twelve. The annotation for twelve sets the count(1) variable to 12. The annotation on size is &keys:[ctrl f][alt s]@count(1)[enter]. The @count(1) variable is replaced with 12 yielding:
&keys:[ctrl f][alt s]12[enter]
<move-command> = move right <count> words:"&keys:@repeat(@count(1),[shift[right]])" . EXTERN <Extern_counts> .Consider the case where this grammar is active and Voice Manager recognzies move right three words. The count(1) variable has the value 3. The annotation on words is &keys:@repeat(@count(1),[shift[right]]). Replacing @count(1) by its value yields &keys:@repeat(3,[shift[right]]). The @repeat sequence is performed yielding &keys:[shift[right]][shift[right]][shift[right]].