Re: Syntax diagram driven parser

Allyn Dimock <dimock@deas.harvard.edu>
28 Sep 2000 17:39:04 -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)
Re: Syntax diagram driven parser cfc@world.std.com (Chris F Clark) (2000-09-28)
Re: Syntax diagram driven parser vbdis@aol.com (2000-09-28)
Re: Syntax diagram driven parser phantom@southcom.com.au (Paul Nicholls) (2000-10-01)
Re: Syntax diagram driven parser sebmol@gmx.net (Sebastian Moleski) (2000-10-01)
[7 later articles]
| List of all articles for this month |

From: Allyn Dimock <dimock@deas.harvard.edu>
Newsgroups: comp.compilers
Date: 28 Sep 2000 17:39:04 -0400
Organization: Harvard University, Cambridge, Massachusetts
References: 00-09-173 00-09-176
Keywords: parse, tools

I find the "railroad diagram" form of EBNF easier to read than the
textual form. See the appendix to Paulson's book "ML For the Working
Programmer" for a nice example.


A browser that would allow me to pop between -- or expand -- diagrams
would be even nicer than having the diagrams on the printed page.


As far as editing such diagrams -- sure it's a nice idea. Think
carefully about error reporting: depending on how you have split up
diagrams, shift/reduce and reduce/reduce errors may refer to pairs of
diagrams -- if you allow the user to pick how the diagrams are split.
If you allow the error reporter to control the diagrams, then you can
show with highlighting exactly the extent of the conflict as a
highlighted path in a diagram.


I would really enjoy such error reporting when / if I next work on a
concrete sytax.


Since the railroad diagrams are just another representation of EBNF,
it should not be hard to extract them from a few standard parser
generators, or to write out a template for input to a parser generator.


It is probably not simple to edit parsers in editing existing parser
generators such as yacc which associate some general eaction with each
reduce.


-- Allyn Dimock


Post a followup to this message

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