同一应用程序中是否可以有两个或多个Lex/Yacc解析器 [英] Is it possible to have two or more Lex/Yacc parsers in the same application

查看:77
本文介绍了同一应用程序中是否可以有两个或多个Lex/Yacc解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,其中已经有用于一种语法的解析器,并且我需要为另一目的添加第二种不同的语法.

I have an application where I already have a parser for one sort of grammar and I need to add a second different grammar for another purpose.

是否可以有多个?

如果是的话,您如何获得另一个入口点?

And if so how do you get another entry point?

谢谢

大卫·艾伦·芬奇

推荐答案

我认为您可以通过使用Bison的--name-prefix选项和Flex的--prefix选项来解决此问题.

I think you can to this by using the --name-prefix option to Bison, and the --prefix option to Flex.

在两种情况下,它们都允许您使用自己选择的前缀替换在生成的函数中使用的默认"yy"前缀.

In both cases they allow you to replace the default "yy" prefix used on the functions generated with a prefix of your own choice.

这篇关于同一应用程序中是否可以有两个或多个Lex/Yacc解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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