Exemplo n.º 1
0
        List <Token> Lex(string input, bool skipWS = true)
        {
            var   lexer  = new LesLexer(input, MessageSink.Trace);
            var   lexer2 = new TokensToTree(lexer, skipWS);
            var   list   = new List <Token>();
            Token?token;

            while ((token = lexer2.NextToken()) != null)
            {
                list.Add(token.Value);
            }
            return(list);
        }
Exemplo n.º 2
0
        List <Token> Lex(string input, bool skipWS = true)
        {
            var           lexer  = new Les2Lexer(input, TraceMessageSink.Value);
            var           lexer2 = new TokensToTree(lexer, skipWS);
            var           list   = new List <Token>();
            Maybe <Token> token;

            while ((token = lexer2.NextToken()).HasValue)
            {
                list.Add(token.Value);
            }
            return(list);
        }