MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In LEX, rule section starts and ends with ____
A
%%
B
{%
C
%}
D
##
Explanation: 

Detailed explanation-1: -The mandatory rules section opens with the delimiter %%. If a routines section follows, another %% delimiter ends the rules section. The %% delimiters must be entered at the beginning of a line, that is, without leading blanks.

Detailed explanation-2: -A lex program consists of three sections: a section containing definitions, a section containing translations, and a section containing functions. The style of this layout is similar to that of yacc.

Detailed explanation-3: -BEGIN 0; resets the lex program to its initial condition. In start state one in the preceding example, both abc and def can be matched. In start state two, only ghi can be matched.

Detailed explanation-4: -The definitions section is where you usually place C definitions of objects accessed by actions in the rules section or by routines with external linkage.

Detailed explanation-5: -A lex program consists of three parts: the definition section, the rules section, and the user subroutines.

There is 1 question to complete.