senk8 / compiler Goto Github PK
View Code? Open in Web Editor NEWC Compiler implemantation by Rust .
C Compiler implemantation by Rust .
パーサのすべての返り値をRetunにする。
現在の文法は非公開メソッドとなっており、テストができない。また、parserの設計の都合上、program()以外からのパースが困難である。今の密結合な状態を解消し、単体テストを可能人する方法を考える。
現在はブロック文も文(stmt)として扱っている。
stmtはスタックに原則として値を残すものの、ブロック文は命令列なのでブロック文の最後ではpop raxをするべきではない。しかし、現在の設計では
{
stmt (pop rax)
stmt (pop rax)
}
(pop rax)
となってしまう。これは例外にすれば対策できるがエレガレントではない。stmtとblockにわけるなど、文法や設計の変更を考える。
パーサとレキシカルアナライザなど、多くのモジュールから参照されるため。
構文解析をトレースさせる。
パターン化された処理が多いので、マクロ、関数などでまとめる
関数コールにはrspを16の倍数にする必要がある。関数を16の倍数にする方法として、
and rsp,0xfffffffffffffff0
call func
が考えられるが、スタックトップが1つ(8バイト)進んでしまうため、funcからretした以降の処理が不正になる。例えば、rspの調整前にスタックトップに10があっても、1つ進んだらスタックトップは10の次の値になってしまうだろう。これを解決する。
エラー名やエラーメッセージを改善する。
配列の要素数には�リテラルだけでなく、式も含められる。配列の要素数は抽象構文木からではわからず、実行しなければ分からない。このとき、要素数をRTに決めるべきか、CTに決めるべきか。
ブロックの返り値はreturnの指定を必須とするかどうか考える必要あり。
関数の計算値が不正であったり、呼び出しに失敗する。
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.