Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.39 KB

README.textile

File metadata and controls

37 lines (25 loc) · 1.39 KB

CSS Parser

As the name suggests, this is a CSS Parser. Well, not quite yet. I just started on it but it soon will be. The SiteCheck project will need to be able to parse CSS in order to check it. It seems like a good idea for that to be a separate project.

See http://www.w3.org/TR/CSS21/syndata.html for a description of CSS 2.1 syntax, grammer and data types. This parser follows the more restrictive grammer found in http://www.w3.org/TR/CSS21/grammar.html. Many of the names used come directly from this document. Most parsers are a direct translation of this specification. Higher level parsers may differ a bit in order to account for additional CSS semantics not expressed in the grammer.

Building

To work with this project, use some combination of the following make commands:

make clean
make tests
make cov
make docs

If you would like to play with the existing parsers in ghci then try this:

$ ghci
> :l Text.CSS.CSSParser
> run unicode "\\00002B"
Right "\\00002B"
> run (unicode >> nonascii) "\\3B \o250"
Right "\168"
> run (num >> comment >> w >> unicode >> num) ".34/* hello */   \\00004F0.25"
Right "0.25"

TODO

Everything.

License

Copyright © 2011 Brenton Ashworth

Distributed under the BSD3 license. See the file LICENSE.