Re: Syntax diagram driven parser

"Joachim Durchholz" <joachim_d@gmx.de>
24 Sep 2000 23:33:15 -0400

          From comp.compilers

Related articles
Syntax diagram driven parser brian_d_webb@hotmail.com (Brian Webb) (2000-09-24)
Re: Syntax diagram driven parser joachim_d@gmx.de (Joachim Durchholz) (2000-09-24)
Re: Syntax diagram driven parser phantom@southcom.com.au (Paul Nicholls) (2000-09-24)
Re: Syntax diagram driven parser eodell@sfmedia.net (2000-09-25)
Re: Syntax diagram driven parser dancohen@canuck.com (Dan Cohen) (2000-09-25)
Re: Syntax diagram driven parser dimock@deas.harvard.edu (Allyn Dimock) (2000-09-28)
Re: Syntax diagram driven parser brian_d_webb@hotmail.com (Brian Webb) (2000-09-28)
Re: Syntax diagram driven parser brian_d_webb@hotmail.com (Brian Webb) (2000-09-28)
[11 later articles]
| List of all articles for this month |

From: "Joachim Durchholz" <joachim_d@gmx.de>
Newsgroups: comp.compilers
Date: 24 Sep 2000 23:33:15 -0400
Organization: Compilers Central
References: 00-09-173
Keywords: parse, tools

Brian Webb <brian_d_webb@hotmail.com> wrote:
>
> Does anyone out there have any experiences or opinions on this
> approach to parsing? It seems like a more natural way to specify a
> language than using BNF, lex, and yacc (which I can claim ignorance
> of).


Hmm... I underwent a similar learning curve. I started with syntax
diagrams, then I wanted to write a tool that generated a parser directly
from the diagrams.
The tool never got past the design stage. I got used to BNF so quickly
that I didn't bother to continue work on syntax diagrams.


> Would anyone use it, even if it worked well?


I wouldn't. BNF is nearer to the usual parsing tools. And I wouldn't
want to stick to some special tool's idea of what's a syntax diagram,
unless the tool is truly outstanding.


> Are the current methods (BNF, LL?, LALR?) good enough?


This depends on what you want to do.
BNF is definitely good enough, at least for me. People who don't adapt
to BNF will probably have even more difficulties diagnosing and
correcting shift-reduce conflicts of LALR parsers.


> What advantages does this approach have?
> Are there useful grammars that it excels at?


This depends entirely on the parse algorithm that you employ. The parse
algorithm is entirely independent of the representation of the grammar,
be it syntax diagrams or BNF.


> What disadvantages are there? Is it too slow?


It shouldn't be slow, at least not on today's machines.
Setting up a good, ergonomic visual interface for syntax diagrams would
be a challenge. It's hard to beat text editors, and BNF is a text form
(and I wouldn't try to represent syntax diagrams as "ASCII art", I think
that this would be exceedingly painful).


Regards,
Joachim


Post a followup to this message

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