在TinyPG中使用BNF中的现有语言吗? [英] Use existing languages in BNF with TinyPG?
问题描述
如何使用
我相信它应该非常简单,因为与Greg语法RegExp + BNF 相比,TinyPG需要RegExp + EBNF .
还有,TinyPG的源代码是否适用于任何语言,只是看我将要进行哪种转换?
EBNF不能与BNF完全向下兼容,但是实际上差异很小,您应该熟悉该文档>
http://www.cs.cmu.edu/~pattis/misc/ebnf.pdf
首先,您必须处理特殊字符<> |:=(用双引号引起来).
如果解析器可以使用一种受支持的语言,则可以仅使用GOLD元语法引擎输出解析器-而不是使用TinyPG ...
这引出了一个问题-解析器实现时将使用哪种语言?
How can I use these BNF grammars which are in GOLD meta-syntax (RegExp + BNF) with TinyPG? I'm new to BNF so approximately what sort of conversion will I have to do to convert BNF to EBNF?
I believe it should be pretty simple since TinyPG needs RegExp + EBNF in comparison to the GOLD grammars which are RegExp + BNF.
Also, is there any TinyPG source code for any language available, just to see what sort of conversion I would have to do?
EBNF is not entirely backwards compatible with BNF, however the differences are actually slight, you should be familiar with the document at
http://www.cs.cmu.edu/~pattis/misc/ebnf.pdf
Primarily you have to handle the special characters <>|:= (enclosed in double quotes).
You could just use the GOLD meta-syntax engine to output your parser if it can be in one of the supported languages - instead of using TinyPG...
It begs the question - What language will your parser be in when you are implementing it?
这篇关于在TinyPG中使用BNF中的现有语言吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!