lib/antelope/ace/grammar/generation.rb in antelope-0.1.7 vs lib/antelope/ace/grammar/generation.rb in antelope-0.1.8
- old
+ new
@@ -11,14 +11,10 @@
[:recognizer, Generation::Recognizer ],
[:constructor, Generation::Constructor],
[:tableizer, Generation::Tableizer ]
].freeze
- DEFAULT_GENERATORS = {
- "ruby" => [Generator::Ruby]
- }
-
# Handles the generation of output for the grammar.
module Generation
# Generates the output. First, it runs through every given
# modifier, and instintates it. It then calls every modifier,
@@ -42,10 +38,11 @@
end
hash = Hash[modifiers.map(&:first).zip(mods)]
# This is when we'd generate
find_generators(generators, options).each do |gen|
+ puts "Running generator #{gen}..."
gen.new(self, hash).generate
end
end
private
@@ -68,10 +65,10 @@
# command line precedence...
type = options[:type] || options["type"] ||
compiler.options.fetch(:type)
- generators += DEFAULT_GENERATORS.fetch(type)
+ generators << Generator.generators.fetch(type)
generators
rescue KeyError => e
raise NoTypeError, "Undefined type #{type}"