develooper Front page | perl.perl6.language | Postings from May 2001

Re: A proposal for more powerful text processing to be built in to Perl: Flex and Pushdown Expressions.

Thread Previous | Thread Next
From:
Tad McClellan
Date:
May 11, 2001 06:26
Subject:
Re: A proposal for more powerful text processing to be built in to Perl: Flex and Pushdown Expressions.
Message ID:
20010511082907.A1437@augustmail.com
On Thu, May 10, 2001 at 04:26:56PM -0700, Daniel S. Wilkerson wrote:

> Flex - Put all of flex right into Perl.  Flex is simply an event
> engine (-compiler) for driving calls against code according to regular
> expression matching events.  While it is often convenient to have the
> the flow of control expressed in an imperative way (do this; do this;
> do this) as Perl already has, the event-driven regular expression
> matching that lexers offer would allow one to easily write
> mini-language interpreters or pre-processors in Perl very easily.


Don't we already have that in Perl 5?


   if ( /\G\s+/gc ) {        # whitespaces
   }
   elsif ( /\G[*/+-]/gc )  { # operator
   }
   elsif ( /\G\d+/gc )  {    # term
   }
   elsif ( /\G.+/gc )  {     # unrecognized token
   }
   
   

-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About