Class: Rattler::Util::GrammarCLI

Inherits:
ParserCLI show all
Defined in:
lib/rattler/util/grammar_cli.rb

Overview

GrammarCLI defines a command line interface for generated grammars.

Instance Method Summary collapse

Methods inherited from ParserCLI

run, #run

Constructor Details

#initialize(grammar_module) ⇒ GrammarCLI

Create a new command line interface for the given grammar module

Parameters:

  • grammar_module (Module)

    the grammar module to run the command line interface for



12
13
14
15
16
# File 'lib/rattler/util/grammar_cli.rb', line 12

def initialize(grammar_module)
  parser_class = Class.new(Rattler::Runtime::ExtendedPackratParser)
  parser_class.module_eval { include grammar_module }
  super(parser_class)
end