Three address codes (TAC / 3AC)

While reading, I came across the terms "Intermediate Language" and "3AC".

IL, as I understand it, is the middle "step" in the process of compiling the source code. In particular, I read about bytecode (Java) and C.

The way I interpret it (correct if I'm wrong):

Source Code 1 (e.g. Lisp) -> Intermediate Language (C) -> Assembly Language -> Machine Code

Source Code 2 (e.g. Java) -> Bytecode -> Java Virtual Machine

So, based on this, I'm struggling to figure out where the Three Address Codes (TAC / 3AC) are located, and what it's used for.

+5
source share
1 answer

(TAC) - , . , , , IR. 2, 3 4 IR, .

TAC . .. , - , - TAC :

//Expresion
        a = b * c + b * d;
//3AC
        _t1 = b * c;
        _t2 = b * d;
        _t3 = _t1 + _t2;
        a = _t3;

: http://web.archive.org/web/20151010192637/http://www.dound.com/courses/cs143/handouts/17-TAC-Examples.pdf

+8

All Articles