Re: Syntax diagram driven parser

"Joachim Durchholz" <>
24 Sep 2000 23:33:15 -0400

          From comp.compilers

Related articles
Syntax diagram driven parser (Brian Webb) (2000-09-24)
Re: Syntax diagram driven parser (Joachim Durchholz) (2000-09-24)
Re: Syntax diagram driven parser (Paul Nicholls) (2000-09-24)
Re: Syntax diagram driven parser (2000-09-25)
Re: Syntax diagram driven parser (Dan Cohen) (2000-09-25)
Re: Syntax diagram driven parser (Allyn Dimock) (2000-09-28)
Re: Syntax diagram driven parser (Brian Webb) (2000-09-28)
Re: Syntax diagram driven parser (Brian Webb) (2000-09-28)
[11 later articles]
| List of all articles for this month |

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

Brian Webb <> 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).


Post a followup to this message

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