C# Lua 解析器/分析器

编程入门 行业动态 更新时间:2024-10-24 14:20:09
本文介绍了C# Lua 解析器/分析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一件事;

我正在用 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 ^^)

有人知道一个 lua 解析器的链接吗?

Anybody got a link to a 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/ - 一个可以适应解析的语言实现工具包几种语言.(顺便说一句.这个几乎没有任何文件......所以代码评论没有文档......但很有趣......)

http://irony.codeplex/ - 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/ - 讽刺的 Lua 语法(增加了一定程度的错误容差)

http://luairony.codeplex/ - 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 解析器/分析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-29 03:39:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/747801.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分析器   Lua

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!