POV-Ray : Newsgroups : povray.programming : Why not generate parser with Bison & Flex? : Re: Why not generate parser with Bison & Flex? Server Time
29 Jul 2024 02:21:56 EDT (-0400)
  Re: Why not generate parser with Bison & Flex?  
From: Ronald L  Parker
Date: 1 Jan 1999 12:48:46
Message: <368f08d2.70060924@news.povray.org>
On Tue, 29 Dec 1998 21:48:08 -0500, "Evan Powers" <ept### [at] aolcom>
wrote:

>Has anyone considered redoing POV's parser entirely using Bison and Flex?
>Making a language grammar file, from what I know, would be child's play
>compared to understanding and changing the existing code. Plus it would make
>maintaining the language grammar (and thus the parser) ridiculously easy.

Maintaining and understanding the grammar is already ridiculously 
easy, or at least as easy as understanding the bison definition-file 
syntax.  The only thing that makes it slightly more difficult is that
here is little if any documentation of the current parser structure.

One thing that will get in the way of a regular grammar for the POV 
language is the #version directive, which can change the entire 
grammar, so you might need multiple grammars and a clean way to switch

between them.

However, the idea of rewriting the parser in flex/bison does have some
merit when considered against the background of Chris Young's recent 
posting to cgrr: everyone wants a standalone parser, but the current 
parser is both severely intermixed with the existing code and covered 
by the Team's solemn promises that it would never see commercial
misuse.  A new parser, especially one written by someone who was
unconcerned about commercial use (and thus covered by an entirely new
version of POVLEGAL), might not suffer from those constraints.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.