Several years ago, I wrote a simple command line tool for parsing EBNF format text (ISO-14977), and translating them into railroad diagrams. This little tool parsed the text and generated HTML output with a canvas control set to render the diagram.

I had thought that this tool was too specialist for anyone to be using it, however, when I rebooted my blog after starting my employment with Embarcadero, I was contacted by someone asking what I’d done with the tool as it was no longer available at my website.

ISO-14977 Compliant EBNF railroad diagrams.

Well, I’d always wanted to turn this little tool into a web service but time had not been in abundance for it. Having acquired a copy of the new RAD Studio Beta which includes Linux support, it seemed like the ideal time to make the conversion of this tool to a service. So that’s what I did, I ported the code over to build an Apache module to run under my Ubuntu web server.

The service has two endpoints. The first simply spits out some HTML to present an input form with a submit button…

I can enter one or more rules in EBNF format and when I hit the submit button, I get my railroad diagram…

Unfortunately, I’ve also managed to introduce one or two memory leaks into the code as I did the conversion. I suspect (though I’ve not yet confirmed), the new compiler utilizes the ARC memory management system, and my code was written pre-ARC. So in short, there is still some work to do before I can consider this service complete. I may even consider making it a RESTFUL API at some point.

Most importantly though. I’d like to take this opportunity to claim my “I did it First!” badge for a Linux web service written in Delphi! I know that the development team no doubt have created unit test services, and some of the other Beta users may well have created “Hello World” Apache modules, but I think it’s not unfair for me to discount those services, if they exist, on the grounds that they’re not actually useful. Of course the usefulness of my EBNF diagram service does depend on you having need of such a tool, but it does indeed perform a useful function if you have that need.

Now for the bad news.

I’m not ready to share the service with you yet! I’d really like to, but the only place I have to host it is the very same web server which hosts this website. Given that I know there are memory leaks and even one potential infinite loop, I don’t want to publish the service until I can be certain it’ll behave (at least somwhat assured if not certain).

So, while this post lacks some of the more technical detail that I have been aiming for for my blog posts of late, I hope you’ll at least appreciate that I’m working towards useful things to share with you.

Thanks for reading!