language design - Is there a good term rewriting library for Java? -


i working on java application reasoning on basic terms of language, trivially implemented composites (they internally generated, not parsed text). in need of applying set of rewrite rules term language, issue becoming annoying hand. after research found tom , possibly stratego/xt may alternatives add term rewriting abilities java. have experience on them suggest me advantages , disadvantages of both? know alternative? given size of software ability rewrite terms implemented pojo data structures requisite (i close deadline , not want replace current term representation one, although in future).

also exists termware: http://redmine.gradsoft.ua/projects/show/termware

does not sure, want, can handle java object in rule, i.e.

 domain(examples,   system(invoicing,default,          ruleset(            # import general operations.            import(general),             # handle new invoice , set 1 paid if possible.            @class("ua.gradsoft.termwaredemos.invoicing.invoice", $invoice)                         [ ! $invoice.ispayed()                            &&                             $invoice.getcustomer().getaccountbalance() - $invoice.getamount() + $invoice.getcustomer().getcreditlimit() > 0                         ]                           -> true                              [ $invoice.getcustomer().decrementaccount($invoice.getamount())                                &&                                $invoice.setpayed(true) ],             # set credit limit in depend summary payments.            @class("ua.gradsoft.termwaredemos.invoicing.customer", $customer)                         [ $customer.getaccountbalance() > 0 && $customer.getsummarypayments() > 2000 ] -> true [ $customer.setcreditlimit(500) ]           ),          firsttop) );  

also can =look @ jess side. http://www.jessrules.com/


Comments