So my question is quite simple, in my lexer class (extending lex::lexer<T>
), I have the following;
this->self.add
...
("&&", AND_AND)
("||", OR_OR)
...
Inside my constructor, which compiles just fine, but triggers a SegFault on runtime. The issue is quite obvious |
is the 'or' operator in the regex system, how do I get past this issue?
From http://www.boost.org/doc/libs/1_54_0/libs/spirit/doc/html/spirit/lex/quick_reference/lexer.html
So you would use
The first backslash in each pair is treated as an escape character by the C++ string parser, causing the second one to be placed into the string content. That backslash in the string content then is seen by Spirit::Lex and acts to escape the regex operator.