-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
209 lines (201 loc) · 6.43 KB
/
Copy pathindex.html
File metadata and controls
209 lines (201 loc) · 6.43 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!doctype html>
<html lang="en" data-theme="blush">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="Interactive compiler optimization tool demonstrating dead code elimination on C programs through Three-Address Code analysis"
/>
<title>Dead Code Eliminator — Compiler Optimization Studio</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<!-- Header -->
<header class="header">
<div class="logo">
<h1>Dead Code Eliminator</h1>
<p>an optimisation tool for C</p>
</div>
<div class="theme-switcher">
<label>theme</label>
<button
class="theme-btn active"
data-theme="blush"
title="Blush"
aria-label="Blush theme"
></button>
<button
class="theme-btn"
data-theme="cloud"
title="Cloud"
aria-label="Cloud theme"
></button>
<button
class="theme-btn"
data-theme="lavender"
title="Lavender"
aria-label="Lavender theme"
></button>
<button
class="theme-btn"
data-theme="sage"
title="Sage"
aria-label="Sage theme"
></button>
<button
class="theme-btn"
data-theme="buttercream"
title="Buttercream"
aria-label="Buttercream theme"
></button>
</div>
</header>
<!-- Main Content -->
<main class="main">
<!-- Input Panel -->
<div class="card input-panel">
<div class="card-header">
<span class="card-title"><span class="dot"></span> Source Code</span>
<span
style="
font-size: 0.7rem;
color: var(--text-light);
font-style: italic;
"
>C language</span
>
</div>
<div class="card-body">
<textarea
id="code-input"
class="input-area"
spellcheck="false"
placeholder="Write or paste your C code here..."
></textarea>
<div id="error-display" class="error-msg"></div>
</div>
<div class="action-bar">
<button id="compile-btn" class="btn btn-primary">
Compile & Optimize
</button>
<div class="toggle-wrap">
<input
type="checkbox"
id="reconstruct-toggle"
class="toggle"
checked
/>
<label for="reconstruct-toggle">Reconstruct C</label>
</div>
<span
style="
margin-left: auto;
font-size: 0.7rem;
color: var(--text-light);
"
>Ctrl+Enter to compile</span
>
</div>
</div>
<!-- Output Panel -->
<div class="card output-panel">
<div class="tabs">
<button class="tab active" data-tab="original-tac">
Original 3AC
</button>
<button class="tab" data-tab="optimized-tac">Optimized 3AC</button>
<button class="tab" data-tab="reconstructed-c">
Reconstructed C
</button>
</div>
<div id="original-tac" class="tab-content active">
<div class="placeholder">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
<span>Compile your code to see results</span>
</div>
</div>
<div id="optimized-tac" class="tab-content">
<div class="placeholder">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M13 10V3L4 14h7v7l9-11h-7z"
/>
</svg>
<span>Optimized output will appear here</span>
</div>
</div>
<div id="reconstructed-c" class="tab-content">
<div class="placeholder">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M9 12h6m-3-3v6m-7 4h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
/>
</svg>
<span>Enable reconstruction to see C-like output</span>
</div>
</div>
<div class="stats">
<div class="stat">
<span>Original:</span>
<span class="stat-value" id="stat-original">—</span>
<span>lines</span>
</div>
<div class="stat">
<span>Optimized:</span>
<span class="stat-value" id="stat-optimized">—</span>
<span>lines</span>
</div>
<div class="stat">
<span>Eliminated:</span>
<span class="stat-value" id="stat-eliminated">—</span>
<span>lines</span>
</div>
<div class="stat">
<span>Reduction:</span>
<span class="stat-value" id="stat-reduction">—</span>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="footer">
made with ♥ by deshna & shiva
</footer>
<!-- Scripts (order matters: dependencies first) -->
<script src="lexer.js"></script>
<script src="parser.js"></script>
<script src="tac-generator.js"></script>
<script src="optimizer.js"></script>
<script src="reconstructor.js"></script>
<script src="app.js"></script>
</body>
</html>