- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Regular grammar describes a regular language. It consists of four components, which are as follows −

G = (N, E, P, S)

Where,

N − finite set of non-terminal symbols,

E − a finite set of terminal symbols,

P − a set of production rules, each of one is in the forms

S → aB

S → a

S → ∈,

S ∈ N is the start symbol.

The above grammar can be of two forms −

Right Linear Regular Grammar

Left Linear Regular Grammar

When the right side of the Grammar part has only one terminal then it's linear else nonv linear.

In a left-regular grammar (also called left-linear grammar), the rules are of the form as given below −

L → a, {L is a non-terminal in N and a is a terminal in Σ}

L → Ma, {L and M are in N and a is in Σ}

L → ∈, {∈ is the empty string}.

The left linear grammar means that the non-terminal symbol will be at the left side.

Consider a language {b^{n}ab^{m}a| n>=2, m>=2}

The left linear grammar that is generated based on given language is −

S → Bbba ⇒ last 3 symbols bba B → Bb| Dbba ⇒ for b^{m}and bba are for bn followed by a. D → Db|e ⇒ for b^{n-2}

- Related Questions & Answers
- Explain about right linear regular grammars in TOC
- Explain about regular expressions in TOC?
- How to convert FA to Left Linear Grammar in TOC?
- How to convert right linear grammar to left linear grammar?
- How to convert left linear grammar to right linear grammar?
- Explain Type-0 grammar in TOC
- Explain Type-1 grammar in TOC
- Explain the concept of grammar in TOC
- Explain Operator grammar and precedence parser in TOC
- Explain the relationship between grammar and language in TOC
- Explain the simplification of context free grammar in TOC
- Explain Type-2 and Type-3 Grammar in TOC?
- How to convert FA to Right Linear Regular Grammar?
- Explain about CYK Algorithm for Context Free Grammar
- What is unambiguous grammar in TOC?

Advertisements