-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
134 lines (130 loc) · 4.76 KB
/
index.html
File metadata and controls
134 lines (130 loc) · 4.76 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>DPDA</title>
</head>
<body>
<div id="machineOutput">
<h1 class="title">Deterministic Pushdown Automata</h1>
<div class="gui">
<p>INPUT</p>
<hr>
<div class="string">
<span class="pointer"></span>
<span></span>
</div>
<hr>
<div class="head">
<div class='pointer'></div>
<svg height="10px" width="10px" viewBox="0 0 32 32">
<g>
<path d="M24.4,24c-0.9,0-1.8-0.3-2.5-1l-5.8-5.7c-0.1-0.1-0.2-0.1-0.3,0L10.1,23c-1.4,1.4-3.6,1.4-5,0c-0.7-0.7-1-1.6-1-2.5
c0-1,0.4-1.8,1-2.5l9.4-9.3c0.9-0.9,2.3-0.9,3.1,0l9.4,9.3c0.7,0.7,1,1.6,1,2.5c0,1-0.4,1.8-1,2.5C26.2,23.7,25.3,24,24.4,24z"/>
</g>
</svg>
</div>
<div class="state-info">
<div class="current-state">
<p>CURRENT STATE</p>
<div class="container">
<span></span>
</div>
</div>
<div class="stack-info">
<p>STACK</p>
<hr>
<div class="stack">
<span></span>
</div>
<hr>
</div>
<div class="verdict">
<p>VERDICT</p>
<div class="container">
<span>--</span>
</div>
</div>
</div>
</div>
</div>
<div class="inputs">
<div class="formatDesc">
<h3 class="title">Machine Definition Input Format</h3>
<p>The machine definition follows the format below per line of text:</p>
<ol>
<li>number of states</li>
<li>list of states</li>
<li>number of symbols in the input alphabet</li>
<li>input alphabet</li>
<li>number of symbols in the stack alphabet</li>
<li>stack alphabet</li>
<li>number of transitions</li>
<li>list of transitions in the format <em>q s pop q' push</em> such that <em>f(q,s,pop) = (q', push)</em></li>
<ul>
<li>Note that for this simulation, only single-character inputs and single-character push/pop to the stack are accepted</li>
<li>DPDA's formal definition is followed for other rules regarding transitions</li>
</ul>
<li>start state</li>
<li>initial stack symbol</li>
<li>number of final states</li>
<li>list of final states</li>
</ol>
</div>
<div class="read">
<label for="machineInput"><h3 class="title">Machine Definition</h3></label>
<textarea name="machineDesc" id="machineInput">5
0 1 2 3 4
2
a b
2
X Z
6
0 * Z 1 *
1 * * 2 Z
2 a * 2 X
2 b X 3 *
3 b X 3 *
3 * Z 4 *
0
Z
2
1 4</textarea>
<p class="validation">Machine Accepted.</p>
<div class="buttons">
<button id="inputFileBtn">IMPORT</button>
<button id="readMachine">READ</button>
</div>
<input type="file" id="inputFile" style="display: none;" accept=".txt">
</div>
<div class="control">
<label for="inputString"><h3 class="title">Input String</h3></label>
<input type="text" id="inputString">
<h3 class="title">Control</h3>
<input type="range" name="range" id="speedInput" min="1" max="10">
<div class="buttons-1">
<button id="runInput" disabled>RUN</button>
<button id="reset" disabled>RESET</button>
</div>
<div class="buttons-2">
<button id="forward" disabled>STEP</button>
<button id="reload">RELOAD</button>
</div>
</div>
</div>
<div class="error-cover"></div>
<div class="error-details">
<h1>ERROR: Check machine input format!!!</h1>
<p id="errorDetails"></p>
</div>
<div class="authors">
<p>Created by:</p>
<span>Go, Daphne Janelyn</span><span>Lasala, Kyle Carlo</span><span>Manlises, Maria Monica</span>
</div>
<!-- JQUERY IMPORT -->
<script src="https://code.jquery.com/jquery-3.7.0.min.js" integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script>
<script type="module" src="index.js"></script>
</body>
</html>