亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? compiler.java

?? 類c語言編譯器
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
		attriStack=new Stack();
		groupVector=new Vector();
	}
	//===測試用
	void displayAttriStack()
	{
		System.out.println("=============attriStack============\n");
		for(int i=0;i<attriStack.size();i++)
		{
			attribution attri=new attribution();
			attri=(attribution)attriStack.elementAt(i);
			System.out.println("(place:"+attri.place+","+"trueList:"+attri.trueList+","+"falseList:"+attri.falseList+","+"nextList:"+attri.nextList+"\n");
		}
	}
	//===測試用
	void displayGroup()
	{
		System.out.println("============group==============\n");
		for(int i=0;i<groupVector.size();i++)
		{
			fourGroup fGroup=new fourGroup();
			fGroup=(fourGroup)groupVector.elementAt(i);
			System.out.println(fGroup.label+":("+fGroup.operate+","+fGroup.opFirst+","+fGroup.opSecond+","+fGroup.result+")");
		}
		
	}
	//===產生新的標號
	int newlabel()
	{
		return(newLabel++);
	}
	//===產生新的變量
	String newtemp()
	{
		return ("temp"+Integer.toString(newtempLabel++));
	}
	//===語法分析及語義分析
	void analyse(boolean isFormulaStep,boolean isGroupStep)throws ArrayIndexOutOfBoundsException 
	{
		int staIndex=0;	
		int tokIndex=0;
		int tokTop=0;
		int staTop=0;
		int actionTemp=0;	//===存放從表中查到的狀態編號
		int gotoTemp=0;		//===產生式編號
		int genLength=0;	//===產生式長度
		int gotoIndex=0;	//===goto表索引
		isStep=isGroupStep;
		
		while(true)
		{
			staTop=Integer.parseInt((String)staStack.lastElement());
			tokTop=Integer.parseInt((String)symTable.tokenCode.elementAt(tokIndex));
			actionTemp=lrTable.lrTable[staTop][tokTop];
			//================================================================================
			//=======================在action表中查到0表示出錯[語法錯誤]======================
			//================================================================================
			if(actionTemp==0)
			{
				errorLine=Integer.parseInt( (String)symTable.tokenLine.elementAt(tokIndex));
				errorColumn=Integer.parseInt ((String)symTable.tokenColumn.elementAt(tokIndex));
				isError=true;
				return;
			}
			switch(actionTemp/100)
			{
			case 0:
				break;
			case 1://===在action表中查到的是s則進棧
				symStack.push((String)symTable.tokenSym.elementAt(tokIndex)); 
				staStack.push(Integer.toString(actionTemp-100));
				tokIndex++;
				break;
			case 2://===在action表中查到的是r則歸約
				genLength=((String)genFormu.genOut.elementAt(actionTemp-200)).length();
				//===輸出完成產生式
				if(isFormulaStep)
				{
					int dlgResult =MessageBox.show((String)genFormu.genAll.elementAt(actionTemp-200),"產生式",1);
					if (dlgResult == DialogResult.CANCEL)
					{
						isFormulaStep=false;
					}
				}
				formulaVector.addElement((String)genFormu.genAll.elementAt(actionTemp-200));
				switch(actionTemp%200)
				{
				case 1:s1();
					break;
				case 2:c2();
					break;
				case 3:c3();
					break;
				case 4:d4();
					break;
				case 5:d5();
					break;
				case 6:f6();
					break;
				case 7:f7();
					break;
				case 8:s8();
					break;
				case 9:v9();
					break;
				case 10:v10();
					break;
				case 11:s11();
					break;
				case 12:e12();
					break;
				case 13:e13();
					break;
				case 14:h14();
					break;
				case 15:h15();
					break;
				case 16:i16();
					break;
				case 17:i17();
					break;
				case 18:j18();
					break;
				case 19:j19();
					break;
				case 20:j20();
					break;
				case 21:j21();
					break;
				case 22:j22();
					break;
				case 23:j23();
					break;
				case 24:s24();
					break;
				case 25:k25();
					break;
				case 26:k26();
					break;
				case 27:a27();
					break;
				case 28:b28();
					break;
				case 29:m29();
					break;
				case 30:n30();
					break;
				case 31:o31();
					break;
				case 32:r32();
					break;
				case 33:p33();
					break;
				default:
					break;
				}
				//如果是空產生式不彈棧
				if(!((String)genFormu.genOut.elementAt(actionTemp-200)).startsWith("z"))
				{
					for(int i=0;i<genLength;i++)
					{
						symStack.pop();
						staStack.pop();
					}
				}
				symStack.push((String)genFormu.genSymbol.elementAt(actionTemp-200));
				staTop=Integer.parseInt((String)staStack.lastElement());
				gotoIndex=Integer.parseInt((String)genFormu.genCode.elementAt(actionTemp-200))+25;
				gotoTemp=lrTable.lrTable[staTop][gotoIndex];
				staStack.push(Integer.toString(gotoTemp));
				break;
			case 3://===如果在action表中查到的是acc則成功
				//===將最后的出口填上標號
				int intLabel=newlabel();
				for(int i=0;i<groupVector.size();i++)
				{
					if(((fourGroup)groupVector.elementAt(i)).notFinished)
					{
						((fourGroup)groupVector.elementAt(i)).result=Integer.toString(intLabel);
					}
				}
				return;
			default:
				break;
			}
		}
	}
	//================================================================================
	//===================================連接兩個表===================================
	//================================================================================
	//==參數說明[firList---先歸約的非終結符的list,secList---后歸約的非終結符的list]==
	int merge(int firList,int secList)
	{
		boolean out=false;
		if(secList==0)
			return firList;
		else
		{
			String strTemp=new String();
			int indexTemp=firList-100;
			if(((fourGroup)groupVector.elementAt(indexTemp)).notFinished)
			{	
				strTemp=((fourGroup)groupVector.elementAt(indexTemp)).result;
			}
			else
			{
				out=true;
			}
			while(strTemp!="#" && !out)
			{
				if(((fourGroup)groupVector.elementAt(indexTemp)).notFinished)
				{	
					indexTemp=Integer.parseInt(strTemp);
					strTemp=((fourGroup)groupVector.elementAt(indexTemp)).result;
				}
				else
				{
					out=true;
				}
			}
			((fourGroup)groupVector.elementAt(indexTemp)).result=Integer.toString(secList-100);
			return firList;
		}
	}
	//===============================================================================
	//=====================================回填出口==================================
	//===============================================================================
	
	//==============參數說明[list---四元組的標號,label---result域的標號]============
	void backpatch(int list,String label)
	{
		String strTemp=new String();
		int indexTemp=list-100;
		boolean out=false;
		
		if(list!=0 && ((fourGroup)groupVector.elementAt(indexTemp)).notFinished)
		{
			strTemp=((fourGroup)groupVector.elementAt(indexTemp)).result;
			((fourGroup)groupVector.elementAt(indexTemp)).result=label;
		}
		else
		{
			out=true;
		}
		while(strTemp!="#" && !out)
		{			
			if(((fourGroup)groupVector.elementAt(indexTemp)).notFinished)
			{
				((fourGroup)groupVector.elementAt(indexTemp)).result=label;
				((fourGroup)groupVector.elementAt(indexTemp)).notFinished=false;
				indexTemp=Integer.parseInt(strTemp);
				strTemp=((fourGroup)groupVector.elementAt(indexTemp)).result;
			}
			else
			{
				out=true;
			}
		}
		if(list!=0 && ((fourGroup)groupVector.elementAt(indexTemp)).notFinished)
		{
			((fourGroup)groupVector.elementAt(indexTemp)).result=label;
			((fourGroup)groupVector.elementAt(indexTemp)).notFinished=false;
		}
	}
	//===============================================================================
	//=================================各文法對應的語義==============================
	//===============================================================================
	void s1()
	{
		attribution attri=new attribution();
		attribution newAttri=new attribution();
		attri=(attribution)attriStack.pop();
		fourGroup group=new fourGroup();
		group.label=newlabel();
		group.operate="=";
		group.opFirst=attri.place;
		group.opSecond=" ";
		group.result=(String)symStack.elementAt(symStack.size()-3);
		group.notFinished=false;
		groupVector.addElement(group);
		fourGroup group2=new fourGroup();
		group2.label=newlabel();
		group2.operate="j";
		groupVector.addElement(group2);
		newAttri.nextList=group2.label;
		attriStack.push(newAttri);
		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 c2()
	{
		attribution attri=new attribution();
		attribution newAttri=new attribution();
		fourGroup group=new fourGroup();
		group.label=newlabel();
		group.operate="+";
		attri=(attribution)attriStack.pop();
		group.opSecond=attri.place;
		attri=(attribution)attriStack.pop();
		group.opFirst=attri.place;
		group.result=newtemp();
		group.notFinished=false;
		groupVector.addElement(group);
		newAttri.place=group.result;
		attriStack.push(newAttri);
		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 c3()
	{
		/**/
	}
	void d4()
	{
		attribution attri=new attribution();
		attribution newAttri=new attribution();
		fourGroup group=new fourGroup();
		group.label=newlabel();
		group.operate="*";
		attri=(attribution)attriStack.pop();
		group.opSecond=attri.place;
		attri=(attribution)attriStack.pop();
		group.opFirst=attri.place;
		group.result=newtemp();
		group.notFinished=false;
		groupVector.addElement(group);
		newAttri.place=group.result;
		attriStack.push(newAttri);
		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 d5()
	{
		/**/
	}
	void f6()
	{
		/* */
	}
	void f7()
	{
		attribution attri=new attribution();
		attri.place=(String)symStack.lastElement();
		attriStack.push(attri);
	}
	void s8()
	{
		attribution attriV=new attribution();
		attribution attriS=new attribution();
		attribution attriA=new attribution();
		attribution attriE=new attribution();
		attriV=(attribution)attriStack.pop();
		attriS=(attribution)attriStack.pop();
		attriA=(attribution)attriStack.pop();
		attriE=(attribution)attriStack.pop();
		attribution newAttri=new attribution();
		backpatch(attriE.trueList,Integer.toString( attriA.nextList));			
		backpatch(attriE.falseList,Integer.toString(attriV.falseList));
		backpatch(attriS.nextList,Integer.toString(attriV.nextList));
		//======================merge============================
		newAttri.nextList=attriV.nextList;
		attriStack.push(newAttri);
	}
	void v9()
	{
		attribution attriS=new attribution();
		attribution attriB=new attribution();
		attriS=(attribution)attriStack.pop();
		attriB=(attribution)attriStack.pop();
		attribution newAttri=new attribution();
		newAttri.nextList=attriS.nextList;
		newAttri.falseList=attriB.nextList;
		attriStack.push(newAttri);
	}
	void v10()
	{
		attribution attri=new attribution();
		attri.nextList=newlabel();
		newLabel--;
		attri.falseList=attri.nextList;
		attriStack.push(attri);
	}
	void s11()
	{
		attribution attriS=new attribution();
		attribution attriN=new attribution();
		attribution attriE=new attribution();
		attribution attriM=new attribution();
		attribution newAttri=new attribution();
		attriS=(attribution)attriStack.pop();
		attriN=(attribution)attriStack.pop();
		attriE=(attribution)attriStack.pop();
		attriM=(attribution)attriStack.pop();
		backpatch(attriS.nextList,Integer.toString(attriM.nextList));
		backpatch(attriE.trueList,Integer.toString(attriN.nextList));
		newAttri.nextList=attriE.falseList;
		attriStack.push(newAttri);
	}
	void e12()
	{
		attribution attriH=new attribution();
		attribution attriO=new attribution();
		attribution attriE=new attribution();
		attriH=(attribution)attriStack.pop();
		attriO=(attribution)attriStack.pop();
		attriE=(attribution)attriStack.pop();
		attribution newAttri=new attribution();
		backpatch(attriE.falseList,Integer.toString(attriO.nextList));
		newAttri.trueList=merge(attriE.trueList,attriH.trueList);
		newAttri.falseList=attriH.falseList;
		attriStack.push(newAttri);
	}
	void e13()
	{
		/* */
		 
	}
	void h14()
	{
		attribution attriI=new attribution();
		attribution attriR=new attribution();
		attribution attriH=new attribution();
		attriI=(attribution)attriStack.pop();
		attriR=(attribution)attriStack.pop();
		attriH=(attribution)attriStack.pop();
		attribution newAttri=new attribution();
		backpatch(attriH.trueList,Integer.toString(attriR.nextList));
		newAttri.trueList=attriI.trueList;
		newAttri.falseList=merge(attriH.falseList,attriI.falseList);
		attriStack.push(newAttri);
	}
	void h15()
	{
		/* */
	}
	void i16()
	{
		attribution attriJ=new attribution();
		attribution newAttri=new attribution();
		attriJ=(attribution)attriStack.pop();
		newAttri.falseList=attriJ.trueList;
		newAttri.trueList=attriJ.falseList;
		attriStack.push(newAttri);
	}
	void i17()
	{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
波多野结衣中文一区| caoporen国产精品视频| 久久久久久久综合狠狠综合| 国产1区2区3区精品美女| 亚洲欧美偷拍三级| 久久综合给合久久狠狠狠97色69| 国产原创一区二区| 亚洲成人免费影院| 久久久不卡影院| 色88888久久久久久影院野外 | 亚洲欧美日韩人成在线播放| 在线不卡免费av| www.欧美.com| 国产在线精品一区二区三区不卡| 18涩涩午夜精品.www| 精品久久免费看| 欧美乱妇23p| 成人综合在线视频| 天堂va蜜桃一区二区三区 | 亚洲自拍偷拍欧美| 精品免费日韩av| 狠狠色狠狠色合久久伊人| 一区二区在线看| 国产亚洲一区字幕| 91视频在线观看| 国产成人免费视频一区| 日本中文字幕一区二区有限公司| 久久综合九色综合97婷婷女人| 欧美日韩精品一区二区三区四区 | 欧美亚洲动漫制服丝袜| 国产一区福利在线| 日韩成人免费看| 亚洲国产日韩精品| 亚洲人成伊人成综合网小说| 精品国产乱码久久久久久夜甘婷婷| 色妹子一区二区| 成人午夜av影视| 国产在线视频一区二区| 免费不卡在线视频| 亚洲成人av资源| 亚洲精品老司机| 日韩午夜精品电影| 日韩三级电影网址| 7777精品伊人久久久大香线蕉最新版| 91小宝寻花一区二区三区| 国产99久久久久久免费看农村| 蜜臀久久99精品久久久久久9| 亚洲一区二区三区四区在线观看| 91黄色免费网站| 欧美性大战久久| 在线观看视频欧美| 色综合色综合色综合 | 亚洲精选免费视频| 亚洲色欲色欲www| 国产精品欧美经典| 亚洲国产精品av| 中文字幕一区免费在线观看| 久久久国产一区二区三区四区小说| 精品福利av导航| 国产午夜精品一区二区三区视频| 欧美一级日韩免费不卡| 日韩欧美色综合| 日韩精品一区二区在线观看| 久久综合999| 久久久久青草大香线综合精品| 久久久久青草大香线综合精品| 国产精品不卡视频| 亚洲视频1区2区| 亚洲欧美日韩成人高清在线一区| 亚洲国产日产av| 午夜精品久久久久影视| 日韩精品三区四区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 亚洲图片你懂的| 亚洲婷婷综合久久一本伊一区| 国产精品国产馆在线真实露脸| 亚洲青青青在线视频| 日韩电影在线一区二区| 乱中年女人伦av一区二区| 国产在线精品一区二区夜色| 狠狠色丁香婷综合久久| 91麻豆免费看| 欧美精品久久一区| 国产清纯在线一区二区www| 中文字幕视频一区二区三区久| 亚洲国产sm捆绑调教视频 | 久久女同精品一区二区| 国产精品久久久久婷婷二区次| 亚洲人妖av一区二区| 蜜桃视频在线观看一区| 国产成人亚洲综合a∨猫咪| 91香蕉视频mp4| 欧美日韩亚洲国产综合| 欧美极品xxx| 亚洲午夜精品久久久久久久久| 免费成人美女在线观看.| 国产乱码一区二区三区| 91女神在线视频| 日韩免费视频一区| 亚洲三级在线看| 国内精品在线播放| 色婷婷久久久久swag精品| 日韩一区二区三区免费观看| 国产精品你懂的在线| 久久国产精品99久久人人澡| 91视视频在线观看入口直接观看www | 午夜视频在线观看一区| 99精品欧美一区二区蜜桃免费| 在线播放/欧美激情| 国产调教视频一区| 日韩成人精品视频| 欧美亚洲日本一区| 国产农村妇女精品| 日韩电影在线免费| 欧美精品一级二级三级| 国产精品天美传媒| 韩国三级中文字幕hd久久精品| 欧美精品成人一区二区三区四区| 久久免费偷拍视频| 午夜视频在线观看一区| 99精品欧美一区二区蜜桃免费 | 亚洲乱码国产乱码精品精98午夜| 六月丁香婷婷久久| 欧美日韩精品一区视频| 亚洲资源在线观看| 99天天综合性| 久久久不卡网国产精品一区| 蜜桃一区二区三区四区| 欧美日韩免费电影| 一区二区在线观看视频| 国产99久久精品| 日本一区二区三区在线不卡| 老司机午夜精品99久久| 欧美揉bbbbb揉bbbbb| 国产欧美精品一区| 成人av电影免费观看| 久久久综合精品| 久久爱另类一区二区小说| 精品日韩在线观看| 久久精品99国产精品| 欧美电影在线免费观看| 国产精品美女久久久久久| 99视频在线观看一区三区| 国产欧美一区二区三区网站| 精品一区二区三区免费| 欧美一区二区黄| 日韩电影网1区2区| 欧美一区二区三区小说| 日韩精品欧美精品| 欧美成人vr18sexvr| 免费成人小视频| 欧美成人三级在线| 视频一区视频二区中文字幕| 欧美大片国产精品| 久久se精品一区精品二区| 久久精品亚洲精品国产欧美| eeuss鲁一区二区三区| 亚洲综合男人的天堂| 777午夜精品免费视频| 国产一区二区在线影院| 国产精品拍天天在线| 欧美四级电影在线观看| 奇米在线7777在线精品| 国产亚洲制服色| 欧美亚洲自拍偷拍| 久久国产精品区| 日韩美女精品在线| 日韩一二三四区| 成人高清视频在线| 五月天激情综合网| 国产欧美一区二区三区在线看蜜臀| 一本久久a久久免费精品不卡| 婷婷国产在线综合| 国产欧美一区二区精品性色超碰| 色老综合老女人久久久| 秋霞午夜鲁丝一区二区老狼| 欧美国产在线观看| 欧美精品色综合| 成人午夜伦理影院| 石原莉奈在线亚洲二区| 国产欧美综合色| 在线不卡的av| av中文字幕不卡| 免费在线观看精品| 亚洲欧美成aⅴ人在线观看| 日韩一区二区三区高清免费看看| 国产91丝袜在线观看| 亚洲6080在线| 国产精品女同互慰在线看| 欧美一区二区视频观看视频| 成人激情av网| 国产做a爰片久久毛片| 一区二区三区国产豹纹内裤在线| 精品国产自在久精品国产| 91福利小视频| 成人va在线观看| 韩国av一区二区三区| 性做久久久久久免费观看 | 亚洲免费在线电影| 日本一区二区久久|