public override ILexer <Host> Create()
        {
            var innerLexer = Concatenation.Create(
                UriHostLexerFactory.Create(),
                Option.Create(
                    Concatenation.Create(
                        Terminal.Create(@":", StringComparer.Ordinal),
                        PortLexerFactory.Create())));

            return(new HostLexer(innerLexer));
        }
Beispiel #2
0
        public override ILexer <Authority> Create()
        {
            var at          = Terminal.Create(@"@", StringComparer.Ordinal);
            var userinfoseq = Concatenation.Create(UserInformationLexerFactory.Create(), at);
            var optuserinfo = Option.Create(userinfoseq);
            var colon       = Terminal.Create(@":", StringComparer.Ordinal);
            var portseq     = Concatenation.Create(colon, PortLexerFactory.Create());
            var optport     = Option.Create(portseq);
            var innerLexer  = Concatenation.Create(optuserinfo, HostLexerFactory.Create(), optport);

            return(new AuthorityLexer(innerLexer));
        }
        public override ILexer <ReceivedBy> Create()
        {
            var innerLexer = Alternation.Create(
                Concatenation.Create(
                    UriHostLexerFactory.Create(),
                    Option.Create(
                        Concatenation.Create(
                            Terminal.Create(@":", StringComparer.Ordinal),
                            PortLexerFactory.Create()))),
                PseudonymLexerFactory.Create());

            return(new ReceivedByLexer(innerLexer));
        }