forked from kframework/c-semantics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.k
156 lines (128 loc) · 4.52 KB
/
configuration.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
module C-CONFIGURATION
imports C-SYNTAX
imports C-DYNAMIC-SYNTAX
imports C-TRANSLATION-INIT-SYNTAX
imports COMPAT-SYNTAX
configuration
<global>
<mem> .Map </mem>
<functions color="lightgray"> .Map </functions>
<main-tu color="lightgray"> .Set </main-tu>
// CId |-> Types
<external-types> .Map </external-types>
// CId |-> Loc
<external-defs> .Map </external-defs>
<linking-state multiplicity="?" initial="">
// CId |-> Set(TUs)
<external-decls> .Map </external-decls>
// CIds
<external-uses> SetItem(Identifier("main")) </external-uses>
</linking-state>
<structs color="lightgray"> .Map </structs>
// dummy link base |-> real base
<linkings> .Map </linkings>
<translation-units>
<tu multiplicity="*" type="Set">
<tu-id> "" </tu-id>
<genv color="lightgray"> .Map </genv>
<gtypes color="lightgray"> .Map </gtypes>
// kpair(CId, Scope) |-> kpair(SymBase, Type)
<local-statics> .Map </local-statics>
<tu-linking-state multiplicity="?" initial="">
<externals> .Map </externals>
<internals> .Map </internals>
<next-link-loc> .K </next-link-loc>
<next-static-loc> .K </next-static-loc>
<uses> SetItem(Identifier("main")) </uses>
<genums> .Map </genums>
</tu-linking-state>
<next-unnamed color="black"> 0 </next-unnamed>
<goto-map color="lightgray"> .Map </goto-map>
// TODO(chathhorn): move.
<incomplete-tags> .Set </incomplete-tags>
</tu>
</translation-units>
</global>
<result-value color="red"> 1 </result-value>
<T multiplicity="?">
<exec>
// SymLoc |-> Type
<effective-types> .Map </effective-types>
<final-computation multiplicity="?" color="lightgray">
.K
</final-computation>
<goto-map-calc color="cyan">
<goto-calc multiplicity="*" color="cyan" type="Set">
<saved-env> .Map </saved-env>
<computation color="cyan"> .K </computation>
<computation-tail color="cyan">
.K
</computation-tail>
<decl-stack color="cyan">
.List
</decl-stack>
<goto-nesting-depth color="cyan">
0
</goto-nesting-depth>
<goto-block-history color="cyan">
.List
</goto-block-history>
<goto-loop-stack color="cyan">
.List
</goto-loop-stack>
</goto-calc>
</goto-map-calc>
<k color="green">
$PGM:K
~> load($OBJS:K)
~> link
~> cleanup
</k>
<elab> .K </elab>
<elab-stack> .List </elab-stack>
// Toggle to allow writes and other special treatment
// for initializers.
<initializing> false </initializing>
<local>
// maps from CIds
<env color="red"> .Map </env>
<types color="lightgray"> .Map </types>
// Like the types cell, but used only for checking local declarations.
<local-types> .Map </local-types>
<enums> .Map </enums>
<block-history> .List </block-history>
<curr-program-loc color="black">
UnknownCabsLoc
</curr-program-loc>
</local>
<block-stack color="violet"> .List </block-stack>
<init-calc multiplicity="?" initial="">
// Used to figure initializers.
<curr-object color="cyan">
.List
</curr-object>
<curr-subobject color="cyan">
.List
</curr-subobject>
<incomplete-length color="cyan">
0
</incomplete-length>
<saved-init color="cyan">
.K
</saved-init>
// Holds the innermost type while we unroll the
// type around it.
<decl-type-holder color="cyan">
.K
</decl-type-holder>
</init-calc>
<curr-tu color="lightgray"> "" </curr-tu>
<curr-scope color="lightgray"> fileScope:Scope </curr-scope>
</exec>
<error-cell multiplicity="?" color="black"> .K </error-cell>
<annotation> "" </annotation>
<generated-annotations> .List </generated-annotations>
<status> initializing </status>
<options> $OPTIONS:Set </options>
</T>
endmodule