2024-04-18 16:34:32 +08:00
|
|
|
using Canon.Core.Abstractions;
|
2024-03-10 19:48:34 +08:00
|
|
|
|
2024-03-15 12:00:47 +08:00
|
|
|
namespace Canon.Core.LexicalParser;
|
|
|
|
|
2024-04-18 16:34:32 +08:00
|
|
|
public class Lexer : ILexer
|
2024-03-10 19:48:34 +08:00
|
|
|
{
|
2024-04-18 16:34:32 +08:00
|
|
|
public IEnumerable<SemanticToken> Tokenize(ISourceReader reader)
|
|
|
|
{
|
2025-02-19 16:29:33 +08:00
|
|
|
LexerStateMachine machine = new(reader);
|
2024-04-04 21:25:11 +08:00
|
|
|
|
2025-02-19 16:29:33 +08:00
|
|
|
return machine.Run();
|
2024-03-10 19:48:34 +08:00
|
|
|
}
|
|
|
|
}
|