Commit Graph

56 Commits

Author SHA1 Message Date
Rui Ueyama 5e5d76ff55 Implement linear scan register allocator. 2018-09-01 06:01:03 +00:00
Rui Ueyama 0208ac2968 Add switch-case. 2018-08-28 22:45:49 +00:00
Rui Ueyama c56da1c14d Accept a bool variable in an expression. 2018-08-27 21:42:50 +00:00
Rui Ueyama 8ea3be478c Add _Bool type. 2018-08-27 13:50:42 +00:00
Rui Ueyama 717a820a15 Fix statement expression.
I didn't understand the spec of the statement expression, which is
a GNU extension to C. As a result I misimplemented it. Now it should
behave the same way as gcc.
2018-08-27 08:56:06 +00:00
Rui Ueyama 27aa9d9fe8 Support hexadecimal-escape-sequence. 2018-08-27 00:10:17 +00:00
Rui Ueyama 0c3ab68861 Support octal-escaped-sequence in a string literal. 2018-08-26 23:44:10 +00:00
Rui Ueyama 0ccc4110b8 Support octal-escaped-sequence in a char literal. 2018-08-26 23:41:20 +00:00
Rui Ueyama abab7f20c5 Add "continue". 2018-08-26 04:08:32 +00:00
Rui Ueyama 0f72dbb0b8 Add typeof(). 2018-08-26 02:18:21 +00:00
Rui Ueyama f0d30b0ca8 Allow ptr - ptr. 2018-08-25 21:37:43 +00:00
Rui Ueyama 1c7ee31757 Split preprocess() into smaller functions. 2018-08-25 05:53:51 +00:00
Rui Ueyama 5ef04d2867 Implement #define but not function-like macro. 2018-08-25 05:16:31 +00:00
Rui Ueyama a382606b97 Implement "#include". 2018-08-25 04:18:46 +00:00
Rui Ueyama e188ffd586 Warn on undeclared functions. 2018-08-25 03:00:33 +00:00
Rui Ueyama 01a437d587 Array should decay into pointer when specified as a function parameter. 2018-08-25 02:25:58 +00:00
Rui Ueyama 5eb746ea74 Fix variable declaration. 2018-08-25 02:06:48 +00:00
Rui Ueyama 55ab29aa57 Fix pointer-to-array conversion. 2018-08-25 01:26:03 +00:00
Rui Ueyama b43d1f00ae Support octal numbers. 2018-08-25 00:55:38 +00:00
Rui Ueyama d860cb8f61 Support hex numbers. 2018-08-25 00:55:38 +00:00
Rui Ueyama 64cc13afc1 Allow CRLF as a newline. 2018-08-25 00:28:17 +00:00
Rui Ueyama 6041eabd3e Support line continuation. 2018-08-25 00:27:25 +00:00
Rui Ueyama 41b3ffd697 Support string literal concatenation. 2018-08-25 00:26:28 +00:00
Rui Ueyama 6070468cd8 Add "~" operator. 2018-08-24 23:28:49 +00:00
Rui Ueyama de9a409f3a Assignment should return a rhs value. 2018-08-23 23:54:52 +00:00
Rui Ueyama 10c7f20495 Add assignment-operators. 2018-08-23 23:50:54 +00:00
Rui Ueyama 66ef1b26f8 Fix ++ and -- operators on pointer type. 2018-08-22 08:43:37 +00:00
Rui Ueyama bd20c44d75 Allow empty expressions in "for", i.e. "for (;;) ...". 2018-08-22 08:43:37 +00:00
Rui Ueyama 614c02ce92 Add "break". 2018-08-22 08:43:37 +00:00
Rui Ueyama 403f7bb5a8 for-loop should introduce a new local variable scope. 2018-08-22 08:43:37 +00:00
Rui Ueyama 0d6c1ec5ba Fix string literal's size. 2018-08-22 08:43:37 +00:00
Rui Ueyama a0bc73852e Do not report an error when typedef'ing an incomplete type. 2018-08-22 08:43:36 +00:00
Rui Ueyama a406a04660 Add pre/post increment/decrement operators. 2018-08-22 08:43:36 +00:00
Rui Ueyama 2383988f60 Add unary "-" operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama d0cb9096ff Add "%" operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama f39ffaaf78 Add "<<" and ">>" operators. 2018-08-22 08:43:36 +00:00
Rui Ueyama e7c9558a5a Add "<=" and ">=" operators. 2018-08-22 08:43:36 +00:00
Rui Ueyama e71e74205c Add "&" operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama 979e04698f Add "^" operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama 635f014bd9 Add "|" operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama 4a0ef62aa9 Add "," operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama 209ab6bd37 Add ?: operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama 34adf40e7c Add "!" operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama 5da0f5a2cd Add void. 2018-08-22 08:43:36 +00:00
Rui Ueyama 6a013f41cf Add typedef. 2018-08-22 08:43:36 +00:00
Rui Ueyama dcacf05ff2 Fix postfix-expression grammar. 2018-08-22 08:43:36 +00:00
Rui Ueyama 2192294798 Handle struct tags. 2018-08-22 08:43:36 +00:00
Rui Ueyama 5f798ad7e5 Add "->" operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama 20b7a51c84 Add '.' (struct member access) operator. 2018-08-22 08:43:36 +00:00
Rui Ueyama bf717fa5e5 Add struct definition. Only sizeof() is applicable. No member access. 2018-08-22 08:43:36 +00:00