Bison/Flex parser
27 Jun 2009 Robin Berthier honeybrid-gsoc-parser
This week I completed an important step which is to integrate a parser in Honeybrid. There are now two new files in the source code:
-
rules.l which defines the different tokens to analyze,
-
rules.y which defines the configuration language and the different subroutines to call when a specific combination of tokens is detected.
Flex and Bison compile these two files and generate rules.c and rules.h which are then used by honeybrid to parse its configuration. The great advantages of having a parser are to have a flexible configuration file and to better handle configuration errors with a short volume of code.