The grammar definition
Basics
The basic rule should have been:
<keys> exported = ({norepkey} | {repkey} [{count}])+;
Implementation
Because with these quasi-recursive rules there have been problems in the past (introduced several NatSpeak versions ago) this basic rule has been changed into (and enhanced with the <before> rule):
<keys> exported = <firstkey> [<stdkeys>+] ;
<firstkey> = <before> | <stdkeys>;
<stdkeys> = ...
And the further details are, including the <modifier>: rule:
<stdkeys> = [ <modifiers> ] (<repkey>[<count>] | <norepkey>);
<repkey> = {repkey};
<count> = {count};
<norepkey> = {character} | {norepkey} | <effkey>;
<effkey> = ( Eff|Function ) {effcount};
<modifiers> = (Cap | ‘All-Caps’ | Shift | Control | Alt|halt) + ;
Lists
The lists {character}, {effcount} and {count} are filled in the python file. The other lists, {repkey} and {norepkey} are filled from the configuration file, so are user configurable. Even for a specific modes. |