In formal language theory, a context-free grammar (CFG) is a grammar in which every production rule is of the form
- V → w
where V is a single nonterminal symbol, and w is a string of terminals and/or nonterminals (possibly empty).
Thus, the difference with arbitrary grammars is that the left hand side of a production rule is always a single nonterminal symbol rather than a string of terminal and/or nonterminal symbols. The term "context-free" expresses the fact that nonterminals are rewritten without regard to the context in which they occur.
A formal language is context-free if some context-free grammar generates it. These languages are exactly all languages that can be recognized by a non-deterministic pushdown automaton.
Context-free grammars play a central role in the description and design of programming languages and compilers. They are also used for analyzing the syntax of natural languages.
[Reference :: wikipedia]
'IT' 카테고리의 다른 글
GCC 옵션 (0) | 2012.02.05 |
---|---|
리눅스-우분투 커널 컴파일 (0) | 2009.08.29 |
유닉스 네트워크 오목 프로그램 (2) | 2009.04.22 |
PuTTy Release 0.58.h1 (0) | 2009.04.22 |
우분투 시스템콜 추가화면... (0) | 2009.04.22 |