COMPILER DESIGN

LEXICAL ANALYSIS

ROLE OF THE LEXICAL ANALYZER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Consider line # 3 of program int main(). { //line 1 int i, n; //line 2fro(I=0, i<n, i++); //line 3}Identify the compiler’s response about this line while creating the object-module
A
No compilation error
B
only lexical error
C
syntactic error
D
both lexical and syntactic errors
Explanation: 

Detailed explanation-1: -To find if three lines are concurrent or not, there are two methods. Let us discuss both of them. Line 3 = a3x a 3 x + b3y b 3 y + c3z c 3 z = 0. To conclude if the above three lines are concurrent, the following condition shown below as a determinant should be evaluated to 0.

Detailed explanation-2: -Concurrent lines Three or more distinct lines are said to be concurrent, if they pass through the same point. The point of intersection of any two lines, which lie on the third line is called the point of concurrence.

Detailed explanation-3: -When two or more lines pass through a single point, in a plane, they are concurrent with each other and are called concurrent lines. A point that is common to all those lines is called the point of concurrency.

There is 1 question to complete.