An open API service indexing awesome lists of open source software.

https://github.com/joeyshi12/pql-parser

Plot query language parser library
https://github.com/joeyshi12/pql-parser

ast node npm-package parser pql

Last synced: 5 months ago
JSON representation

Plot query language parser library

Awesome Lists containing this project

README

          

# pql-parser

![node.js.yml](https://github.com/joeyshi12/pql-parser/actions/workflows/node.js.yml/badge.svg)
![npm-publish.yml](https://github.com/joeyshi12/pql-parser/actions/workflows/npm-publish.yml/badge.svg)
![npm](https://img.shields.io/npm/v/pql-parser.svg)

Plot query language parser.

A 2D plot generation tool made with this parser is hosted at https://devtools.joeyshi.xyz/pql_compiler.

## Syntax

```
PLOT (BAR(category_column, value_column) | LINE(x_column, y_column) | SCATTER(x_column, y_column))
[WHERE ]
[GROUP BY ]
[HAVING ]
[LIMIT [OFFSET ]]
```

## EBNF

```
::= "PLOT" [] [] [] []

::= | |

::= "BAR" "(" "," ")"

::= "LINE" "(" "," ")"

::= "SCATTER" "(" "," ")"

::= "WHERE"

::= "GROUP BY"

::= "HAVING"

::= "LIMIT" ["OFFSET" ]

::= "OR" | "AND"

::= ["AS" ]

::= "(" ")" |

::= "MIN" | "MAX" | "AVG" | "COUNT" | "SUM"

::= { | | "_" }

::= { "OR" } | { "AND" }

::= | "(" ")"

::= { "OR" } | { "AND" }

::= | "(" ")"

::= ">" | "<" | ">=" | "<=" | "="

::= | | "NULL"

::= {}

::= "'" {} "'"

::= "0" | ... | "9"

::= "A" | ... | "Z" | "a" | ... | "z"
```