ack/util/ncgg/make_enterkeyw_c.lua

27 lines
442 B
Lua
Raw Normal View History

print([[
#include "param.h"
#include "lookup.h"
#include "varinfo.h"
#include "instruct.h"
#include "set.h"
#include "expr.h"
#include "iocc.h"
#include "y.tab.h"
void enterkeyw(void) {
]])
for line in io.stdin:lines() do
if not line:find("^#") then
2022-08-01 20:44:31 +00:00
local _, _, w1, w2 = line:find("^([^ \t]+)%s+([^ \t]+)$")
print(string.format([[
lookup("%s", symkeyw, newsymbol)->sy_value.syv_keywno = %s;
]], w1, w2))
end
end
print([[
}
]])