The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Functions | Variables
sourceparser.cpp File Reference

This file contains implementation of sourceparser.cpp. More...

#include "tools/schema/sourceparser.hpp"
#include <boost/regex.hpp>
#include <stack>
Include dependency graph for sourceparser.cpp:

Go to the source code of this file.

Namespaces

 schema_validation
 

Functions

static std::string schema_validation::sub (const std::string &s)
 Private function to surround an argument with brackets. More...
 
static std::string schema_validation::quote (const std::string &s)
 Private function to surround argument with not mandatory quotes. More...
 
static std::string schema_validation::property (const std::string &name, const std::string &value="")
 Creates a property template. More...
 
const std::stringschema_validation::get_valid ()
 A few regex templates. More...
 
const std::stringschema_validation::get_wiki ()
 Template to check line is beginnnig of Wiki block. More...
 
const std::stringschema_validation::get_parent_begin ()
 Template to check begining of parent block. More...
 
const std::stringschema_validation::get_parent_end ()
 Template to check closing of parent block. More...
 
const std::stringschema_validation::get_tag_begin ()
 Template to check if line contains opening of tag block. More...
 
const std::stringschema_validation::get_tag_end ()
 Template to check end of tag block. More...
 
const std::stringschema_validation::get_allow_link ()
 Template to check allow{link} block. More...
 
const std::stringschema_validation::get_allow_global ()
 Template to check allow{global} block. More...
 
static const std::stringschema_validation::get_allow_type ()
 
static const std::stringschema_validation::get_remove_type ()
 
static const std::stringschema_validation::get_remove_key ()
 
const std::stringschema_validation::get_table_key_begin ()
 Template to check begining of table{config} storing key values. More...
 
const std::stringschema_validation::get_table_end ()
 Template to check if table is closed. More...
 
const std::stringschema_validation::get_key_value ()
 Template to get key value. More...
 
void schema_validation::test_regex (std::ostream &f)
 Writes to the file regex templates list. More...
 

Variables

const std::string schema_validation::valid = "^\\s*\\*\\s*"
 Little parts of regex templates used to parse Wml annoations. More...
 
const std::string schema_validation::wiki_begin ="^\\s*/\\*(?:WIKI|SCHEMA)"
 begining of wiki block More...
 
const std::string schema_validation::space ="\\s*"
 whitespace is possible More...
 
const std::string schema_validation::equals ="="
 sigh "=" More...
 
const std::string schema_validation::quote_symbol ="\"?"
 non-mandatory sign " More...
 
const std::string schema_validation::block_begin ="@begin"
 begining of the block. More...
 
const std::string schema_validation::block_end ="@end"
 end of block More...
 
const std::string schema_validation::allow ="@allow"
 allow directive More...
 
const std::string schema_validation::remove ="@remove"
 remove directive More...
 
const std::string schema_validation::property_open ="\\{"
 sign "{" - curly bracket More...
 
const std::string schema_validation::property_close = "\\}"
 sign "}" - another curly bracket More...
 
const std::string schema_validation::name_type = "[a-z][a-zA-Z0-9_-]*"
 type of possible name identificator More...
 
const std::string schema_validation::parent_type = "/|(?:[a-z][a-zA-Z0-9_-]*/)+"
 type of possible parent indentificator More...
 
const std::string schema_validation::link_type ="(?:[a-z][a-zA-Z0-9_-]*/)*(?:[a-z][a-zA-Z0-9_-]*)"
 type of possible link indentificator More...
 
const std::string schema_validation::number ="\\d*"
 template to number regex More...
 
const std::string schema_validation::sign ="-?"
 sign "-" - hyphen-minus used to set sign of signed integer More...
 
const std::string schema_validation::eol =".*$"
 end of line + possible various character before. More...
 

Detailed Description

This file contains implementation of sourceparser.cpp.

Definition in file sourceparser.cpp.