-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
103 lines (102 loc) · 4.09 KB
/
index.html
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
<!DOCTYPE html>
<html lang = "en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://font.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Itim&display=swap" rel="stylesheet">
<title>Shift Reduce Parser</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
</html>
<body>
<div id="main-screen">
<main class="ShiftReduceParser">
<div class = "gameModel">
<button id="gameModalButton">DESCRIPTION</button>
</div>
<div id="modal" class="modal">
<div class="modal-content">
<span class="close-modal">×</span>
<h2>Shift Reduce Parser:</h2>
<p>Shift-reduce parsing is a form of bottom-up parsing in which a stack holds grammar
symbols and an input buffer holds the rest of the tokens to be parse.</p><br>
<p><b>Created By Catherine Rodriquez: Spring 2024</b></p>
</div>
</div>
<section class="title">
<h1>Shift Reduce Parser</h1>
</section>
<div class="parsing-table">
<table class="parser-table" id="parser">
<thead>
<tr>
<th colspan="1">State</th>
<th colspan="6">Action</th>
<th colspan="3">Goto</th>
</tr>
<tr>
<th></th>
<th>id</th>
<th>+</th>
<th>*</th>
<th>(</th>
<th>)</th>
<th>$</th>
<th>E</th>
<th>T</th>
<th>F</th>
</tr>
</thead>
<tbody>
<!-- Table body will be populated dynamically using JavaScript -->
</tbody>
</table>
</div>
<script src="table.js"></script>
<section class="input">
<div class="PR-title">
<p>Production Rule</p>
</div>
<div class="In-title">
<p>Input</p>
</div>
</section>
<section class="box">
<!-- <textarea id="myInput" name="grammarInput" placeholder="Enter grammar..." >E -> E + T
E -> T
T -> T * F
T -> F
F -> (E)
F -> id </textarea> -->
<div id="myInput" name="grammarInput" placeholder="Enter grammar..." >
1. E -> E + T <br>
2. E -> T <br>
3. T -> T * F <br>
4. T -> F <br>
5. F -> (E) <br>
6. F -> id
</div>
<div class="button1">
<button id="submitRule">CHANGE RULE</button>
<button class="parseSubmit" id="submitParse">SUBMIT</button>
<button class="parseStep" id="stepToParse">STEP</button>
<button id="restart" class="restart">RESTART</button>
</div>
<textarea id="parseInput" class="parseInput" placeholder="Enter grammar to parse..." type="text"
value="id + ( id * id ) $">id + ( id * id ) $</textarea>
</section>
<div class="parsing-table">
<div class="outputTable">
<table id="output">
<caption class="Out-title">Output</caption>
<!-- table will be populated using JavaScript -->
</table>
<div class="announce">
<!-- invalid input and completion display -->
</div>
</div>
</div>
</main>
</div>
</body>