xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

這是我在大三的時候解釋器實踐的課程設計,是用C#開發的,包括詞法分析、語法分析和編譯執行階段,文檔比較齊全,可供初步學習解釋器的同學看看,但不鼓勵直接拿來當作業用,起碼也得自己看看源碼,分析分析下,對自己也好

資源截圖

代碼片段和文件信息

/*
?*?作者:黎國梁
?*?班級:三班
?*?學號:200632580088
?*/
using?System;
using?System.Collections.Generic;
using?System.Text;
using?System.Text.Regularexpressions;
using?System.IO;

namespace?CMMCompiler
{
????///?
????///?AccessTable類包含中間代碼訪問符號表的方法
????///?

????class?AccessTable?:?MidCode
????{
????????//可以為VARGTARGSARG和常數
????????string?ARG?=?““;

????????//可以為標識符
????????string?IN_1?=?““;

????????//數組下標為標識符或者常數如果不是數組為空.
????????string?IN_2?=?““;

????????//為純數字用來判斷數組下標是否為常數?還是?標識符
????????string?pattern?=?@“^[0-9]+$“;

????????///?
????????///?此方法,分解VARG(A)等,為VARGA,返回A
????????///?

????????///?需要分解的對象
????????///?返回A變量
????????private?string?find_Table_Kind(string?result)
????????{
????????????int?n?=?0;
????????????ARG?=?““;
????????????IN_1?=?““;
????????????IN_2?=?““;

????????????char[]?c?=?result.ToCharArray();

????????????while?(n?????????????{
????????????????ARG?=?ARG?+?c[n].ToString();?//得到ARG用于訪問表名
????????????????n++;
????????????}

????????????n++;
????????????while?(n?????????????{
????????????????IN_1?=?IN_1?+?c[n].ToString();?//得到IN_1用于查找表內成員
????????????????n++;
????????????}

????????????n++;
????????????while?(n?????????????{
????????????????IN_2?=?IN_2?+?c[n].ToString();?//得到IN_2用于訪問數組內部變量
????????????????n++;
????????????}

????????????return?IN_1;
????????}

????????///?
????????///?此方法返回result對應的所在表的value值
????????///?

????????///?需要返回值的對象
????????///?
????????public?string?getValue(string?result)
????????{
????????????IN_1?=?find_Table_Kind(result);
????????????switch?(ARG)
????????????{
????????????????case?“VARG“:?//標識符
????????????????????int?indexID?=?IDlist.IndexOf(IN_1);
????????????????????IDtable?BStmp?=?(IDtable)IDtablelist[indexID];
????????????????????return?BStmp.Value;
????????????????case?“TARG“:?//臨時變量
????????????????????int?indexTempID?=?TempIDlist.IndexOf(IN_1);
????????????????????TempIDtable?LStmp?=?(TempIDtable)TempIDtablelist[indexTempID];
????????????????????return?LStmp.Value;
????????????????case?“SARG“:?//數組

????????????????????try?//如果數組出界返回一個空值null
????????????????????{
????????????????????????if?(!Regex.IsMatch(IN_2?pattern))?//如果數組下標為常數
????????????????????????{
????????????????????????????int?indexBS1?=?IDlist.IndexOf(IN_2);
????????????????????????????IDtable?BStmp1?=?(IDtable)IDtablelist[indexBS1];
????????????????????????????IN_2?=?BStmp1.Value;?//得到數組下標的值
????????????????????????}

????????????????????????int?indexSZ?=?SZlist.IndexOf(IN_1);
????????????????????????SZtable?SZtmp?=?(SZtable)SZtablelist[indexSZ];
????????????????????????if?(Convert.ToInt32(IN_2)?>?Convert.ToInt32(SZtmp.Length)?-?1)
?????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????6656??2009-01-01?12:45??CMM編譯器\CMMCompiler\CMMCompiler\AccessTable.cs

?????文件??????39359??2009-01-01?12:46??CMM編譯器\CMMCompiler\CMMCompiler\Analysis.cs

?????文件??????94208??2009-10-26?11:13??CMM編譯器\CMMCompiler\CMMCompiler\bin\Debug\CMMCompiler.exe

?????文件?????151040??2009-10-26?11:13??CMM編譯器\CMMCompiler\CMMCompiler\bin\Debug\CMMCompiler.pdb

?????文件??????14328??2009-12-20?13:16??CMM編譯器\CMMCompiler\CMMCompiler\bin\Debug\CMMCompiler.vshost.exe

?????文件????????490??2008-04-30?03:19??CMM編譯器\CMMCompiler\CMMCompiler\bin\Debug\CMMCompiler.vshost.exe.manifest

?????文件??????89600??2009-10-26?11:12??CMM編譯器\CMMCompiler\CMMCompiler\bin\Release\CMMCompiler.exe

?????文件?????144896??2009-10-26?11:12??CMM編譯器\CMMCompiler\CMMCompiler\bin\Release\CMMCompiler.pdb

?????文件??????????1??2008-12-30?14:56??CMM編譯器\CMMCompiler\CMMCompiler\ClassDiagram1.cd

?????文件???????5289??2009-10-26?11:11??CMM編譯器\CMMCompiler\CMMCompiler\CMMCompiler.csproj

?????文件???????5814??2007-12-30?21:53??CMM編譯器\CMMCompiler\CMMCompiler\Form3.resx

?????文件??????16185??2009-01-01?12:46??CMM編譯器\CMMCompiler\CMMCompiler\Interpret.cs

?????文件??????22683??2009-01-01?12:46??CMM編譯器\CMMCompiler\CMMCompiler\LexicalAnalysis.cs

?????文件??????13294??2008-10-09?16:20??CMM編譯器\CMMCompiler\CMMCompiler\Logo.ico

?????文件??????16134??2009-01-01?12:50??CMM編譯器\CMMCompiler\CMMCompiler\MainForm.cs

?????文件??????23445??2009-01-01?12:50??CMM編譯器\CMMCompiler\CMMCompiler\MainForm.Designer.cs

?????文件??????26811??2009-01-01?12:50??CMM編譯器\CMMCompiler\CMMCompiler\MainForm.resx

?????文件??????22715??2009-01-01?12:49??CMM編譯器\CMMCompiler\CMMCompiler\MidCode.cs

?????文件???????5052??2009-01-01?13:03??CMM編譯器\CMMCompiler\CMMCompiler\obj\CMMCompiler.csproj.FileListAbsolute.txt

?????文件????????995??2009-12-20?13:16??CMM編譯器\CMMCompiler\CMMCompiler\obj\Debug\CMMCompiler.csproj.FileListAbsolute.txt

?????文件????????777??2009-10-26?11:13??CMM編譯器\CMMCompiler\CMMCompiler\obj\Debug\CMMCompiler.csproj.GenerateResource.Cache

?????文件??????94208??2009-10-26?11:13??CMM編譯器\CMMCompiler\CMMCompiler\obj\Debug\CMMCompiler.exe

?????文件??????13860??2009-10-26?11:13??CMM編譯器\CMMCompiler\CMMCompiler\obj\Debug\CMMCompiler.MainForm.resources

?????文件?????151040??2009-10-26?11:13??CMM編譯器\CMMCompiler\CMMCompiler\obj\Debug\CMMCompiler.pdb

?????文件???????4380??2009-10-26?11:13??CMM編譯器\CMMCompiler\CMMCompiler\obj\Debug\CMMCompiler.Properties.Resources.resources

?????文件???????5120??2009-10-26?11:13??CMM編譯器\CMMCompiler\CMMCompiler\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

?????文件???????1011??2009-10-26?11:12??CMM編譯器\CMMCompiler\CMMCompiler\obj\Release\CMMCompiler.csproj.FileListAbsolute.txt

?????文件????????777??2009-10-26?11:12??CMM編譯器\CMMCompiler\CMMCompiler\obj\Release\CMMCompiler.csproj.GenerateResource.Cache

?????文件??????89600??2009-10-26?11:12??CMM編譯器\CMMCompiler\CMMCompiler\obj\Release\CMMCompiler.exe

?????文件??????13860??2009-10-26?11:12??CMM編譯器\CMMCompiler\CMMCompiler\obj\Release\CMMCompiler.MainForm.resources

............此處省略48個文件信息

評論

共有 條評論