4

A regular grammar is a mathematical object, $G$, with four components, $G = (N, Σ, P, S)$, where. $N$ is a nonempty, finite set of nonterminal symbols, $Σ$ is a finite set of terminal symbols , or alphabet, symbols, $P$ is a set of grammar rules, each of one having one of the forms. $A → aB$.

I want to know what's Practical Application of these grammars. I mean where and how do we use these in real world?

Also it may be helpful if someone tells me about the weaknesses of regular grammars.

Thanks in advance.

Arman Malekzadeh
  • 349
  • 6
  • 17

1 Answers1

4

Regular grammars are more-or-less the same as NFAs, so you might as well ask what applications these have. Finite automata are used in compilers, for performing lexical analysis. Any course on compilation will contain ample information on this.

As for the weaknesses of regular grammars, they only describe regular languages. In particular, they're not enough to parse programming languages, even superficially. We use context-free grammars for that. Any course on formal languages and automata will explain all of that very clearly.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503