https://github.com/alandoherty/lua-lexer
An Lua Lexer written in C#
https://github.com/alandoherty/lua-lexer
Last synced: 11 months ago
JSON representation
An Lua Lexer written in C#
- Host: GitHub
- URL: https://github.com/alandoherty/lua-lexer
- Owner: alandoherty
- Created: 2013-11-30T22:10:57.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-17T12:27:59.000Z (over 12 years ago)
- Last Synced: 2025-07-11T09:50:12.290Z (11 months ago)
- Language: C#
- Size: 133 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Lua Lexer
=========
An Lua Lexer written in C# designed for analysing but not interpreting Lua, also includes supports for lexing the != operator and C-like comment syntax.
Performance
=========
While primarily unfinished, the lexer can process the following code 1,000,000 times in 13ms:
```lua
-- globals.lua
-- show all global variables
local seen={}
function dump(t,i)
seen[t]=true
local s={}
local n=0
for k in pairs(t) do
n=n+1 s[n]=k
end
table.sort(s)
for k,v in ipairs(s) do
print(i,v)
v=t[v]
if type(v)=="table" and not seen[v] then
dump(v,i.."\t")
end
end
end
dump(_G,"")
```
Code taken from the Lua Demo at http://www.lua.org/cgi-bin/demo?globals