有限状态机过度状态
我有一个有限状态机。 我的正则表达式是:\+[0-9]+\+%\+[0-9]+
问题是 q3 处于过度状态(与 q1 相同)我想知道如何绕过它。 我应该简单地将 q3 重命名为 q1 还是什么? 谢谢。
EOS - 字符串结尾。 如果您不记得 RegX。 它基本上意味着接受的字符串将是:“+[0-9]
([0-9]任意次数,但至少一次。)+%+[0- 9]
“([0-9]任意次数,但至少一次)
UPD1新的FSM,问题相同:q4与q2相同如何克服?
I have i finite-state machine.
My regular expression is: \+[0-9]+\+%\+[0-9]+
The problem is that q3 is is in excessive state (the same as q1) I am wondering how to bypass that.
Should I simply rename q3 to q1 or what?
Thanks.
EOS - end of string.
If you don't remember RegX.
It is basically means that accepted string will be: "+[0-9]
([0-9] any amount of times, but at least one.)+%+[0-9]
"([0-9] any amount of times, but at least one)
UPD1 new FSM, question the same: q4 is the same as q2 how to overcome that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里确实没有问题。你写q₄“与”q2相同,但这不是真的:如果你给它
+%+
,只有其中一个会导致q₃,如果你给它,只有其中一个会导致q₅它位于字符串末尾。因此,它们必须由单独的内部状态代表。There really isn't a problem here. You write that q₄ "is the same as" q₂, but that's not true: only one of them leads to q₃ if you give it
+%+
, and only one of them leads to q₅ if you give it end-of-string. Therefore, they have to be represented by separate internal states.