-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathweb-apg-api.html
35 lines (35 loc) · 1.46 KB
/
web-apg-api.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>web-conv</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../node_modules/apg-js/dist/apg-lib-bundle.css" />
<!--
<link rel="stylesheet" href="../../node_modules/apg-js/dist/apg-lib-bundle.css">
-->
</head>
<body onload="onload()">
<h1>Test the bundled apg API</h1>
<p>Have a look at "web-apg-api.html" & "web-apg-api.js" to see how it is used.</p>
<p>
Click on "generate" to generate a grammar object from the SABNF grammar.<br />
(Errors are not reported in detail.)
</p>
<p>Then click the "parse" button to use the generated grammar object to parse the input string.</p>
<p class="title">
<b>SABNF grammar:</b>
</p>
<textarea id="grammar" rows="20" cols="75" style="float: left"></textarea>
<p> <input type="button" value="generate" style="width: 100px" onclick="generate()" /></p>
<p class="title" style="clear: left">
<br />
<b>SABNF input string:</b>
</p>
<textarea id="input" rows="20" cols="75" style="float: left"></textarea>
<p> <input type="button" value="parse" style="width: 100px" onclick="parse()" /></p>
<p class="title" style="clear: left"><br /><b>output:</b></p>
<div id="output">Translation will appear here.</div>
</body>
<script src="../../node_modules/apg-js/dist/apg-api-bundle.js" charset="utf-8"></script>
<script src="./web-apg-api.js" charset="utf-8"></script>
</html>