LAD (List Aligned Data) is a lightweight data storage format with a simple grammar. It is easy to implement in any language and it can be very efficient and fast. It uses a semi-flat structure by design.
- Bring statements (granular include/import-like statements).
- Namespaces for organization.
- Excellent parse-time errors and warnings.
- Advanced parse-time hooks via the Modular Meta Analysis system.
- An explicit 'use default' keyword,
none, instead of 'null'. - Useful string and integer notation interpolation.
- Comments!
- Super simple API.
- Anyone who wants a lightweight and simple solution to their data storage needs.
- Anyone who wants to try implementing a simple language specification.
#include <LAD.h>
#include <stdio.h>
int main(void){
LAD_ERROR_TYPE Error;
LAD_Handle *Handle = ladNewHandle();
Error = ladParseFile(Handle, "my_file.lad", LAD_PARSER_DEFAULT_FLAGS);
//Only a heap error can stop LAD.
if (Error == LAD_ERROR_MEM_FAIL){
ladFreeHandle(Handle);
return 1;
}
lad_byte *String = ladHandleFetchString(Handle, NULL, "my_global", "some default");
puts(String);
ladFreeHandle(Handle);
return 0;
}- The project comes pre-built (Win64) in the
Bin/folder. -
- The whole project source is divided between
LAD.handLAD.c.
- The whole project source is divided between
-
- It can be built from the
Build/folder just by runningmake.
- It can be built from the
- Documentation on both the language spec and API are found in
Documentation/. - Examples are found in
Examples/
#lad_version : 1
my_global : none //Use the default.
bring 'my_defaults.lad'
namespace MyNamespace
my_name_var : 'im accessible from MyNamespace'#lad_version : 1
#shader_type : 'glsl' //Example hook for a rendering engine's shader config.
namespace Shaders
fragment : 'shader.frg'
vertex : 'shader.vtx'
namespace Textures
/*...*/#lad_version : 1
//Variable shadowing and interpolations.
my_int : 0xbaadf00d //Hexadecimal.
my_int : 0c0127 //Octal.
my_int : 0b1101 //Binary.
my_int : 12345 //Decimal.
//Supports even uncommon characters like the bell or backaspace.
my_string : "interpola\ted"
my_string : 'not interpolated' //Single quotes -> no interpolation.