Ejemplo n.º 1
0
        /// <inheritdoc />
        public ILexer <EndOfLine> Create()
        {
            var carriageReturnLexer    = carriageReturnLexerFactory.Create();
            var lineFeedLexer          = lineFeedLexerFactory.Create();
            var endOfLineSequenceLexer = concatenationLexerFactory.Create(carriageReturnLexer, lineFeedLexer);

            return(new EndOfLineLexer(endOfLineSequenceLexer));
        }
Ejemplo n.º 2
0
        public ILexer <Integer> Create()
        {
            var signLexer         = signLexerFactory.Create();
            var optionalSignLexer = optionLexerFactory.Create(signLexer);
            var digitLexer        = digitLexerFactory.Create();
            var manyDigitsLexer   = repetitionLexerFactory.Create(digitLexer, 1, int.MaxValue);
            var innerLexer        = concatenationLexerFactory.Create(optionalSignLexer, manyDigitsLexer);

            return(new IntegerLexer(innerLexer));
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public ILexer <LinearWhiteSpace> Create()
        {
            var endOfLineLexer          = endOfLineLexerFactory.Create();
            var whiteSpaceLexer         = whiteSpaceLexerFactory.Create();
            var foldLexer               = concatenationLexerFactory.Create(endOfLineLexer, whiteSpaceLexer);
            var breakingWhiteSpaceLexer = alternativeLexerFactory.Create(whiteSpaceLexer, foldLexer);
            var innerLexer              = repetitionLexerFactory.Create(breakingWhiteSpaceLexer, 0, int.MaxValue);

            return(new LinearWhiteSpaceLexer(innerLexer));
        }