Class: Bake::ErrorParser
- Inherits:
-
Object
show all
- Defined in:
- lib/bake/toolchain/errorparser/error_parser.rb
Direct Known Subclasses
DiabCompilerErrorParser, DiabLinkerErrorParser, GCCCompilerErrorParser, GCCLinkerErrorParser, GreenHillsCompilerErrorParser, GreenHillsLinkerErrorParser, IARCompilerErrorParser, IARLinkerErrorParser, IDEInterface, KeilCompilerErrorParser, KeilLinkerErrorParser, MSVCCompilerErrorParser, MSVCLinkerErrorParser, TICompilerErrorParser, TILinkerErrorParser, TaskingCompilerErrorParser, TaskingLinkerErrorParser
Constant Summary
collapse
- SEVERITY_INFO =
0
- SEVERITY_WARNING =
1
- SEVERITY_ERROR =
2
- SEVERITY_OK =
255
Instance Method Summary
collapse
Instance Method Details
#get_severity(str) ⇒ Object
24
25
26
27
28
29
30
31
32
|
# File 'lib/bake/toolchain/errorparser/error_parser.rb', line 24
def get_severity(str)
if str.downcase == "info" || str.downcase == "note" || str.downcase == "remark"
SEVERITY_INFO
elsif str.downcase == "warning"
SEVERITY_WARNING
else
SEVERITY_ERROR
end
end
|
#get_tasking_severity(str) ⇒ Object
34
35
36
37
38
|
# File 'lib/bake/toolchain/errorparser/error_parser.rb', line 34
def get_tasking_severity(str)
return SEVERITY_INFO if str.start_with?"R"
return SEVERITY_WARNING if str.start_with?"W"
return SEVERITY_ERROR end
|
#inv_severity(s) ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/bake/toolchain/errorparser/error_parser.rb', line 40
def inv_severity(s)
if s == SEVERITY_INFO
"info"
elsif s == SEVERITY_WARNING
"warning"
elsif s == SEVERITY_ERROR
"error"
else
raise "Unknown severity: #{s}"
end
end
|
#makeVsError(line, d) ⇒ Object
64
65
66
67
68
69
70
71
72
73
|
# File 'lib/bake/toolchain/errorparser/error_parser.rb', line 64
def makeVsError(line, d)
if d.file_name == nil
return line
end
ret = d.file_name
ret = ret + "(" + d.line_number.to_s + ")" if (d.line_number and d.line_number > 0)
ret = ret + ": " + inv_severity(d.severity) + ": " + d.message
return ret
end
|
#scan(consoleOutput, proj_dir) ⇒ Object
20
21
22
|
# File 'lib/bake/toolchain/errorparser/error_parser.rb', line 20
def scan(consoleOutput, proj_dir)
raise "Use specialized classes only"
end
|
#scan_lines(consoleOutput, proj_dir) ⇒ Object
scan the output from the console line by line and return a list of ErrorDesc objects. for none-error/warning lines the description object will indicate that as severity 255 for single line errors/warnings: description will contain severity, line-number, message and file-name
for multi-line errors/warnings:
one description object for each line, first one will contain all single line error information,
all following desc.objects will just repeat the severity and include the message
60
61
62
|
# File 'lib/bake/toolchain/errorparser/error_parser.rb', line 60
def scan_lines(consoleOutput, proj_dir)
raise "Use specialized classes only"
end
|