LXL README

LXL (Like Excel) is a mini-language that mimics Microsoft Excel formulas. Easily extended with new constants and functions.

Usage


formulas = %{
  ((1+2)*(10-6))/2;
  DATETIME("2004-11-22 11:11:00")=DATE(2004,11,22)+TIME(11,11,00);
  IN(" is ", "this is a string");
  LIST(1, "two", 3.0);
  IN("b", LIST("a", "b", "c"));
  AND(TRUE, NULL);
  OR(TRUE, FALSE);
  IF(1+1=2, "yes", "no");
}
# single formula
puts LXL.eval('5+5').inspect # => 10
# multiple formulas separated by semi-colon
puts LXL.eval(formulas).inspect # => [6, true, true, [1, "two", 3.0], true, false, true, "yes"]
See API docs for more information.

Requirements


* Ruby 1.8.2

Install


gem install lxl

License


LXL uses John Carter's LittleLexer for parsing.
Distributes under the same terms as LittleLexer.
http://www.rubyforge.org/projects/littlelexer/

Kevin Howe <[email protected]>