forked from kframework/c-semantics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.k
56 lines (51 loc) · 2.04 KB
/
error.k
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
module C-TRANSLATION-ERROR
imports C-ERROR-SYNTAX
imports C-BITS-SYNTAX
imports C-COMMON-EXPR-EVAL-SYNTAX
imports C-CONVERSION-SYNTAX
imports C-DECL-GLOBAL-SYNTAX
imports C-DYNAMIC-SYNTAX
imports C-MEMORY-WRITING-SYNTAX
imports C-SYMLOC-SYNTAX
imports C-SYNTAX
imports C-TYPING-EXPR-SYNTAX
imports C-TYPING-SYNTAX
imports C-CONFIGURATION
rule <k> EXIT(Msg:String)
=> #write(2, Msg +String "\n")
~> #write(2, "File: " +String File
+String "\nLine: " +String Int2String(Line)
+String "\n")
~> HALT ...</k>
<curr-scope> S:Scope </curr-scope>
<curr-program-loc>
CabsLoc(File:String, Line:Int, _, _)
</curr-program-loc>
<result-value> _ => 1 </result-value>
requires notBool isCSV andBool S =/=K noEvalScope
rule <k> EXIT(Msg:String)
=> #write(2, Msg +String "\n")
~> HALT ...</k>
<curr-scope> S:Scope </curr-scope>
<curr-program-loc> UnknownCabsLoc </curr-program-loc>
<result-value> _ => 1 </result-value>
requires notBool isCSV andBool S =/=K noEvalScope
rule <k> EXIT(Msg:String)
=> openWriteThenClose(Report, Msg +String "," +String File +String ":" +String Int2String(Line) +String "\r\n")
~> HALT ...</k>
<curr-scope> S:Scope </curr-scope>
<curr-program-loc>
CabsLoc(File:String, Line:Int, _, _)
</curr-program-loc>
<result-value> _ => 1 </result-value>
<options>... SetItem(CSV(Report:String)) ...</options>
requires S =/=K noEvalScope
rule <k> EXIT(Msg:String)
=> openWriteThenClose(Report, Msg +String ",unknown\r\n")
~> HALT ...</k>
<curr-scope> S:Scope </curr-scope>
<curr-program-loc> UnknownCabsLoc </curr-program-loc>
<result-value> _ => 1 </result-value>
<options>... SetItem(CSV(Report:String)) ...</options>
requires S =/=K noEvalScope
endmodule