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

https://github.com/technius/selang

A simple programming language
https://github.com/technius/selang

Last synced: about 1 year ago
JSON representation

A simple programming language

Awesome Lists containing this project

README

          

# Selang

This is a simple __S__-__E__xpression-based __Language__.

## Grammar

The concrete grammar of this language is specified using EBNF below:

```plain
whitespace ::= { " " } ;

digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";

number ::= [ "-" ] digit { digit };

letter ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l"
| "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x"
| "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J"
| "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V"
| "W" | "X" | "Y" | "Z" ;

character ::= letter | digit | "\'" | '\"' ;

string ::= '"' { character | whitespace } '"' ;

boolean ::= "true" | "false"

literal = string | number | boolean ;

identifier ::= letter { letter | digit } ;

atom := identifier | literal ;

list := "[" [ term { "," term } ] "]" ;

conditional := "if" term "then" term "else" term ;

term := atom | list | conditional ;
```

## Evaluation rules

TODO

```plain
```

## License

Copyright 2018 Bryan Tan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.