Skip to content

Instantly share code, notes, and snippets.

@Upliner
Created June 23, 2010 14:45
Show Gist options
  • Save Upliner/450013 to your computer and use it in GitHub Desktop.
Save Upliner/450013 to your computer and use it in GitHub Desktop.
%{
// prolog
%}
%token LBRACKET
%token RBRACKET
%token LBRACE
%token RBRACE
%token LPARENS
%token RPARENS
%token COLON
%token SEMICOLON
%token COMMA
%token PERIOD
%token EQUALS
%token IDENTIFIER
%token NUMBER
%token COLOR
%start mapcss_document
%%
mapcss_document : rules;
rules : rule | rules rule;
rule : selectors styles;
styles : style | styles style;
style : LBRACE properties RBRACE;
properties : property | properties property;
property : IDENTIFIER COLON value SEMICOLON;
value : IDENTIFIER | NUMBER | COLOR;
selectors : selector | selectors COMMA selector;
selector : primitive opt_tag opt_class | primitive opt_tag opt_class primitive opt_tag opt_class;
primitive : 'node' | 'way' | 'relation'
opt_tag : | tag;
tag : LBRACKET IDENTIFIER EQUALS IDENTIFIER RBRACKET;
opt_class : | class | pseudoclass;
class : PERIOD IDENTIFIER;
pseudoclass : COLON IDENTIFIER;
%%
// epilog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment