Site icon i2tutorials

Compiler Design-Capabilities of Context-Free Grammar

Capabilities of Context-Free Grammar

 

The capabilities of Context free Grammars are:

 

Difference between Context Free Grammer and Regular Expressions

Regular Expressions:

  1. In the case of Regular expressions, Lexical Rules are very simple.
  2. It is not easy to understand the notations in Regular Expressions.
  3. Regular expressions are defined using a set of Strings.
  4. Efficient Recognizers are easy to construct from Regular Expressions.
  5. There are guidelines to be followed for Lexical analysis and Syntactical analysis in Regular Expressions.

 

Context-Free Grammar:

  1. In the case of Context-Free Grammar, Lexical Rules are difficult.
  2. It is quite simple and easy to understand the notations in Context-Free Grammer.
  3. Regular expressions are defined using a collection of productions.
  4. Efficient Recognizers are tough to construct from Context free grammars.
  5. There are no guidelines to be followed for Lexical analysis and Syntactical analysis in Context-Free Grammar.

 

Reference Link

Capabilities of Context-Free Grammar

Exit mobile version