形式语言与自动机-第2章-语言与文法案例.ppt

形式语言与自动机-第2章-语言与文法案例.ppt

* College of Computer Science Technology, BUPT 1型文法 也称上下文有关文法(CSG:Context-sensitive Grammar) 生成式的形式为α→β, 其中 |α| ≤ |β| ,β∈(N∪T)+, α∈(N∪T)* N+ (N∪T)* 对应的语言:上下文有关语言(CSL:Context-sensitive Language) 若不考虑ε,与线性有界自动机(LBA, Linear Bounded Automaton)等价。 College of Computer Science Technology, BUPT 1型文法 语言限定约束: 左部的长度小于右部 不含A-ε 实际程序语言中上下文有关的部分: 过程调用时形参与实参的一致性检查等。 * College of Computer Science Technology, BUPT 2型文法 也称上下文无关文法(CFG:Context-free Grammar) A→ β, A∈N, 且 β∈(N∪T)* 对应的语言:上下文无关语言 (CFL: Context-free Language)。 对应的自动机:下推自动机(PDA: Pushdown Automaton)。 College of Computer Science Technolo

文档评论(0)

1亿VIP精品文档

相关文档