Commit Graph

215 Commits

Author SHA1 Message Date
Bill Currie 59ff35558f create empty defs for vertex and quaternion compontents 2001-06-27 22:24:28 +00:00
Bill Currie 768c4a49d3 fix . type checking 2001-06-27 21:43:10 +00:00
Bill Currie b285ab003d more tests 2001-06-27 21:15:15 +00:00
Bill Currie 774a1fe6cd fix // comments at end of file (ie, no trailing \n) 2001-06-27 20:47:41 +00:00
Bill Currie 9c30c0c455 make simple assignments (a = b;) generate code 2001-06-27 20:32:27 +00:00
Bill Currie 1eef491c1c handle -ve constants 2001-06-27 19:40:43 +00:00
Bill Currie 1fd4590212 report file as well 2001-06-27 18:15:24 +00:00
Bill Currie febb139a41 free temp defs at the end of each expr block. CustomTF has gone from 64 to 25
locals.
2001-06-27 17:11:21 +00:00
Bill Currie 9d2bf8df19 better function argument code generation 2001-06-27 16:43:56 +00:00
Bill Currie 1c54a3ddb7 why not? 2001-06-27 05:48:25 +00:00
Bill Currie a35c049744 main.c:
give instruction address in opcode dump
main.qc:
	more test code
2001-06-27 05:46:53 +00:00
Bill Currie 504d03a21a expr.c:
fix a silly stanfu with goto
qc-parse.y:
	suffle the debug code
2001-06-27 05:45:20 +00:00
Bill Currie 673e6e66b7 turns out qcc wasn't so stupid about = vs ||/&& precedence after all (just
my interpretation of the code was:/) why oh why didn't John use bison or yacc
in the first place? :/
2001-06-27 00:10:34 +00:00
Bill Currie ff42e81127 remove some debug info 2001-06-26 23:51:15 +00:00
Bill Currie c629de9b3b function calls work now 2001-06-26 23:42:11 +00:00
Bill Currie 50ae388caa initialisations now seem to work, including cows (mooOOoo:) 2001-06-26 22:43:28 +00:00
Bill Currie c32bcb7262 immediates now seem to work 2001-06-26 22:07:09 +00:00
Bill Currie ce2f26f0b9 lables are working, but immediates and function return values are borked 2001-06-26 21:32:22 +00:00
Bill Currie 5785b93107 implement branches and top level call 2001-06-26 20:06:56 +00:00
Bill Currie 19a7285f6c implement state 2001-06-26 19:54:50 +00:00
Bill Currie aee129ca7d assignments now seem to work in that they no longer seg qfcc 2001-06-26 19:48:03 +00:00
Bill Currie 63ad87db68 return defs of the correct type 2001-06-26 17:34:21 +00:00
Bill Currie 69f869087b oops 2001-06-26 16:24:11 +00:00
Bill Currie d783a024b3 record an expression's line number and file and sort of handle state
expressions
2001-06-26 16:23:21 +00:00
Bill Currie 3242c04798 fix the redef error 2001-06-26 16:12:01 +00:00
Bill Currie c1753046a9 start on actually generating code. doesn't work yet (getting a weird type
redeclaration error and not all expressions are handled yet).
2001-06-26 07:21:20 +00:00
Bill Currie e99796c4cf new expression type: ex_block. forms a linked list of expressions for fast
appending and ease of manipulation.
2001-06-26 03:33:01 +00:00
Bill Currie 749d460041 duplicate code cleanup 2001-06-26 02:46:02 +00:00
Bill Currie 3fa3ab59a9 clean up error reporting a little 2001-06-25 23:42:49 +00:00
Bill Currie 625915288c hopefully make line directives work 2001-06-25 23:38:32 +00:00
Bill Currie 90b5c57266 fix lost initial char of string constants
make expression strings char * instead of string_t (don't put them into
pr_strings prematurely);
2001-06-25 22:53:15 +00:00
Bill Currie 53b66ef2e0 better label handling and strings are now completely parsed (including escapes) 2001-06-25 22:11:20 +00:00
Bill Currie 1779a124c5 expr.h:
nuke the ex_statement and estatement_[st] stuff
	add label_expr prototype
