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

查看:33
本文介绍了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.

谢谢

推荐答案

如果你真的想做增量解析,可以考虑 这篇论文 作者:蒂姆·瓦格纳.

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天全站免登陆