ky/main.lua
2024-06-11 17:46:13 +03:00

17 lines
373 B
Lua

local Lexer = require"lex"
local Parser = require"parse"
local Des = require"des"
local Gen = require"gen"
local tokens = {}
for tt, ts, tr, tc in Lexer.lex(Lexer.codepoints(io.open(arg[1], "r"):read("*a"))) do
tokens[#tokens + 1] = {tt, ts, tr, tc}
end
local ast = Parser(tokens, false)
Des(ast)
Gen(ast, function(str, ...) io.write(string.format(str, ...)) end)