Professional Documents
Culture Documents
CD - Unit - 1 IPU
CD - Unit - 1 IPU
VI SEMESTER
ETCS-302
Department of Computer Science and Engineering, BVCOE New Delhi
1
UNIT-I
Compiler Design
Cross Compiler that runs on a machine ‘A’ and produces a code for another
machine ‘B’. It is capable of creating code for a platform other than the one on
which the compiler is running.
Source-to-source Compiler or transcompiler or transpiler is a compiler
that translates source code written in one programming language into source
code of another programming language.
Step 2:
E→E+E*E
Step 3:
E → id + E * E
Step 5:
E → id + id * id
.
.
S → rXd | rZd
X → oa | ea
Z → ai
Now the parser matches all the input letters in an ordered manner. The string is
accepted.
**Here e is Epsilon
E'( )
{
if (l == '+') {
match('+');
match('i');
E'();
}
else
return ();
}
Here, we can see that there are two productions into the same
cell. Hence, this grammar is not feasible for LL(1) Parser.
IF a state (Ii) contains the final item like A → ab• which has no transitions to the
next state then the production is known as reduce production. For all terminals
X in FOLLOW (A), write the reduce entry along with their production
numbers.