'@brief Unpack the runlength encoded table data.
Terence implemented packed table initializers, because Java has a
size restriction on .class files and the lookup tables can grow
pretty large. The generated JavaLexer.java of the Java.g example
would be about 15MB with uncompressed array initializers.
Python does not have any size restrictions, but the compilation of
such large source files seems to be pretty memory hungry. The memory
consumption of the python process grew to >1.5GB when importing a
15MB lexer, eating all my swap space and I was to impacient to see,
if it could finish at all. With packed initializers that are unpacked
at import time of the lexer module, everything works like a charm.'

def unpack(cls, string):

    ret = []
    for i in range((len(string) / 2)):
        (n, v) = (ord(string[(i * 2)]), ord(string[((i * 2) + 1)]))
        if (v == 65535):
            v = (-1)
        ret += ([v] * n)
    return ret
