Skip to content

A Java Implementation/Parser for the Maple Data Language / "Because JSON was overkill" -EmmaTheMartian

License

Notifications You must be signed in to change notification settings

rotgruengelb/maple4j

Repository files navigation

maple4j

GH Actions Pipeline Status Maven Central Javadoc

A Java Parser for the Maple Data Language, originally outlined by EmmaTheMartian in EmmaTheMartian/maple.

Features

  • 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.

Usage

String input = "message = 'Hello, World!'";
MapleMap map = Maple.parse(input);

System.out.println(map.getString("message"));

Including maple4j

Maple4j is published to Maven Central and rotgruengelb.net's Maven.

Add using Gradle:

repositories {
   mavenCentral()
}
dependencies {
   implementation("net.rotgruengelb:maple4j:${maple4j_version}")
}

Exceptions

Example

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 = 
      ^

Licence

Maple4j is licensed under the MIT License.

Parts of this project and structure were adapted from thriving-dev/java-library-template.

About

A Java Implementation/Parser for the Maple Data Language / "Because JSON was overkill" -EmmaTheMartian

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •