KumiScript/parser/Parser.cs

25 lines
546 B
C#
Raw Normal View History

2024-01-26 05:37:51 +00:00
using KumiScript.Interpreter;
namespace KumiScript.Reader
{
public class Parser
{
Lexer _lexer;
public Parser(Lexer lexer)
{
_lexer = lexer;
}
public Expression NextTopLevelExpression()
{
Token t = _lexer.NextToken();
return t.Accept(new ParserTopLevelVisitor(this));
}
public Expression NextExpressionCC(ITokenVisitor visitor)
{
Token t = _lexer.NextToken();
return t.Accept(visitor);
}
}
}