Go to file
ben 874fb219a1 README 2015-06-10 10:32:59 +00:00
.gitignore Initial commit 2015-06-01 16:53:46 +00:00
README.md README 2015-06-10 10:32:59 +00:00
VCL.BNF quotes around iprange were missing from BNF 2015-06-01 17:13:31 +00:00
vcl.hs Explciit AclEntry and using instance declerations 2015-06-06 14:15:04 +00:00

README.md

vcl

This is a simple AST, Pretty Printer and Parser for VCL (the DSL for configuring Varnish).

This is a learning project, with the goal of being able to correctly generating ACLs in VCL. (I may or may not iplement the rest of this grammar).

The source BNF can be found here.

I have submitted an improvement that hasn't been added yet, see VCL.BNF in this repository.

λ > let ip_a = IPRange "192.168.0.1" $ Just 24
λ > let ip_b = IPRange "10.40.20.1" Nothing
λ > let entries = [AclEntry ip_a True, AclEntry ip_b False]
λ > Acl (Identifier "testacl") entries
λ> Acl (Identifier "test") [AclEntry ip_a True, AclEntry ip_b False]
acl"test"{
  "192.168.0.1"/32;
  ! "10.40.20.1";
}
λ>