Current Version: 1.0.10
Project Name: csspp
Namespaces | Variables
nth_child.cpp File Reference

Implementation of the CSS Preprocessor nth-child handling. More...

#include "csspp/nth_child.h"
#include <cstdio>
#include <iostream>
Include dependency graph for nth_child.cpp:

Go to the source code of this file.


 The namespace of all the classes in the CSS Preprocessor.


int const csspp::anonymous_namespace{nth_child.cpp}::g_shift_a = 0
int const csspp::anonymous_namespace{nth_child.cpp}::g_shift_b = 32

Detailed Description

The CSS Preprocessor, while verifying a grammar, will check each and every parameter. This includes the syntax of the An+B in a function such as the ':nth-child(...)' one.

Grammar used to parse the selectors

The grammar allows for one or two signed integers, the first followed by an 'n' (or 'N' since we are case insensitive). Both of those numbers can be omitted. When an integer is omitted, it defaults to 0.

Spaces can appear anywhere, we just remove them all. In CSS 3, spaces are not allowed between the sign and INTEGER of the first integer, nor between the first integer and the 'n' character.

nth: optionally-signed-integer 'n' signed-integer | optionally-signed-integer 'n' | optionally-signed-integer | 'ODD' | 'EVEN'

optionally-signed-integer: INTEGER | signed-integer

signed-integer: '+' INTEGER | '-' INTEGER

Definition in file nth_child.cpp.

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.