Configuration file parser

I need to create a configurarion file parser for Asterisk but I can’t find a documentation with the grammar of the configuration files. Where can I find it?

Best regards,
Eduardo Castillo