class Antelope::Grammar
Defines a grammar from an Ace
file. This handles setting up productions, loading from files, symbols, precedence, and generation.
Constants
- DEFAULT_MODIFIERS
The default modifiers for generation. It’s not really recommended to (heh) modify this; however, adding your own modifier is always acceptable.
- Precedence
Defines a precedence. A precedence has a type, tokens, and a level.
- Production
Defines a production.
Attributes
The compiler for the Ace
file.
@return [Compiler]
The name of the grammar. This is normally assumed from a file name.
@return [String]
The output directory for the grammar. This is normally the same directory as the Ace
file.
@return [Pathname]
Used by a generation class; this is all the generated states of the grammar.
@return [Set<Generation::Recognizer::State>] @see Generation::Recognizer
Public Class Methods
Initialize.
@param name [String] @param output [String] the output directory. Automagically
turned into a Pathname.
@param compiler [Compiler]
# File lib/antelope/grammar.rb, line 54 def initialize(name, output, compiler) @name = name @output = Pathname.new(output) @compiler = compiler end
Public Instance Methods
Extra options from the compiler. This can be used by generators for output information.
@return [Hash]
# File lib/antelope/grammar.rb, line 64 def options compiler.options[:extra] end