What's the proper grammar for this language?

I have this language:

{an bm | m+n is an even number}

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. 'C' stands for "we have constructed an even number of a's and now an even number of b's follows.

ε stands for "", the empty string

链接地址: http://www.djcxy.com/p/48244.html

上一篇: 我应该如何为Unity和AutoMapper实现MVC引导程序?

下一篇: 这种语言的正确语法是什么?