Method: Bauxite::ParserModule#parse

Defined in:
lib/bauxite/core/parser.rb

#parse(file) ⇒ Object

Parse file and yield the resulting actions.



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/bauxite/core/parser.rb', line 32

def parse(file)
  actions = nil
  Context::parsers.any? { |p| actions = send(p, file) }
  
  unless actions
    raise Errors::FormatError, "Invalid format in '#{file}'. None of the available parsers can understand this file format."
  end
  
  actions.each do |action, args, text, line|
    yield action.strip.downcase, args, text, file, line
  end
end