编译器-源码

上传者: 42098251 | 上传时间: 2021-02-08 10:03:29 | 文件大小: 188KB | 文件类型: ZIP
C#
编译器设计 Lexer 编译器的词法分析器负责识别每个语法标记。 我们定义一个用于描述Lexer的类。 该类具有2个数据属性:一个传递给他的单词,一个表示单词位置的整数。 最初的位置是0,从单词的开头开始。 class Lexer { private readonly string text ; private int position ; } 在Lexer类中,我们有构造函数,可在其中初始化属性。 public Lexer ( string text ) { this . text = text ; this . position = 0 ; } 我们基于类的当前position属性添加了一些其他属性,例如获取当前字符。 我们需要if-else块来检测文件结束,如果是,

文件下载

资源详情

[{"title":"( 38 个子文件 188KB ) 编译器-源码","children":[{"title":"Compiler-main","children":[{"title":"Program.cs <span style='color:#111;'> 3.21KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 4B </span>","children":null,"spread":false},{"title":"concepts.md <span style='color:#111;'> 2.95KB </span>","children":null,"spread":false},{"title":"Compiler.csproj <span style='color:#111;'> 163B </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"Compiler.csproj.nuget.g.props <span style='color:#111;'> 1.25KB </span>","children":null,"spread":false},{"title":"Compiler.csproj.nuget.g.targets <span style='color:#111;'> 289B </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"net5.0","children":[{"title":"Compiler.csproj.CoreCompileInputs.cache <span style='color:#111;'> 41B </span>","children":null,"spread":false},{"title":"Compiler.assets.cache <span style='color:#111;'> 139B </span>","children":null,"spread":false},{"title":"Compiler.AssemblyInfoInputs.cache <span style='color:#111;'> 41B </span>","children":null,"spread":false},{"title":"Compiler.dll <span style='color:#111;'> 11.50KB </span>","children":null,"spread":false},{"title":"Compiler.csproj.FileListAbsolute.txt <span style='color:#111;'> 2.40KB </span>","children":null,"spread":false},{"title":".NETCoreApp,Version=v5.0.AssemblyAttributes.cs <span style='color:#111;'> 186B </span>","children":null,"spread":false},{"title":"Compiler.AssemblyInfo.cs <span style='color:#111;'> 974B </span>","children":null,"spread":false},{"title":"ref","children":[{"title":"Compiler.dll <span style='color:#111;'> 8.00KB </span>","children":null,"spread":false}],"spread":false},{"title":"Compiler.csprojAssemblyReference.cache <span style='color:#111;'> 83.26KB </span>","children":null,"spread":false},{"title":"apphost.exe <span style='color:#111;'> 139.50KB </span>","children":null,"spread":false},{"title":"Compiler.genruntimeconfig.cache <span style='color:#111;'> 41B </span>","children":null,"spread":false},{"title":"Compiler.pdb <span style='color:#111;'> 11.92KB </span>","children":null,"spread":false},{"title":"Compiler.GeneratedMSBuildEditorConfig.editorconfig <span style='color:#111;'> 335B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"project.assets.json <span style='color:#111;'> 1.60KB </span>","children":null,"spread":false},{"title":"Compiler.csproj.nuget.dgspec.json <span style='color:#111;'> 1.68KB </span>","children":null,"spread":false},{"title":"project.nuget.cache <span style='color:#111;'> 271B </span>","children":null,"spread":false}],"spread":true},{"title":"bin","children":[{"title":"Debug","children":[{"title":"net5.0","children":[{"title":"Compiler.dll <span style='color:#111;'> 11.50KB </span>","children":null,"spread":false},{"title":"Compiler.runtimeconfig.json <span style='color:#111;'> 139B </span>","children":null,"spread":false},{"title":"ref","children":[{"title":"Compiler.dll <span style='color:#111;'> 8.00KB </span>","children":null,"spread":false}],"spread":true},{"title":"Compiler.deps.json <span style='color:#111;'> 394B </span>","children":null,"spread":false},{"title":"Compiler.pdb <span style='color:#111;'> 11.92KB </span>","children":null,"spread":false},{"title":"Compiler.exe <span style='color:#111;'> 139.50KB </span>","children":null,"spread":false},{"title":"Compiler.runtimeconfig.dev.json <span style='color:#111;'> 165B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"mdStyles.css <span style='color:#111;'> 487B </span>","children":null,"spread":false},{"title":"Libraries","children":[{"title":"Parser.cs <span style='color:#111;'> 2.41KB </span>","children":null,"spread":false},{"title":"Lexer.cs <span style='color:#111;'> 2.56KB </span>","children":null,"spread":false},{"title":"Syntaxtree.cs <span style='color:#111;'> 487B </span>","children":null,"spread":false},{"title":"Tokens.cs <span style='color:#111;'> 200B </span>","children":null,"spread":false},{"title":"Tokeninfo.cs <span style='color:#111;'> 730B </span>","children":null,"spread":false}],"spread":true},{"title":"readme.md <span style='color:#111;'> 9.38KB </span>","children":null,"spread":false},{"title":".vscode","children":[{"title":"launch.json <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false},{"title":"tasks.json <span style='color:#111;'> 1.18KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明