def countedArray( expr ):
arrayExpr = Forward()<EOL>def countFieldParseAction(s,l,t):<EOL><INDENT>n = int(t[<NUM_LIT:0>])<EOL>arrayExpr << (n and Group(And([expr]*n)) or Group(empty))<EOL>return []<EOL><DEDENT>return ( Word(nums).setName("<STR_LIT>").setParseAction(countFieldParseAction, callDuringTry=True) + arrayExpr )<EOL>
Helper to define a counted list of expressions.
       This helper defines a pattern of the form::
           integer expr expr expr...
       where the leading integer tells how many expr expressions follow.
       The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed.