VBScript部分解析器 [英] VBScript Partial Parser

查看:136
本文介绍了VBScript部分解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建VBScript解析器.我想知道什么是最好的方法.我已经研究了.最受欢迎的方法似乎是用于Gold Parser或ANTLR.

I am trying to create a VBScript parser. I was wondering what is the best way to go about it. I have researched and researched. The most popular way seems to be going for something like Gold Parser or ANTLR.

我要实现的功能是对VBScript中的语法错误进行动态检查.我不想每次更改某些文本时都编译整个VBS.我该怎么做呢?我尝试使用Gold Parser,但我认为没有增量方式可以通过它进行解析,例如部分解析树...关于在这种情况下如何实现部分解析树的任何想法?

The feature I want to implement is to do dynamic checking of Syntax Errors in VBScript. I do not want to compile the entire VBS every time some text changes. How do I go about doing that? I tried to use Gold Parser, but i assume there is no incremental way of doing parsing through it, something like partial parse trees...Any ideas on how to implement a partial parse tree for such a scenario?

我已经通过GOLD Parser实现了VBscript解析.但是,它仍然不是部分解析器,它在每次文本更改后都解析整个脚本.有没有办法建造这样的东西.

I have implemented VBscript Parsing via GOLD Parser. However it is still not a partial parser, parses the entire script after every text change. Is there a way to build such a thing.

thinks

推荐答案

如果您确实要进行增量解析,请考虑

If you really want to do incremental parsing, consider this paper by Tim Wagner.

一个很好的方案是保留现有的语法分析树,在编辑点改组字符串片段的混合物,并解析表示源文本未更改部分的语法树,并将字符串重新集成到语法分析树集合中.这是使用增量GLR解析器完成的.

It is brilliant scheme to keep existing parse trees around, shuffling mixtures of string fragments at the points of editing and parse trees representing the parts of the source text that hasn't changed, and reintegrating the strings into the set of parse trees. It is done using an incremental GLR parser.

实施起来并不容易;我只做了GLR部分,却从未涉及过增量部分. GLR部分值得您为此烦恼.

It isn't easy to implement; I did just the GLR part and never got around to the incremental part. The GLR part was well worth the trouble.

关于增量解析的论文很多.这是非常好的之一.

There are lots of papers on incremental parsing. This is one of the really good ones.

这篇关于VBScript部分解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