简体   繁体   English

这种语言的语法是什么?

[英]What's the proper grammar for this language?

I have this language: 我有这种语言:

{a n b m | {a n b m | m+n is an even number} m + n是偶数}

What's the proper grammar for this? 什么是正确的语法?

S -> aaS | aB | bbC | ε
B -> bbB | b
C -> bbC | ε

you see, it is a regular language. 你看,它是一种常规语言。 'S' stands for "we have constructed an even number of a's and more a's may follow, 'B' stands for "we have constructed an uneven number of a's and now an uneven number of b's follows. 'S'代表“我们构造了一个偶数个并且可以跟随更多的','B'代表”我们已经构造了一个不均匀的数字,现在随后数量不均匀。 'C' stands for "we have constructed an even number of a's and now an even number of b's follows. 'C'代表“我们构建了偶数个a,现在偶数个b。

ε stands for "", the empty string ε代表“”,空字符串

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM