csdltools

Tools for working with DataSift's CSDL language

Лицензия

Лицензия

Группа

Группа

com.github.jond3k
Идентификатор

Идентификатор

csdltools
Последняя версия

Последняя версия

0.5
Дата

Дата

Тип

Тип

jar
Описание

Описание

csdltools
Tools for working with DataSift's CSDL language
Система контроля версий

Система контроля версий

https://github.com/jond3k/csdltools

Скачать csdltools

Как подключить последнюю версию

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

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.scala-lang : scala-library jar 2.9.1
org.apache.commons : commons-lang3 jar 3.1
org.apache.commons : commons-io jar 1.3.2

test (2)

Идентификатор библиотеки Тип Версия
org.scalatest : scalatest_2.9.1 jar 2.0.M3
org.mockito : mockito-all jar 1.9.0

Модули Проекта

Данный проект не имеет модулей.

#CsdlTools

Tools for working with DataSift's Csdl query language

##Csdl Parser

You can start parsing Csdl straight away. Just use the Csdl.parse method

val csdl = Csdl.parse("interaction.content contains \"cheese\"")

The object you'll get back is some form of CsdlBody. Using pattern matching you can decide what to do next.

csdl match {
  case And(l, r) =>
    println("The left hand side is: %s" format l)
    println("The right hand side is: %s" format r)
  case _ => // ..

The hierarchy of AST classes is:

CsdlNode
|- CsdlBody
| |- And
| |- Or
| |- Not
| |- CsdlTaggedBody
| |- Returns
| |- Rule
| |- Stream
|- Argument
| |- Operator
| |- Target
| |- Text
| |- TextList
|- Tag

The parser is implemented using Scala's built-in parser combinators and doesn't provide very good error-handling so isn't too good for use inside editors, etc. It can be pretty useful for automated analysis and optimzation of CSDL we already know is well-formed.

##Future Goals

Right now I'm interested in adding the following:

  • Conversion to other languages
  • Optimization
  • Pretty-printing
  • Versioning, to automatically upgrade statements to newer version of the language

Версии библиотеки

Версия
0.5
0.4
0.3
0.2
0.1