Class: Abnf::FileLoader

Inherits:
Mapper::Grammar show all
Defined in:
../lib/abnf_file.rb

Overview

This subclass of Mapper::Grammar parses the ABNF syntax loaded from the file.

Direct Known Subclasses

File

Instance Attribute Summary (collapse)

Attributes inherited from Mapper::Grammar

#start_symbol

Instance Method Summary (collapse)

Methods inherited from Mapper::Grammar

#deep_copy, #symbols

Constructor Details

- (FileLoader) initialize(fname = nil)

Load the file when creating the instance. If the optional fname argument is ommited, do nothing. This class does not validate grammar (see Validator.analyze_all). If you want your grammer validated, use the subclass Abnf::File.



15
16
17
18
# File '../lib/abnf_file.rb', line 15

def initialize fname=nil
  grammar = load fname
  super( grammar, grammar.start_symbol )
end

Instance Attribute Details

- (Object) filename

The name of the ABNF syntax file.



21
22
23
# File '../lib/abnf_file.rb', line 21

def filename
  @filename
end