Sha256: 8a21a524de77e5fddcd90ec2bd2ad713d7bb5ffed8d375d73621bfeb26855cb7

Contents?: true

Size: 970 Bytes

Versions: 12

Compression:

Stored size: 970 Bytes

Contents

require 'cxxproject/errorparser/error_parser'

module Cxxproject
  class GreenHillsCompilerErrorParser < ErrorParser

    def initialize()
      # example:
      # "test.c", line 1: warning #123-D: blah blub
      @error_expression = /"([^"]+)", line ([0-9]+)[:0-9]* (catastrophic |fatal )*([A-Za-z\._]+) (.+)/
    end

    def scan_lines(consoleOutput, proj_dir)
      res = []
      consoleOutputFullnames = ""
      consoleOutput.each_line do |l|
        d = ErrorDesc.new
        scan_res = l.gsub(/\r\n?/, "").scan(@error_expression)
        if scan_res.length > 0
          d.file_name = File.expand_path(scan_res[0][0])
          d.line_number = scan_res[0][1].to_i
          d.message = scan_res[0][4]
          d.severity = get_severity(scan_res[0][3])
          l.gsub!(scan_res[0][0],d.file_name)
        end
        res << d
        consoleOutputFullnames << l
      end
      [res, consoleOutputFullnames]
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cxxproject-0.5.76 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.75 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.74 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.73 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.72 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.71 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.70 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.69 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.68 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.67 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.66 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
cxxproject-0.5.65 lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb