module Bauxite::ParserModule

Parser common state and behavior.

Public Class Methods

new(ctx) click to toggle source

Constructs a new test parser instance.

# File lib/bauxite/core/parser.rb, line 27
def initialize(ctx)
        @ctx = ctx
end

Public Instance Methods

parse(file) { |strip.downcase, args, text, file, line| ... } click to toggle source

Parse file and yield the resulting actions.

# 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