NPTEL Compiler Design Week 7 Assignment Answers 2025

NPTEL Compiler Design Week 7 Assignment Answers 2025

1. Full form of YACC is

a) Yes Another Compiler Constructor
b) Yet Another Compiler Constructor
c) Yet Another Compiler Compiler
d) Neither of the other options

Answer :- For Answers Click Here 

2. File produced by YACC and used by Lex is SLR

a) y.tab.c
b) y.tab.h
c) y.parse.c
d) y.parse.h

Answer :- 

3. Number of sections in YACC specification file is

a) 1
b) 2
c) 3
d) 4

Answer :- 

4. In YACC rules section $$ refers to

a) First symbol on right hand side
b) Last symbol on right hand side
c) Symbol on the left hand side
d) Any of them

Answer :- 

5. Annotated parse tree means

a) Parse tree with attributes
b) Code generated
c) Correct parse tree
d) None of the given options

Answer :- 

6. For a rule “A → B b C” the symbol C will be referred to by

a) $1
b) $2
c) $3
d) $4

Answer :- 

7. Syntax directed translation helps in

a) Creating parse tree
b) Check syntactical correctness of input
c) Check if the input has foreign symbols
d) None of the othrt options

Answer :- For Answers Click Here 

8. Files generated by YACC are

a) y.tab.c, y.token.h
b) y.parse.c, y.tab.h
c) y.tab.c, y.tab.h
d) None of the other options

Answer :- 

9. Token attributes are returned by

a) yytext
b) yylen
c) yyval
d) yylval

Answer :- 

10. YYSTYPE defines the type for

a) Stack
b) Token
c) Input
d) Queue

Answer :- 

11. Which of the following statements about YACC is true?

a) YACC generates a lexical analyzer
b) YACC is used for syntax analysis
c) YACC does not support semantic actions
d) YACC does not require grammar rules

Answer :- 

12. Which of the following correctly describes the role of yyparse) in YACC?

a) It performs lexical analysis
b) It calls the scanner (Lex) and parses tokens
c) It generates the final executable code
d) It stores token attributes

Answer :- For Answers Click Here 
Scroll to Top