parser.ini

2017-02-27

Introduction

The parser.ini system provides a parser for the "ini-like" family of configuration syntaxes. A builder-based protocol is used to construct parse results.

Tutorial

To parse a string of configuration options and return the result as a simple list-based structure, the parse function is called with the symbol list instead of a more complicated builder object:

(parser.ini:parse "[section] option = value" 'list)

((:SECTION
  (:SECTION-OPTION
   (((:OPTION NIL :NAME ("option") :VALUE "value" :BOUNDS (10 . 24)))))
  :NAME ("section") :BOUNDS (0 . 9)))

Syntactic variants are controlled via special variables (note : instead of =):

(let ((parser.ini:*assignment-operator* #\:))
  (parser.ini:parse "[section] option: value" 'list))

((:SECTION
  (:SECTION-OPTION
   (((:OPTION NIL :NAME ("option") :VALUE "value" :BOUNDS (10 . 23)))))
  :NAME ("section") :BOUNDS (0 . 9)))

TODO Reference

Settings

Author
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
Maintainer
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
License
LLGPLv3