[system] / trunk / pg / macros / parserFormulaWithUnits.pl Repository:
ViewVC logotype

View of /trunk/pg/macros/parserFormulaWithUnits.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4997 - (download) (as text) (annotate)
Mon Jun 11 18:16:40 2007 UTC (12 years, 8 months ago) by gage
File size: 970 byte(s)
Fixing docementation so that it can be read from the web.

    1 
    2 loadMacros('Parser.pl');
    3 
    4 sub _parserFormulaWithUnits_init {}; # don't reload this file
    5 
    6 =head1 DESCRIPTION
    7 
    8 ######################################################################
    9 #
   10 #  This is a Parser class that implements a formula with units.
   11 #  It is a temporary version until the Parser can handle it
   12 #  directly.
   13 #
   14 #  Use FormulaWithUnits("num units") or FormulaWithUnits(formula,"units")
   15 #  to generate a FormulaWithUnits object, and then call its cmp() method
   16 #  to get an answer checker for your formula with units.
   17 #
   18 #  Usage examples:
   19 #
   20 #      ANS(FormulaWithUnits("3x+1 ft")->cmp);
   21 #      ANS(FormulaWithUnits("$a*x+1 ft")->cmp);
   22 #
   23 #      $x = Formula("x");
   24 #      ANS(FormulaWithUnits($a*$x+1,"ft")->cmp);
   25 #
   26 ######################################################################
   27 
   28 #
   29 #  Now uses the version in Parser::Legacy::NumberWithUnits
   30 #  to avoid duplication of common code.
   31 #
   32 
   33 =cut
   34 
   35 sub FormulaWithUnits {Parser::Legacy::FormulaWithUnits->new(@_)}
   36 

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9