VB 스타일의 큰 따옴표 붙은 문자열을 구문 분석하기위한 간단한 파서가 있습니다. 그러나이 간단한 boost :: spirit :: qi 파서의 문제점은 무엇입니까?
namespace qi = boost::spirit::qi;
namespace wide = qi::standard_wide;
class ConfigurationParser : public qi::grammar<std::wstring::iterator, std::wstring()>
{
qi::rule<std::wstring::iterator, std::wstring()> quotedString;
qi::rule<std::wstring::iterator> doubleQuote;
public:
ConfigurationParser() : ConfigurationParser::base_type(quotedString, "vFind Command Line")
{
doubleQuote = (wide::char_(L'"') >> wide::char_(L'"'));
quotedString = L'"' >> +(doubleQuote[qi::_val = L'"'] | (wide::char_ - L'"'))>> L'"';
}
};
, 내가 '속성 : 따라서, 파서가 여기에
This is a quoted string containing quotes (" ")
의 출력에
"This is a quoted string containing quotes ("" "")"
같은 것을 설정해야 내가 이것에 대한 내놓았다 문법이다 get은 전체 구문 분석 된 메시지가 아닌 작은 따옴표 (")입니다.
'std :: wstring'에는 'wchar_t'에서 할당 한 멤버가 없다는 것을 제외하면 일종의 의미가 있습니다 ... –
맞아요. 아마 꺼져 버렸을 것입니다. –