What does "context-free" mean in the term "context-free grammar"?

Posted by rick on Programmers See other posts from Programmers or by rick
Published on 2014-08-15T18:21:16Z Indexed on 2014/08/18 22:32 UTC
Read the original article Hit count: 334

Given the amount of material that tries to explain what a context-free grammar (CFG) is, I found it surprising that very few (in my sample, less than 1 in 20) give an explanation on why such grammars are called "context-free". And, to my mind, none succeeds in doing so.

My question is, why are context-free grammars called context-free? What is "the context"? I had an intuition that the context could be other language constructs surrounding the currently analyzed construct, but that seems not to be the case. Could anyone provide a precise explanation?

© Programmers or respective owner

Related posts about programming-languages

Related posts about compilers