ABNF Parser Generator
Initialization File
Initialization files of the form:
[Section]
value = name
are commonly used for program configuration files. This example gives a syntax which allows for a very flexible ini file. Comments and blank lines are allowed. Line endings are robust - CRLF, LF and CR are each accepted as valid line ends. Comma-delimited arrays of values are accepted. With this syntax it is not difficult to write semantic actions that will create arrays of values and accept multiple occurrances of value and section names.
IniFile syntax:
1) Section begins with a bracket "[" on first character of a line.
2) A Section ends with a new section or EOF.
3) Section names consist of alpha + digit + underscore
(may begin with digit or underscore)
4) Values are of the form "name = ValueArray"
5) Value names consist of alpha + digit + underscore
(may begin with digit or underscore)
6) ValueArray is a comma-delimited list of one or more values.
7) Undefined values not allowed - eg. 1,2,,3 and 1,2, are errors.
8) Values may be of four forms:
- a double quoted string of any printing characters except a double quote,
- a single quoted string of any printing characters except a single quote.
- integer
- alphanumeric (may begin with digit)
9) Comments begin with ";" and continue to end of line.
10) Blank lines are allowed.
11) LineEnd is robust - CRLF, LF or CR are each accepted as a line end
Parser Output:
|
|