Current Version: 1.0.10
Project Name: csspp
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
csspp::lexer Class Reference

#include <lexer.h>

Collaboration diagram for csspp::lexer:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< lexerpointer_t
 

Public Member Functions

 lexer (std::istream &in, position const &pos)
 
wide_char_t mbtowc (char const *mb)
 
node::pointer_t next_token ()
 
void wctomb (wide_char_t const wc, char *mb, size_t max_length)
 
std::string wctomb (wide_char_t const wc)
 

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
 

Detailed Description

Definition at line 25 of file lexer.h.

Member Typedef Documentation

typedef std::shared_ptr<lexer> csspp::lexer::pointer_t

Definition at line 28 of file lexer.h.

Constructor & Destructor Documentation

csspp::lexer::lexer ( std::istream &  in,
position const &  pos 
)

Definition at line 53 of file lexer.cpp.

Member Function Documentation

node::pointer_t csspp::lexer::comment ( bool  c_comment)
private
wide_char_t csspp::lexer::escape ( )
private
wide_char_t csspp::lexer::getc ( )
private
node::pointer_t csspp::lexer::hash ( )
private
int csspp::lexer::hex_to_dec ( wide_char_t  c)
static

Definition at line 744 of file lexer.cpp.

Referenced by escape(), csspp::color::set_color(), and unicode_range().

node::pointer_t csspp::lexer::identifier ( wide_char_t  c)
private
static bool constexpr csspp::lexer::is_digit ( wide_char_t  c)
inlinestatic

Definition at line 86 of file lexer.h.

Referenced by number().

static bool constexpr csspp::lexer::is_hash_character ( wide_char_t  c)
inlinestatic

Definition at line 98 of file lexer.h.

Referenced by hash().

static bool constexpr csspp::lexer::is_hex ( wide_char_t  c)
inlinestatic

Definition at line 91 of file lexer.h.

Referenced by escape(), next_token(), csspp::color::set_color(), and unicode_range().

static bool constexpr csspp::lexer::is_identifier ( wide_char_t  c)
inlinestatic

Definition at line 66 of file lexer.h.

Referenced by csspp::assembler::escape_id(), identifier(), next_token(), and number().

static bool constexpr csspp::lexer::is_non_printable ( wide_char_t  c)
inlinestatic

Definition at line 46 of file lexer.h.

Referenced by identifier(), and csspp::assembler::output_url().

static bool constexpr csspp::lexer::is_space ( wide_char_t  c)
inlinestatic

Definition at line 38 of file lexer.h.

Referenced by comment(), escape(), identifier(), and next_token().

static bool constexpr csspp::lexer::is_start_identifier ( wide_char_t  c)
inlinestatic

Definition at line 77 of file lexer.h.

Referenced by csspp::assembler::escape_id(), identifier(), and next_token().

static bool constexpr csspp::lexer::is_variable ( wide_char_t  c)
inlinestatic

Definition at line 56 of file lexer.h.

Referenced by next_token(), and variable().

wide_char_t csspp::lexer::mbtowc ( char const *  mb)
node::pointer_t csspp::lexer::next_token ( )
node::pointer_t csspp::lexer::number ( wide_char_t  c)
private
std::string csspp::lexer::string ( wide_char_t const  quote)
private

Definition at line 1245 of file lexer.cpp.

References csspp::ERROR_ERROR, escape(), f_start_position, getc(), csspp::error::instance(), ungetc(), and wctomb().

Referenced by identifier().

void csspp::lexer::ungetc ( wide_char_t  c)
private

Definition at line 716 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().

node::pointer_t csspp::lexer::unicode_range ( wide_char_t  c)
private
node::pointer_t csspp::lexer::variable ( wide_char_t  c)
private
void csspp::lexer::wctomb ( wide_char_t const  wc,
char *  mb,
size_t  max_length 
)
std::string csspp::lexer::wctomb ( wide_char_t const  wc)

Definition at line 611 of file lexer.cpp.

References wctomb().

Member Data Documentation

std::istream& csspp::lexer::f_in
private

Definition at line 125 of file lexer.h.

Referenced by getc().

position csspp::lexer::f_position
private

Definition at line 126 of file lexer.h.

Referenced by getc(), and next_token().

position csspp::lexer::f_start_position
private
wide_char_t csspp::lexer::f_ungetc[UNGETSIZ]
private

Definition at line 128 of file lexer.h.

Referenced by getc(), and ungetc().

size_t csspp::lexer::f_ungetc_pos = 0
private

Definition at line 129 of file lexer.h.

Referenced by getc(), and ungetc().

size_t const csspp::lexer::UNGETSIZ = 16
staticprivate

Definition at line 111 of file lexer.h.


The documentation for this class was generated from the following files:

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.