1024e5b8008fcb0f01d336f6d3abdcc550afabbc
[cql-js-moved-to-github.git] / index.html
1 <html>
2   <head>
3     <script type="text/javascript" src="cql.js"></script>
4     <script type="text/javascript">
5         var cp = new CQLParser();
6         
7         function parseInput(query) {
8             try {
9                 cp.parse(query);
10                 document.getElementById("output").value = cp.toXCQL();
11                 document.getElementById("output2").value = cp.toFQ();
12             } catch (e) {
13                 document.getElementById("output").value = e.message;
14                 document.getElementById("output2").value = e.message;
15                 throw e;
16             }
17         }
18     </script>
19     <title>CQL parser</title>
20   </head>
21   <body>
22     <div>
23       <form name="test" onsubmit="parseInput(this.q.value); return false;">
24         Query: 
25         <input type="text" name="q" size="160" onkeyup="parseInput(this.value); return false;"></input>
26         <br>
27         <br>
28         XCQL:
29         <br>
30       </form>
31       <textarea id="output" rows="80" cols="80"></textarea>
32       <textarea id="output2" rows="80" cols="80"></textarea>
33     </div>
34   </body>
35 </html>