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; }
public SyntaxToken Lex(LexerMode mode) => _lexer.Lex(mode);