1 # takes a header file, outputs action ids
3 import tokenize, 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()
52 while tokens.next() != "}":
56 if actionname[-7:] == "Actions":
57 if tokens.next() != "{":
68 raise Exception("action enum must be simple.")
85 raise Exception("no comma")
92 print "#include <lib" + f[2:] + ">"
99 print "{\"" + actionname + "\", \"" + t + "\", " + string.join((classname, t), "::") + "},"
102 counter = counter + 1
108 /* generated by parseactions.py - do not modify! */
111 const char *m_context, *m_action;
115 for x in sys.argv[2:]: