Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have two or more Lex/Yacc parsers in the same application

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.

Is it possible to have more than one?

And if so how do you get another entry point?

Thanks

david allan finch

like image 564
David Allan Finch Avatar asked Apr 08 '09 13:04

David Allan Finch


1 Answers

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

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

like image 191
Alnitak Avatar answered Oct 04 '22 03:10

Alnitak