Re: Wanted: advice on writing compiler in Perl!

edward@nsrc.nus.sg (Edward Walker)
24 May 1996 15:34:12 -0400

          From comp.compilers

Related articles
Wanted: advice on writing compiler in Perl! andyd@aimla.com (1996-05-14)
Re: Wanted: advice on writing compiler in Perl! bnm@indica.bbt.com (1996-05-19)
Re: Wanted: advice on writing compiler in Perl! trulsson@Minsk.docs.uu.se (1996-05-21)
Re: Wanted: advice on writing compiler in Perl! edward@nsrc.nus.sg (1996-05-24)
| List of all articles for this month |

From: edward@nsrc.nus.sg (Edward Walker)
Newsgroups: comp.lang.perl.misc,comp.compilers
Date: 24 May 1996 15:34:12 -0400
Organization: National University of Singapore
References: 96-05-099 96-05-110 96-05-135
Keywords: tools

Erik Trulsson (trulsson@Minsk.docs.uu.se) wrote:
: Brian N. Miller <bnm@indica.bbt.com> wrote:
: > Perl has some very helpful features for compiler writing:
: > [regular expressions, hash tables, lists, and file I/O]
: > But I couldn't find any ready-to-use general parsing toolkits for
: > perl. And I'm not happy with the quality of perl debuggers.


: There exists a version of Berkely Yacc v1.8.2 that can emit
: Perl code as well as C code so you can use normal yacc code
: for parsing. And since Perl is very good at regular expressions
: you don't really need lex.


I beg to differ. Systems like flex, lex and others do more then
match regular expressions. They generate DFAs so that tokens
like
<token> END
<token> END DO
can be disambiguated. If you intend to use perl to do
this, the order in which you search for your tokens must be
carefully arranged, or a wrong token will be returned.


Actually if you look at Larry Wall's TODO list, a perllex
is at the top of it.


- edward
---------------------------------------------------------
Dr Edward Walker
National Supercomputing Research Centre
81, Science Park Drive
Singapore 0511


internet: edward@nsrc.nus.sg
tel: (65)-770-9234
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.