C++ 自定义标识识别
一段字符串 ,中间可能存在需要特殊处理的地方,实现支持
例如:
//以 "[My" 和 “/]”为开始和结束;
string _testStr = "今天天气不错[My color=\"FF00FF\" font=\"cs.ttf\" size=\"36\" txt=\"你要和我一起来春游吗\"/],放风筝吗";
/*************************************************
color : 字体颜色
font : 字体名称
size:字体大小
txt:需要进行特殊处理的字符串
************************************************/
struct _s_TEST_STRUCT
{
string color;
string fonts;
float size;
string txt;
void reset()
{
color = "FFFFFF";
fonts = "微软雅黑.ttf"
size = 36;
txt = "";
}
}TestStruct;
vector<TestStruct> _vecMyTest;
void getString(const string& _strTest, vector<TestStruct>& _vecTest )
{
//这里怎么实现
}
如上,实现解析字符串,并使用自定义结构体进行存储,怎么进行识别呢?getString()函数怎么进行实现
...全文
相关推荐
识别标识符_标识符_PL/0_zooh8z_
编译原理 PL/0语言识别标识符 C++
cpp5 l&y
用flex处理cpp5.l,bison处理 cpp5.y, 然后用VC编译生成的文件
vim-cpp-modern:针对C和C ++的扩展Vim语法突出显示(C ++ 11141720)
vim-cpp-modern:针对C和C ++的扩展Vim语法突出显示(C ++ 11141720)
词法分析程序(c++程序)
经过调试 可以通过 编译原理词法分析程序 c++源代码
web final project.zip_lexicalanalyzer_visual c++
c++ code for lexical analyzer identifier, keywords


