delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/10/10:46:55

From: "Christopher Nelson" <paradox AT gye DOT satnet DOT net>
To: <djgpp AT delorie DOT com>
Subject: Re: Scripts
Date: Wed, 9 Jun 1999 10:23:51 -0600
Message-ID: <01beb294$760b2b60$LocalHost@thendren>
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Reply-To: djgpp AT delorie DOT com

>
>I actually found it to be easier to just write my own lexical parser and
>such.  The time it would take to learn Bison and Flex would take longer
than
>to just write your own anyhows.
>
>Sean Middleditch


you only have to learn Bison and Flex once.  then you can right LALR
grammars to your heart's content.  it's faster, easier, and tons more
efficient since compiler design IS one area that tremndoes R&D has been
applied.  GCC is an exampe of this.

the other point is that, Bison and Flex come from Lex and YACC, so if you
write your grammars in them, odds are very good that they'll be VERY
portable.  in addition, my Lex grammar for a compiled scripting langauge I
wrote is about 80 lines.  I don't think that you're going to duplicate that
using a hand-coded lexer.

a final point is efficiency.  there are things that make program-generated
parsers and lexers a tremendous advantage over hand-coding:  plain speed and
flexibility.

the only real benefit hand-coding gives is control over size:  e.g. the
calculator in RHIDE.

    -={C}=-

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019