ShintenScript/ShintenScriptTest/ScaffoldLexer.cs

28 lines
590 B
C#
Raw Normal View History

2023-02-02 14:05:53 +00:00
using ShintenScript;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShintenScriptTest
{
class ScaffoldLexer : Lexer
{
Queue<Token> tokenQueue;
public ScaffoldLexer(IEnumerable<Token> queue) : base("")
{
tokenQueue = new Queue<Token>(queue);
}
public override Token ParseOne()
{
if (tokenQueue.Count == 0)
return new Token { type = Token.Type.EOF };
return tokenQueue.Dequeue();
}
}
}