📄 compiler.java
字号:
/* */
}
void j18()
{
fourGroup group1=new fourGroup();
group1.label=newlabel();
group1.operate="j<";
group1.opFirst=(String)symStack.elementAt(symStack.size()-3);
group1.opSecond=(String)symStack.elementAt(symStack.size()-1);
fourGroup group2=new fourGroup();
group2.label=newlabel();
group2.operate="j";
groupVector.addElement(group1);
groupVector.addElement(group2);
attribution attri=new attribution();
attri.trueList=group1.label;
attri.falseList=group2.label;
attriStack.push(attri);
if(isStep)
{
String strTemp=new String();
for(int i=0;i<groupVector.size();i++)
{
strTemp=strTemp+((fourGroup)groupVector.elementAt(i)).label+":"+"("+((fourGroup)groupVector.elementAt(i)).operate+","+((fourGroup)groupVector.elementAt(i)).opFirst+","+((fourGroup)groupVector.elementAt(i)).opSecond+","+((fourGroup)groupVector.elementAt(i)).result+")"+"\n";
}
int dlgResult=MessageBox.show(strTemp,"四元组",1);
if (dlgResult == DialogResult.CANCEL)
{
isStep=false;
}
}
}
void j19()
{
fourGroup group1=new fourGroup();
group1.label=newlabel();
group1.operate="j>";
group1.opFirst=(String)symStack.elementAt(symStack.size()-3);
group1.opSecond=(String)symStack.elementAt(symStack.size()-1);
fourGroup group2=new fourGroup();
group2.label=newlabel();
group2.operate="j";
groupVector.addElement(group1);
groupVector.addElement(group2);
attribution attri=new attribution();
attri.trueList=group1.label;
attri.falseList=group2.label;
attriStack.push(attri);
if(isStep)
{
String strTemp=new String();
for(int i=0;i<groupVector.size();i++)
{
strTemp=strTemp+((fourGroup)groupVector.elementAt(i)).label+":"+"("+((fourGroup)groupVector.elementAt(i)).operate+","+((fourGroup)groupVector.elementAt(i)).opFirst+","+((fourGroup)groupVector.elementAt(i)).opSecond+","+((fourGroup)groupVector.elementAt(i)).result+")"+"\n";
}
int dlgResult=MessageBox.show(strTemp,"四元组",1);
if (dlgResult == DialogResult.CANCEL)
{
isStep=false;
}
}
}
void j20()
{
fourGroup group1=new fourGroup();
group1.label=newlabel();
group1.operate="j<=";
group1.opFirst=(String)symStack.elementAt(symStack.size()-3);
group1.opSecond=(String)symStack.elementAt(symStack.size()-1);
fourGroup group2=new fourGroup();
group2.label=newlabel();
group2.operate="j";
groupVector.addElement(group1);
groupVector.addElement(group2);
attribution attri=new attribution();
attri.trueList=group1.label;
attri.falseList=group2.label;
attriStack.push(attri);
if(isStep)
{
String strTemp=new String();
for(int i=0;i<groupVector.size();i++)
{
strTemp=strTemp+((fourGroup)groupVector.elementAt(i)).label+":"+"("+((fourGroup)groupVector.elementAt(i)).operate+","+((fourGroup)groupVector.elementAt(i)).opFirst+","+((fourGroup)groupVector.elementAt(i)).opSecond+","+((fourGroup)groupVector.elementAt(i)).result+")"+"\n";
}
int dlgResult=MessageBox.show(strTemp,"四元组",1);
if (dlgResult == DialogResult.CANCEL)
{
isStep=false;
}
}
}
void j21()
{
fourGroup group1=new fourGroup();
group1.label=newlabel();
group1.operate="j>=";
group1.opFirst=(String)symStack.elementAt(symStack.size()-3);
group1.opSecond=(String)symStack.elementAt(symStack.size()-1);
fourGroup group2=new fourGroup();
group2.label=newlabel();
group2.operate="j";
groupVector.addElement(group1);
groupVector.addElement(group2);
attribution attri=new attribution();
attri.trueList=group1.label;
attri.falseList=group2.label;
attriStack.push(attri);
if(isStep)
{
String strTemp=new String();
for(int i=0;i<groupVector.size();i++)
{
strTemp=strTemp+((fourGroup)groupVector.elementAt(i)).label+":"+"("+((fourGroup)groupVector.elementAt(i)).operate+","+((fourGroup)groupVector.elementAt(i)).opFirst+","+((fourGroup)groupVector.elementAt(i)).opSecond+","+((fourGroup)groupVector.elementAt(i)).result+")"+"\n";
}
int dlgResult=MessageBox.show(strTemp,"四元组",1);
if (dlgResult == DialogResult.CANCEL)
{
isStep=false;
}
}
}
void j22()
{
fourGroup group1=new fourGroup();
group1.label=newlabel();
group1.operate="j<>";
group1.opFirst=(String)symStack.elementAt(symStack.size()-3);
group1.opSecond=(String)symStack.elementAt(symStack.size()-1);
fourGroup group2=new fourGroup();
group2.label=newlabel();
group2.operate="j";
groupVector.addElement(group1);
groupVector.addElement(group2);
attribution attri=new attribution();
attri.trueList=group1.label;
attri.falseList=group2.label;
attriStack.push(attri);
if(isStep)
{
String strTemp=new String();
for(int i=0;i<groupVector.size();i++)
{
strTemp=strTemp+((fourGroup)groupVector.elementAt(i)).label+":"+"("+((fourGroup)groupVector.elementAt(i)).operate+","+((fourGroup)groupVector.elementAt(i)).opFirst+","+((fourGroup)groupVector.elementAt(i)).opSecond+","+((fourGroup)groupVector.elementAt(i)).result+")"+"\n";
}
int dlgResult=MessageBox.show(strTemp,"四元组",1);
if (dlgResult == DialogResult.CANCEL)
{
isStep=false;
}
}
}
void j23()
{
fourGroup group1=new fourGroup();
group1.label=newlabel();
group1.operate="j==";
group1.opFirst=(String)symStack.elementAt(symStack.size()-3);
group1.opSecond=(String)symStack.elementAt(symStack.size()-1);
fourGroup group2=new fourGroup();
group2.label=newlabel();
group2.operate="j";
groupVector.addElement(group1);
groupVector.addElement(group2);
attribution attri=new attribution();
attri.trueList=group1.label;
attri.falseList=group2.label;
attriStack.push(attri);
if(isStep)
{
String strTemp=new String();
for(int i=0;i<groupVector.size();i++)
{
strTemp=strTemp+((fourGroup)groupVector.elementAt(i)).label+":"+"("+((fourGroup)groupVector.elementAt(i)).operate+","+((fourGroup)groupVector.elementAt(i)).opFirst+","+((fourGroup)groupVector.elementAt(i)).opSecond+","+((fourGroup)groupVector.elementAt(i)).result+")"+"\n";
}
int dlgResult=MessageBox.show(strTemp,"四元组",1);
if (dlgResult == DialogResult.CANCEL)
{
isStep=false;
}
}
}
void s24()
{
/**/
}
void k25()
{
attribution attriS=new attribution();
attribution attriP=new attribution();
attribution attriK=new attribution();
attriS=(attribution)attriStack.pop();
attriP=(attribution)attriStack.pop();
attriK=(attribution)attriStack.pop();
attribution newAttri=new attribution();
backpatch(attriK.nextList,Integer.toString(attriP.nextList));
newAttri.nextList=attriS.nextList;
attriStack.push(newAttri);
}
void k26()
{
/**/
}
void a27()
{
attribution attri=new attribution();
attri.nextList=newlabel();
newLabel--;
attriStack.push(attri);
}
void b28()
{
attribution attri=new attribution();
attri.nextList=newlabel();
newLabel--;
attriStack.push(attri);
}
void m29()
{
attribution attri=new attribution();
attri.nextList=newlabel();
newLabel--;
attriStack.push(attri);
}
void n30()
{
attribution attri=new attribution();
attri.nextList=newlabel();
newLabel--;
attriStack.push(attri);
}
void o31()
{
attribution attri=new attribution();
attri.nextList=newlabel();
newLabel--;
attriStack.push(attri);
}
void r32()
{
attribution attri=new attribution();
attri.nextList=newlabel();
newLabel--;
attriStack.push(attri);
}
void p33()
{
attribution attri=new attribution();
attri.nextList=newlabel();
newLabel--;
attriStack.push(attri);
}
}
class LRTable
{
//===分析表
int lrTable[][];
public LRTable()
{
lrTable=new int[61][43];
for(int i=0;i<61;i++)
{
for(int j=0;j<43;j++)
{
lrTable[i][j]=0;
}
}
//===初始化分析表
lrTable[0][1]=105;
lrTable[0][6]=103;
lrTable[0][11]=104;
lrTable[0][24]=102;
lrTable[0][26]=1;
lrTable[1][25]=301;
lrTable[2][16]=106;
lrTable[3][7]=110;
lrTable[3][24]=112;
lrTable[3][30]=7;
lrTable[3][31]=8;
lrTable[3][32]=9;
lrTable[3][33]=11;
lrTable[4][7]=229;
lrTable[4][24]=229;
lrTable[4][37]=13;
lrTable[5][1]=105;
lrTable[5][6]=103;
lrTable[5][11]=104;
lrTable[5][24]=102;
lrTable[5][26]=15;
lrTable[5][34]=14;
lrTable[6][12]=119;
lrTable[6][24]=120;
lrTable[6][27]=16;
lrTable[6][28]=17;
lrTable[6][29]=18;
lrTable[7][8]=122;
lrTable[7][9]=121;
lrTable[8][0]=123;
lrTable[8][2]=213;
lrTable[8][8]=213;
lrTable[8][9]=213;
lrTable[9][0]=215;
lrTable[9][2]=215;
lrTable[9][8]=215;
lrTable[9][9]=215;
lrTable[10][24]=112;
lrTable[10][33]=24;
lrTable[11][0]=217;
lrTable[11][2]=217;
lrTable[11][8]=217;
lrTable[11][9]=217;
lrTable[12][14]=125;
lrTable[12][15]=126;
lrTable[12][17]=127;
lrTable[12][18]=128;
lrTable[12][19]=129;
lrTable[12][20]=130;
lrTable[13][7]=110;
lrTable[13][24]=112;
lrTable[13][30]=31;
lrTable[13][31]=8;
lrTable[13][32]=9;
lrTable[13][33]=11;
lrTable[14][4]=132;
lrTable[14][21]=133;
lrTable[15][4]=226;
lrTable[15][21]=226;
lrTable[16][3]=201;
lrTable[16][4]=201;
lrTable[16][21]=201;
lrTable[16][22]=134;
lrTable[16][25]=201;
lrTable[17][3]=203;
lrTable[17][4]=203;
lrTable[17][13]=203;
lrTable[17][21]=203;
lrTable[17][22]=203;
lrTable[17][23]=135;
lrTable[17][25]=203;
lrTable[18][3]=205;
lrTable[18][4]=205;
lrTable[18][13]=205;
lrTable[18][21]=205;
lrTable[18][22]=205;
lrTable[18][23]=205;
lrTable[18][25]=205;
lrTable[19][12]=119;
lrTable[19][24]=120;
lrTable[19][27]=36;
lrTable[19][28]=17;
lrTable[19][29]=18;
lrTable[20][3]=207;
lrTable[20][4]=207;
lrTable[20][13]=207;
lrTable[20][21]=207;
lrTable[20][22]=207;
lrTable[20][23]=207;
lrTable[20][25]=207;
lrTable[21][1]=227;
lrTable[21][6]=227;
lrTable[21][11]=227;
lrTable[21][24]=227;
lrTable[21][35]=37;
lrTable[22][7]=231;
lrTable[22][24]=231;
lrTable[22][39]=38;
lrTable[23][7]=232;
lrTable[23][24]=232;
lrTable[23][40]=39;
lrTable[24][0]=216;
lrTable[24][2]=216;
lrTable[24][8]=216;
lrTable[24][9]=216;
lrTable[25][24]=140;
lrTable[26][24]=141;
lrTable[27][24]=142;
lrTable[28][24]=143;
lrTable[29][24]=144;
lrTable[30][24]=145;
lrTable[31][2]=146;
lrTable[31][8]=122;
lrTable[32][3]=224;
lrTable[32][4]=224;
lrTable[32][21]=224;
lrTable[32][25]=224;
lrTable[33][1]=233;
lrTable[33][6]=233;
lrTable[33][11]=233;
lrTable[33][24]=233;
lrTable[33][41]=47;
lrTable[34][12]=119;
lrTable[34][24]=120;
lrTable[34][28]=48;
lrTable[34][29]=18;
lrTable[35][12]=119;
lrTable[35][24]=120;
lrTable[35][29]=49;
lrTable[36][13]=150;
lrTable[36][22]=134;
lrTable[37][1]=105;
lrTable[37][6]=103;
lrTable[37][11]=104;
lrTable[37][24]=102;
lrTable[37][26]=51;
lrTable[38][7]=110;
lrTable[38][24]=112;
lrTable[38][31]=52;
lrTable[38][32]=9;
lrTable[38][33]=11;
lrTable[39][7]=110;
lrTable[39][24]=112;
lrTable[39][32]=53;
lrTable[39][33]=11;
lrTable[40][0]=218;
lrTable[40][2]=218;
lrTable[40][8]=218;
lrTable[40][9]=218;
lrTable[41][0]=219;
lrTable[41][2]=219;
lrTable[41][8]=219;
lrTable[41][9]=219;
lrTable[42][0]=220;
lrTable[42][2]=220;
lrTable[42][8]=220;
lrTable[42][9]=220;
lrTable[43][0]=221;
lrTable[43][2]=221;
lrTable[43][8]=221;
lrTable[43][9]=221;
lrTable[44][0]=222;
lrTable[44][2]=222;
lrTable[44][8]=222;
lrTable[44][9]=222;
lrTable[45][0]=223;
lrTable[45][2]=223;
lrTable[45][8]=223;
lrTable[45][9]=223;
lrTable[46][1]=230;
lrTable[46][6]=230;
lrTable[46][11]=230;
lrTable[46][24]=230;
lrTable[46][38]=54;
lrTable[47][1]=105;
lrTable[47][6]=103;
lrTable[47][11]=104;
lrTable[47][24]=102;
lrTable[47][26]=55;
lrTable[48][3]=202;
lrTable[48][4]=202;
lrTable[48][13]=202;
lrTable[48][21]=202;
lrTable[48][22]=202;
lrTable[48][23]=135;
lrTable[48][25]=202;
lrTable[49][3]=204;
lrTable[49][4]=204;
lrTable[49][13]=204;
lrTable[49][21]=204;
lrTable[49][22]=204;
lrTable[49][23]=204;
lrTable[49][25]=204;
lrTable[50][3]=206;
lrTable[50][4]=206;
lrTable[50][13]=206;
lrTable[50][21]=206;
lrTable[50][22]=206;
lrTable[50][23]=206;
lrTable[50][25]=206;
lrTable[51][3]=157;
lrTable[51][4]=210;
lrTable[51][21]=210;
lrTable[51][25]=210;
lrTable[51][42]=56;
lrTable[52][0]=123;
lrTable[52][2]=212;
lrTable[52][8]=212;
lrTable[52][9]=212;
lrTable[53][0]=214;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -