1 # takes a header file, outputs action ids
3 import token, tokenize, os, sys, string
9 while g.next()[1] != "*/":
13 while g.next()[1] != "\n":
22 tokens = filter(tokenize.generate_tokens(open(f, 'r').readline))
24 sys.stderr.write("parsing %s\n" % f)
39 classname = tokens.next()
48 if t == "enum" and state == classstate + 1:
49 actionname = tokens.next()
51 if actionname[-7:] == "Actions":
52 if tokens.next() != "{":
63 raise "action enum must be simple."
87 print "#include <lib" + f[2:] + ">"
94 print "{\"" + actionname + "\", \"" + t + "\", " + string.join((classname, t), "::") + "},"
103 /* generated by parseactions.py - do not modify! */
106 const char *m_context, *m_action;
110 for x in sys.argv[2:]: