next up previous contents
Next: Internal communication of Osiris Up: Flex & Bison Previous: Flex - generating scanners   Contents

Bison - generating parsers

The Bison is a general-purpose parser generator that converts a grammar description for an LALR(1) context-free grammar into a C program to parse that grammar. It may be used to develop a wide range of language parsers, from those used in simple desk calculators to complex programming languages.5.4

In the Osiris, parsers for opening a datafile (for the Controller, the Generator and the Validator) are generated using the Bison.

The Bison reads a given file with the grammar description and then generates as output a C source file, *.tab.c, which defines a routine yyparse(). When the routine is run, it launches yylex() to get the input data, then it analyzes them and tries to match them with the grammar rules. If the match is positive, it executes the corresponding C code.

The example of using the Bison is given is Appendix F, as the source file for the Bison to generate the parser for opening an Osiris datafile.

Any additional information can be found in Appendix D and in [16,12].


next up previous contents
Next: Internal communication of Osiris Up: Flex & Bison Previous: Flex - generating scanners   Contents
Igor Wojnicki 2001-02-21