从无上下文语法生成n条语句 [英] Generating n statements from context-free grammars

查看:68
本文介绍了从无上下文语法生成n条语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,为了不浪费时间,我想知道从上下文无关的语言(如yacc等产生的)生​​成随机语句的工作已经完成了.这些语法主要用于解析,但是也许有人已经花了一些时间来测试解析器? 谢谢

So not to reinvent the wheel, I would like to know what has already been done about generating random statements from a context-free language (like those produced by yacc, etc.). These grammars are primarily for parsing, but maybe someone has done some generation for testing the parsers? Thanks

推荐答案

查看

Check out this blog post. Basically, it randomizes the RHS chosen at each rule application.

这篇关于从无上下文语法生成n条语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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