OpenIndiana and PostgreSQL

The magic begins

Subscribe to RSS feed

Posts tagged with "c"

Parsing command line parameters with Yacc & Flex

, , ,

Every once in a while someone comes along and asks how to parse command line parameters with Yacc & Flex. This is rather straight forward, but requires some knowledge of the generated code to get right.

Here we present a source template that does this. The user only has to edit the grammar and scanning rules. Some knowledge of C, Yacc and Flex is assumed.

The code is Boost licensed

The template is written for Berkeley Yacc and the reflex variant of Flex. It may be made to work with GNU Bison and SourceForge Flex, possibly with a few changes.

Read more...

Passing parameters to Yacc and Flex

, , ,

Here we go through the steps needed to pass parameters to the yyparse() and from that to yylex(). Familiarity with C, Flex and Yacc is assumed.

This document is written for Berkeley Yacc and the reflex variant of Flex. Presumably GNU Bison and SourceForge Flex will work as well.

Read more...