Skip to content

Commit f0ec4db

Browse files
committed
doc: update README.md and add LICENSE
1 parent 5554f88 commit f0ec4db

File tree

2 files changed

+53
-3
lines changed

2 files changed

+53
-3
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 mopp
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+32-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
# 9mm
2-
Hobby C Compiler
2+
Hobby C (subset) Compiler
3+
`9mm` can compile itself.
34

4-
based on [低レイヤを知りたい人のためのCコンパイラ作成入門](https://www.sigbus.info/compilerbook/#%E9%9B%BB%E5%8D%93%E3%83%AC%E3%83%99%E3%83%AB%E3%81%AE%E8%A8%80%E8%AA%9E%E3%81%AE%E4%BD%9C%E6%88%90).
55

6+
## How to build/test
7+
```console
8+
> make 9mm
69

7-
# Production rule
10+
> ./9mm
11+
Usage:
12+
./9mm [--test] [--str 'your program'] [FILEPATH]
13+
14+
--test run test
15+
--str input c codes as a string
16+
17+
# test "9mm"
18+
> make test
19+
20+
# Build "9mms" which is selfhosted 9mm.
21+
> make selfhost
22+
23+
# Test it.
24+
> make test_selfhost
25+
```
26+
27+
## Production rule
828
```txt
929
program = global
1030
global = (decl_var ";")* |
@@ -47,3 +67,12 @@ ident = chars (chars | num)+
4767
chars = [a-zA-Z_]
4868
num = [0-9]+
4969
```
70+
71+
72+
# Acknowledge and Reference
73+
- [低レイヤを知りたい人のためのCコンパイラ作成入門](https://www.sigbus.info/compilerbook).
74+
75+
76+
# License
77+
The MIT License (MIT)
78+
See [LICENSE](./LICENSE)

0 commit comments

Comments
 (0)