网站首页  英汉词典

请输入您要查询的英文单词:

 

单词 Rightmost derivation
释义

Rightmost derivation

中文百科

上下文无关文法 Context-free grammar

(重定向自Rightmost derivation)

在计算机科学中,若一个形式文法 G = (N, Σ, P, S) 的产生式规则都取如下的形式:V -> w,则称之为上下文无关文法英语:context-free grammar,缩写为CFG),其中 V∈N ,w∈(N∪Σ)* 。上下文无关文法取名为“上下文无关”的原因就是因为字符 V 总可以被字串 w 自由替换,而无需考虑字符 V 出现的上下文。一个形式语言是上下文无关的,如果它是由上下文无关文法生成的(条目上下文无关语言)。

上下文无关文法重要的原因在于它们拥有足够强的表达力来表示大多数进程设计语言的语法;实际上,几乎所有进程设计语言都是通过上下文无关文法来定义的。另一方面,上下文无关文法又足够简单,使得我们可以构造有效的分析算法来检验一个给定字串是否是由某个上下文无关文法产生的。例子可以参见 LR 分析器和 LL 分析器。

英语百科

Context-free grammar 上下文无关文法

(重定向自Rightmost derivation)

In formal language theory, a context-free grammar (CFG) is a formal grammar in which every production rule is of the form

A\ \to\ \alpha

where A is a single nonterminal symbol, and \alpha is a string of terminals and/or nonterminals (\alpha can be empty). A formal grammar is considered "context free" when its production rules can be applied regardless of the context of a nonterminal. No matter which symbols surround it, the single nonterminal on the left hand side can always be replaced by the right hand side. This is what distinguishes it from a context-sensitive grammar.

随便看

 

英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/17 12:47:14