πŸŽ“ Computer Science & Engineering Portal

Master Engineering Disciplines with Structured Notes

Comprehensive academic lecture notes, exam-oriented unit summaries, laboratory manuals, and previous year question papers designed strictly for university students.

πŸ“‘

University Syllabi

AKTU & AICTE aligned semester guidelines.

πŸ“

Exam Question Papers

Previous 5 years solved university papers.

πŸ’‘

Lab Manuals & Viva

Practical codes with outputs & interview Qs.

Core Subjects & Units Hub

Click on any specific unit to immediately view its lecture notes below

Viewing All Lectures

BNF Notation

BNF Notation

BNF stands for Backus-Naur Form. It is used to write a formal representation of a context-free grammar. It is also used to describe the syntax of a programming language.

BNF notation is basically just a variant of a context-free grammar.

In BNF, productions have the form:

  1. Left side β†’ definition  

Where leftside ∈ (Vnβˆͺ Vt)+ and definition ∈ (Vnβˆͺ Vt)*. In BNF, the leftside contains one non-terminal.

We can define the several productions with the same leftside. All the productions are separated by a vertical bar symbol "|".

There is the production for any grammar as follows:

  1. S β†’ aSa  
  2. S β†’ bSb  
  3. S β†’ c  

In BNF, we can represent above grammar as follows:

  1. S β†’ aSa| bSb| c  

Labels: ,

Discussion & Queries (<$I18NNumComments$>):

<$CommentPager$>
<$I18NAtCommentTimeWithPermalink$>, <$I18NCommentAuthorSaid$>

<$BlogCommentBody$>

<$BlogCommentDeleteIcon$>
<$CommentPager$>