Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pashashiz/java-parser-combinators
Parser Combinators in Java
https://github.com/pashashiz/java-parser-combinators
functional-programming java parser-combinators parsers
Last synced: 23 days ago
JSON representation
Parser Combinators in Java
- Host: GitHub
- URL: https://github.com/pashashiz/java-parser-combinators
- Owner: pashashiz
- Created: 2017-10-27T17:11:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-06T15:55:02.000Z (about 6 years ago)
- Last Synced: 2024-10-01T19:18:16.350Z (about 1 month ago)
- Topics: functional-programming, java, parser-combinators, parsers
- Language: Java
- Size: 86.9 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Parser combinators for Java
[![Build Status](https://travis-ci.org/pashashiz/java-parser-combinators.svg?branch=master)](https://travis-ci.org/pashashiz/java-parser-combinators)
This is baseline implementation of popular in Scala and Haskell
[parser combinators](https://en.wikipedia.org/wiki/Parser_combinator) for Java.
It has very basic functional so far.Gradle dependency:
```groovy
compile group: 'io.github.pashashiz', name: 'parser-combinators-core', version: '1.0.0'
```Maven dependency:
```xmlio.github.pashashiz
parser-combinators-core
1.0.0```
## Examples:
### JSON parser
Implemented in `parser-json` module.
To parse a JSON just call:
```java
Result result = Json.parse(
"{\"name\": \"John\", \"age\": 30, \"car\": null}");
```### Properties tree parser (the way Spring parses the properties and binds to the objects)
Implemented in `parser-properties-tree` module.
To parse properties just call:
```java
Result properties = PropertyTree.parse(
"ns[1].key1=value1\n" +
"ns[2].key2=value2\n");
```