Any sample about how to use it to parse CSS? #184
Replies: 2 comments
-
We currently do not have an implementation of the CSS grammar as example, and there is no short answer as to how this can be achieved. The latest CSS syntax is defined here and should presumably be used as a guide and reference for a CSS parser. Some of the example grammars in As you can see for example with the Lua 5.3 grammar, the result of combining the two phases can be quite large, though in this case the large apparent size is also due to the incorporation of the operator precedence rules, and I would expect CSS to be less of a hassle. What the PEGTL does nicely is separate syntactical grammar from semantical actions, wherefore the first step towards a CSS parser is the actual grammar, ignoring anything that needs to be done during parsing, which can and should be added later (even though it might again require some tweaks to the grammar). Implementing a non-trivial grammar can be a bit of a grind, we can help you by answering any questions here, and please let us know how thing progress. |
Beta Was this translation helpful? Give feedback.
-
I'll close this issue for now, but feel free to ask any further questions here... |
Beta Was this translation helpful? Give feedback.
-
Hi,
Any sample about how to use it to parse CSS?
Im the creator of ezored (https://ezored.com) and i want make a mobile library in C++ that parse CSS files (but more simple CSS style) and back to mobile platform objects. Example:
And on iOS and Android i will do:
There is a sample to parse CSS with key/value?
Can you help me understand how to parse using library?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions