哪种编程语言,在其正式的规范很短的上下文无关文法? [英] Which programming language has very short context-free Grammar in its formal specification?

查看:141
本文介绍了哪种编程语言,在其正式的规范很短的上下文无关文法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么编程语言都有短暂而美好的语法(用EBNF)?

What programming language has short and beautiful grammars (in EBNF)?

有些语言是easer进行解析。前段时间我创建了一个简单的VHDL解析器,但它是非常缓慢的。不是因为它是用Python全面实行,但由于VHDL语法(以EBNF)是巨大的。 Python中的EBNF是美丽的,但它是不是很短。

Some languages are easer to be parsed. Some time ago I have created a simple VHDL parser, but it was very slow. Not because it is implemented completely in Python, but because VHDL grammar (in EBNF) is huge. The EBNF of Python is beautiful but it is not very short.

我建议像LISP许多函数式编程语言有短暂简单的语法,但我感兴趣的是像C或Bash的一个比较流行的简单命令式语言。

I suggest that many functional programming languages like LISP have short simple grammars, but I am interested in a more popular simple imperative language like C or Bash.

推荐答案

我没有比较,但Lua是以其简单的语法的语言。该BNF在本参考手册的最后: http://www.lua.org /manual/5.1/manual.html

I haven't compared, but Lua is a language renowned for its simple syntax. The BNF is at the very end of this reference manual: http://www.lua.org/manual/5.1/manual.html .

这篇关于哪种编程语言,在其正式的规范很短的上下文无关文法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