Module: Slaw::Parse::GrammarHelpers

Defined in:
lib/slaw/parse/grammar_helpers.rb

Overview

These helpers are mixed into the treetop grammar and provide a means for exposing options into the grammar.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject



10
11
12
# File 'lib/slaw/parse/grammar_helpers.rb', line 10

def options
  @options ||= {}
end

Instance Method Details

#postprocess(doc) ⇒ Nokogiri::XML::Document

Grammars can override this method to run post-processing on the resulting XML document.

Parameters:

  • doc (Nokogiri::XML::Document)

Returns:

  • (Nokogiri::XML::Document)


19
20
# File 'lib/slaw/parse/grammar_helpers.rb', line 19

def postprocess(doc)
end