esc: Extensible Syntax Compiler
This is a project for an extensible parsing system that aims to provide a user-friendly method for designing composable DSLs.
Languages are defined in modules by CFGs written in standard BNF notation. DSLs can be built on top of the Racket programming language by writing type-oriented grammar rules as function or macro signatures followed by Racket code for their implementation.
Integer ::= "|" s:Set "|" = (set-count s); |
1 Installation
To try out the tool, first download and install Racket from http://racket-lang.org. Then start the Racket interpreter, and enter (require (planet esilkensen/esc)). This installs an esc command to the raco program.
raco esc [<source-file>] ... |
2 Examples
"abc.es"
import ML, Sets;
let A = {1, 2, 3} {
let B = {2, 3, 4} {
let C = {3, 4, 5} {
print |A & C|;
print A | B & C
}
}
}
raco esc abc.es |
racket -I typed/racket abc.rkt |
1 |
#<set: 1 2 3 4> |