> 
> <!-- WARNING --><technical>
> 
> The only way to get an Apache configuration file converted would be to  
> write a translator. It'd be something similar to a natural language  
> translator - but slightly more complex, actually.
> 
> The first piece of the puzzle would be a lex scanner, so the program  
> can read the pseudo-XML that the Apache configuration files are based  
> on. That would read, identity an return tokens.
> 
> Then, all those tokens would have to be kept into memory, so a whole  
> configuration structure can be built based on them. This part is quite  
> straightforward.
> 
> The next step would be quite tough, though. At this stage it'd have to  
> read the Apache configuration file, so it can sort of 'understand'  
> what it's actually meaning. Once it got a complete piece of  
> information, it'd have to translate it and add it to the Cherokee  
> configuration tree.  Beware; even if this step doesn't look hard, it'd  
> become really complex eventually. There will be times when those  
> translations will require processing.
> 
> Finally, when the Cherokee configuration tree is completed in memory,  
> it'd have to write it down (a trivial final task).
> 
> <!-- WARNING --></technical>
> 
> So, I'd personally wouldn't try to write a translator without  
> following this sort of lexical/syntactic parser scheme. Doing so would  
> be a hell of a work, but IMHO it's the only way to success.
> 
> --
> Octality
> http://www.octality.com/

I did not want to use any modules from CPAN because of dependencies but
there's already a module that does that:
http://search.cpan.org/~bzajac/Apache-ConfigParser-1.01/lib/Apache/ConfigParser.pm

_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to