コード例 #1
0
        public override ILexer <FieldVisibleCharacter> Create()
        {
            var innerLexer = Alternation.Create(
                VisibleCharacterLexerFactory.Create(),
                ObsoleteTextLexerFactory.Create());

            return(new FieldVisibleCharacterLexer(innerLexer));
        }
コード例 #2
0
        public override ILexer <QuotedPair> Create()
        {
            var htab       = HorizontalTabLexerFactory.Create();
            var sp         = SpaceLexerFactory.Create();
            var vchar      = VisibleCharacterLexerFactory.Create();
            var obsText    = ObsoleteTextLexerFactory.Create();
            var innerLexer = Concatenation.Create(
                Terminal.Create(@"\", StringComparer.Ordinal),
                Alternation.Create(htab, sp, vchar, obsText));

            return(new QuotedPairLexer(innerLexer));
        }
コード例 #3
0
        public override ILexer <CommentText> Create()
        {
            var innerLexer = Alternation.Create(
                HorizontalTabLexerFactory.Create(),
                SpaceLexerFactory.Create(),
                ValueRange.Create(0x21, 0x27, Encoding.UTF8),
                ValueRange.Create(0x2A, 0x5B, Encoding.UTF8),
                ValueRange.Create(0x5D, 0x7E, Encoding.UTF8),
                ObsoleteTextLexerFactory.Create());

            return(new CommentTextLexer(innerLexer));
        }
コード例 #4
0
        public override ILexer <QuotedText> Create()
        {
            var innerLexer = Alternation.Create(
                HorizontalTabLexerFactory.Create(),
                SpaceLexerFactory.Create(),
                Terminal.Create(@"!", StringComparer.Ordinal),
                ValueRange.Create(0x23, 0x5B, Encoding.UTF8),
                ValueRange.Create(0x5D, 0x7E, Encoding.UTF8),
                ObsoleteTextLexerFactory.Create());

            return(new QuotedTextLexer(innerLexer));
        }
コード例 #5
0
        public override ILexer <ReasonPhrase> Create()
        {
            var innerLexer = Repetition.Create(
                Alternation.Create(
                    HorizontalTabLexerFactory.Create(),
                    SpaceLexerFactory.Create(),
                    VisibleCharacterLexerFactory.Create(),
                    ObsoleteTextLexerFactory.Create()),
                0,
                int.MaxValue);

            return(new ReasonPhraseLexer(innerLexer));
        }