World's most popular travel blog for travel bloggers.

[Solved]: Why we use context-free grammar for parsing?

, , No Comments
Problem Detail: 

Why we use context-free grammar for parsing? Why not regular expression and not context-sensitive grammar?

Asked By : Himanshu Saini

Answered By : David Richerby

Because regular expressions are too weak and context-sensitive languages are too difficult to parse. More specifically, regular expressions can't specify that the brackets in your program match up; determining whether a string matches a context-sensitive language is PSPACE-complete (so probably takes exponential time).

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/37167

 Ask a Question

 Download Related Notes/Documents

0 comments:

Post a Comment

Let us know your responses and feedback