lib/antelope/ace/grammar.rb in antelope-0.1.8 vs lib/antelope/ace/grammar.rb in antelope-0.1.9
- old
+ new
@@ -1,22 +1,23 @@
# encoding: utf-8
-require "antelope/ace/grammar/terminals"
+require "hashie"
+require "antelope/ace/grammar/symbols"
require "antelope/ace/grammar/productions"
require "antelope/ace/grammar/precedences"
require "antelope/ace/grammar/loading"
require "antelope/ace/grammar/generation"
module Antelope
module Ace
# Defines a grammar from an Ace file. This handles setting up
- # productions, loading from files, terminals, precedence, and
+ # productions, loading from files, symbols, precedence, and
# generation.
class Grammar
- include Terminals
+ include Symbols
include Productions
include Precedences
include Loading
include Grammar::Generation
@@ -52,9 +53,17 @@
# @param compiler [Compiler]
def initialize(name, output, compiler)
@name = name
@output = Pathname.new(output)
@compiler = compiler
+ end
+
+ # Extra options from the compiler. This can be used by
+ # generators for output information.
+ #
+ # @return [Hash]
+ def options
+ compiler.options[:extra]
end
end
end
end