Commit Graph

57 Commits

Author SHA1 Message Date
Rui Ueyama 11bdd08cff Add L and LL prefixes 2019-09-21 16:17:40 +09:00
Rui Ueyama 308dc70609 Allow variadic functions to be called 2019-08-25 10:06:54 +09:00
Rui Ueyama b1526d8ab7 Add do ... while 2019-08-24 16:09:46 +09:00
Rui Ueyama c5e0c1e7a8 Add &=, |= and ^= 2019-08-24 12:21:54 +09:00
Rui Ueyama ac88c3b38a Add static global variables 2019-08-24 11:22:02 +09:00
Rui Ueyama 8f296f307e Allow global variable initializer to have an addend
A global variable can be initialized with an address of other global
variable, so the following code is legal.

  int x[3];
  int &y = x;

In addition to that, an address can have an addend, so the following
code is also legal

  int x[3];
  int &y = x+2;
2019-08-20 07:27:31 +09:00
Rui Ueyama 490f01b935 Allow parentheses in initializers to be omitted 2019-08-19 06:53:50 +09:00
Rui Ueyama 5b0e79f99a Add scalar global initializer 2019-08-18 19:12:02 +09:00
Rui Ueyama 0f367201b1 Add ?: operator 2019-08-17 10:27:35 +09:00
Rui Ueyama 55d24d049b Add <<, >>, <<= and >>= 2019-08-16 13:45:24 +09:00
Rui Ueyama f3bdaefbc8 Add switch-case 2019-08-15 16:43:24 +09:00
Rui Ueyama 3ccdb2974f Add goto and labeled statement 2019-08-15 14:57:36 +09:00
Rui Ueyama 08f3970c58 Add continue statement 2019-08-15 14:04:51 +09:00
Rui Ueyama afd829689f Add break statement 2019-08-15 13:48:41 +09:00
Rui Ueyama 6f59ac376a Add a notion of an incomplete struct type 2019-08-15 11:28:03 +09:00
Rui Ueyama 6f24dbde5b Add a notion of an incomplete array type 2019-08-13 21:03:20 +09:00
Rui Ueyama 42f6075787 Add && and || operators 2019-08-13 20:10:23 +09:00
Rui Ueyama 2586416967 Add |, & and ^ operators 2019-08-13 19:54:37 +09:00
Rui Ueyama 03acdd2ed9 Add ~ operator 2019-08-13 19:41:11 +09:00
Rui Ueyama 5ec5e38289 Add ! operator 2019-08-13 19:31:04 +09:00
Rui Ueyama f78c409856 Add hexadecimal, octal and binary number literals 2019-08-13 18:39:56 +09:00
Rui Ueyama 05e907d2b8 Add +=, -=, *= and /= operators 2019-08-13 18:04:08 +09:00
Rui Ueyama 7d718c983f Add ++ and -- operators 2019-08-12 12:12:42 +09:00
Rui Ueyama 7c348c85b0 Add comma operator 2019-08-12 10:29:17 +09:00
Rui Ueyama 095bbbec20 Support file-scope functions 2019-08-11 20:40:48 +09:00
Rui Ueyama b253dbf95c Add enum 2019-08-11 19:59:27 +09:00
Rui Ueyama 64c5cf6ce0 Add type cast 2019-08-11 16:06:14 +09:00
Rui Ueyama 80dbe29163 Add _Bool type 2019-08-11 10:20:55 +09:00
Rui Ueyama 1508996b93 Add void type 2019-08-11 10:18:55 +09:00
Rui Ueyama 0ac8705115 Add a return type to a function 2019-08-11 09:53:31 +09:00
Rui Ueyama d25451dcaa Add short and long types 2019-08-09 10:29:42 +09:00
Rui Ueyama b656615a72 Align struct members correctly 2019-08-09 00:04:18 +09:00
Rui Ueyama 6ba0fc5404 Add struct 2019-08-08 22:43:58 +09:00
Rui Ueyama 64f2d0b8a7 Read code from a file instead of argv[1] 2019-08-07 08:30:06 +09:00
Rui Ueyama ca52c2c7fd Add GNU expression statement 2019-08-07 08:05:18 +09:00
Rui Ueyama 948dc8deed Add string literal 2019-08-06 20:49:57 +09:00
Rui Ueyama b6d512ee69 Add char type 2019-08-06 20:10:55 +09:00
Rui Ueyama 5e66e310ed Add global variables 2019-08-06 19:44:47 +09:00
Rui Ueyama a8ae214d16 Add one dimensional arrays 2019-08-05 23:30:35 +09:00
Rui Ueyama 91465fe4ac Add keyword "int" and make variable definition mandatory 2019-08-05 22:44:44 +09:00
Rui Ueyama a3ae40fc7f Annotate AST nodes with types to make pointer arithmetic work 2019-08-05 22:30:34 +09:00
Rui Ueyama 4ff4c3142b Add unary & and * 2019-08-05 21:12:44 +09:00
Rui Ueyama 01893a7ff1 Add a representative node to each Node to improve error messages 2019-08-05 20:53:58 +09:00
Rui Ueyama c86f637f6d Support function definition up to 6 parameters 2019-08-05 08:35:49 +09:00
Rui Ueyama 4cd0e82bf1 Support parameter-less function definition 2019-08-04 19:47:41 +09:00
Rui Ueyama ed3fc29894 Support function call with up to 6 arguments 2019-08-04 19:03:46 +09:00
Rui Ueyama 9dddc1d359 Support argument-less function calls 2019-08-04 18:25:20 +09:00
Rui Ueyama be91a3587b Add { ... } 2019-08-04 17:55:33 +09:00
Rui Ueyama 8dab60e49c Add "for" statement 2019-08-04 17:35:53 +09:00
Rui Ueyama 913319ff27 Add "while" statement 2019-08-04 17:24:03 +09:00