]> git.xonotic.org Git - xonotic/gmqcc.git/blob - doc.html
Haha, not a typo, just old.
[xonotic/gmqcc.git] / doc.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</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         <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
12         <!--[if lt IE 9]>
13         <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
14         <![endif]-->
15     </head>
16     <body>
17         <a href="https://github.com/graphitemaster/gmqcc"><div class="fork"></div></a>
18         <div class="wrapper">
19             <header>
20                 <h1 class="header">GMQCC</h1>
21                 <p class="header">An Improved Quake C Compiler</p>
22                 <ul>
23                     <li class="buttons"><a href=index.html>Index</a></li>
24                     <li class="download"><a href="https://github.com/graphitemaster/gmqcc/archive/0.2.2.zip">Download v0.2.2</a></li>
25                     <li class="buttons"><a href="https://github.com/graphitemaster/gmqcc/issues">Issues</a></li>
26                     <li class="buttons"><a href="doc.html">Documentation</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                 <ul class="wiki">
32                     <li class="wiki"><a class="wiki" href="#cdoc">Compiler Documentation</a></li>
33                     <li class="wiki"><a class="wiki" href="#bdoc">Building Documentation</a></li>
34                     <li class="wiki"><a class="wiki" href="#tdoc">Testsuite Documentation</a></li>
35                     <li class="wiki"><a class="wiki" href="#vdoc">Virtual Machine Documentation</a></li>
36                 </ul>
37                 <h1><a name="cdoc">Compiler Documentation</a></h1>
38                 <h3>Defaults Flag</h3>
39                 <p>
40                     The <i>-show-defaults</i> flag instructs the compiler to print out the defaults used related to
41                     the standard, optimization, and code generation.  When this flag is specified, the compiler
42                     will just print the defaults and quit.  No compilation is performed.
43                 </p>
44                 <pre>$ gmqcc -show-defaults</pre>
45                 <h3>Compiling for an alternitive standard</h3>
46                 To compile with a different dialect of the QuakeC programming language the <i>-std</i>
47                 flag can be instructed to select one of the following options:
48                 <table border="0">
49                     <tr>
50                         <td>gmqcc</td>
51                         <td>default standard</td>
52                     </tr>
53                     <tr>
54                         <td>fteqcc</td>
55                         <td>fteqcc standard</td>
56                     </tr>
57                     <tr>
58                         <td>qcc</td>
59                         <td>vanila QuakeC standard</td>
60                     </tr>
61                 </table>
62                 <h2>Common compiler options</h2>
63                 <table border="0">
64                     <tr>
65                         <td>Options</td>
66                         <td>What it does</td>
67                     </tr>
68                     <tr>
69                         <td>-l&lt;path&gt;</td>
70                         <td>Adds &lt;path&gt; to the directories searched by the preprocessor for include file resolution.</td>
71                     </tr>
72                     <tr>
73                         <td>-o &lt;file&gt;</td>
74                         <td>Generates the named executable (progs.src) file (when not specified default is progs.src).</td>
75                     </tr>
76                     
77                     <tr>
78                         <td>-O&lt;level&gt;</td>
79                         <td>Specfies the optimization level: highest being 3, lowest being 0 (no optimization).</td>
80                     </tr>
81                     <tr>
82                         <td>-g</td>
83                         <td>Enables generation of debug info for engine backtraces (turns on -flno)</td>
84                     </tr>
85                     <tr>
86                         <td>-E</td>
87                         <td>Instructs the compiler to only preprocess the input, writing the preprocessed output to stdout</td>
88                     </tr>
89                     <tr>
90                         <td>-D</td>
91                         <td>
92                             &quot;define&quot; a macro. Optionally you may supply
93                             a value to the macro with &quot;=&quot;. Implicitally turns on -fftepp
94                         </td>
95                     </tr>
96                     <tr>
97                         <td>-Wall</td>
98                         <td>Enables all compiled warnings for the selcted standard</td>
99                     </tr>
100                     <tr>
101                         <td>-Werror</td>
102                         <td>Instruct the compiler to treat all warnings as errors</td>
103                     </tr>
104                     <tr>
105                         <td>-std=&lt;standard&gt;</td>
106                         <td>Selects the standard dialect</td>
107                     </tr>
108                 </table>
109                 <h3>Predefined Macros</h3>
110                 <table border="0">
111                     <tr>
112                         <td>Macro</td>
113                         <td>What it represents</td>
114                     </tr>
115                     <tr>
116                         <td>__STD_GMQCC__</td>
117                         <td>Specifies the current selected standard is gmqcc.</td>
118                     </tr>
119                     <tr>
120                         <td>__STD_FTEQCC__</td>
121                         <td>Specifies the current selected standard is fteqcc.</td>
122                     </tr>
123                     <tr>
124                         <td>__STD_QCC__</td>
125                         <td>Specifies the current selected standard is qcc.</td>
126                     </tr>
127                     <tr>
128                         <td>GMQCC</td>
129                         <td>Defined always regardless of the selected standard</td>
130                     </tr>
131                     <tr>
132                         <td>__STD_VERSION_MINOR__</td>
133                         <td>Specifies the current selected stanadards minor version number.</td>
134                     </tr>
135                     <tr>
136                         <td>__STD_VERSION_MAJOR__</td>
137                         <td>Specifies the current selected stanadards major version number.</td>
138                     </tr>
139                     <tr>
140                         <td>__FILE__</td>
141                         <td>Expands to a const string literal of the current file (requires -fftepp-predef)</td>
142                     </tr>
143                     <tr>
144                         <td>__LINE__</td>
145                         <td>Expands to the current line number (requires -fftepp-predef)</td>
146                     </tr>
147                     <tr>
148                         <td>__RANDOM__</td>
149                         <td>Expands to a random number between [0, 256) (requires -fftepp-predef)</td>
150                     </tr>
151                     <tr>
152                         <td>__COUNTER__</td>
153                         <td>Expands to a unique number, each expansion causes it to increment (requires -fftepp-predef) </td>
154                     </tr>
155                     <tr>
156                         <td>__RANDOM_LAST__</td>
157                         <td>Expands to the last random number (requires -fftepp-predef)</td>
158                     </tr>
159                     <tr>
160                         <td>__COUNTER_LAST__</td>
161                         <td>Expands to the last counter number (requires -fftepp-predef)</td>
162                     </tr>
163                 </table>
164                 <h3>Unsupported compatability options</h3>
165                 <p>
166                     GMQCC strives hard for compatability with standard dialects, but not all
167                     features of those standards might be implemented. The unsupported features
168                     are presented below:
169                     <table border="0">
170                         <tr>
171                             <td>Feature</td>
172                             <td>Standard</td>
173                         </tr>
174                         <tr>
175                             <td>Inline Assembly</td>
176                             <td>FTEQCC</td>
177                         </tr>
178                         <tr>
179                             <td>Macro expansion in strings</td>
180                             <td>FTEQCC</td>
181                         </tr>
182                     </table>
183                 </p>
184                 <h2>Less common compiler options</h2>
185                 <h3>Code generation options</h3>
186                 <table border="0">
187                     <tr>
188                         <td>Option</td>
189                         <td>What it does</td>
190                     </tr>
191                     <tr>
192                         <td>-foverlap-locals</td>
193                         <td>Reduces codesize by overlapping locals where possible</td>
194                     </tr>
195                     <tr>
196                         <td>-fdarkplaces-string-table-bug</td>
197                         <td>Works around a bug in older Darkplaces engine builds where the stringtable size is computed wrong</td>
198                     </tr>
199                     <tr>
200                         <td>-fadjust-vector-fields</td>
201                         <td>corrects assignment of vector field pointers (STORE_V instead of STORE_FLD)</td>
202                     </tr>
203                     <tr>
204                         <td>-fftepp</td>
205                         <td>Enables FTEQ preprocessor</td>
206                     </tr>
207                     <tr>
208                         <td>-fftepp-predef</td>
209                         <td>Enables additional predefined macros for the FTEQ preprocessor</td>
210                     </tr>
211                     <tr>
212                         <td>-frelaxted-switch</td>
213                         <td>Relaxes switch statement semantics</td>
214                     </tr>
215                     <tr>
216                         <td>-fshort-logic</td>
217                         <td>Enables short circut evaluation/logic</td>
218                     </tr>
219                     <tr>
220                         <td>-fperl-logic</td>
221                         <td>Enables perl evalutaion/logic</td>
222                     </tr>
223                     <tr>
224                         <td>-ftranslatable-strings</td>
225                         <td>Enables translatable strings via .po file</td>
226                     </tr>
227                     <tr>
228                         <td>-finitialized-nonconstants</td>
229                         <td>Prevents initializations from becoming constant unless 'const' is specified as a qualifer</td>
230                     </tr>
231                     <tr>
232                         <td>-fassign-function-types</td>
233                         <td>Allows function types to be assignable even if their signature is invariant</td>
234                     </tr>
235                     <tr>
236                         <td>-flno</td>
237                         <td>Enables generation of progs.lno for engine VM backtraces (enabled with -g as well)</td>
238                     </tr>
239                     <tr>
240                         <td>-fcorrect-ternary</td>
241                         <td>Enabling this corrects the ternary percedecce bugs present in fteqcc</td>
242                     </tr>
243                     <tr>
244                         <td>-fsingle-vector-defs</td>
245                         <td>Prevents the creation of progdefs for vectors</td>
246                     </tr>
247                     <tr>
248                         <td>-fcorrect-logic</td>
249                         <td>Use cast vector to real booleans when used in logic expressions</td>
250                     </tr>
251                     <tr>
252                         <td>-ftrue-empty-strings</td>
253                         <td>Always treat empty strings as true</td>
254                     </tr>
255                     <tr>
256                         <td>-ffalse-empty-strings</td>
257                         <td>Opposite of above, empty strings always false</td>
258                     </tr>
259                     <tr>
260                         <td>-futf8</td>
261                         <td>Recognize utf-8 characters in character constants, and encode codepoint escape sequences in strings as utf-8</td>
262                     </tr>
263                     <tr>
264                         <td>-fbail-on-werror</td>
265                         <td>When a warning is printed and it is set to be treated as error via -Werror, compilation will be stopped.</td>
266                     </tr>
267                     <tr>
268                         <td>-floop-labels</td>
269                         <td>Allow loops and switches to be labeled and break and continue to take optional label to target it.</td>
270                     </tr>
271                     <tr>
272                         <td>-funtyped-nil</td>
273                         <td>Enable the 'nil' null constant, which has no type.  It can be used as the right hand of any assignment.</td>
274                     </tr>
275                     <tr>
276                         <td>-fpermissive</td>
277                         <td>Be "permissive", e.g with -funtyped-nil, this will allow local variables with the name 'nil'</td>
278                     </tr>
279                 </table>
280                 <h3>Warning options</h3>
281                 <table border="0">
282                     <tr>
283                         <td>Option</td>
284                         <td>What it does</td>
285                     </tr>
286                     <tr>
287                         <td>-Wunused-uninitialized</td>
288                         <td>Enables warnings about unused or uninitialized variables</td>
289                     </tr>
290                     <tr>
291                         <td>-Wunknwon-control-sequence</td>
292                         <td>Enables warnings about unknown control sequences</td>
293                     </tr>
294                     <tr>
295                         <td>-Wextension</td>
296                         <td>Enables warnings about the use of (an) extension(s)</td>
297                     </tr>
298                     <tr>
299                         <td>-Wfield-redeclared</td>
300                         <td>Enables warnings about redeclared fields</td>
301                     </tr>
302                     <tr>
303                         <td>-Wmissing-return-values</td>
304                         <td>Enables warnings about missing return values</td>
305                     </tr>
306                     <tr>
307                         <td>-Wtoo-few-paramaters</td>
308                         <td>Enables warnings about missing paramaters for function calls</td>
309                     </tr>
310                     <tr>
311                         <td>-Wlocal-shadows</td>
312                         <td>Enables warnings about locals shadowing paramaters or other locals</td>
313                     </tr>
314                     <tr>
315                         <td>-Wlocal-constants</td>
316                         <td>Enables warnings about constants specified as locals</td>
317                     </tr>
318                     <tr>
319                         <td>-Wvoid-variables</td>
320                         <td>Enables warnings about variables declared as type void</td>
321                     </tr>
322                     <tr>
323                         <td>-Wimplicit-function-pointer</td>
324                         <td>Enables warnings about implicitly declared function pointers</td>
325                     </tr>
326                     <tr>
327                         <td>-Wvariadic-function</td>
328                         <td>Enables warnings for use of varadics for non-builtin functions</td>
329                     </tr>
330                     <tr>
331                         <td>-Wframe-macros</td>
332                         <td>Enables warnings about duplicated frame macros</td>
333                     </tr>
334                     <tr>
335                         <td>-Weffectless-statement</td>
336                         <td>Enables warnings about effectiveless statements</td>
337                     </tr>
338                     <tr>
339                         <td>-Wend-sys-field</td>
340                         <td>Enables warnings of end_sys_fields being declared a field</td>
341                     </tr>
342                     <tr>
343                         <td>-Wassign-function-types</td>
344                         <td>Enables warnings for incompatible function pointer signatures used in assignment</td>
345                     </tr>
346                     <tr>
347                         <td>-Wpreprocessor</td>
348                         <td>Enables warnings about redefined macros</td>
349                     </tr>
350                     <tr>
351                         <td>-Wmultifile-if</td>
352                         <td>Enables warnings about multifile if statements</td>
353                     </tr>
354                     <tr>
355                         <td>-Wdouble-declaration</td>
356                         <td>Enables warnings about double declarations</td>
357                     </tr>
358                     <tr>
359                         <td>-Wconst-var</td>
360                         <td>Enables warnings about 'const var' and 'var const'</td>
361                     </tr>
362                     <tr>
363                         <td>-Wmultibyte-character</td>
364                         <td>Enables warnings about use of multibyte characters</td>
365                     </tr>
366                     <tr>
367                         <td>-Wternary-precedence</td>
368                         <td>Enables warnings about ternary expressions whos precedence may be not what expected</td>
369                     </tr>
370                     <tr>
371                         <td>-Wunknown-pragmas</td>
372                         <td>Enables warnings about unknown pragmas</td>
373                     </tr>
374                     <tr>
375                         <td>-Wunreachable-code</td>
376                         <td>Enables warnings about unreachable code</td>
377                     </tr>
378                     <tr>
379                         <td>-Wcpp</td>
380                         <td>Enables warnings about the preprocessor</td>
381                     </tr>
382                     <tr>
383                         <td>Wunknown-attribute</td>
384                         <td>Enables warnings for when an unknown attribute is encountered.</td>
385                     </tr>
386                     <tr>
387                         <td>-Wreserved-names</td>
388                         <td>Enables warnings for variables or fields that are named with a reserved name</td>
389                     </tr>
390                     <tr>
391                         <td>-Wuninitialized-constant</td>
392                         <td>Enables warnings about const global variables with no initializing value</td>
393                     </tr>
394                     <tr>
395                         <td>-Wuninitialized-global</td>
396                         <td>Enables warnings about non-const gloal variable with no initializing value</td>
397                     </tr>
398                     <tr>
399                         <td>-Wdeprecated</td>
400                         <td>Enables warnings about calls to functions marked deprecated</td>
401                     </tr>
402                 </table>
403                 <table border="0">
404                     <tr><td>Options</td><td>What it does</td></tr>
405                     <tr>
406                         <td>-Opeephole</td>
407                         <td>Enables peephole optimizations</td>
408                     </tr>
409                     <tr>
410                         <td>-Olocal-temps</td>
411                         <td>Enables local-temp omission optimizations</td>
412                     </tr>
413                     <tr>
414                         <td>-Oglobal-temps</td>
415                         <td>Enables global-temp omission optimizations</td>
416                     </tr>
417                     <tr>
418                         <td>-Otail-recursion</td>
419                         <td>Enables tail recursion optimization</td>
420                     </tr>
421                     <tr>
422                         <td>-Otail-calls</td>
423                         <td>Enables tail-call optimizations</td>
424                     </tr>
425                     <tr>
426                         <td>-Ooverlap-locals</td>
427                         <td>
428                             Every function where it's safe to do so will share its local
429                             section with others.  The critera being that the function must
430                             have any possibly uninitialized locals, or local arrays regardless
431                             of how they are initialized.
432                         </td>
433                     </tr>
434                     <tr>
435                         <td>-Ostrip-constant-names</td>
436                         <td>Strip the names of constants</td>
437                     </tr>
438                     <tr>
439                         <td>-Ooverlap-strings</td>
440                         <td>Agressivly reuse strings in the string-section.</td>
441                     </tr>
442                     <tr>
443                         <td>-Ocall-stores</td>
444                         <td>
445                             Have expressions which are used as function parameters evaluate directly
446                             into the parameter-globals if possible.  This avoids copying.
447                         </td>
448                     </tr>
449                     <tr>
450                         <td>-Ovoid-return</td>
451                         <td>Do not create a return instruction at the end of return-type void functions</td>
452                     </tr>
453                 </table>
454                 <p>
455                     Individual warnings may be disabled with &nbsp;-Wno-&lt;warning&gt;
456                     <pre>$ gmqcc -Wno-frame-macros # disables frame duplication warning</pre>
457                 </p>
458                 <h3>Miscellaneous options</h3>
459                 <table border="0">
460                     <tr>
461                         <td>Option</td>
462                         <td>What it does</td>
463                     </tr>
464                     <tr>
465                         <td>-force-crc=&lt;num&gt;</td>
466                         <td>Forces a specific checsum into the header</td>
467                     </tr>
468                     <tr>
469                         <td>-debug</td>
470                         <td>Turns on compiler debug messages</td>
471                     </tr>
472                     <tr>
473                         <td>-memchk</td>
474                         <td>Turns on compiler memory leak checker</td>
475                     </tr>
476                     <tr>
477                         <td>-dump</td>
478                         <td>Dump IR before optimizing and finalizing</td>
479                     </tr>
480                     <tr>
481                         <td>-dumpfin</td>
482                         <td>Dump IR after optimizing and finalizing</td>
483                     </tr>
484                     <tr>
485                         <td>-Whelp or -W?</td>
486                         <td>Lists all warning options</td>
487                     </tr>
488                     <tr>
489                         <td>-fhelp or -f?</td>
490                         <td>Lists all code generation options</td>
491                     </tr>
492                     <tr>
493                         <td>-redirout=&lt;file&gt;</td>
494                         <td>Redirect stdout to any file.</td>
495                     </tr>
496                     <tr>
497                         <td>-redirerr=&lt;file&gt;</td>
498                         <td>Redirect stderr to any file.</td>
499                     </tr>
500                     <tr>
501                         <td>-nocolor</td>
502                         <td>Turn off colored stdout/stderr.</td>
503                     </tr>
504                     <tr>
505                         <td>-config=&lt;file&gt;</td>
506                         <td>
507                             Supply a configuration file to set options.
508                             Note: If a file named <b>gmqcc.ini</b> or
509                             <b>gmqcc.cfg</b> is found it will be loaded
510                             implicitally.
511                         </td>
512                     </tr>
513                 </table>
514                 
515                 <h1><a name="bdoc">Building Documentation</a></h1>
516                 <h2>Building on BSD/NIX</h2>
517                 <p>
518                     To compile GMQCC on BSD/NIX the following things are
519                     required:
520                     
521                     <ul>
522                         <li>GIT</li>
523                         <li>Make</li>
524                         <li>Any C90+ C compiler</li>
525                     </ul>
526                     
527                     Once obtained you may checkout the development repository
528                     with the following shell commands
529                     
530 <pre>$ git clone git://github.com/graphitemaster/gmqcc.git
531 $ cd gmqcc
532 </pre>
533
534                     The Makefile contains a few rules, depending on what you
535                     want to compile, the following rules are:
536                     
537                     <table border="0">
538                         <tr>
539                             <td>Rule</td>
540                             <td>What it does</td>
541                         </tr>
542                         <tr>
543                             <td>gmqcc</td>
544                             <td>Builds the gmqcc compiler</td>
545                         </tr>
546                         <tr>
547                             <td>qcvm</td>
548                             <td>Builds a standable QuakeC VM</td>
549                         </tr>
550                         <tr>
551                             <td>testsuite</td>
552                             <td>Builds the testsuite for GMQCC</td>
553                         </tr>
554                         <tr>
555                             <td>check, test</td>
556                             <td>Build and executes the testsuite for GMQCC</td>
557                         </tr>
558                         <tr>
559                             <td>pak</td>
560                             <td>Builds the pak utility</td>
561                         </tr>
562                         <tr>
563                             <td>splint</td>
564                             <td>Runs splint (static analysis) on the source</td>
565                         </tr>
566                         <tr>
567                             <td>gource</td>
568                             <td>Runs gource visualization on the source</td>
569                         </tr>
570                         <tr>
571                             <td>gource-record</td>
572                             <td>Runs gource visualization and produces a rendered mp4</td>
573                         </tr>
574                         <tr>
575                             <td>depend</td>
576                             <td>Builds dependinces into the Makefile</td>
577                         </tr>
578                         <tr>
579                             <td>all</td>
580                             <td>Builds gmqcc, qcvm, pak, and testsuite</td>
581                         </tr>
582                         <tr>
583                             <td>install</td>
584                             <td>Installs gmqcc, qcvm, and documentaion</td>
585                         </tr>
586                         <tr>
587                             <td>uninstall</td>
588                             <td>Uninstalls gmqcc, qcvm, and documentation</td>
589                         </tr>
590                         <tr>
591                             <td>check</td>
592                             <td>Runs the testsuite to verify correctness</td>
593                         </tr>
594                     </table>
595                 </p>
596                 <h2>Building on Windows</h2>
597                 <p>
598                     To compile GMQCC on windows the following things are
599                     required:
600                     
601                     <ul>
602                         <li><a href="http://msysgit.googlecode.com/files/Git-1.8.0-preview20121022.exe">msysGit</a></li>
603                         <li><a href="http://www.microsoft.com/visualstudio/eng/downloads">Visual Studio</a></li>
604                     </ul>
605                     
606                     Once obtained you may checkout the development repository
607                     with the following msysGit commands from a msysGit shell.
608                     <pre>$ git clone git://github.com/graphitemaster/gmqcc.git</pre>
609                     Included is a VS project file.
610                 </p>
611                 
612                 <h1><a name="tdoc">Testsuite Documentation</a></h1>
613                 <h2>Running The Testsuite</h2>
614                 <p>
615                     To run the testsuite you can either use
616                     <pre>$ make check</pre>
617                     Or if you're on windows or have already compiled the
618                     testsuite from source:
619                     <pre>$ ./testsuite </pre>
620                     
621                     Optionally you may provide the testsuite with additional
622                     arguments:
623                     
624                     <table border="0">
625                         <tr>
626                             <td>Argument</td>
627                             <td>What it does</td>
628                         </tr>
629                         <tr>
630                             <td>-redirout=&lt;file&gt;</td>
631                             <td>Redirect stdout to any file.</td>
632                         </tr>
633                         <tr>
634                             <td>-redirerr=&lt;file&gt;</td>
635                             <td>Redirect stderr to any file.</td>
636                         </tr>
637                         <tr>
638                             <td>-debug</td>
639                             <td>Turn on testsuite debug messages.</td>
640                         </tr>
641                         <tr>
642                             <td>-memchk</td>
643                             <td>Turn on testsuite memleak checker.</td>
644                         </tr>
645                         <tr>
646                             <td>-nocolor</td>
647                             <td>Turn off colored stdout/stderr.</td>
648                         </tr>
649                     </table>
650                 </p>
651                 <h2>Writing Tests</h2>
652                 <p>
653                     GMQCC comes with a complete testsuite for verifying semantics
654                     and syntatics.  The testsuite executes files from the test/
655                     directory, by reading task template files.
656                 </p>
657                 <p>
658                    templates are rules for a specific test, used to create a "task" that
659                    is executed with those set of rules (arguments, and what not). Tests
660                    that don't have a template with them cannot become tasks, since without
661                    the information for that test there is no way to properly "test" them.
662                    Rules for these templates are described in a template file, using a
663                    task template language.
664                 </p>
665                 <p>
666                    The languge is composed entierly of "tags" which describe a string of
667                    text for a task.  Think of it much like a configuration file.  Except
668                    it's been designed to allow flexibility and future support for prodecual
669                    semantics.
670                 <p>
671                 <p>
672                    The following "tags" are suported by the language:
673                 </p>
674                 <table border="0">
675                     <tr>
676                         <td>Tag</td>
677                         <td>Description of what the tag does</td>
678                     </tr>
679                     <tr>
680                        <td>D:</td>
681                          <td>Used to set a description of the current test, this must be
682                            provided, this tag is NOT optional.</td>
683                     </tr>
684                     <tr>
685                         <td>F:</td>
686                          <td>Used to set test-suite specific flags, currently
687                             the only supported flag is -no-defs which tells the
688                             testsuite to exclude defs.qh.
689                         </td>
690                     </tr>
691                     <tr>
692                        <td>T:</td>
693                             <td>Used to set the procedure for the given task, there are four
694                            options for this:
695                            <ul>
696                                <li>-compile&nbsp;
697                                    This simply performs compilation only</li>
698                                <li>-execute&nbsp;
699                                    This will perform compilation and execution</li>
700                                <li>-fail&nbsp;
701                                    This will perform compilation on the requirement it fails, otherwise
702                                    the test fails</li>
703                                 <li>-pp&nbsp;
704                                     This will perform preprocessing only</li>
705                             </ul>
706                   
707                            This tag must be provided, this tag is NOT optional.
708                            </td>
709                     </tr>
710                     <tr>
711                        <td>C:</td>
712                         <td>Used to set the compilation flags for the given task, this
713                            must be provided, this tag is NOT optional.</td>
714                     </tr>
715                     <tr>
716                        <td>E:</td>
717                         <td>Used to set the execution flags for the given task. This tag
718                            must be provided if T == -execute, otherwise it's erroneous
719                            as compilation only takes place.</td>
720                     </tr>
721                     <tr>
722                        <td>M:</td>
723                         <td>Used to describe a string of text that should be matched from
724                            the output of executing the task.  If this doesn't match the
725                            task fails.  This tag must be provided at least once if
726                            T == -execute or T == -pp, otherwise it's erroneous as compilation only
727                            takes place. Multiple M tags are required for multi-line comparision
728                         </td>
729                     </tr>
730                     <tr>
731                        <td>I:</td>
732                        <td>Used to specify the INPUT source file to operate on, this must be
733                        provided, this tag is NOT optional</td>
734                     </tr>
735                  </table>
736                 <h3>Notes</h3>
737                 <p>
738                    These tags (with exception to M) have one-time use, using them more
739                    than once will result in template compilation errors,
740                 </p>
741                 <p>
742                    Lines beginning with # or // in the template file are comments and
743                    are ignored by the template parser.
744                    Whitespace is optional, with exception to the colon ':' between the
745                    tag and it's assignment value.
746                 </p>
747                    The template compiler will detect erronrous tags (optional tags
748                    that need not be set), as well as missing tags, and error accordingly
749                    which will result in that task failing.
750                 </p>
751                 <h1><a name="vdoc">Quake C Virtual Machine Documentation</a></h1>
752                 <p>
753                     Included with GMQCC is a minimal implementation of the QCVM used in many game
754                     engines.  It's primarly used for the testsuite, but you may also use it as a
755                     standalone runtime, or even embed it with existing appliciations.
756                 </p>
757                 <h2>Running The Standalone VM</h2>
758                 <p>
759                     To run the standalone application you need to have a compiled progs.dat, with an
760                     entry function named &nbsp;main&nbsp;  The main function can have any amount of arguments
761                     as the standalone executor allows main to be invoked with your choice of arguments.
762                     An example of invoking the VM:
763                     <pre>$ ./qcvm progs.dat -float 200 #execute passing in 200 as a float to main</pre>
764                     If &nbsp;main&nbsp; doesn't require arguments:
765                     <pre>$ ./qcvm progs.dat #call main with no arguments</pre>
766                     
767                     The standalone executor supports the following arguments for passing arguments to &nbsp;main&nbsp
768                     
769                     <table border="0">
770                         <tr>
771                             <td>Argument</td>
772                             <td>What it does</td>
773                         </tr>
774                         <tr>
775                             <td>-string</td>
776                             <td>Passes in a string to main</td>
777                         </tr>
778                         <tr>
779                             <td>-float</td>
780                             <td>Passes in a float to main</td>
781                         </tr>
782                         <tr>
783                             <td>-vector</td>
784                             <td>Passes in a vector to main</td>
785                         </tr>
786                     </table>
787                     
788                     The order in which the arguments are expected for main, must be preserved, for
789                     example if &nbsp;main&nbsp;'s signature is the following:
790                     <pre>void main(float a, vector b)</pre>
791                     
792                     Then to pass the arguments you'd use the same order:
793                     <pre>$ ./qcvm -float 200 -vector '1 2 3'</pre>
794                     
795                     <h3>Additional Arguments</h3>
796                     The standalone virtual machine has the following optional command line arguments:
797                     <table border="0">
798                         <tr>
799                             <td>Argument</td>
800                             <td>What it does</td>
801                         </tr>
802                         <tr>
803                             <td>-h, --help</td>
804                             <td>Print help message</td>
805                         </tr>
806                         <tr>
807                             <td>-trace</td>
808                             <td>Trace the execution call hierarchy.</td>
809                         </tr>
810                         <tr>
811                             <td>-profile</td>
812                             <td>Profile the bytecode to find hotspots.</td>
813                         </tr>
814                         <tr>
815                             <td>-info</td>
816                             <td>Get info of the running bytecode.</td>
817                         </tr>
818                         <tr>
819                             <td>-disasm</td>
820                             <td>Dissasemble the bytecode into assembly.</td>
821                         </tr>
822                         <tr>
823                             <td>-diasm-func</td>
824                             <td>Dissasmble function</td>
825                         </tr>
826                         <tr>
827                             <td>-printdefs</td>
828                             <td>Prints all definitions for the bytecode running.</td>
829                         </tr>
830                         <tr>
831                             <td>-printfields</td>
832                             <td>Prints all fields for the bytecode running.</td>
833                         </tr>
834                         <tr>
835                             <td>-printfuns</td>
836                             <td>Prints all functions for the bytecode running.</td>
837                         </tr>
838                         <tr>
839                             <td>-v</td>
840                             <td>Be verbose</td>
841                         </tr>
842                         <tr>
843                             <td>-v</td>
844                             <td>Be even more verbose</td>
845                         </tr>
846                         <tr>
847                             <td>-version, --version</td>
848                             <td>Print version information</td>
849                         </tr>
850                     </table>
851                     
852                     <h3>Builtins</h3>
853                     The standalone virtual machine includes the following builtins.
854                     <table border="0">
855                         <tr>
856                             <td>Builtin</td>
857                             <td>Number</td>
858                         </tr>
859                             <tr><td>print</td><td>1</td></tr>
860                             <tr><td>ftos</td><td>2</td></tr>
861                             <tr><td>spawn</td><td>3</td></tr>
862                             <tr><td>kill</td><td>4</td></tr>
863                             <tr><td>vtos</td><td>5</td></tr>
864                             <tr><td>error</td><td>6</td></tr>
865                             <tr><td>vlen</td><td>7</td></tr>
866                             <tr><td>etos</td><td>8</td></tr>
867                             <tr><td>stof</td><td>9</td></tr>
868                             <tr><td>strcat</td><td>10</td></tr>
869                             <tr><td>strcmp</td><td>11</td></tr>
870                             <tr><td>normalize</td><td>12</td></tr>
871                             <tr><td>sqrt</td><td>13</td></tr>
872                             <tr><td>floor</td><td>14</td></tr>
873                     </table>
874                 </p>
875                 <h3>Support or Contact</h3>
876                 <p>Having trouble with GMQCC? Join our IRC channel at #kf-engine on irc.freenode.net or contact <a href="mailto:cube2killfild@gmail.com">Us</a> 
877             </section>
878             <footer>
879                 <script type="text/javascript" src="http://www.ohloh.net/p/602517/widgets/project_partner_badge.js"></script>
880             </footer>
881         </div>
882         <!--[if !IE]><script>fixScale(document);</script><![endif]-->
883     </body>
884 </html>