#include <lexer.h>
Public Types | |
typedef std::shared_ptr< lexer > | pointer_t |
Public Member Functions | |
lexer (std::istream &in, position const &pos) | |
wide_char_t | mbtowc (char const *mb) |
node::pointer_t | next_token () |
std::string | wctomb (wide_char_t const wc) |
void | wctomb (wide_char_t const wc, char *mb, size_t max_length) |
Static Public Member Functions | |
static int | hex_to_dec (wide_char_t c) |
static bool constexpr | is_digit (wide_char_t c) |
static bool constexpr | is_hash_character (wide_char_t c) |
static bool constexpr | is_hex (wide_char_t c) |
static bool constexpr | is_identifier (wide_char_t c) |
static bool constexpr | is_non_printable (wide_char_t c) |
static bool constexpr | is_space (wide_char_t c) |
static bool constexpr | is_start_identifier (wide_char_t c) |
static bool constexpr | is_variable (wide_char_t c) |
Private Member Functions | |
node::pointer_t | comment (bool c_comment) |
wide_char_t | escape () |
wide_char_t | getc () |
node::pointer_t | hash () |
node::pointer_t | identifier (wide_char_t c) |
node::pointer_t | number (wide_char_t c) |
std::string | string (wide_char_t const quote) |
void | ungetc (wide_char_t c) |
node::pointer_t | unicode_range (wide_char_t c) |
node::pointer_t | variable (wide_char_t c) |
Private Attributes | |
std::istream & | f_in |
position | f_position |
position | f_start_position |
wide_char_t | f_ungetc [UNGETSIZ] |
size_t | f_ungetc_pos = 0 |
Static Private Attributes | |
static size_t const | UNGETSIZ = 16 |
typedef std::shared_ptr<lexer> csspp::lexer::pointer_t |
csspp::lexer::lexer | ( | std::istream & | in, |
position const & | pos | ||
) |
|
private |
Definition at line 1305 of file lexer.cpp.
References csspp::COMMENT, csspp::ERROR_ERROR, f_start_position, getc(), csspp::error::instance(), is_space(), ungetc(), and wctomb().
Referenced by next_token().
|
private |
Definition at line 764 of file lexer.cpp.
References csspp::ERROR_ERROR, f_start_position, getc(), hex_to_dec(), csspp::error::instance(), is_hex(), is_space(), and ungetc().
Referenced by hash(), identifier(), number(), and string().
|
private |
Definition at line 619 of file lexer.cpp.
References csspp::ERROR_ERROR, csspp::ERROR_HEX, f_in, f_position, f_start_position, f_ungetc, f_ungetc_pos, csspp::error::instance(), mbtowc(), csspp::position::next_line(), and csspp::position::next_page().
Referenced by comment(), escape(), hash(), identifier(), next_token(), number(), string(), unicode_range(), and variable().
|
private |
Definition at line 1213 of file lexer.cpp.
References csspp::ERROR_ERROR, escape(), f_start_position, getc(), csspp::HASH, csspp::error::instance(), is_hash_character(), ungetc(), and wctomb().
Referenced by next_token().
|
static |
Definition at line 745 of file lexer.cpp.
Referenced by escape(), csspp::color::set_color(), and unicode_range().
|
private |
Definition at line 824 of file lexer.cpp.
References csspp::AT_KEYWORD, csspp::EOF_TOKEN, csspp::ERROR_ERROR, escape(), f_start_position, csspp::FUNCTION, getc(), csspp::IDENTIFIER, csspp::error::instance(), is_identifier(), is_non_printable(), is_space(), is_start_identifier(), csspp::PLACEHOLDER, string(), ungetc(), csspp::URL, and wctomb().
Referenced by next_token().
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Definition at line 92 of file lexer.h.
Referenced by escape(), next_token(), csspp::color::set_color(), and unicode_range().
|
inlinestaticconstexpr |
Definition at line 67 of file lexer.h.
Referenced by csspp::assembler::escape_id(), identifier(), next_token(), and number().
|
inlinestaticconstexpr |
Definition at line 47 of file lexer.h.
Referenced by identifier(), and csspp::assembler::output_url().
|
inlinestaticconstexpr |
Definition at line 39 of file lexer.h.
Referenced by comment(), escape(), identifier(), and next_token().
|
inlinestaticconstexpr |
Definition at line 78 of file lexer.h.
Referenced by csspp::assembler::escape_id(), identifier(), and next_token().
|
inlinestaticconstexpr |
Definition at line 57 of file lexer.h.
Referenced by next_token(), and variable().
wide_char_t csspp::lexer::mbtowc | ( | char const * | mb | ) |
Definition at line 488 of file lexer.cpp.
References csspp::ERROR_ERROR, csspp::ERROR_HEX, f_start_position, and csspp::error::instance().
Referenced by csspp::assembler::escape_id(), and getc().
node::pointer_t csspp::lexer::next_token | ( | ) |
Definition at line 59 of file lexer.cpp.
References csspp::ADD, csspp::AND, csspp::ASSIGNMENT, csspp::CDC, csspp::CDO, csspp::CLOSE_CURLYBRACKET, csspp::CLOSE_PARENTHESIS, csspp::CLOSE_SQUAREBRACKET, csspp::COLON, csspp::COLUMN, csspp::COMMA, comment(), csspp::CONDITIONAL, csspp::DASH_MATCH, csspp::DIVIDE, csspp::DOLLAR, csspp::EOF_TOKEN, csspp::EQUAL, csspp::ERROR_ERROR, csspp::ERROR_HEX, csspp::ERROR_WARNING, csspp::EXCLAMATION, f_position, f_start_position, getc(), csspp::GREATER_EQUAL, csspp::GREATER_THAN, hash(), identifier(), csspp::INCLUDE_MATCH, csspp::error::instance(), is_hex(), is_identifier(), is_space(), is_start_identifier(), is_variable(), csspp::LESS_EQUAL, csspp::LESS_THAN, csspp::MODULO, csspp::MULTIPLY, csspp::NOT_EQUAL, number(), csspp::OPEN_CURLYBRACKET, csspp::OPEN_PARENTHESIS, csspp::OPEN_SQUAREBRACKET, csspp::PERIOD, csspp::POWER, csspp::PRECEDED, csspp::PREFIX_MATCH, csspp::REFERENCE, csspp::SCOPE, csspp::SEMICOLON, csspp::STRING, csspp::SUBSTRING_MATCH, csspp::SUBTRACT, csspp::SUFFIX_MATCH, ungetc(), unicode_range(), variable(), and csspp::WHITESPACE.
|
private |
Definition at line 1003 of file lexer.cpp.
References csspp::DECIMAL_NUMBER, csspp::ERROR_ERROR, escape(), f_start_position, getc(), csspp::error::instance(), csspp::INTEGER, is_digit(), is_identifier(), csspp::PERCENT, ungetc(), and wctomb().
Referenced by next_token().
|
private |
Definition at line 1246 of file lexer.cpp.
References csspp::ERROR_ERROR, escape(), f_start_position, getc(), csspp::error::instance(), ungetc(), and wctomb().
Referenced by identifier().
|
private |
Definition at line 717 of file lexer.cpp.
References f_ungetc, and f_ungetc_pos.
Referenced by comment(), escape(), hash(), identifier(), next_token(), number(), string(), unicode_range(), and variable().
|
private |
Definition at line 1424 of file lexer.cpp.
References csspp::ERROR_ERROR, f_start_position, csspp::unicode_range_t::get_range(), getc(), hex_to_dec(), csspp::error::instance(), is_hex(), ungetc(), and csspp::UNICODE_RANGE.
Referenced by next_token().
|
private |
Definition at line 1512 of file lexer.cpp.
References f_start_position, getc(), is_variable(), ungetc(), csspp::VARIABLE, csspp::VARIABLE_FUNCTION, and wctomb().
Referenced by next_token().
std::string csspp::lexer::wctomb | ( | wide_char_t const | wc | ) |
void csspp::lexer::wctomb | ( | wide_char_t const | wc, |
char * | mb, | ||
size_t | max_length | ||
) |
Definition at line 549 of file lexer.cpp.
References csspp::ERROR_ERROR, f_start_position, and csspp::error::instance().
Referenced by comment(), hash(), identifier(), number(), string(), variable(), and wctomb().
|
private |
|
private |
Definition at line 127 of file lexer.h.
Referenced by getc(), and next_token().
|
private |
Definition at line 128 of file lexer.h.
Referenced by comment(), escape(), getc(), hash(), identifier(), mbtowc(), next_token(), number(), string(), unicode_range(), variable(), and wctomb().
|
private |
|
private |
Documentation of CSS Preprocessor.
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.