資源簡介
簡單代碼解釋器

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Text;
namespace?TestInterpreter
{
????public?abstract?class?Abstractexpression
????{
????????public?abstract?void?Interpret(Context?context);
????}
????public?class?Terminalexpression?:?Abstractexpression
????{
????????public?override?void?Interpret(Context?context)
????????{
????????????Console.WriteLine(“終端解釋器“);
????????}
????}
????public?class?Nonterminalexpression?:?Abstractexpression
????{
????????public?override?void?Interpret(Context?context)
????????{
????????????Console.WriteLine(“非終端解釋器“);
????????}
????}
????public?class?Context
????{
????????private?string?input;
????????private?string?output;
????????public?string?Input
????????{
????????????get?{?return?input;?}
????????????set?{?input?=?value;?}
????????}
????????public?string?Output
????????{
????????????get?{?return?output;?}
????????????set?{?output?=?value;?}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????.CA....???????919??2012-03-17?14:12??TestInterpreter.sln
????.CA..H.??????8192??2012-03-17?14:12??TestInterpreter.suo
????.CA....??????6144??2012-03-17?15:48??bin\Debug\TestInterpreter.exe
????.CA....?????19968??2012-03-17?15:48??bin\Debug\TestInterpreter.pdb
????.CA....?????14328??2012-03-17?15:48??bin\Debug\TestInterpreter.vshost.exe
????.CA....???????490??2007-07-21?01:33??bin\Debug\TestInterpreter.vshost.exe.manifest
????.CA....???????356??2012-03-17?15:48??obj\Debug\TestInterpreter.csproj.FileListAbsolute.txt
????.CA....??????6144??2012-03-17?15:48??obj\Debug\TestInterpreter.exe
????.CA....?????19968??2012-03-17?15:48??obj\Debug\TestInterpreter.pdb
????.CA....??????1380??2012-03-17?14:12??Properties\AssemblyInfo.cs
????.CA....??????1004??2012-03-17?15:03??Abstractex
????.CA....???????779??2012-03-17?15:46??ex
????.CA....???????944??2012-03-17?15:49??Program.cs
????.CA....??????2214??2012-03-17?15:43??TestInterpreter.csproj
????.C.D...?????????0??2012-03-17?14:12??obj\Debug\TempPE
????.C.D...?????????0??2012-03-17?15:01??bin\Debug
????.C.D...?????????0??2012-03-17?15:48??obj\Debug
????.C.D...?????????0??2012-03-17?14:12??bin
????.C.D...?????????0??2012-03-17?14:12??obj
????.C.D...?????????0??2012-03-17?14:12??Properties
-----------?---------??----------?-----??----
????????????????82830????????????????????20
評論
共有 條評論