分析树就是一个反映某种形式语言字符串的语法关系的有根有序树 (数据结构)。分析树一般按照两种相反的法则生成,一种是依存语法,一种是短语结构语法。分析树和抽象语法树是不同的。
我们的分析器与分析树输出看起来很相似。
前面已经提到的分析树,提供了一种表现Ruby源代码的格式。
ParseTree, as already mentioned, offers a format to represent Ruby source code.
这种表示比传统分析树不仅空间较小,而且进行结构匹配的速度快。
Compared with the conventional parse tree, this representation not only consumes less space, but also is faster for structure matching.
应用推荐