dcsimg
Linux Today: Linux News On Internet Time.




More on LinuxToday


IBM developerWorks: Cultured Perl: Writing Perl programs that speak English Using Parse::RecDescent

Aug 05, 2000, 17:37 (1 Talkback[s])
(Other stories by Teodor Zlatanov)

WEBINAR:
On-Demand

Re-Imagining Linux Platforms to Meet the Needs of Cloud Service Providers


"Parse::RecDescent is a module for parsing text. With a few simple constructs it can be used for almost any parsing task. The more advanced grammar constructs can be daunting, but they are not needed for most purposes. Parse::RecDescent is an object-oriented module. It creates a parser object around a grammar. A grammar is a collection of rules in text form."

"Why Parse::RecDescent is a good user interface engine

  • Flexibility: rules can be added or removed easily and don't require tweaking other rules.
  • Power: rules can invoke any code and can recognize any text pattern.
  • Ease of use: it takes 5 minutes to put together a simple grammar.
  • Any front-end will work: the parser can be accessed as a regular Perl function, and can access other regular Perl functions and modules.
  • Internationalization: this is an often-overlooked UI design issue. Internationalization is easy when the parsing grammar is intended to easily accept multiple versions of a command."
"Why Parse::RecDescent may not be a good UI engine
  • Speed: startup and parsing speed is not as good as a straightforward matching algorithm. This will improve with future releases of the module, and should be carefully considered in relation to the savings of quick prototyping, development, and release.
  • Module availability: Parse::RecDescent may not be available, due to OS or system administration problems. Talk to your local Perl guru."

Complete Story

Related Stories: