有谁知道经典 ASP 的语法检查器吗?
作为我的 Web 开发系统的一部分,我编写了一个文本编辑器(以及 CSS 和 HTML 等其他格式),它具有 ASP 语法突出显示功能。
有谁知道我可以从该编辑器中调用(最好是)DLL 的 ASP 语法检查程序,以便我可以向用户提供错误列表(就像我已经使用 HTML 验证器所做的那样)。
我想在网页上使用代码之前检查 ASP 语法。现在,根据错误的类型和位置,可能需要几天或几周的时间才会出现某些错误。
As part of my my web development system I have written a text editor witch (among other formats like CSS and HTML) has got ASP syntax highlighting.
Does anyone know of an ASP syntax checker program of (preferably) DLL that I could call from within this editor, so that I could present my users with a list of errors (like I already do with an HTML validator).
I would like to check for the ASP syntax before using the code on a web page. Now, depending on the type and the place of the error, it can take days or weeks before some error pops up.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道有任何 ASP 语法检查器库。但是,可以使用 Windows 脚本接口 加载并“编译”VBScript 或 JScript,但不适合胆小的人。
要启用 ASP 语法检查,您需要将
>%...<%
替换为Response.Write("")
和任何<% =expr%>
与Response.Write(expr)
。现在您将拥有纯粹的脚本语言文本。将一堆用于响应、请求等的虚拟对象(实际上不需要任何成员)添加到脚本上下文中的命名对象中。您还需要能够将行号从修改后的脚本文本映射回原始 ASP 文件文本。即使如此,您也只会得到文件中的第一个编译错误,这就是脚本处理的本质。
I don't know of any syntax checker libraries for ASP. However it is possible to use the Windows Script Interfaces to load and "compile" VBScript or JScript, not for the faint-hearted though.
To enable ASP syntax checking you would need replace
>%...<%
with something likeResponse.Write("")
and any<%=expr%>
withResponse.Write(expr)
. Now you'd have text purely in the Script language. Add a bunch of Dummy objects for Response, Request etc. (the don't actually need any members) to the named objects in the script context. You would also need to be able to map line numbers from the munged script text back to the orignal ASP file text.Even with all that you would only get the first compile error in the file, that's just the nature of script processing.
我正在寻找同样的东西。有一个名为 http://aspclassiccompiler.codeplex.com/ 的东西,它显然将您的经典 asp 编译为 asp。网。
因为我相信这会产生某种编译时错误,所以我认为编译期间会报告语法错误。不过还没有尝试过。
I'm looking for the same thing. There is something called http://aspclassiccompiler.codeplex.com/ which apparently compiles your classic asp into asp.net.
Since I believe this gives some kind of compile time errors, I think syntax errors would be reported during compilation. Haven't tried it out yet though.