Mid Sem Exam - Regular-Solution
Mid Sem Exam - Regular-Solution
HYDERABAD CAMPUS
SECOND SEMESTER 2019 – 2020
Compiler Construction (CS F363) MID SEM EXAM(REGULAR)
Date: 02.03.2020 Weightage:30%(60M) Duration: 90mins.
Type: Closed Book Number of questions: 3 Number of pages: 5
ID NO: NAME:
Note: 1. In all the Grammars shown consider the Upper case letters to be the Non terminal,Lower case letters
to be the terminals and the first production Non terminal be the start production.
3. ϵ denotes the empty string.
Semantic Analyzer/Semantic Analysis. One has to compare the declaration and the call of the function.
That cannot be done by the parser.
ii.Underscore "_" is allowed in the middle of identifiers, but not at the beginning or the end (i.e. "my_id"
is legal but "_id" is not).
Lexer/ Scanner. There is no reason to postpone that. It is a very “standard” thing for a scanner to do
(as one can see by the fact that it’s possible to write regular expressions capturing this condition).
Identifiers (with restrictions such as the one mentioned) are typical tokens (which are the output of a
scanner and the input of the parser).
Parser/Syntax Analyser: