Generic StyleSheets Grammar

The Gold Grammar used for GSS: [Latest]

Grammar
"Name"    = 'Generic Style Sheet'
"Version" = 'v0.1'
"Author"  = 'Max Battcher'
"About"   = 'Generic language similar to CSS for CSS-like use.'

{String Char} = {Printable} - ["\]
{LetterU} = {Letter} + [_]
{AlphanumericU} = {Alphanumeric} + [_]

Identifier     = {LetterU}{AlphanumericU}*
StringLiteral  = '"'({String Char}|'\'{Printable})*'"'
IntegerLiteral = {Digit}+
FloatLiteral   = {Digit}+.{Digit}+

"Case Sensitive" = False
"Start Symbol" = <Rules>

Comment Line  =  '//'
Comment Start =  '/*'
Comment End   =  '*/'

! Add the grammar's rules below.

<Rules> ::= <Rule> <Rules>
| <Rule>

<Rule> ::= <Object> '{' <Properties> '}'

<Properties> ::= <Property> <Properties>
| <Property>
| <Rule> <Properties>
| <Rule>

<Property> ::= Identifier '=' <Valuelist> ';'

<Valuelist> ::= <Value> ',' <Valuelist>
| <Value>

<Value> ::= <Object>
| StringLiteral
| IntegerLiteral
| FloatLiteral
| <Object> '(' <Valuelist> ')'
| <Object> '(' ')'

<Object> ::= Identifier '.' <Object>
| Identifier
| '#' Identifier


Copyright 2004 Max Battcher. Pages and documentation licensed under the Creative Commons License. Source code is licensed under the BSD license.