Details
The current version of The Brace library is thorough yet very basic parser and tokenizer. It goes only as far as to serializing and reconstructing trees of token blocks. Still it provides different storage options and different methods for loading parsed files. The templates can be specialized for different character types and configured through traits structures.
Installation and use of this library is no different than use of any other C++ library. Actually it can be even easier since the implementation is completely templated and thus just within header files.
Two simple examples are included within the distribution package but don't expect any documentation above comments in the source files.
Definition
[token [token […]]] [\n] {
[token [token […]]] [;|\n]
}[;]
Sample brace
file
setup {
window {
topmost: false;
noclose: false;
}
resolution {
width: 320
height: 240
bpp: 32
freq: 75
}
control {
horizontal {
sensitivity: "10.0";
reverse: false;
};
vertical {
sensitivity: "10.0";
reverse: false;
};
}
renderer {
ratio: "1.333333";
depth: 200.0; // far Z plane
}
}
Future development
The priority issue to solve is the Brace tokenizer taking fixed character set for a token. Some kind of munch function needs to be introduced, that will correctly parse decimal numbers in every syntax. Also an optional UTF-8 (and perhaps UTF-16) layer needs to be added (below the tokenizer) that will address necessary conversions and BOM.
The ultimate goal of a final version of the Brace C++ Library is to provide an efficient mapping. That is, setting variables in hierarchy of structures with values parsed from brace::block tree (either pre-read or read on fly) as specified in a definition tree.
Requirements
- C++99 conforming compiler
Verified compatibility
- MinGW (GCC 4.2)
License
The Brace C++ Library is a free software available under the zlib license.
For detailed text of the license see The zlib License.