I need an Augmented Backus-Naur Form Parser (RFC 5234) in Java to validate some languages.
In the interest of not re-inventing the wheel, I would prefer to use an existing open source implementation of ABNF Parser if one already exists.
I need open source because it allows me to maintain the code as needed.
Does anyone know of any that exists?
I have made the observation that Parse2 (see answer by Ralph) comes with some limitations:
;
at the end of the lineS --> NT1 NT2 T1 ; NT1 --> S | T2 ; ...
) and might run into endless loops.These observations have been confirmed by the developer of Parse2. So in short: Parse2 can parse a subset of ABNF grammars, however it will most likely have problems if you find an existing ABNF grammar and try to feed it to the software.
If you specify the ABNF grammars yourself and keep these limitations in mind, this library should work for you. If you have to work with existing ABNF grammars you might have to put additional effort into the grammar prior to code generation.
PS: the Parse2 library source code is currently not available even though the compiled binary (java byte code) is available freely.
Parse2 generates source java for a parser from ABNF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With