Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从Lua引擎获取所有Lua库和关键字_C#_Lua - Fatal编程技术网

C# 从Lua引擎获取所有Lua库和关键字

C# 从Lua引擎获取所有Lua库和关键字,c#,lua,C#,Lua,我正在为我的LuaIDE开发一个代码完成控件 我使用反射从脚本中获取可访问的C#对象信息,但我还希望列表中包含Lua特定的内容,如数学库等 有办法得到这些吗?也希望得到所有关键字,如如果,然后,结束等 有办法得到这些吗 该手册包含所有内容,但您也可以在启动时遍历全局名称空间以获取所有内容(在向名称空间添加任何内容之前,您必须尽早完成此操作!)。如果某个东西是一个表,那么它也是一个名称空间,比如string或table,您可以遍历它来获得方法 local exclude = { _G = tru

我正在为我的LuaIDE开发一个代码完成控件

我使用反射从脚本中获取可访问的C#对象信息,但我还希望列表中包含Lua特定的内容,如数学库等

有办法得到这些吗?也希望得到所有关键字,如如果,然后,结束等

有办法得到这些吗

该手册包含所有内容,但您也可以在启动时遍历全局名称空间以获取所有内容(在向名称空间添加任何内容之前,您必须尽早完成此操作!)。如果某个东西是一个表,那么它也是一个名称空间,比如
string
table
,您可以遍历它来获得方法

local exclude = { _G = true, _VERSION = true, arg = true }
for name, value in pairs(_G) do
    if not exclude[name] then
        print(name)
        if type(value) == 'table' then
            for name, value in pairs(value) do
                print('\t', name)
            end
        end
    end
end
产生以下结果:

string
                sub
                upper
                len
                gfind
                rep
                find
                match
                char
                dump
                gmatch
                reverse
                byte
                format
                gsub
                lower
xpcall
package
                preload
                loadlib
                loaded
                loaders
                cpath
                config
                path
                seeall
tostring
print
os
                exit
                setlocale
                date
                getenv
                difftime
                remove
                time
                clock
                tmpname
                rename
                execute
unpack
require
getfenv
setmetatable
next
assert
tonumber
io
                lines
                write
                close
                flush
                open
                output
                type
                read
                stderr
                stdin
                input
                stdout
                popen
                tmpfile
rawequal
collectgarbage
getmetatable
module
rawset
math
                log
                max
                acos
                huge
                ldexp
                pi
                cos
                tanh
                pow
                deg
                tan
                cosh
                sinh
                random
                randomseed
                frexp
                ceil
                floor
                rad
                abs
                sqrt
                modf
                asin
                min
                mod
                fmod
                log10
                atan2
                exp
                sin
                atan
debug
                getupvalue
                debug
                sethook
                getmetatable
                gethook
                setmetatable
                setlocal
                traceback
                setfenv
                getinfo
                setupvalue
                getlocal
                getregistry
                getfenv
pcall
table
                setn
                insert
                getn
                foreachi
                maxn
                foreach
                concat
                sort
                remove
newproxy
type
coroutine
                resume
                yield
                status
                wrap
                create
                running
select
gcinfo
pairs
rawget
loadstring
ipairs
dofile
setfenv
load
error
loadfile

VisualStudio支持LUA。为什么我们需要另一个IDE?这是一个自定义软件,请在发布之前检查url轻松相关-您只需要“深入”模块。是否有可能获得下一个级别,参数?内部值不是一个表,如果没有这些信息,上面的树是非常无用的,谢谢