#include <compiler.h>
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 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 |
Definition at line 25 of file compiler.h.
|
private |
Definition at line 50 of file compiler.h.
|
private |
Definition at line 51 of file compiler.h.
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.
|
private |
Definition at line 580 of file compiler.cpp.
References csspp::AT_KEYWORD, csspp::BOOLEAN, f_no_logo, f_state, csspp::compiler::compiler_state_t::get_root(), csspp::compiler::compiler_state_t::set_variable(), csspp::STRING, and csspp::VARIABLE.
Referenced by compile().
void csspp::compiler::add_path | ( | std::string const & | path | ) |
Definition at line 523 of file compiler.cpp.
References csspp::compiler::compiler_state_t::add_path(), and f_state.
Referenced by anonymous_namespace{csspp.cpp}::pp::compile().
|
private |
Definition at line 3802 of file compiler.cpp.
References f_current_validation_script, csspp::LIST, and csspp::VARIABLE.
Referenced by compile_declaration(), selector_simple_term(), and selector_term().
|
private |
Definition at line 2672 of file compiler.cpp.
References csspp::expression::compile(), f_state, csspp::OPEN_CURLYBRACKET, and csspp::expression::set_variable_handler().
Referenced by replace_at_keyword(), replace_else(), replace_if(), and replace_import().
void csspp::compiler::clear_paths | ( | ) |
Definition at line 518 of file compiler.cpp.
References csspp::compiler::compiler_state_t::clear_paths(), and f_state.
Referenced by anonymous_namespace{csspp.cpp}::pp::compile().
void csspp::compiler::compile | ( | bool | bare | ) |
Definition at line 528 of file compiler.cpp.
References add_header_and_footer(), compile(), csspp::compiler::compiler_state_t::empty_parents(), expand_nested_components(), f_state, csspp::compiler::compiler_state_t::get_root(), mark_selectors(), remove_empty_rules(), and replace_variables().
Referenced by anonymous_namespace{csspp.cpp}::pp::compile(), compile(), compile(), compile_at_keyword(), csspp::compiler::compiler_state_t::execute_user_function(), and run_validation().
|
private |
Definition at line 618 of file compiler.cpp.
References csspp::AT_KEYWORD, csspp::COMMENT, compile(), compile_at_keyword(), compile_component_value(), csspp::COMPONENT_VALUE, csspp::DECLARATION, f_return_result, f_state, csspp::FRAME, and csspp::LIST.
|
private |
Definition at line 1173 of file compiler.cpp.
References csspp::parser::argify(), csspp::AT_KEYWORD, csspp::expression::compile(), compile(), compile_at_keyword(), compile_component_value(), csspp::COMPONENT_VALUE, csspp::ERROR_DEBUG, csspp::ERROR_ERROR, csspp::ERROR_INFO, csspp::ERROR_WARNING, f_return_result, f_state, csspp::FRAME, csspp::compiler::compiler_state_t::get_previous_parent(), csspp::IDENTIFIER, csspp::error::instance(), csspp::LIST, csspp::NULL_TOKEN, csspp::OPEN_CURLYBRACKET, csspp::PERCENT, csspp::expression::set_variable_handler(), and csspp::STRING.
Referenced by compile(), compile_at_keyword(), and compile_component_value().
|
private |
Definition at line 677 of file compiler.cpp.
References csspp::ARG, csspp::AT_KEYWORD, csspp::COMMENT, compile_at_keyword(), compile_declaration(), compile_qualified_rule(), csspp::COMPONENT_VALUE, csspp::DECLARATION, f_state, csspp::compiler::compiler_state_t::get_previous_parent(), csspp::parser::is_nested_declaration(), csspp::parser::is_variable_set(), and csspp::OPEN_CURLYBRACKET.
Referenced by compile(), compile_at_keyword(), compile_declaration_values(), and compile_qualified_rule().
|
private |
Definition at line 888 of file compiler.cpp.
References add_validation_variable(), csspp::parser::argify(), csspp::COLON, csspp::COMMA, compile_declaration_values(), csspp::COMPONENT_VALUE, csspp::DECLARATION, csspp::DIVIDE, csspp::ERROR_ERROR, csspp::ERROR_WARNING, csspp::EXCLAMATION, f_state, csspp::FUNCTION, csspp::compiler::compiler_state_t::get_previous_parent(), csspp::HASH, csspp::IDENTIFIER, csspp::error::instance(), csspp::LIST, csspp::MULTIPLY, csspp::OPEN_CURLYBRACKET, csspp::PERIOD, run_validation(), set_validation_script(), csspp::STRING, and csspp::WHITESPACE.
Referenced by compile_component_value().
|
private |
Definition at line 1108 of file compiler.cpp.
References compile_component_value(), compile_declaration_values(), csspp::COMPONENT_VALUE, csspp::DECLARATION, f_state, csspp::LIST, and csspp::OPEN_CURLYBRACKET.
Referenced by compile_declaration(), and compile_declaration_values().
|
private |
|
private |
Definition at line 820 of file compiler.cpp.
References compile_component_value(), csspp::COMPONENT_VALUE, csspp::ERROR_ERROR, f_state, csspp::error::instance(), csspp::LIST, and parse_selector().
Referenced by compile_component_value().
|
private |
Definition at line 3861 of file compiler.cpp.
References csspp::AT_KEYWORD, csspp::COMPONENT_VALUE, csspp::DECLARATION, expand_nested_components(), expand_nested_declarations(), expand_nested_rules(), f_state, csspp::compiler::compiler_state_t::get_previous_parent(), csspp::LIST, and csspp::OPEN_CURLYBRACKET.
Referenced by compile(), expand_nested_components(), and expand_nested_rules().
|
private |
Definition at line 4077 of file compiler.cpp.
References csspp::AT_KEYWORD, csspp::COMPONENT_VALUE, csspp::DECLARATION, csspp::ERROR_ERROR, expand_nested_declarations(), f_state, csspp::compiler::compiler_state_t::get_previous_parent(), csspp::error::instance(), csspp::LIST, and csspp::OPEN_CURLYBRACKET.
Referenced by expand_nested_components(), expand_nested_declarations(), and expand_nested_rules().
|
private |
Definition at line 3929 of file compiler.cpp.
References csspp::ARG, csspp::AT_KEYWORD, csspp::COMPONENT_VALUE, csspp::DECLARATION, expand_nested_components(), expand_nested_declarations(), expand_nested_rules(), f_state, csspp::compiler::compiler_state_t::get_previous_parent(), csspp::LIST, csspp::OPEN_CURLYBRACKET, csspp::REFERENCE, and csspp::WHITESPACE.
Referenced by expand_nested_components(), and expand_nested_rules().
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().
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().
node::pointer_t csspp::compiler::get_root | ( | ) | const |
Definition at line 424 of file compiler.cpp.
References f_state, and csspp::compiler::compiler_state_t::get_root().
Referenced by anonymous_namespace{csspp.cpp}::pp::compile(), and set_date_time_variables().
|
private |
Definition at line 1805 of file compiler.cpp.
References csspp::ERROR_ERROR, f_state, csspp::FUNCTION, csspp::IDENTIFIER, csspp::error::instance(), csspp::OPEN_CURLYBRACKET, prepare_function_arguments(), csspp::compiler::compiler_state_t::set_variable(), csspp::VARIABLE, and csspp::VARIABLE_FUNCTION.
Referenced by replace_at_keyword().
|
private |
Definition at line 1867 of file compiler.cpp.
References csspp::AT_KEYWORD, csspp::COMPONENT_VALUE, csspp::DECLARATION, f_state, csspp::parser::is_variable_set(), csspp::LIST, mark_selectors(), and csspp::OPEN_CURLYBRACKET.
Referenced by compile(), mark_selectors(), and replace_variable().
|
private |
Definition at line 3643 of file compiler.cpp.
References csspp::ARG, csspp::parser::argify(), csspp::ERROR_ERROR, csspp::ERROR_INFO, csspp::HASH, csspp::error::instance(), csspp::OPEN_CURLYBRACKET, and selector_list().
Referenced by compile_qualified_rule().
|
private |
Definition at line 2491 of file compiler.cpp.
References csspp::ARG, csspp::parser::argify(), csspp::COLON, csspp::ERROR_ERROR, csspp::error::instance(), csspp::VARIABLE, and csspp::WHITESPACE.
Referenced by handle_mixin(), and set_variable().
|
private |
Definition at line 1915 of file compiler.cpp.
References csspp::AT_KEYWORD, csspp::COMPONENT_VALUE, csspp::DECLARATION, f_state, csspp::compiler::compiler_state_t::get_previous_parent(), csspp::LIST, csspp::OPEN_CURLYBRACKET, and remove_empty_rules().
Referenced by compile(), and remove_empty_rules().
|
private |
Definition at line 2564 of file compiler.cpp.
References at_keyword_expression(), csspp::ERROR_ERROR, csspp::FUNCTION, handle_mixin(), csspp::IDENTIFIER, csspp::error::instance(), replace_else(), replace_if(), replace_import(), replace_variable(), and replace_variables().
Referenced by replace_variables().
|
private |
Definition at line 2736 of file compiler.cpp.
References csspp::AT_KEYWORD, at_keyword_expression(), csspp::expression::boolean(), csspp::ERROR_ERROR, csspp::IDENTIFIER, csspp::error::instance(), csspp::error::reset(), and csspp::WHITESPACE.
Referenced by replace_at_keyword().
|
private |
Definition at line 2685 of file compiler.cpp.
References csspp::AT_KEYWORD, at_keyword_expression(), csspp::expression::boolean(), csspp::ERROR_ERROR, and csspp::error::instance().
Referenced by replace_at_keyword().
|
private |
Definition at line 1629 of file compiler.cpp.
References at_keyword_expression(), csspp::ERROR_ERROR, csspp::error_happened_t::error_happened(), csspp::ERROR_INFO, find_file(), csspp::error::instance(), csspp::STRING, csspp::parser::stylesheet(), and csspp::URL.
Referenced by replace_at_keyword().
|
private |
Definition at line 2082 of file compiler.cpp.
References csspp::ARG, csspp::parser::argify(), csspp::COMPONENT_VALUE, csspp::ERROR_ERROR, f_compiler_validating, f_state, csspp::FUNCTION, csspp::compiler::compiler_state_t::get_empty_on_undefined_variable(), csspp::compiler::compiler_state_t::get_variable(), csspp::error::instance(), csspp::LIST, mark_selectors(), csspp::NULL_TOKEN, csspp::OPEN_CURLYBRACKET, csspp::OPEN_PARENTHESIS, csspp::OPEN_SQUAREBRACKET, replace_variables(), csspp::compiler::compiler_state_t::set_empty_on_undefined_variable(), csspp::compiler::compiler_state_t::set_paths(), set_root(), csspp::VARIABLE, csspp::VARIABLE_FUNCTION, and csspp::WHITESPACE.
Referenced by replace_at_keyword(), and replace_variables().
|
private |
Definition at line 1962 of file compiler.cpp.
References csspp::ARG, csspp::AT_KEYWORD, csspp::COMMENT, csspp::COMPONENT_VALUE, csspp::DECLARATION, f_state, csspp::FUNCTION, csspp::compiler::compiler_state_t::get_previous_parent(), csspp::parser::is_variable_set(), csspp::LIST, csspp::OPEN_CURLYBRACKET, csspp::OPEN_PARENTHESIS, csspp::OPEN_SQUAREBRACKET, replace_at_keyword(), replace_variable(), replace_variables(), replace_variables_in_comment(), set_variable(), csspp::VARIABLE, and csspp::VARIABLE_FUNCTION.
Referenced by compile(), replace_at_keyword(), replace_variable(), and replace_variables().
|
private |
Definition at line 2864 of file compiler.cpp.
References csspp::ERROR_WARNING, f_state, csspp::FUNCTION, csspp::compiler::compiler_state_t::get_empty_on_undefined_variable(), csspp::compiler::compiler_state_t::get_variable(), csspp::error::instance(), csspp::LIST, and csspp::VARIABLE_FUNCTION.
Referenced by replace_variables().
|
private |
Definition at line 3818 of file compiler.cpp.
References compile(), csspp::error_happened_t::error_happened(), f_compiler_validating, f_current_validation_script, f_state, and csspp::compiler::compiler_state_t::set_root().
Referenced by compile_declaration(), selector_simple_term(), and selector_term().
|
private |
Definition at line 2966 of file compiler.cpp.
References csspp::COLON, csspp::DASH_MATCH, csspp::DECIMAL_NUMBER, csspp::EQUAL, csspp::ERROR_ERROR, csspp::FUNCTION, csspp::IDENTIFIER, csspp::INCLUDE_MATCH, csspp::error::instance(), csspp::INTEGER, csspp::NOT_EQUAL, csspp::PREFIX_MATCH, csspp::STRING, csspp::SUBSTRING_MATCH, csspp::SUFFIX_MATCH, and csspp::WHITESPACE.
Referenced by selector_simple_term().
|
private |
Definition at line 3561 of file compiler.cpp.
References csspp::ADD, csspp::ERROR_ERROR, csspp::GREATER_THAN, csspp::error::instance(), csspp::PRECEDED, selector_term(), and csspp::WHITESPACE.
Referenced by parse_selector().
|
private |
Definition at line 3114 of file compiler.cpp.
References csspp::ADD, add_validation_variable(), csspp::AN_PLUS_B, csspp::COLON, csspp::ERROR_ERROR, csspp::FUNCTION, csspp::node::g_to_string_flag_show_quotes, csspp::nth_child::get_error(), csspp::nth_child::get_nth(), csspp::GREATER_THAN, csspp::HASH, csspp::IDENTIFIER, csspp::error::instance(), csspp::MULTIPLY, csspp::OPEN_SQUAREBRACKET, csspp::nth_child::parse(), csspp::PERIOD, csspp::PRECEDED, run_validation(), csspp::SCOPE, selector_attribute_check(), set_validation_script(), and csspp::STRING.
Referenced by selector_term().
|
private |
Definition at line 3398 of file compiler.cpp.
References csspp::ADD, add_validation_variable(), csspp::COLON, csspp::ERROR_ERROR, csspp::FUNCTION, csspp::GREATER_THAN, csspp::HASH, csspp::IDENTIFIER, csspp::error::instance(), csspp::MULTIPLY, csspp::OPEN_SQUAREBRACKET, csspp::PERIOD, csspp::PLACEHOLDER, csspp::PRECEDED, csspp::REFERENCE, run_validation(), csspp::SCOPE, selector_simple_term(), set_validation_script(), and csspp::STRING.
Referenced by selector_list().
void csspp::compiler::set_date_time_variables | ( | time_t | now | ) |
Definition at line 434 of file compiler.cpp.
References f_state, get_root(), csspp::compiler::compiler_state_t::set_variable(), csspp::STRING, and csspp::VARIABLE.
Referenced by anonymous_namespace{csspp.cpp}::pp::compile().
void csspp::compiler::set_empty_on_undefined_variable | ( | bool const | empty_on_undefined_variable | ) |
Definition at line 508 of file compiler.cpp.
References f_state, and csspp::compiler::compiler_state_t::set_empty_on_undefined_variable().
Referenced by anonymous_namespace{csspp.cpp}::pp::compile().
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().
void csspp::compiler::set_root | ( | node::pointer_t | root | ) |
Definition at line 419 of file compiler.cpp.
References f_state, and csspp::compiler::compiler_state_t::set_root().
Referenced by anonymous_namespace{csspp.cpp}::pp::compile(), csspp::compiler::compiler_state_t::execute_user_function(), and replace_variable().
|
private |
Definition at line 3729 of file compiler.cpp.
References csspp::ERROR_FATAL, f_current_validation_script, find_file(), csspp::error::instance(), and csspp::parser::stylesheet().
Referenced by compile_declaration(), selector_simple_term(), and selector_term().
|
private |
Definition at line 2370 of file compiler.cpp.
References csspp::COLON, csspp::ERROR_WARNING, csspp::EXCLAMATION, f_state, csspp::compiler::compiler_state_t::get_previous_parent(), csspp::compiler::compiler_state_t::get_variable(), csspp::IDENTIFIER, csspp::error::instance(), csspp::LIST, csspp::NULL_TOKEN, prepare_function_arguments(), csspp::error::reset(), csspp::compiler::compiler_state_t::set_variable(), csspp::VARIABLE_FUNCTION, and csspp::WHITESPACE.
Referenced by replace_variables().
|
friend |
Definition at line 48 of file compiler.h.
|
friend |
Definition at line 47 of file compiler.h.
|
private |
Definition at line 128 of file compiler.h.
Referenced by replace_variable(), and run_validation().
|
private |
Definition at line 126 of file compiler.h.
Referenced by add_validation_variable(), run_validation(), and set_validation_script().
|
private |
Definition at line 129 of file compiler.h.
Referenced by add_header_and_footer(), and set_no_logo().
|
private |
Definition at line 127 of file compiler.h.
Referenced by compile(), compile_at_keyword(), and get_result().
|
private |
Definition at line 123 of file compiler.h.
Referenced by compiler(), add_header_and_footer(), add_path(), at_keyword_expression(), clear_paths(), compile(), compile(), compile_at_keyword(), compile_component_value(), compile_declaration(), compile_declaration_values(), compile_qualified_rule(), csspp::compiler::compiler_state_t::execute_user_function(), expand_nested_components(), expand_nested_declarations(), expand_nested_rules(), find_file(), get_root(), handle_mixin(), mark_selectors(), remove_empty_rules(), replace_variable(), replace_variables(), replace_variables_in_comment(), run_validation(), set_date_time_variables(), set_empty_on_undefined_variable(), set_root(), and set_variable().
|
private |
Definition at line 125 of file compiler.h.
Documentation of CSS Preprocessor.
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.