问题描述
第一件事;
我正在用 C# 编写一个小 LUA-Ide.代码执行由名为 LuaInterface 的程序集完成.代码编辑由 Scintilla-Port & 完成.RAD/UI 界面是通过可扩展的 IDesignSurfaceExt Visual Studio(一种方式代码生成).文件处理由用作项目包文件的小 sql-lite-db 提供.
I am writing a little LUA-Ide in C#. The code execution is done by an Assembly named LuaInterface. The code-editing is done by a Scintilla-Port & the RAD / UI Interface is via the extensible IDesignSurfaceExt Visual Studio (one way code generation). File handling is provided by a little sql-lite-db used as a project-package-file.
总而言之,我已经拥有了我需要的一切......
So all in all i've got everything i need together...
唯一未解决的问题是 lua 的解析器/词法分析器.我不想加载 &执行代码!我只想解析包含 Lua 代码的字符串并获取有关它的一些信息,例如函数和全局变量.我真的不想自己完全编写解析器......(我讨厌正则表达式 - 我一直都错了^^)
The only problem unsolved is the parser / lexer for lua. I do not want to load & execute the code! I just want to parse the String containing the Lua code and get some information about it like function and global vars. I really don't want to write the parser completly myself... (I hate regex - I get the wrong all the time ^^)
有人知道一个 .net lua 解析器的链接吗?
Anybody got a link to a .net lua parser lying around?
只是为了澄清 - 我只想在这一点分析代码 - 我不不想运行 它!
Just to clarify - I only want to analyse the code at this point - I dont wnat to run it!
提前致谢!
科雷戈特
推荐答案
仅供参考:
我选择了以下组合:
http://irony.codeplex.com/ - 一个可以适应解析的语言实现工具包几种语言.(顺便说一句.这个几乎没有任何文件......所以代码评论没有文档......但很有趣......)
http://irony.codeplex.com/ - A Language implementation Kit that can be adapted to parse several languages. (Btw. this one got virtually no ducumentation what so ever... So code-comments no docs... but lots of fun...)
和一个定制版
http://luairony.codeplex.com/ - 讽刺的 Lua 语法(增加了一定程度的错误容差)
http://luairony.codeplex.com/ - the Lua Syntax for irony (added some degree error tolerance)
但我必须管理,两者都是相当沉重的东西......而且你打开了一箱新问题以及很多可能性......
But I gotta admin, both are pretty heavy stuff... and you kind of open up a box of new problems as well as lots of possibilities...
干杯,科雷戈特
这篇关于C# Lua 解析器/分析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!