Search code examples
c#lualexerparser-generator

C# Lua Parser / Analyser


first things first;

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...

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 ^^)

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!

Thanks in advance!

Corelgott


Solution

  • Just for the record:

    I went with a comibination of:

    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...)

    and a customized version of

    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...

    Cheers, Corelgott