- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is Context-sensitive Grammar?
The Context sensitive grammar (CSG) is defined as G=(V,Σ,P,S)
Where,
- V: Non terminals or variables.
- Σ: Input symbols.
- P: Production rule.
- P:{αAβ → αγβ, A ϵ V,α ϵ (V∪Σ)*, β ϵ (V∪Σ)*
- S: Starting symbol.
Example
- aS→SAa|aA
- aA→abc
In context sensitive grammar, there is either left context or right context (αAβ i.e. α is left context and β is right) with variables.
But in context free grammar (CFG) there will be no context.
For example in production rule
S →0 B S 2 ,
B 0 → 0 B
We cannot replace B until we get B0.
Therefore, CSG is harder to understand than the CFG.
The CFG, CSG and the unrestricted grammar are depicted below −
- Related Articles
- What is Context-Free Grammar?
- What is a context sensitive language in TOC?
- What is context free grammar? Explain with examples
- Explain removing unit productions in context free grammar
- Convert the given Context free grammar to CNF
- Explain about CYK Algorithm for Context Free Grammar
- How to generate the language for context free grammar?
- Explain the simplification of context free grammar in TOC
- Generate a CNF for a given context free grammar
- How to convert context free grammar to push down automata?
- What is Ambiguous Grammar?
- Generate a Context-free grammar for the language L = {anbm| m≠n}?
- What is Context on Android?
- What is unambiguous grammar in TOC?
- What is Adverb Clause in English grammar?

Advertisements