一起做网站下载数据包,在线商城建设,购物网站用户管理,灰色词网站seoFsLex FsYacc微软本身也提供了一个项目模板。但是这个项目模板是lex和yacc文件均包含。我想只适用lex#xff0c;但是如果每次使用命令行也觉得不够方便#xff0c;于是还是研究了一番MsBuild的使用。 使用msbuild hellp.fsproj /v:d 可以查看整个msbuild的流程#xff0c;非…FsLex FsYacc微软本身也提供了一个项目模板。但是这个项目模板是lex和yacc文件均包含。我想只适用lex但是如果每次使用命令行也觉得不够方便于是还是研究了一番MsBuild的使用。 使用msbuild hellp.fsproj /v:d 可以查看整个msbuild的流程非常白盒。 hello.fsproj文件 ?xml version1.0 encodingutf-8? Project ToolsVersion4.0 DefaultTargetsMyBuild xmlnshttp://schemas.microsoft.com/developer/msbuild/2003 UsingTask TaskNameFsLex AssemblyFileE:\Program Files (x86)\FSharpPowerPack-2.0.0.0\bin\FSharp.PowerPack.Build.Tasks.dll/ UsingTask TaskNameFsc AssemblyFile$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\FSharp.Build.dll/ PropertyGroup AssemblyNamehello/AssemblyName OutputPathBin\/OutputPath /PropertyGroup ItemGroup Compile Include*.fs/ Reference IncludeFSharp.PowerPack/ Reference IncludeSystem / Reference IncludeSystem.Core / 以下不需要写写了编译器会提示需要 -noframework 直接简化掉干脆不写 Reference Includemscorlib / Reference IncludeFSharp.Core / /ItemGroup Target NameMyBuild MakeDir Directories$(OutputPath) Condition!Exists($(OutputPath)) / 具体还有那些属性等使用对象浏览器查看即可 两个比较有用的路径能找DLL 和targets文件targets在不知道怎么写的时候很有用模仿微软写法。 C:\Program Files (x86)\Microsoft F#\v4.0 E:\Program Files (x86)\FSharpPowerPack-2.0.0.0\bin FsLex InputFileLexer.fsl OutputFileLexer.fs !-- 直接在proj文件目录生成Lexer.fs-- OtherFlags--unicode / Fsc Sources(Compile) OutputAssembly$(OutputPath)$(AssemblyName).exe References (Reference) / /Target Target NameClean Delete Files$(OutputPath)$(AssemblyName).exe / /Target Target NameRebuild DependsOnTargetsClean;Build / /Project 转载于:https://www.cnblogs.com/jiangzhen/archive/2012/01/13/2321662.html