itoooak / tinycc Goto Github PK
View Code? Open in Web Editor NEWtiny C compiler written in C
tiny C compiler written in C
Node
にToken
もしくはToken
のstr
を持たせる
655f89f の時点で確認
例
$ ./tinycc "itn main() {return 0;}"
で実行すると下の画像のようになる
本来^
が出てほしい位置から右に1文字分ずれている
スタックと同じ方向に変数を配置していくと、配列を実装する際にインデックスとアドレスが増えていく向きが逆向きになってしまう気がする
引数に非負整数と文字列orトークンの種類を取り、ブール値を返す関数を作る
0つ先のトークンを読む操作は、comsumeせずに現在のトークンを調べるという動作にする
複数の段階にまたがって利用される情報は、特定の段階に依存させずに持っておくほうが混乱が少ないように思える
現在グローバル変数として扱われているものをそのファイルの管理下に置くなど
現在は変数が関数単位で管理されているが、ブロック単位で管理されるようにする
return1 = 1; if (0) 1; return1;
を入力としたときに実行結果が不定になってしまう
現状でepilogueのコード生成がgen_funcdef
とgen
(ND_RETURN
のケース)の2か所で行われているが、これを1か所にまとめた方がよい
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.