12.2 to 13.1 EBNF Converter

Mike Dour / Monday, April 22, 2013

As I mentioned in a previous post, the format of EBNF special sequences has changed in the 13.1 version and it is not so easy to change over the 12.2 format to the new format by hand. So if you have already written an EBNF grammar using 12.2 and you want to upgrade to 13.1, I have created a utility to help you convert the file from the old format to the new.

One thing to note when converting is that regular expressions are now more limited in 13.1. In 12.2, we were using .NET regular expressions so you could use anything they supported. But in 13.1, we created a custom regular expression engine specifically designed to lex a document as fast as possible. For example, in 12.2 we were able to lex 74,157 lines of C# per second on one machine. On that same machine, the 13.1 version was able to lex 180,326 lines of C# per second. However, the downside to using a custom regular expression engine is that not all regular expression patterns can be supported. So when converting, you may see some messages about terminal symbols that cannot be converted because their regular expression patterns are no longer valid in 13.1. This must be fixed in the original file before the conversion can succeed, so I recommend that you back up the original file before trying to convert it (or try to convert a copy of the original).

And finally, a short disclaimer before I link to the converter (please excuse the legalese):

Copyright (c) 2013, Infragistics, Inc.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND INFRAGISTICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INFRAGISTICS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

The converter can be found here and you can find the source code for it here.

By Mike Dour