]> git.xonotic.org Git - xonotic/gmqcc.git/blob - test.html
Should now run programs in the browser, just need to compile the examples and load...
[xonotic/gmqcc.git] / test.html
1 <!doctype html>
2 <html>
3     <head>
4         <meta charset="utf-8">
5         <meta http-equiv="X-UA-Compatible" content="chrome=1">
6         <title>GMQCC by graphitemaster</title>
7
8         <link rel="stylesheet" href="stylesheets/styles.css">
9         <link rel="stylesheet" href="stylesheets/pygment_trac.css">
10         <script src="javascripts/scale.fix.js"></script>
11         <!--[if lt IE 9]>
12         <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13         <![endif]-->
14     </head>
15     <body>
16         <a href="https://github.com/graphitemaster/gmqcc"><div class="fork"></div></a>
17         <div class="wrapper">
18             <header>
19                 <h1 class="header">GMQCC</h1>
20                 <p class="header">An Improved Quake C Compiler</p>
21
22                 <ul>
23                     <li class="download"><a href="https://github.com/graphitemaster/gmqcc/zipball/master">Download ZIP</a></li>
24                     <li class="download"><a href="https://github.com/graphitemaster/gmqcc/tarball/master">Download TAR</a></li>
25                     <li class="buttons"><a href="https://github.com/graphitemaster/gmqcc/issues">Issues</a></li>
26                     <li class="Buttons"><a href="test.html">Try it</a></li>
27                     <li class="buttons"><a href="https://github.com/graphitemaster/gmqcc">View On GitHub</a></li>
28                 </ul>
29             </header>
30             <section>
31                 <h3>Try it from your browser</h3>
32                 Load Program:
33                 <select id="eg" onchange="update()">
34                     <option selected value="1">Builtins</option>
35                     <option value="2">Calls</option>
36                     <option value="3">Equality</option>
37                     <option value="4">Field Parameters</option>
38                     <option value="5">Field Definitions</option>
39                     <option value="6">Fields</option>
40                     <option value="7">Functions As Paramaters</option>
41                     <option value="8">Global Definitions</option>
42                     <option value="9">If</option>
43                     <option value="10">Loops</option>
44                     <option value="11">Math</option>
45                     <option value="12">Digraphs and Trigraphs</option>
46                     <option value="13">Variadic Arguments</option>
47                 </select>
48                 <textarea id="input" rows="25" cols="100%" disabled="disabled"></textarea>
49                 <br>
50                 <button onclick="compile()">Execute</button>
51                 <textarea id="args">Test</textarea>
52                 <h4>Execution Output:</h4>
53                 <textarea id="output" rows="25", cols="100%"></textarea>
54             </section>
55             <footer>
56                 <!--<script type="text/javascript" src="http://www.ohloh.net/p/602517/widgets/project_partner_badge.js"></script>-->
57             </footer>
58         </div>
59         <script>
60             var Module = {
61                 preRun: [],
62                 noInitialRun: true,
63                 postRun: [],
64                 print: (function() {
65                     var element = document.getElementById('output');
66                     element.value = ''; // clear browser cache
67                     return function(text) {
68                         // These replacements are necessary if you render to raw HTML
69                         //text = text.replace(/&/g, "&amp;");
70                         //text = text.replace(/</g, "&lt;");
71                         //text = text.replace(/>/g, "&gt;");
72                         //text = text.replace('\n', '<br>', 'g');
73                         element.value += text + "\n";
74                         element.scrollTop = 99999; // focus on bottom
75                     };
76                 })(),
77                 printErr: function(text) {
78                     if (0) { // XXX disabled for safety typeof dump == 'function') {
79                         dump(text + '\n'); // fast, straight to the real console
80                     } else {
81                         console.log(text);
82                     }
83                 }
84             };
85         </script>
86         <script src="javascripts/compiler.js"></script>
87         <script src="javascripts/vm.js"></script>
88         <!--[if !IE]><script>fixScale(document);</script><![endif]-->
89     </body>    
90 </html>