def uric(): return Choice( 0, Group(reserved(), "reserved"), Group(unreserved(), "unreserved"), Group(pct_encoded(), "pct-encoded") )
def par(): return Choice( 0, Group(parameter(), "parameter"), Group(extension(), "extension"), Group(isdn_subaddress(), "isdn-subaddress") )
def paramchar(): return Choice( 0, Group(param_unreserved(), "param_unreserved"), Group(unreserved(), "unreserved"), Group(pct_encoded(), "pct-encoded") )
def hier_part(): return Optional( Choice( 0, Sequence("//", Group(Sequence(*authority()), "authority"), Group(path_abempty(), "path-abempty")), Group(path_absolute(), "path-absolute"), Group(path_rootless(), "path-rootless")))
def phonedigit(): return Choice( 0, DIGIT(), Optional( Group(visual_separator(), "visual-separator") ) )
def phonedigit_hex(): return Choice( 0, HEXDIG(), "*", "#", Optional( Group(visual_separator(), "visual-separator") ) )
def telephone_subscriber(): return Choice( 0, Group(global_number(), "global-number"), Group(local_number(), "local-number") )
def descriptor(): return Choice( 0, Group(domainname(), "domainname"), Group(global_number_digits(), "global-number-digits") )
def domainname(): return Sequence( ZeroOrMore(Sequence(Group(domainlabel(), "domainlabel"), ".")), Group(toplabel(), "toplabel"), Optional(".") )
def userinfo(): return ZeroOrMore( Choice(0, Group(unreserved(), "unreserved"), Group(Sequence(*pct_encoded()), "pct-encoded"), Group(sub_delims(), "sub-delims"), ":"))
def pchar(): return [ Group(unreserved(), "unreserved"), Group(Sequence(*pct_encoded()), "pct-encoded"), Group(sub_delims(), "sub-delims"), ":", "@" ]
def uri(): return Sequence(NonTerminal("scheme"), ":", Group(hier_part(), "hier-part"), Optional(Sequence("?", NonTerminal("query"))), Optional(Sequence("#", NonTerminal("fragment"))))
def fragment(): return ZeroOrMore(Group(Choice(0, *pchar()), "pchar"), "/", "?")
def query(): return ZeroOrMore(Group(Choice(0, *pchar()), "pchar"), "/", "?")
def ls32(): return Choice(0, Sequence(Group(h16(), "h16"), ":", Group(h16(), "h16")), Sequence(Group(Sequence(*ipv4address()), "IPv4address")))
def alias(self, children): base, name = children return Group(base, name.value)