Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 32950632A78 for ; Sat, 17 Jul 2010 04:12:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 06372-03 for ; Sat, 17 Jul 2010 07:12:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from serenity.inversion.ee (serenity.inversion.ee [194.204.33.112]) by mail.postgresql.org (Postfix) with ESMTP id 351CB63284C for ; Sat, 17 Jul 2010 04:12:31 -0300 (ADT) Received: by serenity.inversion.ee (Postfix, from userid 108) id 63B33E34436; Sat, 17 Jul 2010 08:54:26 +0300 (EEST) Received: from [IPv6:::1] (localhost [127.0.0.1]) by serenity.inversion.ee (Postfix) with ESMTP id F2202E343A2; Sat, 17 Jul 2010 08:54:25 +0300 (EEST) Subject: Re: Railroad diagrams, a-la sqlite From: Hannu Krosing To: Heikki Linnakangas Cc: Steve Atkins , pgsql-docs In-Reply-To: <1279350162.16803.3.camel@hvost> References: <2AACFC47-C121-4549-B015-AC4FCA9380CE@blighty.com> <4C413FDE.4040501@enterprisedb.com> <1279350162.16803.3.camel@hvost> Content-Type: text/plain; charset="UTF-8" Date: Sat, 17 Jul 2010 10:12:31 +0300 Message-ID: <1279350751.16803.7.camel@hvost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201007/113 X-Sequence-Number: 5769 On Sat, 2010-07-17 at 10:02 +0300, Hannu Krosing wrote: > On Sat, 2010-07-17 at 08:30 +0300, Heikki Linnakangas wrote: > > On 17/07/10 07:33, Steve Atkins wrote: > > > Has everyone seen the "railroad diagrams" sqlite use in their docs? http://www.sqlite.org/lang_createindex.html , as one example. > > > > > > Would it be nice to have the same sort of format in the postgresql docs? (Yeah, I'm volunteering, if people think they're a useful thing, 'cos I think they'd add a lot to our documentation.) > > > > That would be nice. It would have to be automatically generated from the > > syntax descriptions we already have, otherwise it'd be unmaintainable. > > Also, the text representation would have to still be there in an alt tag > > - I note that the the sqlite docs don't have that. > > > > Any idea how those sqlite images are generated? > > I have used this: > > http://www.informatik.uni-freiburg.de/~thiemann/haskell/ebnf2ps/ > > to make railroad diagrams from postgresql lex/yacc sources a few years > ago, when looking into adding WITH support to pg. > > As it takes extended BNF as input i had to convert pg's lex+yacc into > eBNF, which IIRC I did using some python scripts + manual tweaking. Now it's readme says it does support yacc as one of input formats, so it may be a lot simpler . > > > -- > > Heikki Linnakangas > > EnterpriseDB http://www.enterprisedb.com > > > >