📄 编译原理语法分析lr1_cpp_离子风暴 - ionstorm.mht
字号:
<P>#include "stdafx.h"<BR>#include "CharStack.h"<BR>#include=20
"IntStack.h"<BR>#include <memory.h><BR>#include=20
<stdio.h><BR>#include <stdlib.h><BR>#include=20
<malloc.h></P>
<P>struct BNFNODE // =B2=FA=C9=FA=CA=BD=BD=DA=B5=E3<BR>{<BR>char=20
Left; // =
=B2=FA=C9=FA=CA=BD=D7=F3=B2=BF<BR>char Right[MAX_DATA_LEN];=20
// =B2=FA=C9=FA=CA=BD=D3=D2=B2=BF<BR>int =
RLen; //=20
=B2=FA=C9=FA=CA=BD=D3=D2=B1=DF=B3=A4=B6=C8<BR>} =
m_Bnf[MAX_DATA_LEN];<BR>int m_nBnfLen;</P>
<P>enum ACTIONTYPE // =
=B6=AF=D7=F7=C0=E0=B1=F0<BR>{<BR>Push, //=20
=D2=C6=BD=F8<BR>Sumup, // =
=B9=E6=D4=BC<BR>Accept, //=20
=BD=D3=CA=DC<BR>Error // =B3=F6=B4=ED<BR>};</P>
<P>struct LR1TABLE<BR>{<BR>int nStatus; // =
=D7=B4=CC=AC<BR>char CurChar; // =
=B5=B1=C7=B0=B7=FB=BA=C5<BR>ACTIONTYPE ActionType; //=20
=B6=AF=D7=F7=C0=E0=B1=F0<BR>int nNextStatus; // =
=CF=C2=D2=BB=D7=B4=CC=AC=D2=C6=BD=F8(push)=BB=F2=B9=E6=D4=BC(sumup)=B2=FA=
=C9=FA=CA=BD=D0=F2=BA=C5<BR>}=20
m_Lr1[MAX_DATA_LEN];<BR>int m_nLr1Len;</P>
<P>/*****************************************************<BR>*=20
=
=D2=D4=CF=C2=CA=C7=B4=CA=B7=A8=B7=D6=CE=F6=CE=C4=BC=FE=B2=D9=D7=F7<BR>***=
***************************************************/<BR>//=20
=C7=E5=BF=D5=C1=B4=B1=ED<BR>void ClearWords(WORDNODE =
*pHeader)<BR>{<BR>WORDNODE *pNode;</P>
<P>while (pHeader !=3D NULL)<BR>{<BR> pNode =3D=20
pHeader->pNext;<BR> free(pHeader);<BR> =
pHeader=20
=3D pNode;<BR>}<BR>}</P>
<P>// =D4=F6=BC=D3=BD=E1=B5=E3<BR>WORDNODE* AddNode(char c[], =
WORDNODE *pTail)<BR>{<BR>//=20
=
c=B5=DA0=B8=F6=D7=D6=BD=DA=CE=AA=B5=A5=B4=CA=C0=E0=B1=F0=A3=AC=B5=DA1=B8=F6=
=CE=AA=B6=BA=BA=C5=A3=AC=B5=DA2=B8=F6=D2=D4=BA=F3=CA=C7=D6=B5</P>
<P>WORDNODE *pNode =3D (WORDNODE=20
*)malloc(sizeof(WORDNODE));<BR>pNode->byType =3D c[0] -=20
'0';<BR>pNode->pNext =3D NULL;</P>
<P>int nChars =3D MAX_DATA_LEN - 2;<BR>memcpy(pNode->Value, =
&c[2],=20
nChars);</P>
<P>pTail->pNext =3D pNode;<BR>return pNode;<BR>}</P>
<P>bool ReadWords(char FileName[], WORDNODE *pHeader)<BR>{<BR>//=20
=B4=F2=BF=AA=CE=C4=BC=FE<BR>FILE *f =3D fopen(FileName, =
"r");<BR>if (f =3D=3D=20
NULL)<BR>{<BR> ClearWords(pHeader);<BR> =
return=20
false;<BR>}</P>
<P>WORDNODE *pTail =3D pHeader;<BR>char c[MAX_DATA_LEN];</P>
<P>// =B6=C1=C8=A1=CA=FD=BE=DD<BR>while =
(!feof(f))<BR>{<BR> fscanf(f, "%s\n",=20
c);<BR> pTail =3D AddNode(c, pTail);<BR> =20
printf("%s\n", c);<BR>}</P>
<P>// =B9=D8=B1=D5=CE=C4=BC=FE<BR>fclose(f);</P>
<P>// =D4=F6=BC=D3=D2=BB=B8=F6=BD=E1=CA=F8=B7=FB<BR>c[0] =3D =
WT_OPERATOR + '0';<BR>c[1] =3D ',';<BR>c[2] =3D=20
'#';<BR>c[3] =3D '\0';<BR>AddNode(c, pTail);</P>
<P>return true;<BR>}</P>
<P>/*****************************************************<BR>*=20
=
=D2=D4=CF=C2=CA=C7=CE=C4=B7=A8=CE=C4=BC=FE=B2=D9=D7=F7<BR>***************=
***************************************/<BR>char=20
*ReadFile(char FileName[], int *nLen)<BR>{<BR>// =
=B4=F2=BF=AA=CE=C4=BC=FE<BR>FILE *f =3D=20
fopen(FileName, "r");<BR>if (f =3D=3D NULL)<BR> return =
NULL;</P>
<P>// =B6=C1=C8=A1=CE=C4=BC=FE<BR>char *pChar =3D (char =
*)malloc(sizeof(char) *=20
MAX_DATA_LEN);<BR><BR>// =B6=C1=C8=A1=CA=FD=BE=DD<BR>int =
nRead;<BR>*nLen =3D 0;<BR>while=20
(!feof(f))<BR>{<BR> nRead =3D fread(pChar + *nLen, =
sizeof(char),=20
MAX_DATA_LEN, f);<BR> *nLen +=3D =
nRead;<BR> if=20
(nRead < MAX_DATA_LEN) // =
=CE=C4=BC=FE=BD=E1=CE=B2<BR> break;</P>
<P> pChar =3D (char *)realloc(pChar, *nLen + =
sizeof(char) *=20
MAX_DATA_LEN);<BR>}</P>
<P>// =B9=D8=B1=D5=CE=C4=BC=FE<BR>fclose(f);</P>
<P>return pChar;<BR>}</P>
<P>bool ReadBnfs()<BR>{<BR>// =B6=C1=C8=A1=CE=C4=BC=FE<BR>int =
nLen;<BR>char *pChar =3D=20
ReadFile("Bnf.txt", &nLen);<BR>if (pChar =3D=3D =
NULL)<BR> =20
return false;<BR><BR>// =
=BD=E2=CE=F6=B3=F6=CE=C4=B7=A8=B2=FA=C9=FA=CA=BD<BR>int nBegin, nCur, =
nIndex =3D 0;<BR>for=20
(nBegin =3D 0, nCur =3D 0; nCur < nLen; =
nCur++)<BR>{<BR> //=20
=D7=F3=B2=BF<BR> m_Bnf[nIndex].Left =3D =
pChar[nCur];</P>
<P> // =D3=D2=B2=BF<BR> nCur +=3D =
2;<BR> nBegin =3D=20
nCur;<BR> for (; pChar[nCur] !=3D ';'; =
nCur++);<BR> =20
m_Bnf[nIndex].RLen =3D nCur - nBegin;<BR> =20
memcpy(m_Bnf[nIndex].Right, pChar + nBegin,=20
m_Bnf[nIndex].RLen);<BR> =20
m_Bnf[nIndex].Right[m_Bnf[nIndex].RLen] =3D '\0';</P>
<P> nIndex++;<BR>}<BR>m_nBnfLen =3D nIndex;</P>
<P>return true;<BR>}</P>
<P>/*****************************************************<BR>*=20
=
=D2=D4=CF=C2=CA=C7LR(1)=B7=D6=CE=F6=B1=ED=CE=C4=BC=FE=B2=D9=D7=F7<BR>****=
**************************************************/<BR>ACTIONTYPE=20
GetActionType(char c)<BR>{<BR>if (c >=3D '0' && c =
<=3D=20
'9')<BR> return Push;</P>
<P>switch (c)<BR>{<BR>case 'S':<BR> return =
Push;<BR>case=20
'r':<BR> return Sumup;<BR>case 'a':<BR> =
return=20
Accept;<BR>}</P>
<P>return Error;<BR>}</P>
<P>bool ReadLR1()<BR>{<BR>// =B6=C1=C8=A1=CE=C4=BC=FE<BR>int =
nLen;<BR>char *pChar =3D=20
ReadFile("Lr1.Lr1", &nLen);<BR>if (pChar =3D=3D =
NULL)<BR> =20
return false;</P>
<P>// =BD=E2=CE=F6=B3=F6=B7=D6=CE=F6=B1=ED<BR>int nBegin, nCur, =
nIndex =3D 0;<BR>for (nBegin =3D 0, nCur =3D=20
0; nCur < nLen; nCur++)<BR>{<BR> // =
=D7=B4=CC=AC<BR> =20
m_Lr1[nIndex].nStatus =3D atoi(&pChar[nCur]);<BR> =
for (;=20
pChar[nCur] !=3D ';'; nCur++);<BR> nCur++;</P>
<P> // =B7=FB=BA=C5<BR> =
m_Lr1[nIndex].CurChar =3D=20
pChar[nCur];<BR> nCur +=3D 2;</P>
<P> // =B6=AF=D7=F7=C0=E0=B1=F0<BR> =
m_Lr1[nIndex].ActionType =3D=20
GetActionType(pChar[nCur]);<BR> if (pChar[nCur] =3D=3D =
'a')<BR> {<BR> nCur +=3D=20
3;<BR> m_Lr1[nIndex].nNextStatus =3D =
0;<BR> =20
}<BR> else<BR> {<BR> if=20
(pChar[nCur] =3D=3D 'S' || pChar[nCur] =3D=3D =
'r')<BR> =20
nCur++;<BR> // =
=D7=B4=CC=AC=D7=AA=BB=BB<BR> =20
m_Lr1[nIndex].nNextStatus =3D =
atoi(&pChar[nCur]);<BR> =20
for (; pChar[nCur] !=3D ';'; nCur++);<BR> }</P>
<P> nIndex++;<BR>}<BR>m_nLr1Len =3D nIndex;</P>
<P>return true;<BR>}</P>
<P>/********************************************************<BR>*=20
=
=D2=D4=CF=C2=CA=C7=D3=EF=B7=A8=B7=D6=CE=F6=B2=BF=B7=D6<BR>***************=
******************************************/<BR>/*************************=
***********************<BR>*=20
=BB=F1=C8=A1=B5=B1=C7=B0=B5=A5=B4=CA=B7=FB=BA=C5=A3=BA<BR>* =
=C8=E7=B9=FB=CA=C7=D5=FB=CA=FD=BB=F2=B1=EA=CA=B6=B7=FB=A3=AC=B7=B5=BB=D8'=
i'<BR>*=20
=
=C8=E7=B9=FB=CA=C7=CB=E3=B7=A8=A3=AC=B7=B5=BB=D8=CB=E3=B7=A8<BR>*********=
****************************************/<BR>char=20
GetCurChar(WORDNODE *pNode)<BR>{<BR>switch =
(pNode->byType)<BR>{<BR>case=20
WT_OPERATOR: // =B2=D9=D7=F7=B7=FB<BR> return =
pNode->Value[0];<BR>case=20
WT_UINT: // =D5=FB=CA=FD<BR>case WT_VARIABLE: // =
=B1=E4=C1=BF<BR> =20
return 'i';<BR>}</P>
<P>return '\0';<BR>}</P>
<P>int GetLR1Index(int nStatus, char a)<BR>{<BR>for (int i =3D 0; =
i <=20
m_nLr1Len; i++)<BR>{<BR> if (m_Lr1[i].nStatus =3D=3D =
nStatus=20
&& m_Lr1[i].CurChar =3D=3D a)<BR> return =
i;<BR>}<BR>return -1;<BR>}</P>
<P>// =B4=F2=D3=A1=D7=B4=CC=AC<BR>void PrintState(WORDNODE *pNode, =
int=20
nBnfIndex)<BR>{<BR>PrintIntStack();<BR>PrintCharStack();</P>
<P>WORDNODE *pPrint =3D pNode;<BR>int nCount =3D 0;<BR>while =
(pPrint !=3D=20
NULL)<BR>{<BR> printf("%c",=20
=
GetCurChar(pPrint));//GetCurChar()=B2=E9=D1=AF=B5=A5=B4=CA=B6=D4=D3=A6=B5=
=C4=CE=C4=B7=A8=B7=FB=BA=C5<BR> pPrint =3D=20
pPrint->pNext;<BR> nCount++;<BR>}<BR>for (; nCount =
< 12;=20
nCount++)<BR> printf(" ");</P>
<P>if (nBnfIndex =3D=3D -1)<BR>{<BR> if =
(GetCurChar(pNode) =3D=3D=20
'i')<BR> printf("i=3D%s",=20
pNode->Value);<BR>}<BR>else<BR> =
printf("%c-->%s",=20
m_Bnf[nBnfIndex].Left, m_Bnf[nBnfIndex].Right);</P>
<P>printf("\n");<BR>}</P>
<P><BR>bool LR1Analysis(WORDNODE *pHeader)<BR>{<BR>char =
CurChar;<BR>int=20
LR1Index;<BR>int nBnfIndex;<BR>int nLen;<BR>CHARNODE=20
*Top;<BR><BR>InitIntStack();<BR>PushInt(0);// =
=D7=B4=CC=AC=D5=BB=B3=F5=CA=BC=BB=AF</P>
<P>InitCharStack();<BR>PushChar('#', NULL);// =
=CE=C4=B7=A8=B7=FB=BA=C5=D5=BB=B3=F5=CA=BC=BB=AF</P>
<P> WORDNODE *pNode =3D pHeader->pNext;// =
=B5=A5=B4=CA=C1=B4=B1=ED=D6=B8=CF=F2=B5=DA=D2=BB=B8=F6=B5=A5=B4=CA</P>
<P>PrintState(pNode, -1);// =B4=F2=D3=A1=B6=D1=D5=BB</P>
<P>while(pNode){// =CA=E4=C8=EB=B4=AE<BR> =
CurChar =3D=20
GetCurChar(pNode);<BR> LR1Index =3D =
GetLR1Index(TopInt(),=20
=
CurChar);//=B8=F9=BE=DD=D5=BB=B6=A5=D7=B4=CC=AC=BA=CD=B5=B1=C7=B0=B7=FB=BA=
=C5,=B2=E9=D1=AF=B7=D6=CE=F6=B1=ED=D6=D0=B5=C4=B6=AF=D7=F7=D0=F2=BA=C5</P=
>
<P> switch=20
=
(m_Lr1[LR1Index].ActionType){//m_Lr1[]=B8=C3=CA=FD=D7=E9=D4=DA=B6=C1=B3=F6=
LR1=B7=D6=CE=F6=B1=ED=CA=B1=B2=FA=C9=FA<BR> =20
case Push:<BR> =20
=
PushInt(m_Lr1[LR1Index].nNextStatus);<BR> =20
PushChar(m_Lr1[LR1Index].CurChar,=20
pNode);<BR> pNode =3D=20
pNode->pNext;<BR> =
PrintState(pNode,=20
-1);<BR> =
break;<BR> case=20
=
Sumup://=B9=E6=D4=BC=B9=FD=B3=CC=A3=A1<BR> =
nBnfIndex =3D=20
=
m_Lr1[LR1Index].nNextStatus;//=C8=A1=B3=F6=CF=C2=D2=BB=B8=F6=D7=B4=CC=AC=B5=
=C4=B2=FA=C9=FA=CA=BD=D0=F2=BA=C5<BR> =20
nLen =3D=20
=
m_Bnf[nBnfIndex].RLen;//=C8=A1=B3=F6=B2=FA=C9=FA=CA=BD=D3=D2=B2=BF=B5=C4=B3=
=A4=B6=C8<BR> <BR> &n=
bsp;=20
PopIntN(nLen);<BR> =20
=
PopCharN(nLen);//=BD=AB=D7=B4=CC=AC=D5=BB=BA=CD=B7=FB=BA=C5=D5=BB=B5=C4N=B8=
=F6=D4=AA=CB=D8=B3=F6=D5=BB<BR> <BR>&n=
bsp; =20
PushChar(m_Bnf[nBnfIndex].Left,=20
=
NULL);//=BD=AB=B2=FA=C9=FA=CA=BD=B5=C4=D7=F3=B2=BF=D1=B9=C8=EB=B7=FB=BA=C5=
=D5=BB<BR> <BR>  =
;=20
Top =3D =
TopChar();//=B5=C3=B5=BD=B7=FB=BA=C5=D5=BB=B5=C4=D5=BB=B6=A5<BR> &nb=
sp; LR1Index =3D=20
GetLR1Index(TopInt(),=20
=
Top->cCur);//=B8=F9=BE=DD=D7=B4=CC=AC=D5=BB=D5=BB=B6=A5=D7=B4=CC=AC=BA=
=CD=B7=FB=BA=C5=D5=BB=D5=BB=B6=A5=B7=FB=BA=C5=B2=E9=D1=AF=B7=D6=CE=F6=B1=ED=
=A3=AC=C8=B7=B6=A8=D7=AA=D2=C6=D7=B4=CC=AC=A3=BB<BR> &nb=
sp; <BR> =20
if(LR1Index =3D=3D -1)<BR> =
return=20
false;<BR> =20
else<BR> =20
=
PushInt(m_Lr1[LR1Index].nNextStatus);//=D1=B9=C8=EB=D7=B4=CC=AC=D5=BB<BR>=
=20
PrintState(pNode,=20
=
nBnfIndex);//=B4=F2=D3=A1<BR> &n=
bsp; =20
break;<BR> case=20
Accept:<BR> return=20
true;<BR> default: return =
false;<BR> =20
}<BR>}<BR>}<BR><BR>int main(int argc, char* argv[])<BR>{<BR>//=20
=CA=E4=C8=EB=CE=C4=BC=FE=C3=FB<BR>char=20
=
FileName[MAX_DATA_LEN];<BR>printf("=C7=EB=CA=E4=C8=EB=B4=CA=B7=A8=B7=D6=CE=
=F6=B5=C4=CE=C4=BC=FE=C3=FB=A3=BA\n");<BR>scanf("%s",=20
FileName);</P>
<P>// =
=B6=C1=C8=A1=CE=C4=BC=FE<BR>printf("=B5=A5=B4=CA=D0=F2=C1=D0=A3=BA\n");<B=
R>WORDNODE *pHeader =3D (WORDNODE=20
*)malloc(sizeof(WORDNODE));<BR>if (!ReadWords(FileName,=20
pHeader))<BR>{<BR> =
printf("=B6=C1=C8=A1=B4=CA=B7=A8=B7=D6=CE=F6=CE=C4=BC=FE=CA=A7=B0=DC=A3=A1=
\n");<BR> =20
ClearWords(pHeader);<BR> return 0;<BR>}</P>
<P>// =B6=C1=C8=A1=CE=C4=B7=A8<BR>if =
(!ReadBnfs())<BR>{<BR> =20
=
printf("=B6=C1=C8=A1=B2=FA=C9=FA=CA=BD=CA=A7=B0=DC=A3=A1\n");<BR> &n=
bsp; ClearWords(pHeader);<BR> =20
return 0;<BR>}</P>
<P>// =B6=C1=C8=A1LR(1)=B7=D6=CE=F6=B1=ED<BR>if =
(!ReadLR1())<BR>{<BR> =20
=
printf("=B6=C1=C8=A1LR(1)=B7=D6=CE=F6=B1=ED=CA=A7=B0=DC=A3=A1\n");<BR>&nb=
sp; =20
ClearWords(pHeader);<BR> return 0;<BR>}</P>
<P>//=20
=
=D3=EF=B7=A8=B7=D6=CE=F6<BR>printf("=D3=EF=B7=A8=B7=D6=CE=F6=B9=FD=B3=CC=A3=
=BA\n");<BR>printf("=D7=B4=CC=AC=D5=BB  =
; =
&=
nbsp; =20
=B7=FB=BA=C5=D5=BB =
=CA=E4=C8=EB=B4=AE =
=B2=FA=C9=FA=CA=BD\n");<BR>if=20
(LR1Analysis(pHeader))<BR> =20
=
printf("=D3=EF=B7=A8=B7=D6=CE=F6=B3=C9=B9=A6=A3=A1\n");<BR>else<BR> =
printf("=D3=EF=B7=A8=B7=D6=CE=F6=CA=A7=B0=DC=A3=A1\n");</P>
<P>// =C7=E5=BF=D5=C1=B4=B1=ED<BR>ClearWords(pHeader);</P>
<P>getchar();<BR>getchar();</P>
<P>return 0;<BR>}</P>
<P></P></DIV></TD></TR></TBODY></TABLE><BR>
<DIV class=3Dopt><A =
title=3D=B2=E9=BF=B4=B8=C3=B7=D6=C0=E0=D6=D0=CB=F9=D3=D0=CE=C4=D5=C2=20
href=3D"http://hi.baidu.com/ionstorm/blog/category/%B4%FA%C2%EB%D2%D5%CA%=
F5">=C0=E0=B1=F0=A3=BA=B4=FA=C2=EB=D2=D5=CA=F5</A>=20
| <A =
title=3D=BD=AB=B4=CB=CE=C4=D5=C2=CC=ED=BC=D3=B5=BD=B0=D9=B6=C8=CB=D1=B2=D8=
onclick=3D"return addToFavor();"=20
href=3D"http://cang.baidu.com/do/add" =
target=3D_blank>=CC=ED=BC=D3=B5=BD=CB=D1=B2=D8</A> | =E4=AF=C0=C0(<SPAN=20
id=3Dresult></SPAN>) | <A=20
href=3D"http://hi.baidu.com/ionstorm/blog/item/540ace6235514edee6113a54.h=
tml#send">=C6=C0=C2=DB</A> (1)
<SCRIPT language=3Djavascript>
/*<![CDATA[*/
var pre =3D =
[true,'=B1=E0=D2=EB=D4=AD=C0=ED=D3=EF=B7=A8=B7=D6=CE=F6IntStack.h', =
'=B1=E0=D2=EB=D4=AD=C0=ED=D3=EF=B7=A8=B7=D6=CE=F6IntStack.h','/ionstorm/b=
log/item/a7f94760f1cbf5dc8cb10d4b.html'];
var post =3D =
[true,'=BF=CE=B3=CC=B1=E0=D6=C6=CE=CA=CC=E2=A3=A8=CA=FD=BE=DD=BD=E1=B9=B9=
=BF=CE=B3=CC=C9=E8=BC=C6=A3=A91','=BF=CE=B3=CC=B1=E0=D6=C6=CE=CA=CC=E2=A3=
=A8=CA=FD=BE=DD=BD=E1=B9=B9=BF=CE=B3=CC=C9=E8=BC=C6...', =
'/ionstorm/blog/item/8b9a83221159bcf0d6cae247.html'];
if(pre[0] || post[0]){
document.write('<div =
style=3D"height:5px;line-height:5px;"> </div><div id=3D"in_nav">');
if(pre[0]){
document.write('=C9=CF=D2=BB=C6=AA=A3=BA<a href=3D"' + pre[3] + '" =
title=3D"' + pre[1] + '">' + pre[2] + '</a> ');
}
if(post[0]){
document.write('=CF=C2=D2=BB=C6=AA=A3=BA<a href=3D"' + post[3] + '" =
title=3D"' + post[1] + '">' + post[2] + '</a>');
}
document.write('</div>');
}
/*]]>*/
</SCRIPT>
</DIV>
<DIV class=3Dline></DIV>
<STYLE type=3Dtext/css>#in_related_doc A {
TEXT-DECORATION: none
}
</STYLE>
<DIV id=3Din_related_tmp></DIV>
<SCRIPT language=3Djavascript type=3Dtext/javascript>
/*<![CDATA[*/
function HI_MOD_IN_RELATED_DOC_CALLBACK(arg){
if(arg.length <=3D 1) return false;
var hasMore =3D arg[0];
var D=3Dfunction(A,B){A[A.length]=3DB;}
if(arg.length % 2 =3D=3D 0) D(arg, ["","","",""]);
var html =3D ['<div id=3D"in_related_doc"><div =
class=3D"tit">=CF=E0=B9=D8=CE=C4=D5=C2=A3=BA</div>'];
D(html, '<table cellpadding=3D"0" cellspacing=3D"3" border=3D"0">');
for(var i =3D 1, j =3D arg.length; i < j; i +=3D 2){
D(html, '<tr>');
D(html, '<td width=3D"15px"><a style=3D"font-size:25px" =
>•</a></td><td><a href=3D"http://hi.baidu.com/' + arg[i][3] + =
'/blog/item/' + arg[i][2] + '.html" target=3D"_blank" title=3D"' + =
arg[i][0] + '">' + arg[i][1] + '</a>');
D(html, new Array(10).join('\u3000'));
D(html, '</td>');
if(arg[i + 1][0] !=3D "")
D(html, '<td width=3D"15px"><a style=3D"font-size:25px" =
>•</a></td><td><a href=3D"http://hi.baidu.com/' + arg[i + 1][3] + =
'/blog/item/' + arg[i + 1][2] + '.html" target=3D"_blank" title=3D"' + =
arg[i + 1][0] + '">' + arg[i + 1][1] + '</a></td>');
else
D(html, '<td> </td><td> </td>');
D(html, '</tr>');
}
if(hasMore) D(html, '<tr><td colspan=3D"4"><a target=3D"_blank" =
href=3D"/sys/search?pageno=3D1&type=3D7&sort=3D1&word=3D%B1%E0%D2%EB%D4%A=
D%C0%ED%D3%EF%B7%A8%B7%D6%CE%F6LR1%2Ecpp&item=3D540ace6235514edee6113a54"=
>=B8=FC=B6=E0>></a></td></tr>');
D(html, '</table></div><div class=3D"line"> </div>');
var div =3D document.getElementById('in_related_tmp');
if(div){
div.innerHTML =3D html.join('');
while(div.firstChild){
div.parentNode.insertBefore(div.firstChild, div);
}
div.parentNode.removeChild(div);
}
}
if(RelatedDocData =3D=3D -1){ // not supported xhr
var script =3D document.createElement('script');
script.type =3D 'text/javascript';
script.src =3D =
'/sys/search?type=3D8&word=3D%B1%E0%D2%EB%D4%AD%C0%ED%D3%EF%B7%A8%B7%D6%C=
E%F6LR1%2Ecpp&item=3D540ace6235514edee6113a54&t=3D' + new =
Date().getTime();
document.getElementsByTagName('HEAD')[0].appendChild(script);
}else if(RelatedDocData =3D=3D null){
GetAndEval =3D true;
}else{
eval(RelatedDocData);
}
/*]]>*/
</SCRIPT>
<DIV id=3Din_reader>
<DIV class=3Dtit>=D7=EE=BD=FC=B6=C1=D5=DF=A3=BA</DIV>
<SCRIPT>
var g_spAnnony=3Dtrue;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -