Exemplo n.º 1
0
        public override ILexer <Path> Create()
        {
            var innerLexer = Alternation.Create(
                PathAbsoluteOrEmptyLexerFactory.Create(),
                PathAbsoluteLexerFactory.Create(),
                PathNoSchemeLexerFactory.Create(),
                PathRootlessLexerFactory.Create(),
                PathEmptyLexerFactory.Create());

            return(new PathLexer(innerLexer));
        }
Exemplo n.º 2
0
        public override ILexer <RelativePart> Create()
        {
            var innerLexer =
                Alternation.Create(
                    Concatenation.Create(
                        Terminal.Create(@"//", StringComparer.Ordinal),
                        AuthorityLexerFactory.Create(),
                        PathAbsoluteOrEmptyLexerFactory.Create()),
                    PathAbsoluteLexerFactory.Create(),
                    PathNoSchemeLexerFactory.Create(),
                    PathEmptyLexerFactory.Create());

            return(new RelativePartLexer(innerLexer));
        }
Exemplo n.º 3
0
        public override ILexer <HierarchicalPart> Create()
        {
            var delim = Terminal.Create(@"//", StringComparer.Ordinal);
            var seq   = Concatenation.Create(
                delim,
                AuthorityLexerFactory.Create(),
                PathAbsoluteOrEmptyLexerFactory.Create());
            var innerLexer = Alternation.Create(
                seq,
                PathAbsoluteLexerFactory.Create(),
                PathRootlessLexerFactory.Create(),
                PathEmptyLexerFactory.Create());

            return(new HierarchicalPartLexer(innerLexer));
        }
Exemplo n.º 4
0
        public override ILexer <HttpUri> Create()
        {
            var innerLexer = Concatenation.Create(
                Terminal.Create(@"http://", StringComparer.OrdinalIgnoreCase),
                AuthorityLexerFactory.Create(),
                PathAbsoluteOrEmptyLexerFactory.Create(),
                Option.Create(
                    Concatenation.Create(
                        Terminal.Create(@"?", StringComparer.Ordinal),
                        QueryLexerFactory.Create())),
                Option.Create(
                    Concatenation.Create(
                        Terminal.Create(@"#", StringComparer.Ordinal),
                        FragmentLexerFactory.Create())));

            return(new HttpUriLexer(innerLexer));
        }