Advertisement
Guest User

nearley css

a guest
Jan 2nd, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
BNF 0.69 KB | None | 0 0
  1. # Match a CSS color
  2. # http://www.w3.org/TR/css3-color/#colorunits
  3.  
  4. @builtin "whitespace.ne" # `_` means arbitrary amount of whitespace
  5. @builtin "number.ne"     # `int`, `decimal`, and `percentage` number primitives
  6.  
  7. csscolor -> "#" hexdigit hexdigit hexdigit hexdigit hexdigit hexdigit
  8.           | "#" hexdigit hexdigit hexdigit
  9.           | "rgb"  _ "(" _ colnum _ "," _ colnum _ "," _ colnum _ ")"
  10.           | "hsl"  _ "(" _ colnum _ "," _ colnum _ "," _ colnum _ ")"
  11.           | "rgba" _ "(" _ colnum _ "," _ colnum _ "," _ colnum _ "," _ decimal _ ")"
  12.           | "hsla" _ "(" _ colnum _ "," _ colnum _ "," _ colnum _ "," _ decimal _ ")"
  13.  
  14. hexdigit -> [a-fA-F0-9]
  15. colnum   -> int | percentage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement