Class: JsDuck::BatchParser

Inherits:
Object
  • Object
show all
Defined in:
lib/jsduck/batch_parser.rb

Overview

Performs the parsing of all input files. Input files are read from options object (originating from command line).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ BatchParser

Returns a new instance of BatchParser.



19
20
21
# File 'lib/jsduck/batch_parser.rb', line 19

def initialize(opts)
  @opts = opts
end

Instance Attribute Details

#parsed_filesObject (readonly)

Array of Source::File objects. Available after calling the #run method.



25
26
27
# File 'lib/jsduck/batch_parser.rb', line 25

def parsed_files
  @parsed_files
end

Instance Method Details

#runObject

Parses the files and returns instance of Relations class.



28
29
30
31
32
33
34
# File 'lib/jsduck/batch_parser.rb', line 28

def run
  @parsed_files = parallel_parse(@opts.input_files)
  result = aggregate(@parsed_files)
  @relations = filter_classes(result)
  apply_extra_processing
  return @relations
end