Re: Using Rules Today

2006-07-07 Thread Flavio S. Glock
2006/7/5, Joshua Gatcomb <[EMAIL PROTECTED]>: I have not had a chance to look at Flavio's links yet. Since no one who actually knows rules seemed to be inspired to write an example for me - I will *eventually* figure it out on my own and post back to the list as an FYI. Here is a simple one t

Re: Using Rules Today

2006-07-05 Thread Joshua Gatcomb
On 7/3/06, Paul Seamons <[EMAIL PROTECTED]> wrote: It isn't specifically a parser designed for general language parsing, but CGI::Ex::Template does have a mathematical expression parser. Thanks, but this falls into the realm of existing wheels which is a different part of this project. pe

Re: Using Rules Today

2006-07-03 Thread Paul Seamons
> In any case, I was wondering if someone could provide me with an example of > a mathematical expression parser (and evaluator). > To properly compare to the others, it would need to handle the following > operators > > +, - (left associative) > *, /, % (left associative) > ^ (right as

Re: Using Rules Today

2006-07-03 Thread Flavio S. Glock
ee what the syntax looks like for writing an evaluator using rules in p5. http://svn.openfoundry.org/pugs/perl5/Pugs-Compiler-Rule/lib/Pugs/Grammar/Rule/Rule.pm - this is the grammar for rules, written in rules. The last rules have looser precedence; the rules at the start of the file have tighter

Using Rules Today

2006-07-03 Thread Joshua Gatcomb
All: I have a for-fun project that I am working on exploring various different parsers and their methods. So far I have looked at things like Parse::RecDescent, Parse::YAPP, Parse::Earley, and HOP::Parser. I had Perl6::Rules on my list, but it is my understanding that Pugs::Compiler::Rule is mor

Re: using rules

2005-06-09 Thread Patrick R. Michaud
On Sun, Jun 05, 2005 at 05:11:55PM +0200, BÁRTHÁZI András wrote: > Thanks, it helped me! > > More questions. ;) It seems to me, that the following constructs not > yet(?) implemented in Pugs. Is it true? I'll note briefly here that questions regarding implementation (in Perl 6 or Pugs) generally

Re: using rules

2005-06-05 Thread BÁRTHÁZI András
Hi, I'll take a shot at it since no one else seems to want to. :-) > Hope this is helpful. Corrections are welcome from anyone who spots > any mistakes. Thanks, it helped me! More questions. ;) It seems to me, that the following constructs not yet(?) implemented in Pugs. Is it true? Built

Re: using rules

2005-06-05 Thread Aankhen
I'll take a shot at it since no one else seems to want to. :-) On 6/3/05, BÁRTHÁZI András <[EMAIL PROTECTED]> wrote: > How can I catch the matched elem name, and block content? I'm guessing > that hypotetical variables can be the solution, but it says, that those > variables should have been defin

Re: using rules

2005-06-05 Thread BÁRTHÁZI András
Hi, No ideas? Bye, Andras I'm working on a web templating system, and I'm wondering how should I use rules? I have these defs: rule elem { \< wts \: (<[a..z]>+) \/ \> } rule block { \< wts \: (<[a..z]>+)\>(.*?)\< \/ wts \: $1 \> } I would like to execute subroutines during the e

using rules

2005-06-03 Thread BÁRTHÁZI András
Hi, I'm working on a web templating system, and I'm wondering how should I use rules? I have these defs: rule elem { \< wts \: (<[a..z]>+) \/ \> } rule block { \< wts \: (<[a..z]>+)\>(.*?)\< \/ wts \: $1 \> } I would like to execute subroutines during the evaluation. What sh

using Rules with undefined values (was Re: some misc Perl 6 questions)

2005-03-09 Thread Darren Duncan
At 9:08 AM -0800 3/9/05, Larry Wall wrote: My other quibble is that you seem to be prone to stating things in the negative for at least two of your three tests here: subtype KeyName of Str where { $_.defined and $_ ne '' and $_ !~ m/\W/ } and it seems to me that you could simplify all that to j