class GrammarTransform

@abstract Subclass and override {#pre_transform} and/or {#post_transform}

to implement a transformation

Public Instance Methods

post_transform(grammar_hash) click to toggle source

Performs the transformation on the whole grammar

@param [Hash] grammar_hash The entire grammar

@return [Hash] The transformed grammar

@note grammar_hash should not be modified

# File lib/ruby_grammar_builder/grammar_plugin.rb, line 87
def post_transform(grammar_hash)
    grammar_hash
end
pre_transform(pattern, options) click to toggle source

Preforms the transformation on each pattern

@param pattern [PatternBase, Symbol, Hash] the pattern to transform @param options [Hash] hash of any of the option keys provided by self.options.

options will only be populated when pattern is a PatternBase

@return [PatternBase, Symbol, Hash] The transformed pattern. The return type should

match the type of pattern

@note pattern should not be modified

# File lib/ruby_grammar_builder/grammar_plugin.rb, line 74
def pre_transform(pattern, options) # rubocop:disable Lint/UnusedMethodArgument
    pattern
end