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

#include <compiler.h>

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

Classes

class  compiler_state_t
 

Public Member Functions

 compiler (bool validating=false)
 
void add_path (std::string const &path)
 
void clear_paths ()
 
void compile (bool bare)
 
std::string find_file (std::string const &script_name)
 
node::pointer_t get_result () const
 
node::pointer_t get_root () const
 
void set_date_time_variables (time_t now)
 
void set_empty_on_undefined_variable (bool const empty_on_undefined_variable)
 
void set_no_logo (bool no_logo=true)
 
void set_root (node::pointer_t root)
 

Private Types

typedef std::vector< std::string > string_vector_t
 
typedef std::map< std::string,
node::pointer_t
validator_script_vector_t
 

Private Member Functions

void add_header_and_footer ()
 
void add_validation_variable (std::string const &variable_name, node::pointer_t value)
 
node::pointer_t at_keyword_expression (node::pointer_t n)
 
void compile (node::pointer_t n)
 
void compile_at_keyword (node::pointer_t n)
 
void compile_component_value (node::pointer_t n)
 
void compile_declaration (node::pointer_t n)
 
void compile_declaration_values (node::pointer_t declaration)
 
node::pointer_t compile_expression (node::pointer_t n, bool skip_whitespace, bool list_of_expressions)
 
void compile_qualified_rule (node::pointer_t n)
 
void expand_nested_components (node::pointer_t n)
 
void expand_nested_declarations (std::string const &name, node::pointer_t parent, node::pointer_t &root, node::pointer_t n)
 
void expand_nested_rules (node::pointer_t parent, node::pointer_t root, node::pointer_t &last, node::pointer_t n)
 
void handle_mixin (node::pointer_t n)
 
void mark_selectors (node::pointer_t n)
 
bool parse_selector (node::pointer_t n)
 
void prepare_function_arguments (node::pointer_t var)
 
void remove_empty_rules (node::pointer_t n)
 
void replace_at_keyword (node::pointer_t parent, node::pointer_t n, size_t &idx)
 
void replace_else (node::pointer_t parent, node::pointer_t n, size_t idx)
 
void replace_if (node::pointer_t parent, node::pointer_t n, size_t idx)
 
void replace_import (node::pointer_t parent, node::pointer_t import, size_t &idx)
 
void replace_variable (node::pointer_t parent, node::pointer_t n, size_t &idx)
 
void replace_variables (node::pointer_t n)
 
void replace_variables_in_comment (node::pointer_t n)
 
bool run_validation (bool check_only)
 
bool selector_attribute_check (node::pointer_t parent, size_t &parent_pos, node::pointer_t n)
 
bool selector_list (node::pointer_t n, size_t &pos)
 
bool selector_simple_term (node::pointer_t n, size_t &pos)
 
bool selector_term (node::pointer_t n, size_t &pos)
 
void set_validation_script (std::string const &script_name)
 
void set_variable (node::pointer_t n)
 

Private Attributes

bool f_compiler_validating = false
 
node::pointer_t f_current_validation_script
 
bool f_no_logo = false
 
node::pointer_t f_return_result
 
compiler_state_t f_state
 
validator_script_vector_t f_validator_scripts
 

Friends

class safe_compiler_state_t
 
class safe_parents_t
 

Detailed Description

Definition at line 25 of file compiler.h.

Member Typedef Documentation

typedef std::vector<std::string> csspp::compiler::string_vector_t
private

Definition at line 50 of file compiler.h.

typedef std::map<std::string, node::pointer_t> csspp::compiler::validator_script_vector_t
private

Definition at line 51 of file compiler.h.

Constructor & Destructor Documentation

csspp::compiler::compiler ( bool  validating = false)

Definition at line 399 of file compiler.cpp.

References csspp::compiler::compiler_state_t::add_path(), and f_state.

Member Function Documentation

