2gis/cartoshka

Name: cartoshka

Owner: 2GIS

Description: CartoCSS parser for Java (JVM)

Created: 2015-10-08 09:49:36.0

Updated: 2017-09-14 19:42:20.0

Pushed: 2015-12-29 09:48:26.0

Homepage: http://2gis.github.io/cartoshka

Size: 313

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

cartoshka

CartoCSS (carto) parser for Java. All it does is translate CartoCSS to a traversable hierarchy of Java classes.

![GitHub license](https://img.shields.io/badge/license-MPL 2.0-blue.svg?style=flat-square) Build status Coverage Status

Features
Setup

Add the following to your maven configuration or taylor to your own dependency management system.

endencies>
<dependency>
    <groupId>com.2gis.cartoshka</groupId>
    <artifactId>cartoshka</artifactId>
    <version>0.2</version>
</dependency>
pendencies>
Quickstart

Look at the simple example below

oParser parser = new CartoParser();
(FileReader reader = new FileReader(file)) {
// parsing the file
Block style = parser.parse(file.getName(), reader);

// constant folding
style.accept(new ConstantFoldVisitor(), null);

// pretty print
String pretty = style.accept(new PrintVisitor(), null);
System.out.println(pretty);
tch (IOException e) {
e.printStackTrace();


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.