grammar CssBorder;

import BaseNumbers, CssColor, CssUnit;

borderCSS
    : borderCSS_Style WS color WS borderSize
    | borderCSS_Style (WS borderSize)? (WS color)?
    | color WS borderCSS_Style WS borderSize
    | color (WS borderSize)? (WS borderCSS_Style)?
    | borderSize WS borderCSS_Style WS color
    | borderSize (WS color)? (WS borderCSS_Style)?
    ;

borderCSS_Style
    : CSS2_none
    | CSS2_BORDER_solid
    | CSS2_BORDER_dotted
    | CSS2_BORDER_dashed
    | CSS2_BORDER_double
    | CSS2_BORDER_groove
    | CSS2_BORDER_ridge
    | CSS2_BORDER_inset
    | CSS2_BORDER_outset
    ;

borderSize
    : borderSizeComponent #borderSize1
    | borderSizeComponent WS borderSizeComponent #borderSize2
    | borderSizeComponent WS borderSizeComponent WS borderSizeComponent WS borderSizeComponent #borderSize4
    ;

borderSizeComponent
    : length
    | CSS2_BORDER_thin
    | CSS2_BORDER_medium
    | CSS2_BORDER_thick
    ;

CSS2_none             : 'none';
CSS2_BORDER_solid     : 'solid';
CSS2_BORDER_dotted    : 'dotted';
CSS2_BORDER_dashed    : 'dashed';
CSS2_BORDER_double    : 'double';
CSS2_BORDER_groove    : 'groove';
CSS2_BORDER_ridge     : 'ridge';
CSS2_BORDER_inset     : 'inset';
CSS2_BORDER_outset    : 'outset';

CSS2_BORDER_thin      : 'thin';
CSS2_BORDER_medium    : 'medium';
CSS2_BORDER_thick     : 'thick';
