io.github.spair:byond-dme-parser

Parser to deserialize BYOND object tree.

License

License

GroupId

GroupId

io.github.spair
ArtifactId

ArtifactId

byond-dme-parser
Last Version

Last Version

0.4
Release Date

Release Date

Type

Type

jar
Description

Description

io.github.spair:byond-dme-parser
Parser to deserialize BYOND object tree.
Project URL

Project URL

https://spair.github.io/byond-dme-parser
Source Code Management

Source Code Management

https://github.com/SpaiR/byond-dme-parser/tree/master

Download byond-dme-parser

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.spair/byond-dme-parser/ -->
<dependency>
    <groupId>io.github.spair</groupId>
    <artifactId>byond-dme-parser</artifactId>
    <version>0.4</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.spair/byond-dme-parser/
implementation 'io.github.spair:byond-dme-parser:0.4'
// https://jarcasting.com/artifacts/io.github.spair/byond-dme-parser/
implementation ("io.github.spair:byond-dme-parser:0.4")
'io.github.spair:byond-dme-parser:jar:0.4'
<dependency org="io.github.spair" name="byond-dme-parser" rev="0.4">
  <artifact name="byond-dme-parser" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.spair', module='byond-dme-parser', version='0.4')
)
libraryDependencies += "io.github.spair" % "byond-dme-parser" % "0.4"
[io.github.spair/byond-dme-parser "0.4"]

Dependencies

compile (2)

Group / Artifact Type Version
com.udojava : EvalEx jar 2.0
com.eclipsesource.minimal-json : minimal-json jar 0.9.4

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Build Status Javadocs License

BYOND Dme Parser

About

Library to parse BYOND project and deserialize whole object tree into Dme.class object.

Installation

Maven Central JCenter

Library deployed to Maven Central and JCenter repositories.

pom.xml

<dependency>
    <groupId>io.github.spair</groupId>
    <artifactId>byond-dme-parser</artifactId>
    <version>${last.version}</version>
</dependency>

build.gradle:

compile 'io.github.spair:byond-dme-parser:${last.version}'

How To Use

Project parsing process should be started from the root .dme file.

Dme dme = DmeParser.parse(new File(${path/to/root/dme/file}));

Also Dme object has method to merge himself with provided json.

JSON should have next format:

{
  "macroses": {
    "NUMBER_MACROS": 100,
    "TEXT_MACROS": "{text}one hundred",     << this will result in quoted text
    "RAW_MACROS": "one hundred"
  },
  "definitions": [
    {
      "type": "/obj",
      "parent": "/datum",
      "subtypes": [],
      "vars": {
        "number_var": 100,
        "text_var": "{text}one hundred",    << this will result in quoted text
        "raw_var": "one hundred"
      }
    }
  ]
}

Next fields for object definitions are mandatory: type, parent, subtypes, vars. If you don't wan't provide value to one of these field, it should still exist and have empty value (empty string for type and parent, empty array for subtypes, empty object for vars).

More could be found in JavaDoc.

Credits

The parsing algorithm itself is a pretty straightforward port of @monster860 JS library byond-parser, big thanks to him for that.

Versions

Version
0.4
0.3.2
0.3.1
0.3
0.2
0.1.9.1
0.1.9
0.1.8.1
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1