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")
    )
Exemplo n.º 4
0
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(".")
    )
Exemplo n.º 10
0
def userinfo():
    return ZeroOrMore(
        Choice(0, Group(unreserved(), "unreserved"),
               Group(Sequence(*pct_encoded()), "pct-encoded"),
               Group(sub_delims(), "sub-delims"), ":"))
Exemplo n.º 11
0
def pchar():
    return [
        Group(unreserved(), "unreserved"),
        Group(Sequence(*pct_encoded()), "pct-encoded"),
        Group(sub_delims(), "sub-delims"), ":", "@"
    ]
Exemplo n.º 12
0
def uri():
    return Sequence(NonTerminal("scheme"), ":", Group(hier_part(),
                                                      "hier-part"),
                    Optional(Sequence("?", NonTerminal("query"))),
                    Optional(Sequence("#", NonTerminal("fragment"))))
Exemplo n.º 13
0
def fragment():
    return ZeroOrMore(Group(Choice(0, *pchar()), "pchar"), "/", "?")
Exemplo n.º 14
0
def query():
    return ZeroOrMore(Group(Choice(0, *pchar()), "pchar"), "/", "?")
Exemplo n.º 15
0
def ls32():
    return Choice(0, Sequence(Group(h16(), "h16"), ":", Group(h16(), "h16")),
                  Sequence(Group(Sequence(*ipv4address()), "IPv4address")))
Exemplo n.º 16
0
 def alias(self, children):
     base, name = children
     return Group(base, name.value)