Which one of the following tools generates parser from BNF notation?

2025

Which one of the following tools generates parser from BNF notation?

  1. A.

    lex

  2. B.

    yacc

  3. C.

    ed

  4. 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.

Explore the full course: Niacl Ao It Specialist