NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: reading config files from C



On Sun, Feb 2, 2020 at 1:25 PM Brett Lymn <blymn%internode.on.net@localhost> wrote:
> If you are doing more than just a simple key/value per line then it may
> be worth investing in learning lex/yacc to do the parsing instead of
> rolling your own.  It is a bit of a learning curve to get going but
> extending the config language is a lot easier than a roll your own.

Hi Brett,

Thanks for the tip, I had some flex notes to make use of some day,
but my challenges are far simpler than that!

FLEX Tutorial
http://alumni.cs.ucr.edu/~lgao/teaching/flex.html
First, FLEX reads a specification of a scanner either from an input
file *.lex, or from standard input, and it generates as output a C
source file lex.yy.c. Then, lex.yy.c is compiled and linked with the
"-lfl" library to produce an executable a.out. Finally, a.out analyzes
its input stream and transforms it into a sequence of tokens.

your comment helps me put it in  to context anyway.  :)

-George


-- 
George Georgalis, (415) 894-2710, http://www.galis.org/


Home | Main Index | Thread Index | Old Index