Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #666

Blog: Parsing command line parameters with Yacc & Flex

From Johann 'Myrkraverk' Oskarsson <myrkraverk@yahoo.com>
Newsgroups comp.compilers
Subject Blog: Parsing command line parameters with Yacc & Flex
Date 2012-06-05 17:12 +0000
Organization A noiseless patient Spider
Message-ID <12-06-005@comp.compilers> (permalink)

Show all headers | View raw


Hi all,

I wrote a blog tutorial about how to use yacc & (re)flex to parse
command line arguments.  Here is the blurb:

> 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.

I feel this tutorial is about 20 years too late, but no matter, it's
here now.  There are questions on stack exchange which might benefit
from a pointer to the blog entry.  Depending on the promptness of our
moderator, the blog entry may be referenced there by the time you're
reading this.

If you want to use this in a project and don't want to read and
understand the boost license, I can put up another WTFPL licensed
download.


--
  Have fun,

  Johann

Back to comp.compilers | Previous | NextNext in thread | Find similar


Thread

Blog: Parsing command line parameters with Yacc & Flex Johann 'Myrkraverk' Oskarsson <myrkraverk@yahoo.com> - 2012-06-05 17:12 +0000
  Re: Blog: Parsing command line parameters with Yacc & Flex Johann 'Myrkraverk' Oskarsson <johann@2ndquadrant.com> - 2012-06-06 10:43 +0000

csiph-web