Skip to content
README.md 1.3 KiB
Newer Older
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed
Rolas
=====

Rolas is a simple database for music. It can mine a music folder for the
database, and it can also show and play the tracks and do queries on them.

Canek Peláez Valdés's avatar
Canek Peláez Valdés committed
Compiling and running it
------------------------

To compile `rolas` you need [`meson`](https://mesonbuild.com/) and
[`ninja`](https://ninja-build.org/) installed.
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed

```
git clone https://aztlan.fciencias.unam.mx/gitlab/canek/rolas.git
cd rolas/
meson build/
ninja -C build/
```

The executable will be in `buid/rolas`, and you should be able to run it from
anywhere.

```
./bin/rolas
```

To run the tests you need to be in the project directory.

```
ninja -C build/ test
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed
```

Grammar
-------

The grammar for the query language is shown here in
[Backus–Naur form](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form):

```
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed
<expr> ::= <match> | (<expr>) | <unaryop><expr> | <expr><binaryop><expr>
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed

<match> ::= <field> ":" <string>
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed

<field> ::= "title" | "titl" | "tit" | "ti" | "t" |
            "artist" | "artis" | "arti" | "art" | "ar" | "a" |
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed
            "album" | "albu" | "alb" | "al" | "l"
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed

<string> ::= [:alpha:]+ | "\""[^\"]+"\""
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed

<unaryop> ::= "!"

<binaryop> ::= "&" | "|"
```

To avoid ambiguity, the binary operators associate to the left; in other words:

```
t:love & a:john | l:hits
```

is interpreted as:

```
(t:love & a:john) | l:hits
Canek Peláez Valdés's avatar
Canek Peláez Valdés committed
```