Release 2.1.0
Builds on the previous 2.0 release with the PEG/Packrat parser. This version supports additional BNF-like grammars:
As the gem parses everything to an intermediate S-Expression model, the gem can also perform limited transliterations between different BNF variants, either as text formatted for the particular variant, or HTML also specific to the particular variation.
Additional notable changes:
- Better logging support of RDF::Util::Logger is loaded, or errors are being logged to STDOUT/ERR.
- Add
Base#validate!, Base#valid?
,Rule#validate! and
Rule#valid?`. - Update Turtle generation to use rule sym as identifier, and id as dc:identifier.
- Allow
diff
(a - b
) to be used with non-termainals in PEG parsing. - Added
not
andrept
operators (not used directly by EBNF grammar, just yet). - Added ISO EBNF (ISO/IEC 14977:1996) example, which parses files using that grammar.
- Allow
start_production
to take an option, which can includeas_hash: true
, which is provided toPEG::Rule#parse
on the return fromPEG::Parser#onStart
. This allowsseq
matching to return a hash rather than an array of hashes. - Add native ABNF support usable from the command line, and by using
format: :abnf
toEBNF.parse
. No support for writing ABNF yet, but parsed ABNF can be written as EBNF, with some loss of fideliy. - Use Erubis instead of Haml for HTML formatting, as it preserves leading whitespace.