OA. free
Free
IBM Quantitative Aptitude Core Computer Science Medium

Which one of the following tools is a LALR parser generator?

IBM aptitude question, verified with a worked answer. Free to practise - no sign-up.

Which one of the following tools is a LALR parser generator?

Choose one option.
Show answer & explanation
Answer: A. Yacc

Yacc (Yet Another Compiler Compiler) is a LALR (Look-Ahead Left-to-Right) parser generator that reads grammar specifications and produces a parser in C. Lex is a lexical analyzer generator (not a parser generator), while Vi and Emacs are text editors unrelated to parsing or compilation tools.

Step-by-step Derivation:
LALR parser generators are specialized compiler tools used in the compilation pipeline. Yacc specifically implements the LALR parsing algorithm to generate bottom-up parsers from context-free grammars. Lex works upstream to tokenize input, Vi and Emacs are general-purpose editors with no parser generation capability. This is a definition/tooling knowledge question with a straightforward answer.