Commit Graph

316 Commits

Author SHA1 Message Date
Rui Ueyama f5d480f139 Add "for" statement 2020-10-07 20:13:25 +09:00
Rui Ueyama 72b841508f Add "if" statement 2020-10-07 20:13:19 +09:00
Rui Ueyama ff8912c68e Add null statement 2020-10-07 20:13:00 +09:00
Rui Ueyama 18ac283a5d Add { ... } 2020-10-07 20:13:00 +09:00
Rui Ueyama 6cc1c1f064 Add "return" statement 2020-10-07 20:12:57 +09:00
Rui Ueyama 482c26b536 Support multi-letter local variables 2020-10-07 20:12:19 +09:00
Rui Ueyama 1f9f3adf32 Support single-letter local variables 2020-10-07 20:11:48 +09:00
Rui Ueyama 76cae0ad05 Accept multiple statements separated by semicolons 2020-10-07 20:11:22 +09:00
Rui Ueyama 725badfb49 Split main.c into multiple small files 2020-10-07 20:11:16 +09:00
Rui Ueyama 25b4b85b88 Add ==, !=, <= and >= operators 2020-10-07 20:10:14 +09:00
Rui Ueyama bf9ab52860 Add unary plus and minus 2020-10-07 13:17:05 +09:00
Rui Ueyama 84cfcaf98f Add *, / and () 2020-10-07 13:17:05 +09:00
Rui Ueyama cc5a6d9781 Improve error message
Now, chibicc can print out an error message with an error location
like this:

  $ ./chibicc 1+foo
  1+foo
    ^ expected a number
2020-10-07 13:17:05 +09:00
Rui Ueyama a1ab0ff26f Add a tokenizer to allow space characters between tokens 2020-10-07 13:17:04 +09:00
Rui Ueyama bf7081fba7 Add + and - operators 2020-09-13 21:36:37 +09:00
Rui Ueyama 0522e2d77e Compile an integer to an exectuable that exits with the given number 2020-09-13 21:36:28 +09:00