C:\chas_sandbox\grammars>grammarharness.pl packagegrammar.txt packagecommands.tx t $grammar is startrule: commandline{$item{commandline}} commandline: command options {[$item {command},$item{options}]} command: packagecommand {$item{packagecommand}} packagecommand: /(hap)/ | /(hccmrg)/ | /(hup)/ | /(hspp)/ | /(hpp)/ | /(hpg)/ | /(hdp)/ | /(hdlp)/ | /(hcp)/ options: option(s?) option: optionflag optionvalue { [$item{optionflag}, $item{optionvalue}?$item{op tionvalue}:1] } optionflag: /(-\w+)/ { $1 } optionvalue: /(\w*)/ { $1 } parsing $_: hap -b $VAR1 = [ 'hap', [ [ '-b', 1 ] ] ]; $VAR1 = [ 'hap', [ [ '-b', '1' ] ] ]; parsing $_: hap -b sknxharvest01 $VAR1 = [ 'hap', [ [ '-b', 'sknxharvest01' ] ] ]; $VAR1 = [ 'hap', [ [ '-b', 'sknxharvest01' ] ] ]; parsing $_: hap -b sknxharvest01 -enc testfile.dfo $VAR1 = [ 'hap', [ [ '-b', 'sknxharvest01' ], [ '-enc', 'testfile' ] ] ]; $VAR1 = [ 'hap', [ [ '-b', 'sknxharvest01' ], [ '-enc', 'testfile' ] ] ]; parsing $_: hap -b sknxharvest01 -usr cgowing -pass chaspass $VAR1 = [ 'hap', [ [ '-b', 'sknxharvest01' ], [ '-usr', 'cgowing' ], [ '-pass', 'chaspass' ] ] ]; $VAR1 = [ 'hap', [ [ '-b', 'sknxharvest01' ], [ '-usr', 'cgowing' ], [ '-pass', 'chaspass' ] ] ]; parsing $_: hap -badflag $VAR1 = [ 'hap', [ [ '-badflag', 1 ] ] ]; $VAR1 = [ 'hap', [ [ '-badflag', '1' ] ] ]; parsing $_: hap -prompt $VAR1 = [ 'hap', [ [ '-prompt', 1 ] ] ]; $VAR1 = [ 'hap', [ [ '-prompt', '1' ] ] ]; parsing $_: hap -b sknxharvest01 -prompt $VAR1 = [ 'hap', [ [ '-b', 'sknxharvest01' ], [ '-prompt', 1 ] ] ]; $VAR1 = [ 'hap', [ [ '-b', 'sknxharvest01' ], [ '-prompt', '1' ] ] ]; parsing $_: hap -prompt -b sknxharvest01 $VAR1 = [ 'hap', [ [ '-prompt', 1 ], [ '-b', 'sknxharvest01' ] ] ]; $VAR1 = [ 'hap', [ [ '-prompt', '1' ], [ '-b', 'sknxharvest01' ] ] ]; C:\chas_sandbox\grammars>type data10.xml hap -b 1 C:\chas_sandbox\grammars>