250+ TOP MCQs on YACC Parser Generator and Answers

Automata Theory Multiple Choice Questions on “YACC Parser Generator”.

1. YACC is a computer program for ______ operation system.
a) Windows
b) DOS
c) Unix
d) openSUSE

Answer: c
Clarification: YACC technique is a computer code for the Unix operating system. It is a LALR parser generator, generating a parser, the part of a compiler that tries to make syntactic sense of the source code.

2. YACC is an acronym for:
a) Yes Another Compile Compiler
b) Yet Another Compile Compiler
c) Yet Another Compiler Compiler
d) Yes Another Compiler Compiler

Answer: c
Clarification: YACC stands for ‘Yet another compiler compiler’ and it was developed by Stephen Johnson in B programming language later translated to C.

3. The YACC takes C code as input and outputs_________
a) Top down parsers
b) Bottom up parsers
c) Machine code
d) None of the mentioned

Answer: b
Clarification: The YACC takes C code as input and produces shift reduce parsers in C,also known as Bottom up parsers which execute C snippets with the associated rule.

4. The _______ table is created by YACC.
a) LALR parsing
b) LL parsing
c) GLR parsing
d) None of the mentioned

Answer: a
Clarification: LALR parser generator is software tool that reads a BNF grammar and creates a LALR parser which is capable of parsing files written in programming language identified by BNF grammar.

5. The original YACC as written in __________ language
a) R programming language
b) C programming language
c) B programming language
d) None of the mentioned

Answer: c
Clarification: Stephen Johnson wrote this parser generator in B programming language which was further modified and written in C, JAVA, Python, etc.

6. Which of the following is false for B programming language?
a) Typeless
b) Influenced by PL/I
c) Designed by Dennis Ritchie
d) None of the mentioned

Answer: d
Clarification: B was programming language designed by Dennis Ritchie and Ken Thompson for recursive, non numeric, system and language softwares. It was a typeless language, everything is a word.

7. Which of the following is false for BNF?
a) BNF means Backus Naur Form
b) It is a normal form used in Data base normalization
c) It is a notation technique for context free grammar
d) None of the mentioned

Answer: b
Clarification: The normal form used in Data base normalization is BCNF i.e. Boyce Codd normal form and NOT Backus Naur Form.

8. State true or false:
Statement: BNF is a metasyntax used to express CFG
a) True
b) False

Answer: a
Clarification: BNF is a metasyntax used to express context free grammar, moreover a formal way to express the language.

9. Which of the following are not used to express CFG?
a) BNF
b) EBNF, ABNF
c) Van Wijngaarden form
d) None of the mentioned

Answer: d
Clarification: W grammar or van Wijngaarden form is used to define potentially infinite context free grammars in a finite number of rules. It is an example of larger class of affix grammars. This technique was used to define the P/L Algol 68.

10. Which of the following version of Unix came up with YACC first?
a) V3
b) V5
c) CB UNIX
d) Unix-RT

Answer: a
Clarification: Yacc appeared in version 3 of unix, though full description was published by 1975.

Leave a Reply

Your email address will not be published. Required fields are marked *