Re: [css-parse] Getting this conversation rolling

I agree that generically we will want some kind of CSSOM transform API. And yes inevitably that will require a parser.

I have been working on a Parsing Expression Grammar generator (very slowly and very leisurely) and it is designed for this purpose - create a simple way to build parsers and extend grammars with object models. It's not new and in fact I took great ideas from a lot of other implementations (more info about PEGs here: http://bford.info/packrat/).

Whether my parser is helpful here or not, I believe it is a core feature of the larger "engine" that we've discussed and will go a long ways to help define Prollyfills in an object model.



On Nov 19, 2012, at 3:48 PM, Brian Kardell <bkardell@gmail.com> wrote:

> It is inevitable, so I'd like to begin the discussion about parsing CSS or CSS-like languages as one thing that would be necessary to whole families of prollyfills.  I made a proposal for CSSOM a while back about how you could add to standard CSSOM, but that didn't go anywhere because of unknown rules handling and - I think because then Anne left...  CSSOM would be no good for a preprocessor which is probably how many would want to push stuff ultimately... Because of all of this I worked up a different idea[1] which I actually used in another project (not hitch) and proposed you could merely list under a different interface in the CSSOM API - I have the parser, it is open-sourceable but while it is fast, it's really limited in what it can/can't parse -  - after lots of threads back then I believe that maybe at least a few FF and Webkit folks might think it is _plausible_ that we could do at least one of those.
> 
> In any case, all of these CSS-related projects always wind up having to start by parsing the CSS and I think that step 1 would be "define a transform API" _something like_ (in vague terms) the one I lay out in that email which could be describe CSS in easily parsed terms which could be used for easy registration in all kinds of ways and for all kinds of purposes in prollyfills.  Of course, you could lay a proposed CSSOM on top of that if you wanted to...
> 
> http://lists.w3.org/Archives/Public/www-style/2011Jul/0501.html
> 
> This seems like actually a pretty interesting and fun place to start conversations as I think it would help loop in some new/valuable people and get the idea juices flowing...
> 
> Thoughts?

Received on Tuesday, 20 November 2012 20:26:22 UTC