Added Parser

- can parse a basic token list to an AST
This commit is contained in:
Clemens-Dautermann 2020-08-17 01:07:59 +02:00
parent ea26acce4a
commit b3fe78fffb
19 changed files with 451 additions and 88 deletions

View file

@ -0,0 +1,20 @@
using System;
using Compiler.Lexer;
namespace Compiler.Parser.Exceptions
{
public class UnexpectedTokenException : Exception
{
public TokenType expected { get; set; }
public TokenType got { get; set; }
public override string Message { get; }
public UnexpectedTokenException(TokenType expected, TokenType got)
{
this.expected = expected;
this.got = got;
this.Message = "Unexpected Token " + got + ". Expected: " + expected;
}
}
}