RigsofRods
Soft-body Physics Simulation
|
Defines regular expressions to verify and pull data from rig-def file. 'E' stands for Expression. More...
#include <regex>
Go to the source code of this file.
Namespaces | |
RigDef | |
RigDef::Regexes | |
Macros | |
#define | E_SLASH "\\/" |
#define | E_OPTIONAL_SPACE "[[:blank:]]*" |
#define | E_OR "|" |
#define | E_TRAILING_WHITESPACE "[[:blank:]]*$" |
#define | E_LEADING_WHITESPACE "^[[:blank:]]*" |
#define | E_DELIMITER_SPACE "[[:blank:]]+" |
#define | E_DELIMITER_CLASSIC "[[:blank:],:|]+" |
#define | E_NODE_ID "[[:alnum:]_-]+" |
#define | E_CAPTURE(_REGEXP_) "(" _REGEXP_ ")" |
Encloses expression in 'capture' marks. More... | |
#define | E_CAPTURE_OPTIONAL(_REGEXP_) "(" _REGEXP_ ")?" |
Encloses expression in 'capture' marks with ? (zero or one time) mark. More... | |
#define | E_KEYWORD_BLOCK(_NAME_) "(^" _NAME_ "[[:blank:]]*$)?" |
A keyword which should be on it's own line. Used in IDENTIFY_KEYWORD. More... | |
#define | E_KEYWORD_INLINE(_NAME_) "(^" _NAME_ E_DELIMITER_CLASSIC ".*$)?" |
A keyword which should have values following it. Used in IDENTIFY_KEYWORD. More... | |
#define | E_KEYWORD_INLINE_UNSEPARATED(_NAME_) "(^" _NAME_ ".*$)?" |
Hack for forset which doesn't require a separator from args, see also BEWARE OF QUIRKS in ParseDirectiveForset() More... | |
#define | DEFINE_REGEX(_NAME_, _REGEXP_) const std::regex _NAME_ = std::regex( _REGEXP_, std::regex::ECMAScript); |
Actual regex definition macro. More... | |
#define | DEFINE_REGEX_IGNORECASE(_NAME_, _REGEXP_) const std::regex _NAME_ = std::regex( _REGEXP_, std::regex::ECMAScript | std::regex::icase); |
#define | IDENTIFY_KEYWORD_REGEX_STRING |
#define | E_2xCAPTURE_TRAILING_COMMENT |
Functions | |
RigDef::Regexes::DEFINE_REGEX (PARSE_ANIMATORS_NUMBERED_KEYWORD, E_LEADING_WHITESPACE E_TRAILING_WHITESPACE) | |
RigDef::Regexes::DEFINE_REGEX (SECTION_AXLES_PROPERTY, E_LEADING_WHITESPACE E_CAPTURE_OPTIONAL(E_OPTIONAL_SPACE "w(1|2)" "\\(" E_CAPTURE(E_NODE_ID) E_DELIMITER_SPACE E_CAPTURE(E_NODE_ID) "\\)" E_OPTIONAL_SPACE) E_CAPTURE_OPTIONAL(E_OPTIONAL_SPACE "d\\(" E_CAPTURE("[olsv]*") "\\)" E_OPTIONAL_SPACE) E_2xCAPTURE_TRAILING_COMMENT) | |
Defines regular expressions to verify and pull data from rig-def file. 'E' stands for Expression.
REGEX CRASH COURSE: ^ Start of line $ End of line . Wildcard - matches any character . Escaped special character '.', matches '.' IMPORTANT! \ is also an escape character in C, so it needs to be doubled \ to use in string constants something* Match something 0 or more times something+ Match something 1 or more times something? Match something 0 or 1 times (stuff) Subsection. Can be manipulates as 'something'. Also works as a Capture | Alternation character. (abc|cba) means abc OR cba. [:some_type:] A POSIX character class. Read this: http://www.boost.org/doc/libs/1_54_0/libs/regex/doc/html/boost_regex/syntax/character_classes.html
REGEX NAMING CONVENTION: E_* ~ Re-usable regexes or macros. SECTION_* ~ File sections DIRECTIVE_* ~ File directives INLINE_SECTION_* ~ Inline sections of file [ANYTHING ELSE] ~ Helpers. It's forbidden to use the above reserved prefixes for other purposes.
Definition in file RigDef_Regexes.h.
#define DEFINE_REGEX | ( | _NAME_, | |
_REGEXP_ | |||
) | const std::regex _NAME_ = std::regex( _REGEXP_, std::regex::ECMAScript); |
Actual regex definition macro.
Definition at line 109 of file RigDef_Regexes.h.
#define DEFINE_REGEX_IGNORECASE | ( | _NAME_, | |
_REGEXP_ | |||
) | const std::regex _NAME_ = std::regex( _REGEXP_, std::regex::ECMAScript | std::regex::icase); |
Definition at line 112 of file RigDef_Regexes.h.
#define E_2xCAPTURE_TRAILING_COMMENT |
Definition at line 241 of file RigDef_Regexes.h.
#define E_CAPTURE | ( | _REGEXP_ | ) | "(" _REGEXP_ ")" |
Encloses expression in 'capture' marks.
Definition at line 89 of file RigDef_Regexes.h.
#define E_CAPTURE_OPTIONAL | ( | _REGEXP_ | ) | "(" _REGEXP_ ")?" |
Encloses expression in 'capture' marks with ? (zero or one time) mark.
Definition at line 93 of file RigDef_Regexes.h.
#define E_DELIMITER_CLASSIC "[[:blank:],:|]+" |
Definition at line 80 of file RigDef_Regexes.h.
#define E_DELIMITER_SPACE "[[:blank:]]+" |
Definition at line 78 of file RigDef_Regexes.h.
#define E_KEYWORD_BLOCK | ( | _NAME_ | ) | "(^" _NAME_ "[[:blank:]]*$)?" |
A keyword which should be on it's own line. Used in IDENTIFY_KEYWORD.
Definition at line 97 of file RigDef_Regexes.h.
#define E_KEYWORD_INLINE | ( | _NAME_ | ) | "(^" _NAME_ E_DELIMITER_CLASSIC ".*$)?" |
A keyword which should have values following it. Used in IDENTIFY_KEYWORD.
Definition at line 101 of file RigDef_Regexes.h.
#define E_KEYWORD_INLINE_UNSEPARATED | ( | _NAME_ | ) | "(^" _NAME_ ".*$)?" |
Hack for forset
which doesn't require a separator from args, see also BEWARE OF QUIRKS in ParseDirectiveForset()
Definition at line 105 of file RigDef_Regexes.h.
#define E_LEADING_WHITESPACE "^[[:blank:]]*" |
Definition at line 76 of file RigDef_Regexes.h.
#define E_NODE_ID "[[:alnum:]_-]+" |
Definition at line 82 of file RigDef_Regexes.h.
#define E_OPTIONAL_SPACE "[[:blank:]]*" |
Definition at line 70 of file RigDef_Regexes.h.
#define E_OR "|" |
Definition at line 72 of file RigDef_Regexes.h.
#define E_SLASH "\\/" |
Definition at line 68 of file RigDef_Regexes.h.
#define E_TRAILING_WHITESPACE "[[:blank:]]*$" |
Definition at line 74 of file RigDef_Regexes.h.
#define IDENTIFY_KEYWORD_REGEX_STRING |
Definition at line 120 of file RigDef_Regexes.h.