C # Lua Parser / Analyzer

first things first;

I am writing a little LUA-Ide in C #. Code execution is performed by an assembly named LuaInterface. Code editing is carried out using Scintilla-Port, and the RAD / UI interface is through extensible IDesignSurfaceExt Visual Studio (code generation in one direction). File processing is provided by a small sql-lite-db used as a project package file.

So I have everything I need together ...

The only problem that is not resolved is the parser / lexer for lua. I do not want to download and execute code! I just want to parse the string containing the Lua code and get some information about this as functions and global vars. I really don't want to write a parser completely ... (I hate regex - I'm wrong all the time ^^)

Has anyone got a link to the .net lua parser?

Just to clarify - I just want to analyze the code at this point - I dont wnat run > this!

Thanks in advance!

Corelgott

+3
source share
5 answers

For write only:

I went with compilation:

http://irony.codeplex.com/ - a set for implementing a language that can be adapted to analyze several languages. (By the way, this didn’t have practically any duplication, which is always so ... So, code comments do not document ... but it’s a lot of fun ...)

and custom version

http://luairony.codeplex.com/ - Lua ( )

, ... , ...

Cheers, Corelgott

+3
+1

, , , , .

Lua C, Lua AST. . Lua, , :)

0

: Lua LPeg , - BNF .

0

Source: https://habr.com/ru/post/1774097/


All Articles