singrdk/base/Windows/csic/mkKeyword.icn

27 lines
601 B
Plaintext
Raw Normal View History

2008-11-17 18:29:00 -05:00
procedure main(argv)
local s, L, i
L := []
while s := read() do {
put(L, s)
}
write("public class ", argv[1], " {")
write("\tstatic System.Collections.Hashtable set = new System.Collections.Hashtable();")
write("\tstatic ", argv[1], "() {")
every i := !L do {
write("\t\tset.Add(", image(i), ", ", image(i), ");")
}
write("\t}")
write()
write("\tpublic static string keywordTag(string s) {")
write("\t\tif (set.Contains(s)) {")
write("\t\t\treturn s;")
write("\t\t}")
write("\t\treturn null;")
write("\t} // keywordTag")
write("} // ", argv[1])
end