Current Version: 1.0.33
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_tvalidator_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 = node::pointer_t()
 
bool f_no_logo = false
 
node::pointer_t f_return_result = node::pointer_t()
 
compiler_state_t f_state = compiler_state_t()
 
validator_script_vector_t f_validator_scripts = validator_script_vector_t()
 

Friends

class safe_compiler_state_t
 
class safe_parents_t
 

Detailed Description

Definition at line 25 of file compiler.h.

Member Typedef Documentation

◆ string_vector_t

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

Definition at line 50 of file compiler.h.

◆ validator_script_vector_t

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

◆ compiler()

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

Definition at line 413 of file compiler.cpp.

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

Member Function Documentation

◆ add_header_and_footer()

void csspp::compiler::add_header_and_footer ( )
private

◆ add_path()

void csspp::compiler::add_path ( std::string const &  path)

◆ add_validation_variable()

void csspp::compiler::add_validation_variable ( std::string const &  variable_name,
node::pointer_t  value 
)
private

◆ at_keyword_expression()

node::pointer_t csspp::compiler::at_keyword_expression ( node::pointer_t  n)
private

◆ clear_paths()

void csspp::compiler::clear_paths ( )

◆ compile() [1/2]

void csspp::compiler::compile ( bool  bare)

◆ compile() [2/2]

void csspp::compiler::compile ( node::pointer_t  n)
private

◆ compile_at_keyword()

void csspp::compiler::compile_at_keyword ( node::pointer_t  n)
private

◆ compile_component_value()

void csspp::compiler::compile_component_value ( node::pointer_t  n)
private

◆ compile_declaration()

void csspp::compiler::compile_declaration ( node::pointer_t  n)
private

◆ compile_declaration_values()

void csspp::compiler::compile_declaration_values ( node::pointer_t  declaration)
private

◆ compile_expression()

node::pointer_t csspp::compiler::compile_expression ( node::pointer_t  n,
bool  skip_whitespace,
bool  list_of_expressions 
)
private

◆ compile_qualified_rule()

void csspp::compiler::compile_qualified_rule ( node::pointer_t  n)
private

◆ expand_nested_components()

void csspp::compiler::expand_nested_components ( node::pointer_t  n)
private

◆ expand_nested_declarations()

void csspp::compiler::expand_nested_declarations ( std::string const &  name,
node::pointer_t  parent,
node::pointer_t root,
node::pointer_t  n 
)
private

◆ expand_nested_rules()

void csspp::compiler::expand_nested_rules ( node::pointer_t  parent,
node::pointer_t  root,
node::pointer_t last,
node::pointer_t  n 
)
private

◆ find_file()

std::string csspp::compiler::find_file ( std::string const &  script_name)

Definition at line 3724 of file compiler.cpp.

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

Referenced by replace_import(), and set_validation_script().

◆ get_result()

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

Definition at line 429 of file compiler.cpp.

References f_return_result.

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

◆ get_root()

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

◆ handle_mixin()

void csspp::compiler::handle_mixin ( node::pointer_t  n)
private

◆ mark_selectors()

void csspp::compiler::mark_selectors ( node::pointer_t  n)
private

◆ parse_selector()

bool csspp::compiler::parse_selector ( node::pointer_t  n)
private

◆ prepare_function_arguments()

void csspp::compiler::prepare_function_arguments ( node::pointer_t  var)
private

◆ remove_empty_rules()

void csspp::compiler::remove_empty_rules ( node::pointer_t  n)
private

◆ replace_at_keyword()

void csspp::compiler::replace_at_keyword ( node::pointer_t  parent,
node::pointer_t  n,
size_t &  idx 
)
private

◆ replace_else()

void csspp::compiler::replace_else ( node::pointer_t  parent,
node::pointer_t  n,
size_t  idx 
)
private

◆ replace_if()

void csspp::compiler::replace_if ( node::pointer_t  parent,
node::pointer_t  n,
size_t  idx 
)
private

◆ replace_import()

void csspp::compiler::replace_import ( node::pointer_t  parent,
node::pointer_t  import,
size_t &  idx 
)
private

◆ replace_variable()

void csspp::compiler::replace_variable ( node::pointer_t  parent,
node::pointer_t  n,
size_t &  idx 
)
private

◆ replace_variables()

void csspp::compiler::replace_variables ( node::pointer_t  n)
private

◆ replace_variables_in_comment()

void csspp::compiler::replace_variables_in_comment ( node::pointer_t  n)
private

◆ run_validation()

bool csspp::compiler::run_validation ( bool  check_only)
private

◆ selector_attribute_check()

bool csspp::compiler::selector_attribute_check ( node::pointer_t  parent,
size_t &  parent_pos,
node::pointer_t  n 
)
private

◆ selector_list()

bool csspp::compiler::selector_list ( node::pointer_t  n,
size_t &  pos 
)
private

◆ selector_simple_term()

bool csspp::compiler::selector_simple_term ( node::pointer_t  n,
size_t &  pos 
)
private

◆ selector_term()

bool csspp::compiler::selector_term ( node::pointer_t  n,
size_t &  pos 
)
private

◆ set_date_time_variables()

void csspp::compiler::set_date_time_variables ( time_t  now)

◆ set_empty_on_undefined_variable()

void csspp::compiler::set_empty_on_undefined_variable ( bool const  empty_on_undefined_variable)

◆ set_no_logo()

void csspp::compiler::set_no_logo ( bool  no_logo = true)

Definition at line 513 of file compiler.cpp.

References f_no_logo.

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

◆ set_root()

void csspp::compiler::set_root ( node::pointer_t  root)

◆ set_validation_script()

void csspp::compiler::set_validation_script ( std::string const &  script_name)
private

◆ set_variable()

void csspp::compiler::set_variable ( node::pointer_t  n)
private

Friends And Related Symbol Documentation

◆ safe_compiler_state_t

friend class safe_compiler_state_t
friend

Definition at line 48 of file compiler.h.

◆ safe_parents_t

friend class safe_parents_t
friend

Definition at line 47 of file compiler.h.

Member Data Documentation

◆ f_compiler_validating

bool csspp::compiler::f_compiler_validating = false
private

Definition at line 128 of file compiler.h.

Referenced by replace_variable(), and run_validation().

◆ f_current_validation_script

node::pointer_t csspp::compiler::f_current_validation_script = node::pointer_t()
private

Definition at line 126 of file compiler.h.

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

◆ f_no_logo

bool csspp::compiler::f_no_logo = false
private

Definition at line 129 of file compiler.h.

Referenced by add_header_and_footer(), and set_no_logo().

◆ f_return_result

node::pointer_t csspp::compiler::f_return_result = node::pointer_t()
private

Definition at line 127 of file compiler.h.

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

◆ f_state

compiler_state_t csspp::compiler::f_state = compiler_state_t()
private

◆ f_validator_scripts

validator_script_vector_t csspp::compiler::f_validator_scripts = validator_script_vector_t()
private

Definition at line 125 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.