Which one of the following tools generates parser from BNF notation?
2025
Which one of the following tools generates parser from BNF notation?
- A.
lex
- B.
yacc
- C.
ed
- D.
gdb
Attempted by 71 students.
Show answer & explanation
Correct answer: B
Yacc (Yet Another Compiler-Compiler) is a parser generator tool that creates parsers from BNF-like grammar specifications. It reads the grammar definition and generates C code for a parser. Lex is used for lexical analysis (tokenization), not parsing. Ed is a text editor, and GDB is a debugger; neither generates parsers.