MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
no of sections in a lex program are
A
1
B
2
C
3
D
4
Explanation: 

Detailed explanation-1: -A lex program consists of three sections: a section containing definitions, a section containing translations, and a section containing functions.

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

Detailed explanation-3: -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-4: -lex Specification File The input file can contain three sections: definitions, rules, and user subroutines. Each section must be separated from the others by a line containing only the delimiter, %% (double percent signs).

Detailed explanation-5: -The Structure of LEX: It is also possible to write any C code here, which will be copied verbatim into the generated source file. It is bracketed with % and %. The Rules section is the most important section; Each rule is made up of two parts: a pattern and an action separated by whitespace.

There is 1 question to complete.