主要源代码:读取属性、递归读取节点
static void ReadAttributes(LGrammarTree *pGrammarTree,StringProperties &pProperties)
{
LGrammarTree *theTree;
LGrammarTree::LoopVariant begin;
wchar_t *attr_name;
wchar_t *attr_value;
int len;
begin=pGrammarTree->Children.begin();
theTree=*begin;
attr_name=theTree->Node->Value.GetText();
begin++;
//跳过 '='
begin++;
theTree=*begin;
attr_value=theTree->Node->Value.GetText();
if(attr_value[0]==L'/"')
{
len=wcslen(attr_value);
if(len>1)
{
attr_value[len-1]=0;
attr_value++;
}
}
LWideString w;
w=attr_name;
pProperties[w]=attr_value;
}
static void ReadAttributes(LGrammarTree *pGrammarTree,StringProperties &pProperties)
{
LGrammarTree *theTree;
LGrammarTree::LoopVariant begin;
wchar_t *attr_name;
wchar_t *attr_value;
int len;
begin=pGrammarTree->Children.begin();
theTree=*begin;
attr_name=theTree->Node->Value.GetText();
begin++;
//跳过 '='
begin++;
theTree=*begin;
attr_value=theTree->Node->Value.GetText();
if(attr_value[0]==L'/"')
{
len=wcslen(attr_value);
if(len>1)
{
attr_value[len-1]=0;
attr_value++;
}
}
LWideString w;
w=attr_name;
pProperties[w]=attr_value;
}