SYNTAX ANALYSIS
ROLE OF THE PARSER
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
1
|
|
2
|
|
3
|
|
4
|
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: -LEX is a program generator designed for lexical processing of character input/output stream. Anything from simple text search program that looks for pattern in its input-output file to a C compiler that transforms a program into optimized code. In program with structure input-output two tasks occurs over and over.
Detailed explanation-3: -A rule in a LEX program comprises of a ‘pattern’ part (specified by a regular expression) and a corresponding (semantic) ‘action’ part (a sequence of C statements). In the above example, “integer” is the pattern and return ID TYPE INTEGER; is the corresponding action.