Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Reversible parsing (with Parse::RecDescent?)

by goibhniu (Hermit)
on Mar 14, 2008 at 19:55 UTC ( [id://674283]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    
    
    ...
                       |            |
                       /------------\
    
  2. or download this
    #/usr/bin/perl -Wl
    
    ...
            print Dumper($reresult);
        }else{ print "  badstring\n"}
    }
    
  3. or download this
    startrule: commandline{$item{commandline}}
    commandline: command options {[$item {command},$item{options}]}
    ...
    option: optionflag optionvalue { [$item{optionflag}, $item{optionvalue
    +}?$item{optionvalue}:1] }
    optionflag: /(-\w+)/ { $1 }
    optionvalue: /(\w*)/ { $1 }
    
  4. or download this
    hap -b
    hap -b sknxharvest01
    ...
    hap -prompt
    hap -b sknxharvest01 -prompt
    hap -prompt -b sknxharvest01
    
  5. or download this
    C:\chas_sandbox\grammars>grammarharness.pl packagegrammar.txt packagec
    +ommands.tx
    t
    ...
    
    
    C:\chas_sandbox\grammars>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://674283]
Approved by Corion
Front-paged by mr_mischief
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 17:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found