Listing 1 grammar.dat
Command :nooptcmd EndOfString
{ $return = $item[1]; }
| oneoptcmd anoption EndOfString
{ $return = "$item[1] $item[2]"; }
| twooptcmd anoption anoption EndOfString
{ $return = "$item[1] $item[2] $item[3]";}
| { $return = 0; }
oneoptcmd : 'script1'
twooptcmd : 'script2' | 'script1'
nooptcmd : 'script3'
anoption : /[A-Za-z0-9\-\_\*\.]+/
EndOfString : /\Z/
|