On Wed, Apr 09, 2003 at 06:04:38PM -0600, Luke Palmer wrote: > So, how does this relate to the discussion at hand? Well, maybe > parsers are implemented policy-wise. Then you could replace the > default character atom with a Colorific atom. > > my $colorific_parser = new Parser::RecursiveDescent( > atom => Colorific ); > > $colorific_parser.parse(@skysamples, /./); # Matches one Colorific > > The method by which is specified probably has to be more powerful than > that. A "Colorific atom" doesn't make sense to me. It seems to conflate the thing you want to match against with the criteria you've chosen for matching. It's equivalent to saying my $p = new Parser::RecursiveDescent( atom => "a" ); $p.parse(@things, /./); # matches one "a" Atoms are things to which you can apply a matching criterion. "Is it Colorific?" sounds like a matching criterion and "it" sounds like an object, so your atoms would be objects, not Colorifics. > I hope this whet somebody's appetite for abstract thinking. Patterns > are just too powerful for text. Nah, just first pass your object stream through a routine that maps each object to a string representation of the thing you want to match against on each object, then apply regular text rules to the string. :-) -Scott -- Jonathan Scott Duff duff@cbi.tamucc.eduThread Previous | Thread Next