Class: GrammarTransform Abstract

Inherits:
GrammarPlugin show all
Defined in:
lib/ruby_grammar_builder/grammar_plugin.rb

Overview

This class is abstract.

Subclass and override #pre_transform and/or #post_transform to implement a transformation

Instance Method Summary collapse

Methods inherited from GrammarPlugin

display_options, options

Instance Method Details

#post_transform(grammar_hash) ⇒ Hash

Note:

grammar_hash should not be modified

Performs the transformation on the whole grammar



87
88
89
# File 'lib/ruby_grammar_builder/grammar_plugin.rb', line 87

def post_transform(grammar_hash)
    grammar_hash
end

#pre_transform(pattern, options) ⇒ PatternBase, ...

Note:

pattern should not be modified

Preforms the transformation on each pattern



74
75
76
# File 'lib/ruby_grammar_builder/grammar_plugin.rb', line 74

def pre_transform(pattern, options) # rubocop:disable Lint/UnusedMethodArgument
    pattern
end