Skip to content

Releases: dryruby/ebnf

Release 2.1.2

25 Oct 23:56
Compare
Choose a tag to compare
  • Support :rept expressions in PEG (@stouset)
  • Minor HTML format updates.
  • Use native parser for builds and tests so that changes to the PEG parser don't spread too far.
  • Note ambiguity inherent in using rule identifiers which conflict with ranges.

Release 2.1.1

25 Oct 23:55
Compare
Choose a tag to compare
  • Remove :unescape option in PEG parser. (It remains in LL1, but really a contamination of concerns from RDF).
  • Fix line counting in scanner.
  • Encode HTML entities in formatted output.

Release 2.1.0

13 Jul 18:38
Compare
Choose a tag to compare

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 and rept 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 include as_hash: true, which is provided to PEG::Rule#parse on the return from PEG::Parser#onStart. This allows seq 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 to EBNF.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.

Release 2.0.0

19 Jun 17:16
Compare
Choose a tag to compare

New PEG parser mode, allows parsing of non-context-free grammars based on Parser Expression Grammars

  • Add a PEG parser option, implemented to do recursive-descent parsing by interpreting the rules directly. The Rule#to_peg (and related) changes extract sub-rules from rules in a simlar way to Rule#to_bnf.
  • Uses a Packrat memoizer.

Other changes:

  • Update EBNF grammar to eliminate confusion between ENUM and LHS and to fix PASS so that #xN is not confused with a comment.
  • Don't rewrite LL1 rules to de-dupliate terminals, as it gets into nasty self-depedency issues.
  • Update LL1 parser to accept a logger, and use if available if a callback is not provided. Adjust log levels to be compatible with Logger.
  • Remove Rule#rewrite, which was flawed and unused.

Release 1.2.0

16 Dec 21:13
Compare
Choose a tag to compare
  • Updates for Ruby 2.7 calling sequence changes.
  • Fix problems generating SXP and help debugging LL1 when rules do not have a first.

Release 1.1.0

12 Dec 00:04
Compare
Choose a tag to compare
  • Note rules which require cleanup to get back to EBNF (opt, star, plus) and add default production to pass and merge these results. This is activated in the LL1 parser when the :cleanup option is provided, which can be initialized from the generated CLEANUP table.
  • Add simple parsers for *, + and ? EBNF operator cleanup.
  • Fix bug in Scanner based on some upstream change to StringScanner which caused it to return null when empty. If passed a string, instantiate StringScanner rather than Scanner, which saves some work.
  • Allow Scanner#first, #recover, and #match_token to take a list of type symbols to subset the actual terminals searched against.