A Java Parser for the Maple Data Language, originally outlined by EmmaTheMartian in EmmaTheMartian/maple.
- Clear exception reporting with a snippet of the input around the offending location.
- Simple, easy-to-use interface.
Uses ANTLR for parser and lexer generation.
String input = "message = 'Hello, World!'";
MapleMap map = Maple.parse(input);
System.out.println(map.getString("message"));
Maple4j is published to Maven Central and rotgruengelb.net's Maven.
Add using Gradle:
repositories {
mavenCentral()
}
dependencies {
implementation("net.rotgruengelb:maple4j:${maple4j_version}")
}
Maple.parse("key = ");
this will result in an Exception like this:
MapleParseException: Unexpected token "<EOF>" at line 1, column 7.
Expected: {, [, a string, a number, or a boolean.
key =
^
Maple4j is licensed under the MIT License.
Parts of this project and structure were adapted from thriving-dev/java-library-template.