Commit graph

38 commits

Author SHA1 Message Date
Bill Currie
b29c0d70b7 more signed char indeces 2002-04-07 05:44:34 +00:00
Bill Currie
d1fcfd1939 Implement --traditional so qfcc can be a nicer qcc. This disables several
keywords (quaternion integer function for break continue switch case default
NIL struct enum typedef) and converts some errors to warnings (assignment to
constants, insufficient function arguments, return; from non-void function,
anal function `pointer' type checks)
2002-02-18 06:23:59 +00:00
Bill Currie
6a393d175e implement typedef 2002-01-23 20:50:25 +00:00
Bill Currie
64c5983742 enum support 2002-01-21 19:03:29 +00:00
Bill Currie
718a64343b more old-code cleanup. move PR_LexString into make_string 2002-01-04 18:27:01 +00:00
Bill Currie
12d2338d1b handle dos line endings a little better 2002-01-04 17:13:13 +00:00
Bill Currie
9d2739598a character constants 2002-01-04 08:45:24 +00:00
Bill Currie
b03a1bee42 ok, structures seem to generate correct code now 2001-12-08 08:19:48 +00:00
Jeff Teunissen
581411e9e2 qfcc: Preparation for getopt. 2001-10-26 06:43:56 +00:00
Bill Currie
f029687ff0 switch statement. could do with lots of improvements, but this should be a
good start.
2001-10-25 06:41:52 +00:00
Adam Olsen
3bba5398ba - audit malloc usage. now everything checks the return value :) 2001-10-24 22:50:06 +00:00
Bill Currie
133ce647fb implement break and continue. only loops covered for now, but that's because
switch isn't implemented yet
2001-10-24 18:57:29 +00:00
Bill Currie
79ac85b54f type checking now works much better and there is now a NIL builtin constant
which can be assigned (/only/) to anything.
2001-10-17 07:45:37 +00:00
Bill Currie
7407e4f1b7 and some more 2001-09-28 07:09:38 +00:00
Bill Currie
8d29efe552 remove a debug print 2001-08-21 17:22:55 +00:00
Bill Currie
cf4ca286f0 implement pre and post increment operators (++ and --) 2001-08-20 06:22:28 +00:00
Bill Currie
c2d3d8f3ab temp def expressions and ?:
seems to work :)
2001-08-11 21:15:24 +00:00
Bill Currie
4388bf0519 good bye, old parser 2001-08-10 18:35:55 +00:00
Adam Olsen
6414897dae got a few new operators for qc :)
<< >> % which all act like their C counterparts
+= -= *= /= &= ^= |= <<= >>= %= which just expand into the obvious,
also like the C versions.
2001-08-10 16:17:00 +00:00
Bill Currie
081d8f3c47 ^ and ~ operators for qc (^ from Rhamphoryncus) and clean up the punctuation
line in qc-lex.l (why didn't I think to do that in the first place?!?)
2001-08-09 16:34:46 +00:00
Bill Currie
b341529fce more --id support 2001-08-07 16:50:22 +00:00
Adam Olsen
c218ede288 Add support for checkfunction, which is a builtin that searches for
another builtin by name, and returns it.

Soon I'll change all our new builtins to by allocated dynamically, as
well as changing the number checkfunction uses, and happily break
everything that uses them :D
2001-08-04 09:11:50 +00:00
Bill Currie
c248372e20 Initial integer type support. qfcc /is/ partially broken when it comes to
integer constants and float function args/return values.

pr_comp.h:
	o  add the integer opcodes to pr_opcode_e
pr_edict.c:
	o  add "quaternion" and "integer" to type_name[]
	o  support quatnernion and integers types when printing values
	o  support the integer opcodes when bounds checking
pr_exec.c
	o  enable the integer opcodes
pr_opcode:
	o  add the integer opcodes to the opcode table
	o  logical operators all result in an integer rather than a value
expr.h:
	o  rename int_val to integer_val
qfcc.h:
	o  kill another magic number
expr.c:
	o  move the opcode to string conversion out of type_mismatch and into
	   get_op_string
	o  rename int_val to integer_val
	o  general integer type support.
	o  generate an internal comipiler error for null opcodes rather than
	   segging.
pr_imm.c:
	o  rename int_val to integer_val
	o  support integer constants, converting to float when needed.
pr_lex.c:
	o  magic number death and support quaternions and integers in type_size[]
qc-lex.l
	o  rename int_val to integer_val
	o  support quaternion and integer type keywords
qc-parse.y:
	o  rename int_val to integer_val
	o  use binary_expr instead of new_binary_expr for local initialized
	   variables
builtins.c:
	o  rename int_val to integer_val
	o  fix most (all?) of the INT related FIXMEs
defs.qc:
	o  use integer instead of float where it makes sense
main.c:
	o  read_result is now integer rather than float
main.qc:
	o  float -> integer where appropriate
	o  new test for int const to float arg
2001-07-23 01:31:22 +00:00
Bill Currie
6dfee9968b /much/ better error handling 2001-06-28 21:26:40 +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
1fd4590212 report file as well 2001-06-27 18:15:24 +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
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
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
Bill Currie
89fecd7cee slowly getting there with defs processing. still borked 2001-06-18 22:51:49 +00:00
Bill Currie
eeaab95be5 beginnings of expression and def handling. 2001-06-15 19:38:43 +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
489ddbc7a7 getting closer. soon timie to start putting real code in there 2001-06-12 21:06:28 +00:00