On Mon, 08 Aug 2011 12:48:22 -0400 Tom Metro <tmetro-boston...@vl.com> wrote: 

TM> I have a command line utility I am developing that I'd like to be
TM> extendable with additional "verbs" such that you can do:

TM> command verb ...args...

TM> And I'd like the utility to be able to support new verbs by merely
TM> having a module added to a designated directory. Thus I'd like my code
TM> to be able to use some form of introspection to extract the new verbs
TM> (designated methods) from the modules.

Have each module define text lines that become part of a big
Parse::RecDescent grammar you evaluate at the end to generate the top
rule.  As long as your basic lexing rules are consistent you should be
OK.  This gives you the most flexibility, as long as you control all the
modules and the load order.  I also think it's the most readable
approach and it only exposes the functionality you want to expose.

Ted

_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to