本文介绍了判断BNF语法是否模棱两可的最简单方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就是说,有没有一种工具可以自动显示给定语法的完整语言,包括突出显示歧义(如果有的话)?

简而言之,不存在任何工具,因为通常在数学上该工具是不可能的.不过,可能会有一些特殊情况对您有用.

Namely, is there a tool out there that will automatically show the full language for a given grammar, including highlighting ambiguities (if any)?

解决方案

There might be some peculiarity about BNF-style grammars, but in general, deciding whether a given context-free grammar (such as BNF) is ambiguous is not possible.

In short, there does not exist a tool because in general, that tool is mathematically impossible. There might be some special cases that could work for you, though.

这篇关于判断BNF语法是否模棱两可的最简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 14:36