Compiler Design 1marks
Compiler Design 1marks
---------(c) Lexemes:
Lexemes are the smallest units of meaning in the source code, such as keywords,
operators, identifiers, or literals, which are matched by the rules defined in the
lexical analyzer.
css
Copy code
A → αβ | αγ
is rewritten as:
css
Copy code
A → αA'
A' → β | γ
They allow easier rearrangement of instructions during optimization since they use
explicit names for temporary results.
Triples use index-based referencing, which complicates code optimization and
reordering.
Example:
Original code:
css
Copy code
a = b + c;
d = b + c;
Optimized code:
makefile
Copy code
t = b + c;
a = t;
d = t;