Jonas Nordström wrote:
>
> I have a proxy-application that I want to make as generic as possible by
> using configure files.
> I have a configure file that looks something like:
>
> <Interface>
> ko-web.ei.sigma.se
> </Interface>
>
> <Label information>
> <DefaultSite>
> info.ei.sigma.se
> </DefaultSite>
> <Sites>
> info.ei.sigma.se
> <Block>
> Order deny, allow
> Deny All
> Allow nisse.ei.sigma.se
> </Block
> stodjande.ei.sigma.se
> lopande.ei.sigma.se
> css.ei.sigma.se
> </Sites>
> </Label>
>
> Is there a standard way of reading such file into a perl-structure (hash or
> object)?
> I have solved it by just reading the file and use regexps to filter the
> information. It works, but the code will be hard to maintain.
>
> thanks for listening,
> Jonas Nordstrom
Since you are talking about parsing, this reminds me about my project.
It's a token analyzer. If you are faced with the task of
scanning/parsing files, for instance, configuration ones, maybe you'll
want to give a token at my code.
Some features of The Ant Scanner (ASC for short).
(and remeber, you may call this features as bugs as you may like)
. Performance: Extremely FAST,
. Reliability: Error recovery option,
. Flexibility: you are on the control, ALWAYS,
. Token Size: ASC put no limitation on token size,
. Design: Carefully designed, to be used builtin your app.
It's very small, no external linkage required.
. Requires you to define you token types and DFA by HAND = dirty
work,
but leap you to great control over what the asc will
reconize.
Anyone who may wish to take a closer look on what i have written, send
me an email and i will send the tarball.
I hope this helps.
Re: parsing an apache-like conf-file
Gustavo Vieira Goncalves Coelho Rios Wed, 31 Jan 2001 06:59:26 -0800
- parsing an apache-like conf-file Jonas Nordstr�m
- Re: parsing an apache-like conf-... Matt Sergeant
- Re: parsing an apache-like c... Steven Cotton
- Re: parsing an apache-like c... Paul J. Lucas
- Re: parsing an apache-li... Matt Sergeant
- Re: parsing an apach... Paul J. Lucas
- Re: parsing an ... Matt Sergeant
- Re: parsing... Paul J. Lucas
- Re: par... Matt Sergeant
- Re: par... Paul J. Lucas
- Gustavo Vieira Goncalves Coelho Rios
