Class: Abnf::FileLoader
- Inherits:
-
Mapper::Grammar
- Object
- Hash
- Mapper::Grammar
- Abnf::FileLoader
- Defined in:
- ../lib/abnf_file.rb
Overview
This subclass of Mapper::Grammar parses the ABNF syntax loaded from the file.
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) filename
The name of the ABNF syntax file.
Attributes inherited from Mapper::Grammar
Instance Method Summary (collapse)
-
- (FileLoader) initialize(fname = nil)
constructor
Load the file when creating the instance.
Methods inherited from Mapper::Grammar
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 |