in reply to Re: Regex Report
in thread Regex Report

Heh, sorry. You'll be happy to know all the grammar is stored (gasp?) as methods of the object. This means you have method names like "(" and "[" and "|". If you think this is blasphemous, tough cookies. In fact, the only non-weird looking method name is "atom", which is the starting node for the grammar.

Another thing. Right now, the grammar is determined on the fly. That is, each rule (upon successful match) tells the object what possible rules follow it. Perhaps I should implement that differently.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re^3: Regex Report
by diotalevi (Canon) on Jun 28, 2004 at 15:27 UTC

    So there's code that looks like $next = List::Util::first { eval { $self->$_ } } @tokens? Oof. Holey AUTOLOAD batman! Why not just make the token a parameter to some function instead of passing the value via the function name? Or is this so you can get overriding? When do we get to see this code and are you sure you couldn't have written this using a mundane method?

      Rules are methods of the object so that object inheritence works easily. Data is not inherited easily, methods are.
      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;