https://github.com/sahandevs/cell-script
A programming language for generating tabular data
https://github.com/sahandevs/cell-script
Last synced: 9 months ago
JSON representation
A programming language for generating tabular data
- Host: GitHub
- URL: https://github.com/sahandevs/cell-script
- Owner: sahandevs
- License: mit
- Created: 2022-02-17T12:41:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-09T11:55:10.000Z (about 3 years ago)
- Last Synced: 2024-12-30T15:36:41.445Z (11 months ago)
- Language: Rust
- Size: 56.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Example
```
# Title: Example 1
param math_score;
param physics_score;
param data_structure_score;
cell math:
math_score * 3
;
cell physics:
physics_score * 3
;
cell data_structure:
data_structure_score * 2
;
cell total:
math + physics + data_structure
;
```
```sh
./cell-script app.cell \
--param "math_score=10,11,13" \
--param "physics_score=15" \
--param "data_structure_score=15" \
--query "total" \
--format "json"
```
```json
[
{
"input": {
"math_score": 10,
"physics_score": 15,
"data_structure_score": 15
},
"output": {
"total": 105
}
},
{
"input": {
"math_score": 11,
"physics_score": 15,
"data_structure_score": 15
},
"output": {
"total": 109
}
},
{
"input": {
"math_score": 11,
"physics_score": 15,
"data_structure_score": 15
},
"output": {
"total": 113
}
}
]
```
### Grammar
```
S: (Param | Cell)*
Param: PARAM Ident SemiColon
Cell: CELL Ident Colon Exp SemiColon
Expr:
| ParOpen Expr ParClose
| Expr Plus Expr
| Expr Sub Expr
| Expr Mul Expr
| Expr Div Expr
| Atom
Atom:
| Number
| Ident
```
### Roadmap
- [x] scanner
- [x] parser
- [x] AST interpreter
- [x] detect cyclic dependency
- [x] CLI
- [x] multi-threaded
- [ ] Bytecode
- [ ] ByteCode interpreter
- [ ] Compiler / CodeGen (LLVM)