Cronos's Enhanced QCC.....Beta 1.
---------------------------------
Well... I was having problems compiling the Quake source with Borland C++ and TASM and so I decided to have a mess with QCC as an alternative. So many people are working on the engine source anyway. Some time ago I found that all of the other qc compilers out there had bugs in them and so I ended up getting the normal qcc working with large projects. I had the basic source compiling fine already. There were a few changes I wanted to make to qcc and I had a few ideas for enhancements. Looking back it seems remarkable that no-one ever did more with qcc.

Cronos.

Changes to QCC, summary:
------------------------

1. Added hex chars to strings, use \x00 to \xff to embed specific chars in strings.
eg "Hello\20There\n" is equal to "Hello There\n"

2. Added \r escape char which has the effect of making text red. Actually it adds 128 to all chars. Repeated toggles the effect.
eg "Hello \rThere\r\n" is equal to Hello_space_red'There'_\n
"\r \r" is the same as a normal space (the shifted character is the same). Other chars are available from shifted chars like !"$%, etc.

3. Added extended macro parsing to the compiler. Now ($attack1) is parsed properly, without requiring additional spaces.

4. Semicolons at the end of functions are now optional.

5. Added for loops to the compiler. Example:
	for(k=BOT_1;k<=BOT_17;k=k*2)
	{	if(k&indbots)
  			numbots=numbots+1;
	}
another example:
for(k=find(world,classname,"bot");k!=world;k=find(k,classname,"bot"))
{
}
Nesting of loops, etc works fine as well.

6. Added -opt switch to compiler. This turns optimisation on. Currently two optimisations are performed. The first reduces numstatements and numpr_globals by combining arithmetic and store assembler instructions. The second is just a reduction in temporary values required. The optimisations reduce numstatements by around 2.5% and numpr_globals by around 20%. It should be possible to reduce numpr_globals quite significantly but it is not simple.

7. Removed local variable names from compilations. This results in a decompilable progs.dat (along with the optimisations I make which most current decompilers will not be able to work out and will probably die on...). This also significantly reduces the size of the progs.dat

8. Nearly forgot...this program won't choke on big projects, I made the bounds a lot larger than any other compiler out there.

9. Added breaks for for loops and while loops. break jumps outside the current for or while loop (only the innermost one when nested). So the following is now ok:
while(i<10)
{	i=i+1;
	if(i==5) break;
}
for (i=1;i<10;i=i+1)
{	if(i==5) break;
}
for(;;)
{	if(done==TRUE) break;
}

