COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
o r more occurrence
|
|
one or more
|
|
exactly one
|
|
none
|
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: -Structure of a Lex Specification A lex program consists of three parts: the definition section, the rules section, and the user subroutines. The parts are separated by lines consisting of two percent signs. The first two parts are required, although a part may be empty.
Detailed explanation-3: -Lex specification. – Create a set of patterns. • which lex matches against the input. – When one of the patterns matches. • the lex program invokes C code.
Detailed explanation-4: -Lex file format A Lex program is separated into three sections by %% delimiters. The formal of Lex source is as follows: definitions %%