Lex() public method

public Lex ( LexerMode mode ) : SyntaxToken
mode LexerMode
return SyntaxToken
Esempio n. 1
0
        public static IReadOnlyList<SyntaxToken> ParseAllTokens(SourceText sourceText, IIncludeFileSystem fileSystem = null)
        {
            var tokens = new List<SyntaxToken>();

            var lexer = new HlslLexer(sourceText, fileSystem: fileSystem);
            SyntaxToken token;
            do
            {
                tokens.Add(token = lexer.Lex(LexerMode.Syntax));
            } while (token.Kind != SyntaxKind.EndOfFileToken);

            return tokens;
        }
Esempio n. 2
0
 public SyntaxToken Lex(LexerMode mode) => _lexer.Lex(mode);