Class: DGD::Doc::SourceFile

Inherits:
Object
  • Object
show all
Defined in:
lib/dgd-tools/dgd-doc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, dgd_root:) ⇒ SourceFile

Returns a new instance of SourceFile.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dgd-tools/dgd-doc.rb', line 17

def initialize(path, dgd_root:)
  unless File.exist?(path)
    raise "No such source file for DGD::Doc::Sourcefile: #{path.inspect}"
  end

  @parser = DGDGrammarParser.new
  @path = path
  @dgd_root = dgd_root

  parse_contents
end

Instance Attribute Details

#parserObject (readonly)

Returns the value of attribute parser.



15
16
17
# File 'lib/dgd-tools/dgd-doc.rb', line 15

def parser
  @parser
end