Le mercredi 30 mars 2005 à 11:05, Orton, Yves écrivait:
> 
> Also, when i say these classes what im thinking is that they encapsulate the
> knowledge about how to convert a rule specification into _source_code_ im
> not thinking that they should have methods that are executed inside of the
> parse loop. IMO there shouldnt be ANY subroutines inside of the parse loop.
> That way the resulting parser is lean and mean and fast. No method lookup BS
> or subroutine call stack overhead. 

My goal is to create an object, configure it with everything needed to do
the job (how to split the data, how to select the data to process, what
code to apply to that data). I want the parse/select part of the process
to be as fast as possible. The processing part involves a subroutine call
right now, but that could be optional.  I need to leave room to insert as
many hooks as possible. In the end, the run() method should be defined as:

    sub run {
        my $self = shift;
        local @ARGV = $self->files();
        eval $self->compute_code();
        die $@ if $@; # shouldn't happen
    }

Well, that's already the code in my module (roughly 60 lines of code).

> Anyway, as i said i look forward to seeing your work. :-)

I'll try to upload the existing code on CPAN soon.

-- 
 Philippe "BooK" Bruhat

 Honesty is its own reward. Dishonesty is its own punishment.
                                    (Moral from Groo The Wanderer #30 (Epic))

Reply via email to