void csspp::compiler::add_header_and_footer ( )
private
void csspp::compiler::add_path ( std::string const &  path)
void csspp::compiler::add_validation_variable ( std::string const &  variable_name,
node::pointer_t  value 
)
private
node::pointer_t csspp::compiler::at_keyword_expression ( node::pointer_t  n)
private
void csspp::compiler::clear_paths ( )
void csspp::compiler::compile ( bool  bare)
void csspp::compiler::compile ( node::pointer_t  n)
private
void csspp::compiler::compile_at_keyword ( node::pointer_t  n)
private
void csspp::compiler::compile_component_value ( node::pointer_t  n)
private
void csspp::compiler::compile_declaration ( node::pointer_t  n)
private
void csspp::compiler::compile_declaration_values ( node::pointer_t  declaration)
private
node::pointer_t csspp::compiler::compile_expression ( node::pointer_t  n,
bool  skip_whitespace,
bool  list_of_expressions 
)
private
void csspp::compiler::compile_qualified_rule ( node::pointer_t  n)
private
void csspp::compiler::expand_nested_components ( node::pointer_t  n)
private
void csspp::compiler::expand_nested_declarations ( std::string const &  name,
node::pointer_t  parent,
node::pointer_t root,
node::pointer_t  n 
)
private
void csspp::compiler::expand_nested_rules ( node::pointer_t  parent,
node::pointer_t  root,
node::pointer_t last,
node::pointer_t  n 
)
private
std::string csspp::compiler::find_file ( std::string const &  script_name)

Definition at line 3434 of file compiler.cpp.

References f_state, and csspp::compiler::compiler_state_t::find_file().

Referenced by replace_import(), and set_validation_script().

node::pointer_t csspp::compiler::get_result ( ) const

Definition at line 415 of file compiler.cpp.

References f_return_result.

Referenced by csspp::compiler::compiler_state_t::execute_user_function().

node::pointer_t csspp::compiler::get_root ( ) const
void csspp::compiler::handle_mixin ( node::pointer_t  n)
private
void csspp::compiler::mark_selectors ( node::pointer_t  n)
private
bool csspp::compiler::parse_selector ( node::pointer_t  n)
private
void csspp::compiler::prepare_function_arguments ( node::pointer_t  var)
private
void csspp::compiler::remove_empty_rules ( node::pointer_t  n)
private
void csspp::compiler::replace_at_keyword ( node::pointer_t  parent,
node::pointer_t  n,
size_t &  idx 
)
private
void csspp::compiler::replace_else ( node::pointer_t  parent,
node::pointer_t  n,
size_t  idx 
)
private
void csspp::compiler::replace_if ( node::pointer_t  parent,
node::pointer_t  n,
size_t  idx 
)
private
void csspp::compiler::replace_import ( node::pointer_t  parent,
node::pointer_t  import,
size_t &  idx 
)
private
void csspp::compiler::replace_variable ( node::pointer_t  parent,
node::pointer_t  n,
size_t &  idx 
)
private
void csspp::compiler::replace_variables ( node::pointer_t  n)
private
void csspp::compiler::replace_variables_in_comment ( node::pointer_t  n)
private
bool csspp::compiler::run_validation ( bool  check_only)
private
bool csspp::compiler::selector_attribute_check ( node::pointer_t  parent,
size_t &  parent_pos,
node::pointer_t  n 
)
private
bool csspp::compiler::selector_list ( node::pointer_t  n,
size_t &  pos 
)
private
bool csspp::compiler::selector_simple_term ( node::pointer_t  n,
size_t &  pos 
)
private
bool csspp::compiler::selector_term ( node::pointer_t  n,
size_t &  pos 
)
private
void csspp::compiler::set_date_time_variables ( time_t  now)
void csspp::compiler::set_empty_on_undefined_variable ( bool const  empty_on_undefined_variable)
void csspp::compiler::set_no_logo ( bool  no_logo = true)

Definition at line 499 of file compiler.cpp.

References f_no_logo.

Referenced by anonymous_namespace{csspp.cpp}::pp::compile().

void csspp::compiler::set_root ( node::pointer_t  root)
void csspp::compiler::set_validation_script ( std::string const &  script_name)
private
void csspp::compiler::set_variable ( node::pointer_t  n)
private

Friends And Related Function Documentation

friend class safe_compiler_state_t
friend

Definition at line 48 of file compiler.h.

friend class safe_parents_t
friend

Definition at line 47 of file compiler.h.

Member Data Documentation

bool csspp::compiler::f_compiler_validating = false
private

Definition at line 127 of file compiler.h.

Referenced by run_validation().

node::pointer_t csspp::compiler::f_current_validation_script
private

Definition at line 125 of file compiler.h.

Referenced by add_validation_variable(), run_validation(), and set_validation_script().

bool csspp::compiler::f_no_logo = false
private

Definition at line 128 of file compiler.h.

Referenced by add_header_and_footer(), and set_no_logo().

node::pointer_t csspp::compiler::f_return_result
private

Definition at line 126 of file compiler.h.

Referenced by compile(), compile_at_keyword(), and get_result().

compiler_state_t csspp::compiler::f_state
private
validator_script_vector_t csspp::compiler::f_validator_scripts
private

Definition at line 124 of file compiler.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.