https://github.com/jagrosh/jagtag
📝 JagTag is a simple - yet powerful and customizable - interpretted text parsing language!
https://github.com/jagrosh/jagtag
java parser parsing text-parser text-parsing
Last synced: 3 months ago
JSON representation
📝 JagTag is a simple - yet powerful and customizable - interpretted text parsing language!
- Host: GitHub
- URL: https://github.com/jagrosh/jagtag
- Owner: jagrosh
- License: apache-2.0
- Created: 2016-11-06T09:07:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-28T15:10:04.000Z (over 5 years ago)
- Last Synced: 2025-03-21T19:01:36.749Z (3 months ago)
- Topics: java, parser, parsing, text-parser, text-parsing
- Language: Java
- Homepage:
- Size: 42 KB
- Stars: 44
- Watchers: 4
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## JagTag
JagTag is a simple - yet powerful and customizable - interpretted text parsing language!
Some methods are included in the built-in libraries, and additional methods can be defined that utilize the parser environment veriables, as well as the method's input.## Simple Example
```java
import com.jagrosh.jagtag.*;
public class Example
{
public static void main(String[] args)
{
Parser parser = JagTag.newDefaultBuilder()
.addMethod( new Method("exclaim", (env,in) -> in[0]+"!!!") )
.build();
String result = parser.parse("{exclaim:{if:this|=|that|then:Foo Bar|else:Hello World}}");
System.out.println(result);
}
}
```
Result: `Hello World!!!`## Maven
To use Maven with JagTag, simply add the following sections to your pom.xml
```xml
central
bintray
http://jcenter.bintray.com
```
```xml
com.jagrosh
JagTag
0.5
```## Current Projects
Here are some other projects that utilize JagTag:
* [**Spectra (Discord Bot)**](https://github.com/jagrosh/Spectra) - Spectra uses JagTag in its customizable "tags" (user-created commands), and in welcome and leave messages for servers. (https://github.com/jagrosh/Spectra/blob/master/src/spectra/jagtag/libraries/Discord.java)## Other Libraries
Below are JagTag-related libraries available for other languages or purposes:
* [**TheSharks/JagTag-JS**](https://github.com/TheSharks/JagTag-JS) - A JavaScript port of the JagTag text parsing language
* [**TheMonitorLizard/JagTagXML**](https://github.com/TheMonitorLizard/JagTagXML) - a JagTag to XML transpiler written in Java