This is baseline implementation of popular in Scala and Haskell
parser combinators for Java.
It has very basic functional so far.
Gradle dependency:
compile group: 'io.github.pashashiz', name: 'parser-combinators-core', version: '1.0.0'
Maven dependency:
<dependency>
<groupId>io.github.pashashiz</groupId>
<artifactId>parser-combinators-core</artifactId>
<version>1.0.0</version>
</dependency>
Implemented in parser-json
module.
To parse a JSON just call:
Result<Json> result = Json.parse(
"{\"name\": \"John\", \"age\": 30, \"car\": null}");
Implemented in parser-properties-tree
module.
To parse properties just call:
Result<PropertyTree> properties = PropertyTree.parse(
"ns[1].key1=value1\n" +
"ns[2].key2=value2\n");