expr.c:
	ex_statement nukage
	correct new_expr's decl
	add label_expr to ease label creation
	don't crash when printing a null expression (bare return)
qc-parse.y:
	estatement_t nukage
	statement statements and statement_block are type expr
	generate `expressions' for statements

a full parse tree for each function is now generated. there are several
special expression opcodes for statements:
	d	done    \
	r	return  -> unary: expression to return or null
	i	if      binary:   evaluated expression, destination label
	n	ifnot   binary:   evaluated expression, destination label
	c	call    binary:   function def, args (expr list, rev order)
	s	state   binary:   frame const, function def
	g	goto    unary:    destination label
	l	label   unary:    label number
in a top level expression, l (label) defines the label, otherwise it is a
reference.
2001-06-25 20:52:04 +00:00
Bill Currie 2d87eeb57d functions are now initialized, but no code is yet generated 2001-06-25 18:23:29 +00:00
Bill Currie df897255ff make usage of the new parser easier to configure 2001-06-25 18:22:53 +00:00
Bill Currie ab051248e8 expr.h:
add prototype for print_expr
expr.c:
	add print_expr
	correct string accessors
	currect the result type for unary operators
qc-lex.l:
	correct string, vector and quaternion parsing
qc-parse.y:
	precedence corrections and more function scope work

CustomTF gets through the parsing again.
2001-06-25 17:15:56 +00:00
Zephaniah E. Hull 3715430479 This is changing more then I wanted to at once, however.
The major change is that we no longer require libGL to even exist on the
system at compile time for the GL targets, we dynamicly link to the
libGL of choice at run time. (This probably breaks most non-linux
systems, and all GL targets except -glx, some fixup will be needed.)
(This also kills glquake, dead dead DEAD! GONE FOREVER! WHEE!)

Some gl_draw cleanup.

Commented out equake alias model occlusion test stuff, very experimental.

Added the .lo and .la patterns to the .gitignore files.

Some minor sbar cleanup. (We don't use the disc in use symbol for
anything.)
2001-06-24 09:25:55 +00:00
Bill Currie c12ac3278e a little progress on functions 2001-06-21 07:08:34 +00:00
Bill Currie ae98ed8603 field types are parsed correctly, but parameters have been lost for the
moment
2001-06-20 23:32:13 +00:00
Bill Currie aac91d8cd6 more expression handling. turns out I'm mis-parsing field types, so that's next 2001-06-20 21:18:04 +00:00
Jeff Teunissen ba17807833 whitespace. 2001-06-20 19:53:37 +00:00
Bill Currie 226b40483d beginnings of expression and statement processing 2001-06-20 07:02:36 +00:00
Bill Currie 56aafce20c qfcc.h:
rearrange def_t a little and add def_next (leaving next free for other
	uses)
pr_def.c:
	use def_next instead of next to link /all/ of the named defs
qfcc.c:
	ditto
2001-06-20 03:05:50 +00:00
Bill Currie 327e95a3c8 gcc 3.0 fixes 2001-06-20 02:07:20 +00:00
Bill Currie 90a0cdfedf now seems to get through CustomTF properly, but better def handling is needed 2001-06-19 23:35:09 +00:00
Adam Olsen 67e4fa85bf add support for \<, \>, and \^ to qfcc. \< bolds all characters (toggles bold really) until \>, and \^ bolds (toggles) the next character. 2001-06-19 23:27:07 +00:00
Bill Currie 20bf698330 fix \x handling for 0-9 2001-06-19 22:26:16 +00:00
Bill Currie f50ce04ccb d'oh, forgot to add 10 for a-f and A-F 2001-06-19 22:13:35 +00:00
Bill Currie af701d74cd fix infinite loop for \x... 2001-06-19 21:45:57 +00:00
Bill Currie 2647e63810 finally fix the tupe corruption. 2001-06-19 16:01:38 +00:00
Bill Currie bdc0ba32ca pr_lex.c:
add PR_PrintType (and lotsa debug to PR_FindType)
qc-parse.y:
	fix up one bit of type corruption, only to find another :/
2001-06-19 07:28:50 +00:00
Bill Currie 89fecd7cee slowly getting there with defs processing. still borked 2001-06-18 22:51:49 +00:00
Bill Currie 9f158b148e now cross builds out-of-the-box 2001-06-16 05:16:02 +00:00
Bill Currie 7254dc0052 rename filelength to FileLength to avoid a name clash in windows 2001-06-16 04:27:22 +00:00
Bill Currie b595f0122f got function params scope sort of sorted out 2001-06-15 20:38:57 +00:00
Bill Currie eeaab95be5 beginnings of expression and def handling. 2001-06-15 19:38:43 +00:00
Bill Currie 373ea8132a more work on the code generation and make generally usable again by disabling
the new stuff
2001-06-15 07:16:18 +00:00
Bill Currie f9baacd440 beginnings of code generation. hangs :) 2001-06-14 21:49:47 +00:00
Bill Currie 00f1288940 don't delete processed files if --keep is given 2001-06-13 22:56:20 +00:00
Bill Currie d7ebba6a74 parses CustomTF now, but no code generation 2001-06-13 18:35:41 +00:00
Bill Currie c89da89b69 almost parses CustomTF ($macro junk next) 2001-06-13 07:16:39 +00:00
Bill Currie 2c26de2c2b oops 2001-06-12 22:26:52 +00:00
Bill Currie 72b93d0062 more stuff 2001-06-12 22:26:10 +00:00
Bill Currie d59048d592 pass given params to qfcc 2001-06-12 22:20:45 +00:00
Bill Currie 489ddbc7a7 getting closer. soon timie to start putting real code in there 2001-06-12 21:06:28 +00:00
Bill Currie 7d52f12248 clean up C warnings 2001-06-12 20:24:02 +00:00
Bill Currie 3be018e1f9 beginnings of a bison grammar for qc 2001-06-12 19:44:26 +00:00
Bill Currie c0654f3541 miss tagged string != string 2001-06-12 15:29:05 +00:00
Bill Currie aa825853bf full \ handling in strings (including \e for escape (why C doesn't have that
is beyond me))
2001-06-11 23:37:01 +00:00
Bill Currie 73ce5c6f9c what's this .vimrc? :) 2001-06-11 20:12:29 +00:00
Bill Currie fcd29459e4 produce line directive output and clean up the generated files 2001-06-11 18:04:32 +00:00
Bill Currie dfb6062f9d fix an out-by-one for line directives at the beginning of the file 2001-06-11 17:51:09 +00:00
Bill Currie c732d098f4 add '# 1 "foo.qcc" ...' (flags ignored) processing to qfcc so preprocessed
output can make sense.
2001-06-11 15:43:06 +00:00
Adam Olsen f094db3977 add support for --with-qf=/usr/local as a prefix for lib and include dirs 2001-06-10 13:07:30 +00:00
Bill Currie bbc97079e0 pr_comp.h:
define PROG_ID_VERSION as 6 and redefine PROG_VERSION as 0x00fff001
	(0.fff.001) for the new qc features.
pr_edict.c:
	support version 6 and version 0.fff.001 progs
qfcc.h:
	add version field to options_t
	add min_version field to opcode_t
pr_opcode.c:
	set the minumum version of each opcode (gee, that table is getting ugly)
	filter out opcodes with too high a min_version when initializing the opcode
	hash tables.
qfcc.c:
	update help output.
	accept --id to limit code generation to id compatable (ver 6) progs.
	default progs generation to 0.fff.001
2001-06-09 06:25:33 +00:00
Bill Currie e61884fefb add a test for initialized locals 2001-06-08 22:54:34 +00:00
Bill Currie 0186732130 make initialized local variables work /properly/
local float urk = 0;
STORE_F    46(IMMEDIATE)  0.0   55(?)
2001-06-08 20:13:10 +00:00
Bill Currie 7ef4c2776e Immidiate sharing now /works/ (shaved off two pr_globals from CustomTF, too:).
Detect assignments to initialized globals and give an error, unless the --cow
(copy on write) option is given, and then allocate a new global for the var,
clear its initialized flag.
Relocate all globals.
2001-06-08 06:32:15 +00:00
Bill Currie 8656eb998a add ChangeLog 2001-06-08 00:18:53 +00:00
Bill Currie ef99ad24b0 const merge testing. qfcc is currently borked in that dept. 2001-06-08 00:14:11 +00:00
Bill Currie bddf7069a2 might as well return the result of the main in the progs 2001-06-06 21:30:58 +00:00
Bill Currie e349ed3013 implement file io for qwaq (and cat in qc }:> ) 2001-06-06 20:05:08 +00:00
Bill Currie 3d566d47e3 more testing 2001-06-06 00:38:24 +00:00
Bill Currie 867260d27d report the size of the locals pool 2001-06-06 00:34:35 +00:00
Bill Currie c3cdfce12b don't bother writing out local defs as they mess up progs dumping now that
they overlap
2001-06-06 00:12:10 +00:00
Bill Currie 1e6d69e2be main.c:
allow dumping to work with entities
main.qc:
	more tests
2001-06-05 23:53:55 +00:00
Bill Currie d86ed9a3b9 relocate the locals defs as well as their references 2001-06-05 23:52:34 +00:00
Bill Currie bbb37d0080 customTF is now down to 4989 pr_globals. all parameters, local veriables and
termporary variables sit in one pool of memory (at the end of the globals)
thus drasticly reducing globals requirements. This works because the whole
lot is declared to be in the function's local variable space which is copied
to the locals stack in the progs engine.
2001-06-05 08:09:12 +00:00
Bill Currie a26f799de4 allocate temps based on size rather than type (get better re-usage this way)
put temps onto the local scope.
2001-06-05 05:22:11 +00:00
Bill Currie 17e19f3892 regain about 5000 globals for customTF, but this fixes possible breakage with
premature temp var re-usage (ie, it puts the temps back into the locals space).
2001-06-04 22:35:54 +00:00
Bill Currie 55d58f8d46 ignore .vimrc 2001-06-04 18:33:50 +00:00
Bill Currie 42c880ab8a formatting cleanup 2001-06-04 18:33:32 +00:00
Bill Currie 1b930b73d1 execute qfcc on completion for that one stop shopping experience 2001-06-04 18:20:14 +00:00
Bill Currie e090f3c9e3 do proper temp def handling so we don'e use any where near as many defs for
temporary variables (customTF went from 35941 to 12587 pr_globals).
2001-06-04 17:52:50 +00:00
Bill Currie 53e9fb65d1 prepare PR_Statement for proper temporary usage 2001-06-04 05:45:51 +00:00
Bill Currie e339e82c01 hash.h is now const correct as is a lot of qfcc 2001-06-04 04:52:14 +00:00
Bill Currie 4aa47d728a use the correct STORE_ op for function arges, rather than STORE_V. Should
speed up progs in general.
2001-06-04 03:57:15 +00:00
Bill Currie 275e74161b string comparison operators 2001-06-04 03:36:35 +00:00
Bill Currie 7178824ee6 put ADD_S up where it belongs :) 2001-06-04 02:49:59 +00:00
Bill Currie ddcd172a03 re-write the opcode selection to be a hash table lookup and statment generation
to get the opcode from the table record rather than the location within the
table (ewww). gives a nice speed boost /and/ makes the opcode table easier to
maintain.
2001-06-04 02:41:45 +00:00