-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
42 lines (41 loc) · 1.44 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
<html>
<head>
<script type="text/javascript" src="cql.js"></script>
<script type="text/javascript">
var cp = new CQLParser();
function parseInput(query) {
try {
cp.parse(query);
document.getElementById("output").value = cp.toXCQL();
document.getElementById("output2").value = cp.toString();;
//re-parse fq to see the o/i matches
var fq = cp.toFQ();
document.getElementById("output3").value = fq;
cp.parseFromFQ(fq);
document.getElementById("output4").value = cp.toString();
} catch (e) {
document.getElementById("output").value = e.message;
document.getElementById("output2").value = e.message;
throw e;
}
}
</script>
<title>CQL parser</title>
</head>
<body>
<div>
<form name="test" onsubmit="parseInput(this.q.value); return false;">
Query:
<input type="text" name="q" size="160" onkeyup="parseInput(this.value); return false;"></input>
<br>
<br>
XCQL:
<br>
</form>
<textarea id="output" rows="80" cols="80"></textarea>
<textarea id="output2" rows="80" cols="80"></textarea>
<textarea id="output3" rows="80" cols="80"></textarea>
<textarea id="output4" rows="80" cols="80"></textarea>
</div>
</body>
</html>