-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
87 lines (85 loc) · 3.36 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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<script charset="UTF-8" type="text/javascript" src="jme/numbas.js" charset="utf-8"></script>
<script charset="UTF-8" type="text/javascript" src="jme/jme.js" charset="utf-8"></script>
<script charset="UTF-8" type="text/javascript" src="jme/jme-builtins.js" charset="utf-8"></script>
<script charset="UTF-8" type="text/javascript" src="jme/jme-display.js" charset="utf-8"></script>
<script charset="UTF-8" type="text/javascript" src="jme/math.js" charset="utf-8"></script>
<script charset="UTF-8" type="text/javascript" src="jme/util.js" charset="utf-8"></script>
<script charset="UTF-8" type="text/javascript" src="jme/jquery.js"></script>
<script charset="UTF-8" type="text/javascript" src="jme/R.js"></script>
<script charset="UTF-8" type="text/javascript" src="jme/en-GB.js"></script>
<script charset="UTF-8" type="text/javascript" src="nearley.js"></script>
<script src="peg.js"></script>
<script src="expander.js"></script>
<script src="base.js"></script>
<script src="jme-nearley.js"></script>
<script src="peg-jme.js"></script>
<script src="util.js"></script>
<script src="index.js"></script>
<style>
html {
font-family: sans-serif;
}
@media screen and (min-width: 768px) {
body {
display: flex;
}
section {
flex: 50%;
margin: 0 0.5em;
padding: 0.5em;
}
section.base {
flex: 30em;
background: #eee;
}
}
pre {
white-space: pre-wrap;
}
textarea {
width:100%;
height: 10em;
}
#presets {
list-style: none;
padding: 0;
}
#presets li {
display: inline-block;
margin: 0 1em 0 0;
line-height: 1.6em;
}
</style>
</head>
<body>
<section class="interactive">
<div class="explanation">
<p>Customise the JME grammar using a <a href="http://pegjs.org">peg.js</a> specification.</p>
<p>There are some special rules to add new operators, atomic data types, and special number names.</p>
<p>This doesn't affect the way parsed expressions are subsequently rendered - using the grammar specification in the other direction would be difficult!</p>
</div>
<div class="controls">
<h2>Presets</h2>
<ul id="presets">
</ul>
<h2>Experiment</h2>
<label for="extra-grammar">Grammar</label>
<textarea id="extra-grammar"></textarea>
<label for="expression">Expression</label>
<textarea id="expression">x+1/2</textarea>
<label for="jme">JME</label>
<pre id="jme"></pre>
<label for="result">Result</label>
<pre id="result"></pre>
</div>
</section>
<section class="base">
<h2>Base grammar</h2>
<pre id="show-base-jme"></pre>
</section>
</body>
</html>