Commit graph

497 commits

Author SHA1 Message Date
Wolfgang (Blub) Bumiller
b966cd4f4d More ternary fixes 2012-12-01 00:50:04 +01:00
Wolfgang (Blub) Bumiller
43c0343755 Offsetting builtins so we can use 'if builtin!=0' as condition but also allow a '#0' builtin 2012-12-01 00:36:24 +01:00
Wolfgang (Blub) Bumiller
75ab0e6663 and 'const' is a keyword, not an ident 2012-12-01 00:33:07 +01:00
Wolfgang (Blub) Bumiller
ac9d68387c var const / const var - both need to be allowed 2012-12-01 00:32:18 +01:00
Wolfgang (Blub) Bumiller
d52879315d some SYA fix; adding optional variable parsing to the head of a switch block 2012-12-01 00:31:00 +01:00
Wolfgang (Blub) Bumiller
8d014cc6eb changing parse_statement_or_block to return a bool and put the output block into a pointer, so that NULL can still be possible 2012-11-30 21:31:19 +01:00
Wolfgang (Blub) Bumiller
cda62cef20 apparently #0 is a valid builtin number, used for some NULL funcs 2012-11-30 21:25:18 +01:00
Wolfgang (Blub) Bumiller
2a3e7c1cff field constants - revert globals generated after fields 2012-11-30 21:11:25 +01:00
Wolfgang (Blub) Bumiller
316298650e remember if an ast_value is a field-declaration, build fields before globals 2012-11-30 21:03:57 +01:00
Wolfgang (Blub) Bumiller
f587e9cfb3 remove array-field without parens warning since it seems to not be broken in fteqcc anymore 2012-11-30 14:47:55 +01:00
Wolfgang (Blub) Bumiller
535fd5744b lex_ctx of a return will be at the return keyword now 2012-11-30 14:42:18 +01:00
Wolfgang (Blub) Bumiller
207293bf74 revert 1 of the error messages 2012-11-30 14:37:54 +01:00
Wolfgang (Blub) Bumiller
321a1fe0d6 Keep track of the beginning of a block 2012-11-30 14:37:23 +01:00
Wolfgang (Blub) Bumiller
eec61af381 mark vectors as used when their members are used 2012-11-30 14:30:25 +01:00
Wolfgang (Blub) Bumiller
600ecda860 Set the full const/var qualifier; only generate warnings about unimplemented functions if they have no qualifier at all 2012-11-30 14:05:25 +01:00
Wolfgang (Blub) Bumiller
5e23e8296d don't just store a 'bool constant' in the ast/ir, store the complete qualifier: 'int cvq', moved CV_ defines into gmqcc.h 2012-11-30 13:47:28 +01:00
Wolfgang (Blub) Bumiller
8e043c8447 Remove the 'warnreturn' parameter in some parser functions 2012-11-30 12:37:46 +01:00
Wolfgang (Blub) Bumiller
a58061464e actually removing -Wmissing-return-values from parser.c and enabling the ast code for it 2012-11-30 12:11:36 +01:00
Wolfgang (Blub) Bumiller
08551eefba Fix a small typo 2012-11-26 14:05:31 +01:00
Dale Weiler
77272da718 opval is asserted .. need (void) to hide warning when NDEBUG 2012-11-26 02:12:50 +00:00
Wolfgang (Blub) Bumiller
ec2ff09eff operator &~= must not cause the generated binstore to free the destination twice 2012-11-26 00:15:07 +01:00
Wolfgang (Blub) Bumiller
0af62801f4 Don't add redeclared globals a second time 2012-11-25 23:35:31 +01:00
Wolfgang (Blub) Bumiller
38df8b5e40 Another case for -fassign-function-types 2012-11-25 23:28:47 +01:00
Wolfgang (Blub) Bumiller
0d3896ca54 introducing -fassign-function-types, previously guarded by std==qcc this is now the flag to cause a warning (-Wassign-function-types) instead of an error when assigning functions of wrong types 2012-11-25 23:27:48 +01:00
Wolfgang (Blub) Bumiller
2f5a26a4de __builtin_debug_printtype directive... helped me down tracking a bug: parsing typedeffed types in parameter lists properly now 2012-11-25 22:57:11 +01:00
Wolfgang (Blub) Bumiller
08ef8bd045 Only check the ast-type of a switch case, not if it's an ACTUAL constant, fteqcc doesn't either... grrr 2012-11-25 22:40:35 +01:00
Wolfgang (Blub) Bumiller
10f49a38ca actually handle unary plus... 2012-11-25 22:38:52 +01:00
Wolfgang (Blub) Bumiller
42bd37a2e8 Ah right, 'var' is not an actual keyword, support TOKEN_IDENT-var inside functions 2012-11-25 22:26:28 +01:00
Wolfgang (Blub) Bumiller
f1bbdb7d45 Use the correct default cv-qualifier on locals 2012-11-25 22:16:08 +01:00
Wolfgang (Blub) Bumiller
c62e0a93eb Allow 'var' in functions... even there initialized locals seem to be constant by default... laaaaaaaame 2012-11-25 22:15:08 +01:00
Wolfgang (Blub) Bumiller
797ceb9e04 handling TOKEN_CHARCONST - -Wmultibyte-character 2012-11-25 22:11:21 +01:00
Wolfgang (Blub) Bumiller
e2602e6b87 Filling up remaining gotos at the end of a function for when the label is defined after the goto; erroring for missing labels 2012-11-25 21:56:38 +01:00
Wolfgang (Blub) Bumiller
24f9b63475 parsing goto 2012-11-25 21:53:14 +01:00
Wolfgang (Blub) Bumiller
474d8bd6f0 ast_label, and labels later used for goto 2012-11-25 21:27:14 +01:00
Wolfgang (Blub) Bumiller
336d91494f temporarily disable the 'constant' flag when parsing the initializer to avoid the 'assigning to constant' error in a block-local constant 2012-11-25 21:10:43 +01:00
Wolfgang (Blub) Bumiller
22173df7bd Allow 'const' within function bodies 2012-11-25 21:08:30 +01:00
Wolfgang (Blub) Bumiller
3424b7227b Set the output to NULL always before parsing stuff 2012-11-25 20:48:06 +01:00
Wolfgang (Blub) Bumiller
4513fc4d0b fix wrong parameter order in parse_variable calls, dammit I hate how 'bool' and 'int' are implicitly convertible here 2012-11-25 20:29:12 +01:00
Wolfgang (Blub) Bumiller
1b72cb264a more on CV_CONST/CV_VAR, initializers to check 'constant' not just 'hasvalue' 2012-11-25 20:25:39 +01:00
Wolfgang (Blub) Bumiller
6cd432a909 const/variable qualifier flag for parse_variable 2012-11-25 20:22:47 +01:00
Wolfgang (Blub) Bumiller
779c974511 Allow dangling semicolons for now 2012-11-25 20:18:40 +01:00
Wolfgang (Blub) Bumiller
f2887f1208 a '(void)' parameter list does not mean 1 parameter of type void, but empty... xonotic needs this 2012-11-25 19:44:21 +01:00
Wolfgang (Blub) Bumiller
b59401db1b fixed: -frelaxed-switch check was in the wrong position 2012-11-25 19:42:16 +01:00
Wolfgang (Blub) Bumiller
353b1f945f assignment to constant error 2012-11-25 19:37:31 +01:00
Wolfgang (Blub) Bumiller
39f572fe99 constant flag, -finitialized-nonconstants to turn initialized globals into mutable variables 2012-11-25 19:35:00 +01:00
Wolfgang (Blub) Bumiller
6e400ca81f ast: isconst->hasvalue, const keyword will set the const flag 2012-11-25 19:30:10 +01:00
Wolfgang (Blub) Bumiller
55aa53beca Parse the 'not' keyword in if as TOKEN_IDENT 2012-11-25 19:20:00 +01:00
Wolfgang (Blub) Bumiller
ca033e5acd Some side-effect propagation for better warnings, so that comma-operators with assignments in them don't cause the -Weffectless-statement warning, and fixing ternary precedence for fte operator list 2012-11-25 19:19:36 +01:00
Wolfgang (Blub) Bumiller
63d89f9f5a Allow regular AND used on non-float types 2012-11-25 18:56:22 +01:00
Wolfgang (Blub) Bumiller
2c0a9d78df Guard translatable strings by -ftranslatable-strings, defaults to ON with -std=fteqcc 2012-11-25 18:25:01 +01:00
Wolfgang (Blub) Bumiller
66317aaef9 update noops flag while parsing a translatable string 2012-11-25 18:23:48 +01:00
Wolfgang (Blub) Bumiller
7838e772de Translatable string constants 2012-11-25 18:22:00 +01:00
Wolfgang (Blub) Bumiller
0df394dcbc parser_const_string can now create a translatable string 2012-11-25 18:17:08 +01:00
Wolfgang (Blub) Bumiller
e22af32805 Fix parsing of multi-dot field types 2012-11-25 17:43:13 +01:00
Wolfgang (Blub) Bumiller
2884556fe3 multiple dots to start a field type, ie ..float for a fieldpointer field 2012-11-25 17:37:54 +01:00
Wolfgang (Blub) Bumiller
b5d6f454a4 moving cleanvar=false out of a condition 2012-11-25 16:20:22 +01:00
Wolfgang (Blub) Bumiller
2da37129d7 a more verbose error 2012-11-25 15:58:10 +01:00
Wolfgang (Blub) Bumiller
4b619ce1cd -Wconst-var 2012-11-25 15:56:13 +01:00
Wolfgang (Blub) Bumiller
f6a374c1d5 free the _locals vector 2012-11-25 15:31:26 +01:00
Wolfgang (Blub) Bumiller
3c0c002e2f Fix a missing uninitialized value which caused typedefs within functions to cause a segfault 2012-11-25 15:30:31 +01:00
Wolfgang (Blub) Bumiller
63d9e44f56 Allow typedefs to shadow defs of previous scopes 2012-11-25 15:27:22 +01:00
Wolfgang (Blub) Bumiller
b851f542ac Implementing typedef 2012-11-25 15:21:52 +01:00
Wolfgang (Blub) Bumiller
d69b576d6b Fix some uninitialized values 2012-11-25 13:55:29 +01:00
Wolfgang (Blub) Bumiller
613e1e7247 Change the parser to use the hashtable functions 2012-11-25 13:23:37 +01:00
Dale Weiler
5c0a62be96 Add respective license headers + some cleanups 2012-11-24 21:22:35 +00:00
Wolfgang (Blub) Bumiller
86f3ef2194 turn the message about global variable double-declaration into a warning instead of an error on std != gmqcc 2012-11-23 22:30:35 +01:00
Wolfgang (Blub) Bumiller
39b8b6a660 warn about double function declarations... 2012-11-23 22:22:22 +01:00
Wolfgang (Blub) Bumiller
2bc99076cf 'var' is now no keyword anymore, :\ 2012-11-23 22:07:35 +01:00
Wolfgang (Blub) Bumiller
1c7e9c5fde handling 'const' - still need correct separation of constant and just initialized later when we distinguish between them 2012-11-23 21:52:16 +01:00
Wolfgang (Blub) Bumiller
6df6906ed2 Adding an unrecognized keywords error 2012-11-23 21:41:50 +01:00
Wolfgang (Blub) Bumiller
0d33939b1b operator &~= 2012-11-23 14:39:05 +01:00
Wolfgang (Blub) Bumiller
122e80cc4d operators &= and |= 2012-11-23 14:28:11 +01:00
Wolfgang (Blub) Bumiller
553f3df5df *= and /= operators 2012-11-23 14:24:58 +01:00
Wolfgang (Blub) Bumiller
1223e04e05 correcting an error message 2012-11-23 12:28:51 +01:00
Wolfgang (Blub) Bumiller
f22f1af891 Suffix operators, and remembering the const-float-1 in parser_t 2012-11-23 12:25:13 +01:00
Wolfgang (Blub) Bumiller
4079835c7e Parsing of suffix operators, NOTE: applied like prefix operators just to get it committed in a compilable state 2012-11-23 11:57:08 +01:00
Wolfgang (Blub) Bumiller
38f5090778 Prefix ++,-- 2012-11-23 11:52:03 +01:00
Wolfgang (Blub) Bumiller
9a43eb6370 a type_name -> ast_type_to_string conversion 2012-11-23 11:45:22 +01:00
Dale Weiler
c748293ccb Use memcmp for comparing doubles 2012-11-23 06:41:06 +00:00
Dale Weiler
b5507b3127 Make it compile with -Wall and -pedantic 2012-11-23 02:23:22 +00:00
Wolfgang (Blub) Bumiller
905ca8819b unused params in parser.c 2012-11-22 21:44:09 +01:00
Wolfgang (Blub) Bumiller
dfde3a583c Remove unused macro 2012-11-22 21:10:37 +01:00
Wolfgang (Blub) Bumiller
07d5686a47 Fixing shadows in parser.c - moving generate_checksum over the static parser global 2012-11-22 20:47:46 +01:00
Wolfgang (Blub) Bumiller
6983142c4d -dump vs -dumpfin; to see the IR before and after finalizing functions 2012-11-21 21:53:38 +01:00
Wolfgang (Blub) Bumiller
9c8dc43775 error if the ternary operands aren't of the same type - except for the first one of course 2012-11-21 20:56:51 +01:00
Wolfgang (Blub) Bumiller
0787038934 check 'ternaries' count 2012-11-21 20:50:27 +01:00
Wolfgang (Blub) Bumiller
90bd91e294 Utilizing vec_last more 2012-11-21 20:44:43 +01:00
Wolfgang (Blub) Bumiller
55c2148016 operator handling for ternary 2012-11-21 20:41:26 +01:00
Wolfgang (Blub) Bumiller
11f1af78d5 Removing some obsolete messages 2012-11-21 20:40:10 +01:00
Wolfgang (Blub) Bumiller
e0ddf32d2e parsing the ternary 2012-11-21 20:36:42 +01:00
Wolfgang (Blub) Bumiller
f4043faf0b -frelaxed-switch to enable switch on non-constant cases 2012-11-19 22:27:58 +01:00
Wolfgang (Blub) Bumiller
4649c12fa9 Parsing of switches 2012-11-19 22:06:29 +01:00
Wolfgang (Blub) Bumiller
b72900214b fix a warning and remove unused variables 2012-11-19 19:44:26 +01:00
Wolfgang (Blub) Bumiller
ea75003cf4 break and continue support 2012-11-19 19:39:52 +01:00
Wolfgang (Blub) Bumiller
2d8bf20d43 moving 'return' parsing into a function 2012-11-19 19:22:00 +01:00
Wolfgang (Blub) Bumiller
f023004a67 Make functions copy their extparams 2012-11-18 20:06:28 +01:00
Wolfgang (Blub) Bumiller
e8d1e5dbc0 Make the >8 parameter message a warning 2012-11-18 19:19:38 +01:00
Wolfgang (Blub) Bumiller
0330b082a2 The ftepp now always outputs into a string buffer, with -E the buffer will be dumped to stdout or the via -o specified file, without -E it'll be passed to the parser to be compiled 2012-11-18 13:33:53 +01:00
Wolfgang (Blub) Bumiller
f0d56d07fe Merge branch 'master' into ftepp 2012-11-18 13:06:29 +01:00
Wolfgang (Blub) Bumiller
cec58b53e4 Collect accessor functions in the parser so they can later be deleted, fixed that leak 2012-11-18 13:06:16 +01:00
Wolfgang (Blub) Bumiller
f47a20aa53 Removing some code duplication 2012-11-18 13:00:18 +01:00
Wolfgang (Blub) Bumiller
2b65ea599f Some printf/con_out/con_err conversions, guarded some outputs with not-opts_pp_only so the -E switch can print to stdout normally 2012-11-18 11:43:46 +01:00
Wolfgang (Blub) Bumiller
906f319673 Replaced it all... 2012-11-15 18:32:09 +01:00
Dale Weiler
2e84cc0b41 Use new console system everywhere. 2012-11-15 00:28:46 +00:00
Wolfgang (Blub) Bumiller
84088cb5f0 Merging in new-syntax 2012-11-14 21:39:16 +01:00
Dale Weiler
f0750209b7 preliminary segregated console subsystem 2012-11-14 19:17:43 +00:00
Wolfgang (Blub) Bumiller
f3ebbf598f if not() support 2012-11-13 18:55:55 +01:00
Wolfgang (Blub) Bumiller
e7d558dbd8 if not() support 2012-11-13 18:54:25 +01:00
Wolfgang (Blub) Bumiller
51ba2c49d6 improve the warning 2012-11-13 14:46:14 +01:00
Wolfgang (Blub) Bumiller
b1175eabfc Warn (via -Wextensions) when accessing a field-of-array's element without putting the indexed field name in parenthesis 2012-11-13 14:43:20 +01:00
Wolfgang (Blub) Bumiller
b0326c66ed when finishing an array-indexing operation the parser now calls rotate_entfield_array_index_nodes to fixup 'ent.foo[n]' to become 'ent.(foo[n])' 2012-11-13 00:39:39 +01:00
Wolfgang (Blub) Bumiller
d60a76abd1 allowing inexing of array-fields 2012-11-12 23:35:47 +01:00
Wolfgang (Blub) Bumiller
dbdcdb059e array-field setter needs to use STOREP* 2012-11-12 23:05:44 +01:00
Wolfgang (Blub) Bumiller
0340a6a6e7 support for ast_entfield nodes with specific output types, fixing array-field instantiating code to print the correct name on error 2012-11-12 22:39:43 +01:00
Wolfgang (Blub) Bumiller
89d86420ad entity-array-field-setter generation 2012-11-12 22:31:54 +01:00
Wolfgang (Blub) Bumiller
3579e495be code to instantiate field-array accessors 2012-11-12 22:24:11 +01:00
Wolfgang (Blub) Bumiller
0de1ebbc21 Preparing to generate accessors for field arrays 2012-11-12 22:16:18 +01:00
Wolfgang (Blub) Bumiller
f026ca2fc5 more factorizing and shortening of code 2012-11-12 21:12:25 +01:00
Wolfgang (Blub) Bumiller
c18c89cd62 shorten some code 2012-11-12 20:51:12 +01:00
Wolfgang (Blub) Bumiller
83438d9833 call ir_function_finalize on array accessors otherwise they'll blow up stuff 2012-11-11 23:46:03 +01:00
Wolfgang (Blub) Bumiller
511058c018 handling of op-[ 2012-11-11 18:54:08 +01:00
Wolfgang (Blub) Bumiller
d5b95f0412 Handling [ in the SYA 2012-11-11 18:45:43 +01:00
Wolfgang (Blub) Bumiller
2994d308a0 array index opening-paren can now return TOKEN_OPERATOR, partially handled in SYA 2012-11-11 16:43:16 +01:00
Wolfgang (Blub) Bumiller
533f9f2cfc SY_PAREN_ constants to replace magic numbers 2012-11-11 16:36:20 +01:00
Wolfgang (Blub) Bumiller
1ab303c528 Store accessors in the ast_value for access from within the ast - generate accessors after generating all the globals to not mess up the order of globals in the output 2012-11-11 16:22:09 +01:00
Wolfgang (Blub) Bumiller
7d9568f806 array accessor function genaration 2012-11-11 16:06:27 +01:00
Wolfgang (Blub) Bumiller
9324a96f77 properly in all situations where an array is part of a function's return type 2012-11-11 14:17:48 +01:00
Wolfgang (Blub) Bumiller
86e42ad123 Don't allow arrays and other unsupported parameter types to be used in parameter lists 2012-11-11 14:08:02 +01:00
Wolfgang (Blub) Bumiller
df77e062dc Starting to add error messages for when using array types in expressions 2012-11-11 12:32:47 +01:00
Wolfgang (Blub) Bumiller
fb264b90b9 need to use ast_unref rather than ast_delete on the parsed array-size otherwise we end up deleting constants 2012-11-11 12:13:34 +01:00
Wolfgang (Blub) Bumiller
cf1ea01de3 parser_compile_file vs parser_compile_string 2012-11-11 10:33:29 +01:00
Wolfgang (Blub) Bumiller
00a28e48ee parse arrays 2012-11-11 10:13:01 +01:00
Wolfgang (Blub) Bumiller
2cb15e8c2d first parsing of [ - pushing temp changes 2012-11-11 10:13:01 +01:00
Wolfgang (Blub) Bumiller
1869440fd9 Preparing to parse arrays: adding TYPE_ARRAY and union/struct TYPE_ constants to be consistent with fteqcc, filled type-arrays with their data, attempting to parse an array variable and added some error messages to the IR in case of unhandled types 2012-11-11 10:13:01 +01:00
Wolfgang (Blub) Bumiller
c87b056fdc Support non-const initialized locals 2012-11-11 10:13:01 +01:00
Wolfgang (Blub) Bumiller
8687aa9a3e Shouldn't require a 'local' keyword for local fieldpointers 2012-11-11 10:13:01 +01:00
Wolfgang (Blub) Bumiller
a27750966f globals of type .vector will now properly generate 3 globals 2012-11-11 10:13:00 +01:00
Wolfgang (Blub) Bumiller
52daf02444 Support in the AST for TYPE_FIELD globals which are no actual fields 2012-11-11 10:13:00 +01:00
Wolfgang (Blub) Bumiller
fe05d5afd9 added 'var' to the keywords when not in -std=qcc, supporting 'var .float x;' in global-scope to declare a field-pointer variable without creating a field of that name 2012-11-11 10:13:00 +01:00
Wolfgang (Blub) Bumiller
76b21ad192 -std=qcc now errors on C-style function syntax 2012-11-11 10:13:00 +01:00
Wolfgang (Blub) Bumiller
0bb90f284e -std=qcc should error when the '=' is missing in a function declaration before the body 2012-11-11 10:13:00 +01:00
Wolfgang (Blub) Bumiller
0fc3a0c517 Removing old commented-out parsing code 2012-11-11 10:13:00 +01:00
Wolfgang (Blub) Bumiller
016257c44e Making the = in front of function bodies optional 2012-11-11 10:13:00 +01:00
Wolfgang (Blub) Bumiller
7f4047381e new-style syntax 2012-11-11 10:13:00 +01:00
Wolfgang (Blub) Bumiller
e87fd30c48 Enable 'local-already-declared' check for locals even when they are functions - this was previously simply in the wrong 'if' 2012-11-11 10:13:00 +01:00
Wolfgang (Blub) Bumiller
8e30d7cb86 fixing a stupid typo - why doesn't any compiler warn about this crap 2012-11-11 10:12:45 +01:00
Wolfgang (Blub) Bumiller
9141217481 Merged parsing of variable and field declarations into 1 function 2012-11-09 19:10:27 +01:00
Wolfgang (Blub) Bumiller
e143db0cae gcc lost it's magic analyzer and now complains about uninitialized stuff... <sadface> 2012-11-04 11:41:44 +01:00
Wolfgang (Blub) Bumiller
5ff0013357 error on more than 8 params for now since more need special treatment 2012-11-02 22:51:26 +01:00
Wolfgang (Blub) Bumiller
2fa544f681 Error when trying to assign variables whose types are different - with -std=qcc only warn when they are both functions with non-matching parameter types 2012-10-28 20:32:13 +01:00
Wolfgang (Blub) Bumiller
cd8043fc18 a failing 'parse-statement' call should not print 'parse error' at all since at that point more descriptive error message has to have been printed already 2012-10-28 15:53:30 +01:00
Wolfgang (Blub) Bumiller
634a544dca The proper way to deal with error messages which did not cause the parser to bail out early is this, not a 'parse error'-error... 2012-10-28 15:48:51 +01:00
Wolfgang (Blub) Bumiller
478a9249a0 add error for function parameters of invalid types 2012-10-28 15:44:27 +01:00
Wolfgang (Blub) Bumiller
201bfb9803 When erroring while parsing a function and the function had been added to the parser's function list, remove it, otherwise it'll get freed again in the parser's cleanup function 2012-10-28 15:28:39 +01:00
Wolfgang (Blub) Bumiller
5dd8e23dfd Cleaner crc implementation 2012-10-02 17:51:03 +02:00
Wolfgang (Blub) Bumiller
354dd94b95 Generating checksums 2012-10-02 17:09:49 +02:00
Wolfgang (Blub) Bumiller
9d70c3a56e Print a warning if end_sys_fields was declared as a field rather than a global 2012-10-02 15:59:37 +02:00
Wolfgang (Blub) Bumiller
4742ee9123 don't warn about unused end_sys_{globals,fields} 2012-10-02 15:35:43 +02:00
Wolfgang (Blub) Bumiller
ab91dea4e0 the lexer now doesn't _allocate_ the token structure, also: the vector holding the token doesn't shrink so we have much fewer reallocations 2012-08-24 17:37:55 +02:00
Wolfgang (Blub) Bumiller
20b8a191b1 parse_variable refactored, moved out the parsing of function bodies, easier memory handling 2012-08-24 17:23:47 +02:00
Wolfgang (Blub) Bumiller
e1155eebc2 renaming some parser functions, mainly shortining things: parse_type just looks much better than parser_parse_type... 2012-08-24 15:34:48 +02:00
Wolfgang (Blub) Bumiller
50e76a56c5 Adding static keyword to some more parser functions 2012-08-24 15:27:41 +02:00
Wolfgang (Blub) Bumiller
02512f21f2 create_vector_members sanitized 2012-08-24 15:09:51 +02:00
Wolfgang (Blub) Bumiller
41d1ef37d2 use the expression's linenumber for the 'statement has no effect' warning rather than the current one because that one's usually the line below... 2012-08-23 20:56:05 +02:00
Wolfgang (Blub) Bumiller
cb604603ca -Weffectless-statement now also triggers on effectless incrementors in for-loops, if an incrementor was specified 2012-08-23 20:54:24 +02:00
Wolfgang (Blub) Bumiller
45388202c4 -Weffectless-statement, on by default, creates 'statement has no effect' warning 2012-08-23 20:52:09 +02:00
Wolfgang (Blub) Bumiller
dff6328c9e add 'X has been declared here:' too the too-few/many-parameters warning/error 2012-08-23 20:48:51 +02:00
Wolfgang (Blub) Bumiller
8adbf07555 Warn about unused globals too, not about functions or constants though 2012-08-23 20:32:33 +02:00
Wolfgang (Blub) Bumiller
c84830bdee Warna bout unused variables - -Wunused-variable, on by default 2012-08-23 20:25:54 +02:00
Wolfgang (Blub) Bumiller
5022f716dc fix: check if parsing a variable initializer failed 2012-08-23 13:30:30 +02:00
Wolfgang (Blub) Bumiller
412446f42e -std=qcc now warns about variadic functions via -Wextensions 2012-08-23 11:33:50 +02:00
Wolfgang (Blub) Bumiller
f22112bcb8 Variadic functions: works for builtins, warns for implemenetd functions, -Wvariadic-function, on by default 2012-08-23 11:29:48 +02:00
Wolfgang (Blub) Bumiller
d4077f6884 Have the parser generate immediates AFTER generating the globals for correct def layout 2012-08-22 14:20:28 +02:00
Wolfgang (Blub) Bumiller
330a801ae9 Pop off all the locals after a function 2012-08-22 12:59:52 +02:00
Wolfgang (Blub) Bumiller
19b66800ae TYPE_FUNCTION values which are not constant are now allowed to be generated, they are function pointers. 2012-08-21 16:01:28 +02:00
Wolfgang (Blub) Bumiller
22896e5ef6 at last, the annoying missing ast_delete(typevar) 2012-08-21 11:21:05 +02:00
Wolfgang (Blub) Bumiller
d7f43dfa4d some more error situations where typevar wouldn't get freed 2012-08-21 11:18:40 +02:00
Wolfgang (Blub) Bumiller
8fcc528ffa new warning: -Wlocal-constants 2012-08-21 10:18:55 +02:00
Wolfgang (Blub) Bumiller
92e8f08df3 don't _move_ values out of immediates, it causes NULL strings to be code-generated 2012-08-21 10:08:17 +02:00
Wolfgang (Blub) Bumiller
02cc86db25 Since function prototypes now don't cause the function to become a constant, we cannot check for a constant in [frame,think] notations anymore 2012-08-20 18:27:27 +02:00
Wolfgang (Blub) Bumiller
0d64e555e2 Better handling of EOF - encountering EOF in parser_next will not return false yet, this is a more elegant way... 2012-08-20 18:15:31 +02:00
Wolfgang (Blub) Bumiller
5a0995c767 better handlign of a too early error condition 2012-08-20 18:14:02 +02:00
Wolfgang (Blub) Bumiller
198e35a823 Fix correction of parsiong of multiple variables: parse past the comma 2012-08-20 18:10:06 +02:00
Wolfgang (Blub) Bumiller
99bab76006 Creating the ast_function for a function only when encountering its body, so if no body is specified it works like a function pointer - just like QC wants it 2012-08-20 18:09:41 +02:00
Wolfgang (Blub) Bumiller
20448b93dc Corrected parsing of declarations of multiple variables 2012-08-20 17:59:19 +02:00
Wolfgang (Blub) Bumiller
f0f9680774 add the backticks for a warning 2012-08-19 20:41:31 +02:00
Wolfgang (Blub) Bumiller
af3d9e0bdf ir_value_set_string needs to use a strdup which doesn't return NULL for an emptystring 2012-08-19 20:35:51 +02:00
Wolfgang (Blub) Bumiller
c12e60a510 take 'warnreturn' into account, don't ignore the parsewarnin's Werror status 2012-08-19 20:32:07 +02:00
Wolfgang (Blub) Bumiller
7ef248aadb set -Wmissing-return-values to on by default, new warning: control reaches end of non-void... 2012-08-19 20:26:54 +02:00
Wolfgang (Blub) Bumiller
66ec592f94 parse_block gets a warn-return bool flag 2012-08-19 20:20:39 +02:00
Wolfgang (Blub) Bumiller
adda894976 have function declarations of functions with prototypes take over the actual declaration's body's context data 2012-08-19 19:39:58 +02:00
Wolfgang (Blub) Bumiller
481baeeedc relax parse_close_paren to allow values in parenthesis with no operators... duh 2012-08-19 19:35:45 +02:00
Wolfgang (Blub) Bumiller
a93ed6ae80 fix: use thinkfunc not nextthink, nextthink is set later 2012-08-19 19:25:37 +02:00
Wolfgang (Blub) Bumiller
bd64d7d7b4 Automatic prototyping of frame-functions 2012-08-19 19:24:43 +02:00
Wolfgang (Blub) Bumiller
dae13e87de First draft of handling the [frame,think] notation 2012-08-19 16:13:29 +02:00
Wolfgang (Blub) Bumiller
92d40e0925 Factoring out duplicate code into a function: create_vector_members; creating vector members for vector function parameters 2012-08-19 14:34:23 +02:00
Wolfgang (Blub) Bumiller
78d04a8352 implement correct behaviour for shadows locals 2012-08-18 21:56:42 +02:00
Wolfgang (Blub) Bumiller
ee3aaa58b3 -Wlocal-shadows - note that -std=gmqcc is very different from the rest 2012-08-18 21:54:19 +02:00
Wolfgang (Blub) Bumiller
deccf4e708 splitting parser_find_local up into find_local and find_param - find_local also takes a bool-ptr to tell the caller if it was a local or a global 2012-08-18 21:42:52 +02:00
Wolfgang (Blub) Bumiller
28891c5a37 quotes around the variable name in some messages 2012-08-18 21:35:47 +02:00