ENع
الدرس S5 · Special topics

Inside a compiler

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

Open up a real, tiny compiler and watch one expression, x + 2 * 3, change shape at every stage. A lexer cuts it into tokens, a recursive-descent parser builds an abstract syntax tree, a type checker marks every node int, and the tree is flattened into intermediate code. The optimiser folds 2 * 3 into 6 before the program ever runs, and the code generator writes three instructions for a stack machine, which runs them to get 10. Finally, see why compilers such as LLVM split into a front end and a back end.

14 دقيقة10 خطوات5 أسئلةAdvanced
شكل S5 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.